TurboIMAGE/XL Database Management System Reference Manual MPE/iX V6.5 (30391-90011)

294 Chapter6
Host Language Access
Pascal
Pascal
Portions of the model program presented at the beginning of this chapter are now shown
here in Pascal. The examples perform specific tasks to illustrate the use of
TurboIMAGE/XL intrinsics.
Data items are defined at the beginning of the sample program. TurboIMAGE/XL
intrinsics must be declared for Pascal as external procedures. The procedure name is
followed by the word "Intrinsic."
Type declarations declare names for data structure forms that will be used in allocating
variables. Variable declarations allocate the variables of the program. Variables are
defined with precise types or forms. Pascal string literals are delimited with single quotes
(' '). Field and record names are separated with a dot (.), when referenced (for example,
"base_name.baseid").
NOTE
Because the Schema Processor, DBSCHEMA, upshifts alphabetic characters,
programs must specify data set and data item names in all uppercase
characters. Take note of this because Pascal does not require that you use
uppercase characters.
For information on TurboIMAGE/XL data item lengths and type designators, refer to
chapter 3. Tables 3-2 and 3-3 show the TurboIMAGE/XL type designators, sub-item
lengths, and data types typically used to process them in Pascal.
NOTE
All parameters must be on halfword boundaries and cannot be odd-byte
aligned.
Defining Data Types, Variables, and Intrinsics
The following is part of the Pascal example program; it defines type declarations, variable
declarations, and TurboIMAGE/XL intrinsics.
$Standard_Level 'HP_MODCAL'$
$hp3000_16$
Program Pascal_For_TurboIMAGEXL (Input,Output);
Label 100;
(* Define all your TurboIMAGE/XL constants. *)
Const
End_Of_Chain =15; (* For DBGET Mode 5 *)
End_Of_Data_Set =11; (* For DBGET Mode 2 *)
No_Chain_Head =17; (* For DBFIND *)
No_Such_Entry =17; (* For DBGET Mode 7 *)
Entry_Has_No_Data =17; (* For DBGET Mode 4 *)
(* Define all your TurboIMAGE/XL record structures. *)
Type
(* for the base parameter *)
Database_Name_Type = Packed Record