Home Page The Club Computers News Links Glossary EYAWTK
Before Amiga Background ICS OCS ECS AGA ??? PPC
U-Boot SLB Linux Amiga OS Dual Boot Motherboards Peripherals Other
Initialisation Installation OS4 Updates About OS4 File Systems Networking Printing Other
Introduction File System Workbench Preferences Commands Error Msgs Miscellaneous

AmigaOS 4.0 - About OS4 - Commands

SKIP Internal
Purpose: Skips to a label when executing script files.
Format: SKIP [<label>] [BACK]
Template: LABEL, BACK/S
Path: Internal
SKIP is used in scripts to enable you to skip ahead in the script to a <label> defined by a LAB command. If no <label> is specified, SKIP jumps to the next LAB statement.

SKIP always searches forward from the current line of the script. However, when the BACK option is used, SKIP starts searching for the label from the beginning of the script. This enables you to skip to points prior to the SKIP command.

You can only SKIP as far back as the last EXECUTE statement. If there are no EXECUTE statements in a script, you can SKIP back to the beginning of the script.

If SKIP does not find the <label> you specified, but finds an ENDSKIP statement instead, execution of the script resumes at the line following the ENDSKIP. The return code is set to 5 (WARN).

If SKIP finds neither the <label> or an ENDSKIP statement, the command sequence terminates with the message:

Label <label> not found by Skip and the return code is set to 10 (ERROR).

Example:

Assume you have the following script, called CheckFile:

.KEY name
IF EXISTS <name>
    SKIP message
ELSE
    ECHO "<name> is not in this directory."
    QUIT
ENDIF
LAB message
ECHO "The <name> file exists."
You can run the script by entering: 3.OS4:> EXECUTE CheckFile Document

If the Document file exists in the current directory, the execution of the script SKIPs ahead to the LAB command. The following message is displayed in the Shell window:

The Document file exists.

If the Document file is not in the current directory, the execution of the script drops through to the line after the ELSE statement, and the following message is displayed in the Shell window:

Document is not in this directory.

See also: IF, ELSE, ENDIF, ENDSKIP, EXECUTE, LAB, QUIT.


Return to Commands Selection

Disclaimer: Amiga Auckland have prepared the above information for the use of its members based on our experiences and as such is subject to revision at any time. Amiga Auckland cannot guarantee any of the information and cannot be held accountable for any issues that may result from using it.


Copyright 2006 Amiga Auckland Inc. All rights reserved.
Revised: February 9, 2006.