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

5- 28
| 10: | The last previous input is valid. |
| | |
---------------------------------------------------------------------------------------------
| | |
| 11: | The input was accepted without a carriage return. The TINPUT and |
| | ACCEPT statements allow suppression of the carriage return by |
| | specification of the CHARS and NOLF options. |
| | |
---------------------------------------------------------------------------------------------
Syntax
RESPONSE
Examples
10 ON KEY 1 GOSUB Help;LABEL="Help"
100 LOOP
200 INPUT "Your Name; ";Name$
300 EXIT IF RESPONSE > 2
400 ENDLOOP
500 STOP
600 HELP:!
700 PRINT "In Help"
800 RETURN
The program above continues to prompt for the user's name until it is
entered on the keyboard. If the user presses f1, the program executes
the specified HELP subroutine. When it returns from the HELP subroutine,
since RESPONSE returns a value of -1, the program reprompts for the
user's name.
REVISION
The REVISION function returns the revision number of HP Business BASIC/XL
running on the system. The result is of type INTEGER.
Syntax
REVISION
Examples
10 DISP REVISION
RND
The RND function returns a pseudo-random number in the range of [0.0,
1.0]. The result is of type REAL. You can supply a dummy parameter.
Syntax
RND[(
n
)]
Parameters
n
A dummy parameter. This dummy parameter, called a seed,
is used by the RND function to completely determine a
pseudo-random number sequence. For each seed number, a
different random number sequence is generated. In order
for the sequence to be correctly followed for multiple
random numbers, the seed value from the previous RND
call must be used as input for the next RND call, as
each call changes the seed value. This is of type REAL.
Examples
10 A = RND !A = 0.237298
20 B = RND(4) !B = 0.789717