Sign in to follow this  
Followers 0
Chris_1013

If $var

2 posts in this topic

If I have code like this

If $var
;do something
EndIf

Is that equivalent to

If $var = 1
;do something
EndIf

Or

If $var > 0
;do something
EndIf

I've used this loads, but never really known which is correct.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

A variable is "true" if it is non-zero (if it's a number) and not blank (if it's a string)

False:

0

""

True:

1

10

-2

"hjkhk"

And

If $Var

is the same as saying "If $var is true"

Edited by Jon

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0