Christian_Boeck_57

Is there something else like "IF ... ELSE" to use more options?

Discussion created by Christian_Boeck_57 on Dec 21, 2016
Latest reply on Jan 3, 2017 by joel_wiesmann_automic

Customer Request

Is there a script function where i can use more than one option?

:IF &something = "status"
:PRINT 'Hallo01'
:ELSE
:PRINT 'Hallo02'
: ENDIF


Answer

I think, since V9 you are able to use the SWITCH CASE function. here is an example from the Automic documentation.

:SET &STATUS# = GET_STATISTIC_DETAIL(&RUNID#,STATUS)

:SWITCH "Y"
:CASE &STATUS# between 1300 and 1599
:CASE &STATUS# between 1700 and 1799
: PRINT "The task &RUNID# is active."
:CASE &STATUS# between 1600 and 1699
: PRINT "The task &RUNID# is in a waiting condition."
:CASE &STATUS# between 1800 and 1899
: PRINT "The task &RUNID# has aborted."
:CASE &STATUS# >= 1900
: PRINT "The task &RUNID# has successfully ended."
:ENDSWITCH

Outcomes