Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple case if statement
#1
I want to create a process that will run if a string is any of several different values without doing a separate if statement and command?
Code:
Copy      Help
if x=1 do this
if x =5 do the same thing
if x=17 do the same thing

In VB you can do a sort of
Code:
Copy      Help
if x in {1,5,17} do this
#2
Code:
Copy      Help
sel x
,case [1,5,17] do this
or
Code:
Copy      Help
sel s
,case ["string1","..."] do this

The sel-case works with integers or strings, but only with constants. For variables, use if:

Code:
Copy      Help
if x=a or x=b or x=c
,do this
#3
exactly what i needed!!!

THANKS


Forum Jump:


Users browsing this thread: 1 Guest(s)