Deathboy Posted May 8, 2010 Posted May 8, 2010 hi there if you got a script like this: $variable = 12 if 1234 = $variable then ... endif that does something if 1234 is the same as the variable. But is there a way to make it do something if the variable isn't the same? I've looked in the help file but can't find anything.
SagePourpre Posted May 8, 2010 Posted May 8, 2010 If...ElseIf...Else...EndIf --------------------------------------------------------------------------------Conditionally run statements.If <expression> Then statements ...[ElseIf expression-n Then [elseif statements ... ]] ...[Else [else statements] ...EndIfSource : Autoit Helpfile ( F1 )
MvGulik Posted May 8, 2010 Posted May 8, 2010 (edited) whatever Edited February 7, 2011 by MvGulik "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ...
Deathboy Posted May 8, 2010 Author Posted May 8, 2010 If...ElseIf...Else...EndIf -------------------------------------------------------------------------------- Conditionally run statements. If <expression> Then statements ... [ElseIf expression-n Then [elseif statements ... ]] ... [Else [else statements] ... EndIf Source : Autoit Helpfile ( F1 ) Thanks but not what I was looking for
Deathboy Posted May 8, 2010 Author Posted May 8, 2010 But is there a way to make it do something if the variable isn't the same? Read doc on Operators. If 1234 <> $variable Then If Not (1234 = $variable) Then If IsNumber($variable) And Not($variable = 1234) Then If IsInt($variable) And Not($variable = 1234) Then Edit: not sure what your need, but experiment with the last two. Thank you very much! Just what I wanted to see
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now