Previous Next Chapter

Script Commands

Any AmigaDOS command can be used in a script, however, there are some commands that are used only in scripts. You can do the following with script commands:

Script-Specific Commands

The following commands are typically used only with scripts:

Script Command

Meaning

ASK

Asks for user input.

ECHO

Prints a string.

ELSE

Allows an alternative in a conditional block.

ENDIF

Terminates an IF block.

ENDSKIP

Terminates a SKIP block.

EXECUTE

Executes a script with optional argument substitution.

FAILAT

Sets the failure condition of the script.

IF

Handles conditional operations.

LAB

Specifies a label; used with SKIP.

QUIT

Specifies a return code and exits a script.

REQUESTCHOICE

Allows AmigaDOS and ARexx scripts to use system requesters to ask the user for feedback.

REQUESTFILE

Allows AmigaDOS and ARexx scripts to use the system file requester.

SKIP

Skips the execution of the script ahead or backwards to the specified label.

WAIT

Waits for the specified time.

Dot Commands

Dot commands are keywords beginning with a period that are used only in scripts. Special dot command lines included in your script can specify places for parameter substitution. Enter these parameters as arguments to the EXECUTE command. The following table lists the dot commands.

Dot Command

Meaning

.KEY

Argument template used to specify the format of arguments; can be abbreviated to .K. Separate arguments for .KEY with commas. Do not use spaces. See page 5-7 for more information on using .KEY.

.DOT <ch>

Change dot character from . to <ch>, where <ch> is the character that is substituted.

.BRA <ch>

Change opening bracket character from < to <ch>.

.KET (<ch>

Change closing bracket character from > to <ch>.

.DOLLAR <ch>

Change default character from $ to <ch>; can be abbreviated to .DOL.

.DEF <keyword> <value>

Give default to parameter.

.<space>

Comment line. Be sure to include the space following the dot to avoid producing an error. Note that the preferred method for entering comments is with a semicolon (;).

.

Blank comment line. Be sure there is nothing else on the line with the dot to avoid producing an error.

When you EXECUTE a command line, AmigaDOS looks at the first line of the script. If it starts with a dot command, AmigaDOS scans the script looking for the parameter substitutions described above and builds a temporary file in the T: directory. If the file does not start with a dot command, AmigaDOS assumes that no parameter substitution is necessary and starts executing the file immediately without copying it to T: Because dot commands require extra disk accesses and increase execution time, do not use them if you do not need parameter substitution.

Top Previous Next Chapter