|
Label - Create |
Declaration
<AMLABEL LABELNAME="text" />
Description
Labels a point in a task with a specific name. Can be used with the Goto action or On Error Goto to direct task execution to a different point of the task.
Practical Usage
This action does not have an effect on task execution, it only defines a point in a task. Please see Goto activity for usage information.
Parameters
General
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Label name | Text | Yes | (Empty) | LABELNAME="problemhandler" | The name of the label to create. |
Example
- 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 sample task checks if C:\Temp\test1.txt exists. If so, it will be copied to C:\Monthly_Backup\Archive\test1.txt and a subsequent step stops the task. If not, the task will skip to a label named bugHandler, at which point, a subsequent step will display a message dialog stating "File not found!"
<AMIF ACTIVITY="file_exist" FILE="C:\Temp\test1.txt" MODE="not_exist"><AMGOTO LABELNAME="bugHandler" /></AMIF>
<AMLABEL ACTIVITY="goto" LABELNAME="bugHandler" />
<AMIF ACTIVITY="end" />
<AMFILESYSTEM SOURCE="C:\Temp\test1.txt" DEST="C:\Monthly_Backup\Archive\test.txt" />
<AMTASK ACTIVITY="stop" STATUSTYPE="SUCCESS" />
<AMLABEL LABELNAME="bugHandler" />
<AMSHOWDIALOG MESSAGE="File not found!" />