3.29 WRITE

Use WRITE to display messages on the workstation screen when a user logs in to the network. Text that you want to display must be enclosed in quotation marks (" ").

There are several ways to display variables in the text message. The way you enter the variable in the WRITE command determines the display format, as follows:

  • If you type the identifier variable as shown, with no special punctuation, only the variable is displayed on the screen.

  • If you enclose the identifier variable inside quotation marks, precede the variable with a percent sign (%) and type it in uppercase letters. This method is often used to combine regular text with an identifier variable, because both the text and the variable can be enclosed in the same quotation marks.

  • To join several text strings and identifier variables into a single display without enclosing the variables in quotation marks, use a semicolon (;) between the text and the variables.

  • If you have several WRITE commands, each one appears on a separate line on the user's workstation. However, if you put a semicolon at the end of all but the last WRITE commands, the commands all appear as one continuous sentence or paragraph (although they might wrap onto additional lines on the workstation's screen).

Text strings can include the following special characters:




Causes a carriage return


Starts a new line of text


Displays a quotation mark on the screen


Makes a beep sound

In addition to the semicolon, you can use other operators to form compound strings (in other words, to join text and identifier variables into one command). These operators are listed in the following table, in order of precedence:



* / %

Multiply, divide

+ -

Add, subtract

>> <<

Shift left or right (1000 >> 3 becomes 1)

Command Format

WRITE "[text][%identifier]" [;][identifier]

Replace text with the words you want to display on the screen.

Replace identifier with a variable you want to display, such as a user's login name. See Section 3.2, Using Identifier Variables for a complete list of variables.


To display the message Hello, add the following line to the login script:

WRITE "Hello"

To display the user's surname along with a greeting, add the identifier LAST_NAME to the command. To do this, either join the text and the identifier with a semicolon (;) or include the variable in the quotation marks with the text.

For example, either of the following lines displays Hello, Smith when user Bob Smith logs in:


To make a beep sound occur while the phrase Good morning appears on the screen, add the following line to the login script: