HP 3000 Manuals

WRITE FORM [ HP Business BASIC/XL Reference Manual ] MPE/iX 5.0 Documentation


HP Business BASIC/XL Reference Manual

WRITE FORM 

The WRITE FORM can be used to display the value of an HP Business
BASIC/XL variable in a field of a VPLUS form, position the cursor, or
write to the message window of the VPLUS form.  It is possible to do any
combination of these operations in a single statement.

Syntax 

WRITE [TO] FORM

[          [{,}             ]]
[form_item [{;} form_item...]]

[{,}                       ]
[{;} CURSOR [=] cursor_expr]
[{,}                     ]
[{;} MSG [=] message_expr] form_item->

{form_element | for_clause | skip_clause}

Parameters 

form_element     One of the following:

                       num_var 
                       str_var$
                       array_name ([*[,*]...])
                       str_array_name$([*[,*]...])

                 The last format above has one asterisk per dimension or
                 no asterisks.  No asterisks specifies any number of
                 dimensions.  Either format is legal, but the format with
                 no asterisks is not compilable.  Substrings are also
                 allowed.

for_clause       (FOR num_var=num_expr1 TO num_expr2 [STEP num_expr3],
                 form_item [, form_item]...)

                 A for_clause is useful for reading array elements.
                 Refer to the INPUT statement in this chapter for more
                 information.

skip_clause      SKIP skip_expr 

                 A skip_clause is used to skip one or more fields in the
                 form to avoid the necessity of displaying values for
                 them.  The skip_expr is a numeric expression that
                 evaluates to the number of fields to skip.

cursor_expr      Either a numeric or a string expression.  If a string
                 expression is used, it must be the name of a field in
                 the form that is active.

                 If a numeric expression is used, it is a field number.
                 The fields corresponding to the value of the numeric
                 expressions are:

                 0:              for input field on the form.
                 positive        field number according to the form.
                 value:
                 negative        field number according to the terminal.
                 value:

message_expr     A string expression.  Its value is written to the
                 message window located at the bottom of each VPLUS form.

The WRITE FORM statement writes an entire screen of information at once.
The value of each field is obtained from a single variable or array
element.  The value of the first form_item is written to the first field
on the form, the value of the second form_item is written to the second
field on the form, etc.  The value of each data item specified in a
for_clause is written to a single field.  The value of each element of
the array specified by the array_name (*) notation is also written to a
single field.  Use of the option SKIP 3 allows you to write a value in
the fourth field of the form without having to write information in the
preceding three.

The clauses are evaluated in the following order:

   1.  Any message that is to be written to the message window.

   2.  Any specified final cursor positioning takes place.

   3.  Any data that is to be written to the fields.

It is important to understand that cursor positioning is of value only
for a subsequent READ FORM; using a WRITE FORM to position the cursor for
a subsequent WRITE FORM does not produce the expected results unless you
position the cursor to the first field.  Use the SKIP clause to begin
writing to a field other than the first field.

If no VPLUS form is active, executing a WRITE FORM statement causes a
run-time error.

Examples 

The following examples show the use of the WRITE FORM statement.

     400 WRITE FORM Num_var
     410 WRITE FORM A,B;C$
     420 WRITE FORM A,B;C$
     430 WRITE FORM A,SKIP 3,B
     440 WRITE FORM ;MSG="ERROR: BAD NAME";CURSOR=5
     450 WRITE FORM ;CURSOR="Emp-name"
     460 WRITE FORM A;SKIP 3,B;MSG="ERROR: BAD NAME";CURSOR=5



MPE/iX 5.0 Documentation