Thanks - Here is what it looks like in Purebasic - it doesnt seem quite right :

I think it maybe this part of the original code :
if and(q,1)<>0 then
t = x1:x1 = x2:x2 = t
fiWhich I checked the yabasic reference which tells me :
and() — the bitwise arithmetic and
In PB we use & for a bitwise :
& - Bitwise AND. You should be familiar with binary numbers when using this operator. The result of this operator will be the value of the expression on the LHS anded with the value of the expression on the RHS, bit for bit. The value of each bit is set according to the table below. Additionally, if the result of the operator is not used and there is a variable on the LHS, then the result will be stored directly in that variable. This operator cannot be used with strings.I've attached an exe showing what happens.