Page 1 of 1

command SWAP bug

Posted: Mon Aug 13, 2007 12:00 pm
by PaPi

I think so, there is a bug with SWAP. Look at:
[code]
`swap_test by PaPi
dim word1 as string,word2 as string
dim i1 as integer,i2 as integer
word1="first"
word2="second"
i1=1
i2=2
showmessage word1+chr$(9)+word2+chr$(9)+str$(i1)+chr$(9)+str$(i2)
swap word1 word2
swap i1 i2
showmessage word1+chr$(9)+word2+chr$(9)+str$(i1)+chr$(9)+str$(i2)
[/code]

Why????
PaPi

command SWAP bug

Posted: Thu Aug 16, 2007 3:58 pm
by Marco
Hi,
I don`t know if it is really a bug, the compiler should have give an error for what you are doing.
The right separator for the swap command is not the space but a comma.
example
swap a , b  

best regards

command SWAP bug

Posted: Thu Aug 16, 2007 4:24 pm
by PaPi
Oh yes,  sorry...
PaPi