; comment
The semicolon is used to add comments to OMA commands. This can follow the last numeric argument on a command line or can be used at the beginning of a line. For example, a macro might have lines like this:
+ @offset ; the value stored in the variable “offset” will be added to each pixel
; now display the result (the window title will be “the result”)
d the result
Note that adding the “; comment” at the end of a command that expects a string or filename argument will include “; comment” as part of the string or filename.
DMACRO [n] [command]
Prompts the user for lines of a command macro to be executed using the RMACRO command. If the argument n is omitted, definition starts with line one. If n is specified, definition begins with the nth line of the macro. To include numerical arguments that change each time the macro is executed, %d can be inserted in the macro command at the location where the number will be placed upon execution of the macro. If “command” is not present, the program prompts for additional command lines until a null command is entered (i.e. <CR> only). If the optional “command” is included on the same line, the text of “command” replaces any command already existing at line n and no further command lines are solicited. Dummy arguments in Macros or Execute files include the following:
%c the number of seconds since OMA was started (float)
%d a decimal digit
%s the string specified by the STRMAC command
%f last file name
%b maximum value (big)
%l minimum value (little)
%m multiplier (the current scale factor)
%t current date and time
%v an integer value that increments by a specified amount every time it is used
Use the VALMAC command to specify the starting value and increment.
%e the result of the last error code (0 means no error)
%a the average within the currently defined rectangle
%r the rms within the currently defined rectangle
%h the height of the current image
%w the width of the current image
%x the x pixel coordinate of the last mouse click
%y the y pixel coordinate of the last mouse click
ECHO string
Prints “string” during macro execution. “string” can be replaced with any of the macro dummy arguments (e.g., ECHO %b).
ENDIF
Terminates an IF command. This is applicable within Macros only.
EXECUTE <filename>
Reads OMA commands stored in the specified file into a special execute buffer and then performs those commands. Unlike macros, these should not contain dummy numerical arguments (%d).
FCLOSE
Closes the currently open text file (there can be only one). The use of FOPEN, FCLOSE, and FECHO allows derived values to be written to a file from within a macro.
FECHO %s
Exactly as echo but instead of printing to the command window, it writes to the file opened with FOPEN. The use of FOPEN, FCLOSE, and FECHO allows derived values to be written to a file from within a macro.
FOPEN <filename>
Open a text file with the name <filename> for I/O. The use of FOPEN, FCLOSE, and FECHO allows derived values to be written to a file from within a macro.
GMACRO <filename>
Loads the contents of the specified file into the current macro buffer.
IF condition
If condition evaluates to a non-zero value, the commands following the IF are executed. However, if the condition is zero, the commands between IF and ENDIF are not executed. The condition can be any arithmetic statement and can include logical operators < (less than), > (greater than), others to come....
IFEXST <filename>
If the specified filename exists, the condition is satisfied, and the macro commands following the IFEXST command will be executed.
Note: the SAVE prefix and suffix are applied to the filename before the test is done.
IFNEXS <filename>
If the specified filename does not exist, the condition is satisfied, and the macro commands following the IFNEXS command will be executed.
Note: the SAVE prefix and suffix are applied to the filename before the test is done.
IFDEFINED variable_name
If the specified variable_name is defined, the condition is satisfied, and the macro commands following the IFDEF command will be executed.
IFNDEFINED variable_name
If the specified variable_name is not defined, the condition is satisfied, and the macro commands following the IFNDEF command will be executed.
IMACRO n
Used for setting or clearing a flag which determines whether or not an executing macro can be interrupted (using “cmd .”). If n = 0, interruption is not allowed. If n is non-0, it is. This can be used from within a macro to ensure that certain sequences of commands are complete before stopping the macro. (e.g., to be sure that the camera shutter is closed.)
INCMACRO n
Specifies that on each execution of a macro, values should be incremented by value n.
LMACRO
Lists the contents in the current macro buffer.
LOOP variable_name start end [step]
Initializes a loop. The variable_name can be any string of reasonable length. The variable takes on the initial value specified by “start” and the commands within the loop are repeated until the variable is >= “end”. ( or <= “end” if step < 0) If step is not specified, a step of 1 is assumed. The end of the loop is specified by the LOOPND command. Each LOOP must have a corresponding LOOPND. To access the value of a loop variable, precede variable_name with “@” For example:
loop fnum 2 10 2
get data@fnum
disp
loopnd
.
.
Note: To signify the end of a variable name when it is followed by other characters, use a '\' character. For example:
loop fnum 2 10 2
get data@fnum\_corrected
disp
loopnd
LOOPBREAK
Break out of current loop.
LOOPND
Specifies the end of a loop initiated with the LOOP command.
MACRO [n m]
Like “RMACRO [n m]” except that printing of intermediate output is automatically suppressed.
PAUSE [pause_string]
When executed in a macro, the PAUSE command causes macro execution to be suspended until a key on the keyboard is pressed, at which time the macro will continue execution. If the optional pause_string is included, it will be echoed to the right of the Macro # in the status window. The pause_string can contain variable names or %d type dummy arguments that will be filled in before echoing the string. To terminate a paused macro, type <cmnd period>.
PMACRO n
Executes commands in the current macro buffer with “%d”s being replaced by the value n.
RMACRO [n m]
Starts executing commands in the macro buffer with %d being replaced first by value n. Subsequently, n is incremented by the amount specified in the INCMACRO command (default is 1). If the new numeric value is equal to m, the macro will be executed again. Menu items can be selected and the appropriate commands executed during macros. Commands typed during the execution of a macro will be echoed to the terminal but not performed. To stop a macro during execution type “cmd .” (hold down the apple key and type “.”)
SMACRO
Saves the contents of the current macro buffer to a specified file. SMACRO is also used to save commands to be used with the EXECUTE command.
STRMACRO string
Specifies that “string” is to be substituted for any “%s” found in macro or execute commands. If no string is specified, the current string is printed.
VALMACRO [Startval Incval]
Resets the %v value to “Startval” (0 is default) with an increment of “Incval”