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

4-: 135
An HP Business BASIC/XL program can pass an HP Business BASIC/XL string
as an actual parameter to a Pascal PAC or C array formal parameter, but
only the string characters are passed (the current string length is not).
If the HP Business BASIC/XL program passes the string by reference, and
the Pascal or C external routine changes its current length, then the HP
Business BASIC/XL program must reset the current length when it resumes
control.
Examples
100 EXTERNAL PASCAL INTEGER FNAbbreviate(BYTE A$)
110 INTEGER New_length
120 READ String$
130 New_length = FNAbbreviate(String$) !Calls the function to set
131 !the length
140 SETLEN String$ TO New_length !Sets string to length
141 !returned by FNAbbreivate
150 PRINT String$
999 END
SHORT
This statement defines a variable as a type SHORT REAL.
The SHORT statement can also be used as an option with the REAL, DECIMAL
or INTEGER statements to declare SHORT REAL, SHORT DECIMAL, or SHORT
INTEGER types. See each of those statements for syntax and examples.
SHORT and SHORT REAL are equivalent.
Syntax
{
num_var
} [ {
num_var
}]
SHORT {
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
100 SHORT I
120 SHORT L,M
130 SHORT A(3)
SORT
The SORT statement sorts the record pointers contained in a workfile.
The SORT statement must also specify the sort keys and their usage
(ascending/descending). Since the record pointers must be sorted by the
data to which they point, the database must be accessed once more.
However, only the records whose pointers are in the workfile need to be
read. The order in which the data sets are to be read is governed by the
thread list. Sort keys specified must be defined in an IN DATASET
statement. After sorting is done, the workfile contains the same record
pointers but they are sorted.
The SEARCH and SORT statements are related, yet independent statements.
SEARCH can be done before or after SORT. If no SEARCH has been done when
SORT is executed, the workfile is empty, and a SEARCH ALL is issued
first. In other words, the SORT statement does an implicit SEARCH ALL if
it is executed before a SEARCH statement. On the other hand, if the
SEARCH is done after the SORT, then all the record pointers contained in
the workfile are searched. The workfile may then contain fewer records
after a SEARCH because the record pointers to any data records that do
not satisfy the SEARCH condition are deleted from the workfile.