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

4- 24
Syntax
DATA
datum
[,
datum
]...
Parameters
datum
Numeric or string literal. A string literal can be
enclosed in quotes, but doesn't have to be. If it is
enclosed in quotes it is called a quoted string literal;
if not, it is called an unquoted string literal.
Leading and trailing spaces are not part of an unquoted
string literal, but embedded spaces are.
A DATA statement is not executable. When the program reaches a DATA
statement, it proceeds to the next line following it.
A data pointer points to the datum that is assigned to the next variable.
Before a program unit is executed, the data pointer is set to point to
the first datum in the program unit's first or lowest-numbered DATA
statement. The data in a DATA statement are read from left to right.
When all the data in one DATA statement are read, the data pointer is
positioned at the first datum in the next DATA statement. Within a
program unit, DATA statements are used in line number order.
When one program unit calls another, the data pointer points to the first
data item in the called program unit. When the called program unit
returns control to the calling program unit, the data pointer returns to
its position in the calling program unit at the time of the call.
Examples
10 DATA "2", truffles, "four", A B C, 56
Datum Description
"2" Quoted string literal
truffles Unquoted string literal
"four" string literal
A B C Unquoted string literal
56 Numeric literal
The following program shows the use of the data statement. It reads, and
then prints three variables.
>LIST
! DATAEX
10 READ A,B,C$
20 DATA 1,2,"THREE"
30 PRINT A
40 PRINT B
50 PRINT C$
60 END
>RUN
1
2
THREE
>
DBASE IS
The DBASE IS statement identifies the database to be searched or sorted.
The statement is global to the entire program. Once specified, it
remains in effect until another DBASE IS statement is executed. The
database identified in this statement must be open. If it is not, an
error occurs.
Syntax
DBASE IS
dbname
$
Parameters
dbname
$ A string variable, whose value is a TurboIMAGE database