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

6- 1
Chapter 6 Input and Output
Introduction
An HP Business BASIC/XL program can receive input from any of the
following:
* A terminal keyboard.
* An input file.
* A data file.
It can produce output on any of the following:
* A terminal screen.
* A printer.
* A data file.
An output statement that specifies the output format produces
formatted
output; an output statement that does not specify the output format
produces
unformatted
output.
This chapter explains the following:
* Receiving input from a terminal keyboard or an input file.
* Producing unformatted output on a terminal screen, a printer, or a
data file supported by the operating system, but not a BASIC DATA
file.
* The format specifiers available to produce formatted output.
When an HP Business BASIC/XL output statement passes a character sequence
to an output device, the resulting output depends on the output device's
interpretation of the individual characters. For example, a sequence
that repositions the cursor on a terminal may be ignored by a printer.
Information about how an individual output device interprets a specific
character sequence is contained in the manual for that output device.
Input from the Keyboard or Input File
This section describes the use of the ACCEPT, INPUT, LINPUT, and TINPUT
statements. These statements are defined in chapter 4. If HP Business
BASIC/XL is running interactively, these statements accept input from a
terminal keyboard. Each of these statements suspends an executing
program so that you can enter values on the keyboard.
The program is in the
input state
while it is suspended waiting for
input. The input state ends when you press RETURN. The input consists of
all characters that you type before pressing RETURN. ACCEPT and TINPUT
optionally allow the programmer to specify the length of the input item.
The program leaves the input state when the designated number of
characters is entered.
If HP Business BASIC/XL is running in a job stream, these statements take
input from the job stream file or an input file. The input is obtained
from the next record in the appropriate file.
The ACCEPT, INPUT, LINPUT, and TINPUT statements differ in the type of
input that they accept and whether they echo input to the display.
Options are available to print a specific prompt on the terminal, specify
the maximum time allowed for input, monitor the amount of time required
for input, specify the maximum input length, and suppress the line feed
following input. Table 6-1, Table 6-2, and Table 6-3 present this
information.