Aries
New Member
I occasionally use #DEFINE where a value can change depending on what code is compiled - #UNDEFINE allows me to redefine it, whereas once a SYMBOL is set it (as far as I know) cannot be unset.
I came across this oddity - the code is much simpler that what I was using, but it shows the problem:
#define CodeType 1 ' 1 = normal, 2 = test
b0 = CodeType
b1 = CodeType * 2
sertxd(#b0," ",#b1)
end
The printed result is:
1 1
whereas I would have expected
1 2
The reason is that the defined symbol CodeType includes the comment, so anything in the expression after it is ignored.
A word of warning, therefore, to those who - like me - comment their code
Roger
I came across this oddity - the code is much simpler that what I was using, but it shows the problem:
#define CodeType 1 ' 1 = normal, 2 = test
b0 = CodeType
b1 = CodeType * 2
sertxd(#b0," ",#b1)
end
The printed result is:
1 1
whereas I would have expected
1 2
The reason is that the defined symbol CodeType includes the comment, so anything in the expression after it is ignored.
A word of warning, therefore, to those who - like me - comment their code
Roger
Attachments
-
105 bytes Views: 6
Last edited: