Guest Guest_LoneReaper Posted June 14, 2004 Share Posted June 14, 2004 I have an if statement and if its true i want it to go to a section of the script and if not go to another section. what is that called? Link to comment Share on other sites More sharing options...
cowsmanaut Posted June 14, 2004 Share Posted June 14, 2004 you can do a really big if statement and it would work.. but I think maybe this is where Select.. case.. endselect could be used? Link to comment Share on other sites More sharing options...
pekster Posted June 14, 2004 Share Posted June 14, 2004 There are several ways to accomplish this, and each has advantages depending on the rest of your code.Method 1: If-ElseIf <CONDITION> Then ;do your "true" code here Else ;do your "false" code here EndIfMethod 2: Select-CaseSelect Case <CONDITION> ;do your "true" code here Case Else ;do your "false" code here EndSelectMethod 3: FunctionsIf <CONDITION> Then TrueFunction() Else FalseFunction() EndIf ;rest of your script goes here as required Func TrueFunction() ;do your "true" code here EndFunc Func FalseFunction() ;do your "false" code here EndFunc [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Link to comment Share on other sites More sharing options...
darknuke Posted June 15, 2004 Share Posted June 15, 2004 If $variable = 1 Then MsgBox(0, "My Message", "$variable = 1!") Else MsgBox(0, "My Message", "$variable != 1!") EndIf Of course replace condition with desired condition, and same thing with what's in the if statement. Link to comment Share on other sites More sharing options...
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