If Variable XYZ Equals 0 fails on Check with Var-Value 0

Got a problem you cannot solve? Try here.
Post Reply
voiid
Posts: 9
Joined: Mon Nov 24, 2008 10:24 am
Location: Germany
Contact:

If Variable XYZ Equals 0 fails on Check with Var-Value 0

Post by voiid »

The 'If Variable XYZ Equals 0(Zero) statement fails while debugging and runtime if it gets evaluated against the Variable with a Value of 0(Zero).
To me this behavior is wrong, as my variable value is 0(zero) and I test if this variable is equal zero to jump into the condition.

Manual:
Choose a comparison type from the drop down menu. If both variables contain integer values, a numeric comparison will be performed. If at least one variable contains a non-integer value, a string comparison will be performed.

Thanks for your help guys.
---------------------------------------------------
ArCon Kitchen Planning and Interior Design
www.planTEK.de - www.ArConKitchen.com
---------------------------------------------------
ulrichard
Posts: 150
Joined: Thu Dec 27, 2007 5:45 am
Location: Switzerland
Contact:

snippet?

Post by ulrichard »

Hi voiid,

these comparisons always worked for me, so I created a small example to try what you described:

Set Variable intval to 0
if Variable intval Equals 0
MessageBox: zero, zero
end

Set Variable intvalA to 0
Set Variable intvalB to 0
if Variable intvalA Equals $intvalB$
MessageBox: zero, zero
end


As expected, both messageboxes got displayed.

Could you post a snippet with a bit more detail?

Maybe you were missing the $DOLLAR$ signs in the expression part of the if statement?

Rgds
Richard
http://www.pointline.com
http://www.paraeasy.ch
http://ulrichard.ch
voiid
Posts: 9
Joined: Mon Nov 24, 2008 10:24 am
Location: Germany
Contact:

Hello ulrichard

Post by voiid »

Thanks for your help.

Well what I simply do is the following.

Set Persistent Variable ARCONVERSION to 0 at the top of the script

and then later in the setup routine ...

if Variable ARCONVERSION Equals 0
....
end

And the variable really contains 0(zero).
---------------------------------------------------
ArCon Kitchen Planning and Interior Design
www.planTEK.de - www.ArConKitchen.com
---------------------------------------------------
ulrichard
Posts: 150
Joined: Thu Dec 27, 2007 5:45 am
Location: Switzerland
Contact:

translation

Post by ulrichard »

from reading your other post, this might well be also translation related.

Rgds
Richard
http://www.pointline.com
http://www.paraeasy.ch
http://ulrichard.ch
thohoff
Posts: 2
Joined: Wed Jan 13, 2010 10:23 am

Post by thohoff »

I think I got the same problem. Comparision with exit code 0 (zero) did not work. Now I solved it with the following workaround

Code: Select all

set Varialbe TEST to $ARCONVERSION$_string
if Variable TEST Equals 0_string   (i.e. Zero + _string)
    ...
end
Now this enters the IF block. Seems to be a type conversion problem for 0 (Zero) values.
Post Reply