$status - Macro command execution status
boolean TRUE (1) | FALSE (0)
$status contains the return status of the last command executed (TRUE or FALSE). $status is generally used with the !force directives in macros.
This variable can not be set, any attempt to set it will result in an error.
The following example shows how the variable is used within a macro construct, it converts all tab characters to their SPACE equivalent.
; ; tabs-to-spaces. ; Convert all of the tabs to spaces. define-macro tabs-to-spaces ; Remember line set-variable #l0 $window-line beginning-of-buffer !force search-forward "\t" !while $status set-variable #l1 $window-acol backward-delete-char &sub #l1 $window-acol insert-space !force search-forward "\t" !done goto-line #l0 screen-update ml-write "[Converted tabs]" !emacro
In this case $status monitors the search-forward command which is searching for a tab character. The command returns a status value of TRUE if a tab is found, otherwise FALSE.
The !force statement prevents the macro from terminating when a FALSE condition is detected, if omitted the macro would terminate with an error as soon as the FALSE status is encountered. The definition of tabs-to-spaces(3) can be found in format.emf.
Copyright (c) 1998-2006 JASSPA
Last Modified: 2002/01/11
Generated On: 2006/10/07