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

ENDIF Internal
Purpose: Terminates an IF block in a script file.
Format: ENDIF
Template: (none)
Path: Internal
ENDIF must be used when an IF command is used. ENDIF is used in scripts at the end of an IF block.

If the IF condition is not true, or if the true-condition commands are executed and an ELSE is encountered, the execution of the script skips to the next ENDIF command.

Every IF command must be terminated by an ENDIF command. The ENDIF command applies to the most recent IF or ELSE command.

Example 1:

In the following example, the ENDIF terminates the IF block:

IF exists <name>
    TYPE <name> NUMBER
    ECHO "File <name> display complete."
ENDIF
the script tests if the file exists, and if it does displays it followed by a summary message.

Example 2:

In the following example, the ENDIF still terminates the IF block, but there is also an ELSE command within the block:

IF exists <name>
    TYPE <name> NUMBER
    ECHO "File <name> display complete."
ELSE
    ECHO "<name> is not in this directory"
ENDIF
as for Example 1, but now if the script does not exists, a warning message is displayed.

See also: IF, ELSE


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.