idoru Posted June 19, 2009 Share Posted June 19, 2009 Hi Guys, I hate to bother you with what I think is a syntax problem but your my only hope of me keeping my hair till lunch time. I have the following code If $chassis=(8 OR 9 OR 10 OR 11 OR 12 OR 14) Then (DO SOMETHING) Elseif $chassis=(1 OR 2 OR 3 OR 4 OR 5 OR 6 OR 7) Then (DO SOMETHING ELSE) EndIf EndIf Even if $chassis = 1 it runs the (DO SOMETHING) rather than the (DO SOMETHING ELSE). I assume this is because my syntax is horribly wrong as the help file states that If's can use boolean operators. Can anyone help? Link to comment Share on other sites More sharing options...
thomaatje Posted June 19, 2009 Share Posted June 19, 2009 CODEIf $chassis = 8 OR $chassis = 9 OR $chassis = 10 OR $chassis = 11 OR $chassis = 12 OR $chassis = 14 Then (DO SOMETHING) Elseif $chassis = 1 OR $chassis = 2 OR $chassis = 3 OR $chassis = 4 OR $chassis = 5 OR $chassis = 6 OR $chassis = 7 Then (DO SOMETHING ELSE) EndIf Link to comment Share on other sites More sharing options...
November Posted June 19, 2009 Share Posted June 19, 2009 Hi there, Is it suitable for you? If $chassis>= 8 and $chassis <= 14 then (DO SOMETHING) Elseif $chassis>= 1 and $chassis <= 7 (DO SOMETHING ELSE) EndIf EndIf Cheers Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font] Link to comment Share on other sites More sharing options...
idoru Posted June 19, 2009 Author Share Posted June 19, 2009 Thanks Forsaken much obliged! For the record I think my way would be better (or at least easier to read). Link to comment Share on other sites More sharing options...
idoru Posted June 19, 2009 Author Share Posted June 19, 2009 Thanks again November but my values don't run as neatly as that Link to comment Share on other sites More sharing options...
November Posted June 19, 2009 Share Posted June 19, 2009 Thanks again November but my values don't run as neatly as that Ok, i dont know the rest of code So you should stick with the other solution, so that your variables don't lose value Cheers Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font] Link to comment Share on other sites More sharing options...
Malkey Posted June 19, 2009 Share Posted June 19, 2009 Here is another method you can consider.. ; Local $chassis = 10 Switch $chassis Case 8 To 12, 14 MsgBox(0, "", "DO SOMETHING") Case 1 To 7 MsgBox(0, "", "DO SOMETHING ELSE") EndSwitch ; 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