HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)

4- 120
user-defined branch-during-input key. Fields with matching data items
are converted and assigned to the corresponding HP Business BASIC/XL
variables.
The READ FORM statement is designed to assign the information in all the
fields on an entire screen at once. Each field is assigned to a single
variable or array element. The first
form_item
is assigned the value of
the first field on the form, the second
form_item
is assigned the next
value, etc. Each variable specified in a
for_clause
is assigned the
value from a single field. Each element of the array specified by the
array_name(*)
notation is also assigned from a single field.
Skip_clause
is used; for example, if you wish to only assign the value of
the fourteenth field to a variable without reading and converting fields
one through thirteen. Simply include the option, SKIP 13.
The following is an example of a READ FORM statement that assigns values
from a form with at least 13 fields assuming the A array has five
elements and the B$ array has two elements.
READ FORM Surname$, Firstname$, Initials, SKIP 3, &
(FOR I=1 to 5 STEP 2,A(I)), B$(*), Choice1$, Choice2$
The first three fields are read into Surname$, Firstname$ and Initial$.
The next three fields are ignored. The
for_clause
reads values into
A(1), A(3), and A(5). B$(*) reads values into B$(1) and B$(2). The
twelfth and thirteenth fields are read into Choice1$ and Choice2$
respectively. This same statement causes a run-time error if the active
form has fewer than thirteen fields.
The TIMEOUT clause requires that you respond within a set amount of time.
If input is not complete within this time, an error condition occurs.
The built-in RESPONSE function returns a value of two.
If no VPLUS form is active, or a JOINFORM is active, executing a READ
FORM statement causes a run-time error. See Appendix F for information
on reading values from a JOINFORM form.
Examples
The following examples show the READ FORM statement.
300 READ FORM
310 READ FORM A;TIMEOUT=100
320 READ FROM FORM A;TIMEOUT 100;NOEDIT=8
330 READ FORM A,B;C$;NOEDIT
340 READ FORM A,SKIP 2;C$
REAL
This statement defines a variable as a type REAL. If the SHORT option is
used with it, the variable is type SHORT REAL.
Syntax
{
num_var
} [ {
num_var
}]
[SHORT] REAL {
arrayd
} [, {
arrayd
}]...
Parameters
num_var
Name of scalar numeric variable to be declared.
arrayd
Numeric array description. The syntax for the array is
described under the DIM statement.
Examples
The following examples show the REAL and SHORT REAL statements.