[AmigaOS 3.1 Command Reference/Failat] 
 

FAILAT

Format: FAILAT [<n>] Template: RCLIM/N Purpose: To instruct a command sequence to fail if a program gives a return code greater than or equal to the given value. Path: Internal Specification: Commands indicate that they have failed in some way by setting a return code. A nonzero return code indicates that the command has encountered an error of some sort. The return code, normally 5, 10, or 20, indicates how serious the error was. A return code greater than or equal to a certain limit, the fail limit, terminates a sequence of non-interactive commands (commands you specify after RUN or in a script). You may use the FAILAT command to alter the fail limit RCLIM (Return Code Limit) from its initial value of 10. If you increase the limit, you indicate that certain classes of error should not be regarded as fatal and that execution of subsequent commands may proceed after an error. The argument must be a positive number. The fail limit is reset to the initial value of 10 on exit from the command sequence. If the argument is omitted, the current fail limit is displayed. Example: Assume a script contains the following lines: COPY DF0:MyFile to RAM: ECHO "MyFile being copied." If MyFile cannot be found, the script will be aborted and the following message will appear in the Shell window: COPY: object not found COPY failed returncode 20: However, if you changed the return code limit to higher than 20, the script would continue even if the COPY command fails. For example, if you changed the script to read: FAILAT 21 COPY DF0:MyFile to RAM: ECHO "MyFile being copied." Even if MyFile cannot be found, the script will continue. The following message will appear in the Shell window: COPY: object not found MyFile being copied. See also: ECHO EXECUTE


Converted from AmigaGuide to HTML by Jaruzel