Macro Statements

The following macro statements are supported:

comment Statement

The comment statement performs cursor control and screen display commands in a macro is similar to the t statement in a PROC. Its primary function is to add screen control capabilities to macro commands.

Parameters are passed to the comment command as discrete units surrounded by parentheses. These types of text are supported:

(column,row)

x, y (column,row) positioning.

(-n)

Special cursor control features.

(xn)

Prints the characters whose numeric value is n.

(string)

Prints the string of characters at the current cursor position.

Several text segments may be entered on a single comment command line, but each must be surrounded by a single pair of parentheses.

The optional + character at the end of a line suppresses the automatic CR/LF (carriage return and line feed).

WARNING

Using comment after a select will kill the active select list.

Syntax

comment (text){(text2)}{(...)}{+}

Example(s)

A sample logon macro to clear the screen:

001 n clear-screen macro

002 comment (-1)

This example of a logon macro clears the screen and displays the user’s name/account, the current date and time, and the current terminal and printer assignment parameters.

001 n logon macro

002 comment (-1)(-13)(User Logon)(0,2)(User:)(-14)(20,2)+

003 who

004 comment (0,3)(-13)(Time-Date:)(-14)(20,3)+

005 time

006 comment (0,5)(-13)(Spooler Assignment)(-14)

007 sp-assign ?

008 comment (0,10)(-13)(Terminal Assignment)(-14)

009 term

display Statement

The display statement outputs text on the screen in a macros or a Procs. If the message text is terminated by a +, the trailing carriage return is suppressed.

message.text

Regular text, special characters, or any combination of them, such as these below:

@(x{,y})

Positions cursor at the specified x,y coordinates where x indicates the row position and y indicates the column position.

@(-x)

Generates the corresponding video attributes. The values of x are the exactly the same as the values of the BASIC @ function.

@({x}n)

Generates x carriage returns. If x is omitted, only one carriage return is generated.

@({x}b)

Generates x bells. If x is omitted, only one bell is generated.

@(O[n|.x])

Generates one character whose decimal representation is n, or hexadecimal representation is x, preceded by a period. Valid values are from 0 to 254 decimal (x'00' to X'FE').

'command'

Result of the execution of 'command', between back quotation marks, is substituted in place of command.

Syntax

display message.text {+}

Example(s)

display I am ‘who‘!

Displays:

I am 0 joe pa!

Clears the screen, displays the highlighted text, and suppresses the trailing form feed.

display @(-1)@(-13)main menu@(-14)+

Sends the Del character.

display Sending del: @(O.7F)

prompt Statement

The prompt statement in a macro prompts the user with a specified text string. The user is then given the option to either continue (by entering c, or stopping the process (by entering q). No other characters are allowed.

Syntax

prompt {prompt.text}

Parameter(s)

prompt.text

Displays text that requires user input. This option has the same conventions and syntax as the display command.

Example(s)

mactest

001 n

002 display Starting file save

003 prompt Insert first reel

004 save (fts

In the example above, after displaying Starting file save, the user is prompted with:

Insert first reel -- Quit/Continue (q/c)?

If a c is entered, the save command is executed. The macro stops immediately if a q is provided.

NOTE

Only c or q are accepted by the prompt command.

rem Statement

The rem statement, used in a macro, designates a remark statement and all text which follows on the same line is ignored.

The remark statement is used to explain or document the macro. It is provided for compatibility and readability.

Syntax

rem text

See Also

@() Function

Macros

Prompt Characters

t Command