command SWAP bug

In this category you can exchange your programming questions and solutions.
Post Reply
PaPi
Posts: 114
Joined: Wed May 16, 2007 11:55 am

command SWAP bug

Post: # 148Post PaPi
Mon Aug 13, 2007 12:00 pm


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

Marco
Site Admin
Posts: 246
Joined: Sat Sep 15, 2018 8:41 pm

command SWAP bug

Post: # 149Post Marco
Thu Aug 16, 2007 3:58 pm

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

PaPi
Posts: 114
Joined: Wed May 16, 2007 11:55 am

command SWAP bug

Post: # 150Post PaPi
Thu Aug 16, 2007 4:24 pm

Oh yes,  sorry...
PaPi

Post Reply