rarefluid
19th December 2002 21:18 UTC
Compiler accepts wrong values for IntOp?!
I wrote this recently to make a loop counter :
IntOp $R2 R2 + 1
what I meant was of course
IntOp $R2 $R2 + 1
but the compiler never complained, no crashes, only an endless loop, because $R2 didn't get incremented...
Shouldn't the compiler tell me that the value isn't valid?!
Oh :I'm using NSIS v2.0b0
kichik
19th December 2002 23:42 UTC
R2 is treated as a string, just like 1 is. Since R2's first char isn't a number NSIS treats it as 0. 0 + 1 is always 1. The first parameter can also be a number or a define, it doesn't have to be a variable...
rarefluid
20th December 2002 00:30 UTC
Oh...
Didnt know that. I can't imagine when you need adding a number and another define, but anyways...
I understand this was a valid command, but in this case I would have wished for for a warning ;-)...
Thanks
KIM
rainwater
20th December 2002 01:00 UTC
Originally posted by rarefluid
I understand this was a valid command, but in this case I would have wished for for a warning ;-)...
You have now been warned :) Don't do it again ;)