MattX 0 Posted December 14, 2004 Silly question time can I have more than one If or do you have to use more Elses ? I have a case of a prog starting but I may have 3 or 4 possible situations in regards to windows opening..... Would it be: If WinExists("Serif Registration Wizard") Then DO WHATEVER Else WinWait("DrawPlus") Else WinWait("DrawPlus new window") Else WinWait("Another possible window") DO WHATEVER EndIf Or If WinExists("Serif Registration Wizard") Then DO WHATEVER If WinWait("DrawPlus") If WinWait("DrawPlus new window") Else WinWait("Another possible window") DO WHATEVER EndIf EndIf EndIf Sorry for the dumb question Share this post Link to post Share on other sites
MattX 0 Posted December 14, 2004 (edited) Thanks Larry - is there a limit on the number of ElseIf commands you can use ? If I was going to use say 10 of them then I suppose a Do Until would be better. Did not know you can use 'Or' - time to change some badly written scripts. Edited December 14, 2004 by MattX Share this post Link to post Share on other sites
Blue_Drache 260 Posted December 14, 2004 Logical operators are in the help file. AND, OR, NOT.... all usable with the "IF/Then Elseif/Then Else", "Do/Until", and "While/Wend". ElseIf $lock = 05740 Or $lock = 05765 Or $lock = 05778 Or $lock = 05779 Or $lock = 12458 Or $lock = 12459 Then This is my biggest ElseIf line with an "OR" so far. Currently building a massive script that will definately test the limits of the "ElseIf" if any exist. LOL. If $elseif > $limits.... I need to go back to work. Personally, I think it should be infinate, as it basically is just an individual block of code that is only executed if the If/ElseIf is true. I treat If/ElseIf as a single line number in my head.....don't know if it helps, but.... have fun re-writing the code. Can't say that I envy you. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Share this post Link to post Share on other sites
ezzetabi 3 Posted December 14, 2004 But if you need more than a couple of If/ElseIf using a Select/Case/Case/EndSelect is better IMNSHO. Share this post Link to post Share on other sites
SlimShady 1 Posted December 14, 2004 (edited) Logical operators are in the help file. AND, OR, NOT.... all usable with the "IF/Then Elseif/Then Else", "Do/Until", and "While/Wend".<{POST_SNAPBACK}>Let me add to that:Those operators even work in variables. (I only tried the NOT operatord, actually)Let me give you some examples.$var = NOT NOT 100 ;means: $var becomes 0 then turns into a 1$var = NOT 100 ;means: $var equals 0$var = NOT 0 ;means: $var equals 1 Edited December 14, 2004 by SlimShady Share this post Link to post Share on other sites