File Format Conversion [ HP Pascal/XL Migration Guide ] MPE/iX 5.0 Documentation
HP Pascal/XL Migration Guide
File Format Conversion
Data alignment is different in HP Pascal/XL from data alignment in
Pascal/V. Thus, it is necessary to convert the data in existing files to
a format that is compatible with MPE XL. A program can be written to copy
data from the Pascal/V format to the HP Pascal/XL format.
The HP3000_16 and HP3000_32 compiler options facilitate the conversion.
The HP3000_16 option must appear before the program statement if
HP3000_32 is to be enabled. HP3000_16 tells the compiler to pack data
using Pascal/V size and alignment as much as possible and to use MPE/V
floating point representation. HP3000_32 tells the compiler which data
declaration is to use HP Pascal/XL packing and alignment. This must be
placed immediately after the "=" in the type declaration. Embedded types
that are structures must also be declared with this option.
HP3000_16
The HP3000_16 compiler option specifies the Pascal/V packing algorithm
for the allocation and alignment of all data structures.
Syntax
$HP3000_16$
Default HP Pascal/XL optimized data structures (see the
HP3000_32 compiler option)
Location At front
The HP3000_16 compiler option causes all data types (except files and
pointers) to be allocated and aligned according to the Pascal/V packing
algorithm. A structure compiled by the HP Pascal/XL compiler with
HP3000_16 looks exactly like the same structure compiled by the Pascal/V
compiler. This is useful for reading data files generated by Pascal/V.
NOTE HP3000_16 does not affect file and pointer types. The allocation
and alignment of file variables is system dependent and HP
Pascal/XL does not allow the creation of files that contain files.
The allocation and alignment of pointers is also system dependent,
so pointers are not portable. A pointer declared in an HP
Pascal/XL program can be used only with HP Pascal/XL (not
Pascal/V).
Real numbers declared in an HP3000_16 program are represented in MPE V
floating point representation. Operations performed with these numbers
emulate MPE V floating point operations.
All constants declared in an HP3000_16 program are Pascal/V constants.
HP3000_32
The HP3000_32 compiler option specifies that a given type in an HP3000_16
program is to be allocated and aligned according to the HP Pascal/XL
packing algorithm.
Syntax
$HP3000_32$
Default HP3000_32 is the default when the HP3000_16 is not used.
Location After the symbol = in a type definition
If a program does not specify HP3000_16, then HP3000_32 has no effect,
and the compiler issues a warning.
A user-defined type that is within a structure declared with HP3000_32
must also be declared with HP3000_32.
A user-defined type that is within a structure declared without HP3000_32
must also be declared without HP3000_32.
HP3000_32 is illegal with these types:
* boolean
* char
* integer
* text
String, set, and real operations are illegal on HP3000_32 strings, sets,
and real numbers. HP3000_32 strings, sets, and real numbers are not
assignment compatible with HP3000_16 strings, sets, and real numbers.
Use the predefined procedures strconvert and setconvert and the intrinsic
HPFPconvert to convert HP3000_32 strings, sets, and real numbers to
HP3000_16 strings, sets, and real numbers.
For an example using the HP3000_16 and HP3000_32 compiler options, refer
to the HP Pascal Programmer's Guide. Refer also to the data file
migration example in Chapter 4 of this guide.
MPE/iX 5.0 Documentation