HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
4- 2
time is not measured.
chars_num_expr
A numeric expression that evaluates to the maximum
number of characters that can be input. Typing this
number of characters causes the generation of a
carriage return and assignment of the value to the
specified
str_var
. Then the program begins execution
of the next statement in the program.
separator
One of the following:
{WITH}
{, }
{; }
Each
option_clause
can occur only once in an ACCEPT statement.
Examples
The following examples show the use of the ACCEPT statement. Lines 10 -
60 will assign the input string to a string variable, whole lines 70 -
110 discard the input.
10 ACCEPT String_var1$
20 ACCEPT String_var2$, TIMEOUT Time_limit
30 ACCEPT String_var3$ WITH TIMEOUT=Time_limit
40 ACCEPT String_var4$ WITH TIMEOUT Time_limit, ELAPSED Elapsed_time
50 ACCEPT String_var5$, CHARS Num_chars, ELAPSED Elapsed_time
60 ACCEPT String_var6$, ELAPSED Elapsed_time, CHARS 5, TIMEOUT 3
70 ACCEPT
80 ACCEPT TIMEOUT 5
90 ACCEPT ELAPSED Elapsed_time
100 ACCEPT CHARS 1
110 ACCEPT TIMEOUT 1, CHARS 1
ADVANCE
The ADVANCE statement moves the datum pointer of a specified BASIC DATA
file a given number of datum from its current position. Use of any other
file type with this statement results in an error.
Syntax
[{,} ]
ADVANCE
#fnum
;
num_expr
[{;} STATUS[=]
num_var
]
Parameters
fnum
The file number that HP Business BASIC/XL uses to
identify the file.
fnum
is a numeric expression that
evaluates to a positive short integer.
num_expr
A numeric expression that indicates the number of datum
and the direction that the pointer will move. The
absolute value of this expression is the number of datum
in the file that the ADVANCE statement moves the datum
pointer. If
num_expr
is positive, the datum pointer
moves ahead. If
num_expr
is negative, the datum pointer
moves back. Consider the first datum in the file to be
labeled number one. If the current position in the file
plus the value of
num_expr
is either less than zero or
greater than the total number of datum in the BASIC DATA
file, an end of file error occurs.
num_var num_var
is a numeric variable that returns the status of
the ADVANCE operation. The value assigned to
num_var
is
zero if ADVANCE is successful. If either the beginning
or the end-of-file marker is passed, the difference
between
num_expr
and the number of items actually
skipped prior to reaching the file delimiter is
returned. Note that if
num_expr
is negative, the value
returned to
num_var
in the event of trying to advance