Sign in to follow this  
Followers 0
sykes

Single Line Ifs

3 posts in this topic

OK ... I just want to clarify here:

Using single line Ifs: if $var == "amount" Then DoStuff

Does this mean you use these for If statements that aren't going to need an Else statement?

Also does this mean you have to use the Then statements in all Ifs?

I'm assuming using an If Then Else statement still requires the EndIf?


We have enough youth. How about a fountain of SMART?

Share this post


Link to post
Share on other sites



By the way, the == is a case-sensitive comparison. Normally, = is all you need.

The single-line If is useful when you want to conditionally run ONE statement. If you want multiple statements or want and else case, then you must use If...[Else]...EndIf

Hope that helps clarify


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

Gotcha ... So all that changed was the ability to use an If statement without all the trimmin's Thanks a bunch :whistle:


We have enough youth. How about a fountain of SMART?

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