Jump to content

Recommended Posts

Posted

Hello all,

I'm trying to write a Select ... Case statement that compares string values.

The code is pretty simple I'm just havng problems comparing the string values.

Select
Case $xyz = ""
    ;xyz values is blank
    ;does something
Case $xyz = 'abc' OR 'xyz'
    ;xyz value is either abc or xyz
    ;does something Else
Case Else
    ;xyz value is anything else

Thanks in advance

Posted (edited)

If you are comparing 1 value against several possible values, you could also use a switch statement.

Switch $xyz
  Case ""
    ;xyz value is empty
  Case 'abc' ,'xyz'
        ;xyz value is either abc or xyz
  Case Else
        ;xyz value is anything else
EndSwitch

Edit: John beat me to it

Edited by Bowmore

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

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...