Jump to content

Recommended Posts

Posted

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?

Posted

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

Posted

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]

Posted

Thanks Forsaken much obliged!

For the record I think my way would be better (or at least easier to read).

Posted

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]

Posted

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
;

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
  • Recently Browsing   0 members

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