RosettaCodeData/Task/Symmetric-difference/Run-BASIC/symmetric-difference.basic

21 lines
369 B
Plaintext

setA$ = "John,Bob,Mary,Serena"
setB$ = "Jim,Mary,John,Bob"
x$ = b$(setA$,setB$)
print word$(x$,1,",")
c$ = c$ + x$
x$ = b$(setB$,setA$)
print word$(x$,1,",")
print c$;x$
end
function b$(a$,b$)
i = 1
while word$(a$,i,",") <> ""
a1$ = word$(a$,i,",")
j = instr(b$,a1$)
if j <> 0 then b$ = left$(b$,j-1) + mid$(b$,j+len(a1$)+1)
i = i + 1
wend
end function