Select - End case

Declaration

<AMCASE ACTIVITY="endcase" />

Related Topics   

Description

Ends a block of steps started by a preceding Select - Begin case activity.

Practical Usage

Required whenever a Select - Begin case step is used to mark the end of a block of steps started by the preceding Select - Begin case activity.

Parameters

General

(No parameters)

Description

Error Causes

On Error

Example

NOTE:
  • The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
  • Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.

Description

This example uses a Select/Case combination along with a Weekday() function to determine the day of the week (1=Sunday, 2=Moday, etc.). A message box that corresponds to the matching case will display the correct answer.

Copy
<AMSELECTCASE EXPRESSION="%Weekday(Now)%" />
<AMCASE CONSTANT="1" />
<AMSHOWDIALOG MESSAGE="Today is Sunday" />
<AMCASE ACTIVITY="endcase" />
<AMCASE CONSTANT="2" />
<AMSHOWDIALOG MESSAGE="Today is Monday" />
<AMCASE ACTIVITY="endcase" />
<AMCASE CONSTANT="3" />
<AMSHOWDIALOG MESSAGE="Today is Tuesday" />
<AMCASE ACTIVITY="endcase" />
<AMCASE CONSTANT="4" />
<AMSHOWDIALOG MESSAGE="Today is Wednesday" />
<AMCASE ACTIVITY="endcase" />
<AMCASE CONSTANT="5" />
<AMSHOWDIALOG MESSAGE="Today is Thursday" />
<AMCASE ACTIVITY="endcase" />
<AMCASE CONSTANT="6" />
<AMSHOWDIALOG MESSAGE="Today is Friday" />
<AMCASE ACTIVITY="endcase" />
<AMCASE CONSTANT="7" />
<AMSHOWDIALOG MESSAGE="Today is Saturday" />
<AMCASE ACTIVITY="endcase" />
<AMCASE CONSTANT="8" />
<AMSHOWDIALOG MESSAGE="Something went horribly wrong" />
<AMCASE ACTIVITY="endcase" />
<AMSELECTCASE ACTIVITY="end" />