HP Pascal/iX Reference Manual (31502-90022)

7- 8
EXPORT { Exported types }
TYPE
bits8 = 0..255; { Exported type }
IMPLEMENT { No implement, part, module }
END; { only provides data types }
MODULE char_info; { Module declaration }
IMPORT
bit_types; { Import other modules needed }
{ to compile this module }
EXPORT { Start of export text }
TYPE
byte = bits8; { Exported type }
VAR
last_byte: byte; { Exported variable }
FUNCTION control (i:byte; flag:BOOLEAN): BOOLEAN; { Exported function }
IMPLEMENT { Start of implementation }
IMPORT stdoutput; { Required for using output }
CONST
error = 'non-ASCII character'; { Non-exported constant }
FUNCTION check (i: byte; flag: BOOLEAN): BOOLEAN; {Non-exported function}
BEGIN
IF i > 127 THEN
BEGIN
check := false;
IF flag THEN writeln (error);
END
ELSE
check := true;
END;
FUNCTION control (i: byte; flag: BOOLEAN): BOOLEAN;{ Exported function }
BEGIN
last_byte := i;
control := check (i,flag) AND (i < 32);
END;
END.
EXPORT
This reserved word precedes the
constants
,
types
,
variables
,
procedures
,
and
functions
of a MODULE that can be used or imported by other programs
and modules. The EXPORT section is used to define the constants, types,
variables, procedures, and functions that the module supplies to any
program or module that imports it. Procedures and functions are
presented as headings without blocks or directives. The EXPORT section
may make use of things that were exported from modules listed in the
IMPORT section. Every module must have an EXPORT section.
Syntax
Export_declaration: