Jump to content

Boolean Syntax Help


Recommended Posts

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

CODE
If $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

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

Thanks again November but my values don't run as neatly as that :D

Ok, i dont know the rest of code :D

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...