HP Pascal/iX Reference Manual (31502-90022)

12- 6
between uppercase and lowercase letters. By default, the
external name is downshifted. The LITERAL_ALIAS compiler
option allows the external name to remain as it is. The
UPPERCASE compiler option upshifts the external name.
Default The internal name, downshifted (or upshifted if UPPERCASE
is ON).
Location Routine: Heading.
Global Immediately after the variable name in the
variable: variable declaration.
When a routine has both internal and external names, the program
recognizes its internal name and the operating system recognizes its
external name.
NOTE For global variables, the HP Pascal options EXTERNAL or GLOBAL must
be included or the ALIAS option is ignored.
Also, routines must be level 1 or the ALIAS option is ignored.
The reasons to use the ALIAS option are:
* To define multiple internal names for a single external procedure.
* To access a library or system routine that has an illegal
(external) name, by giving it a legal internal name.
Example 1
$GLOBAL$
PROGRAM p (input,output);
VAR
global_var $ALIAS 'gvar'$ : integer; {global variable}
PROCEDURE $ALIAS 'write'$ Writefile; EXTERNAL; {procedure}
FUNCTION $ALIAS 'read'$ Readfile : char; EXTERNAL; {function}
BEGIN
.
.
.
END.
Example 2
PROGRAM show_alias;
.
.
PROCEDURE $ALIAS 'intrinname'$ A; INTRINSIC; {One intrinsic }
PROCEDURE $ALIAS 'intrinname'$ B; INTRINSIC; {has two internal}
{names, A and B }
.
.
PROCEDURE $ALIAS 'x''x'$ xx; INTRINSIC; {The intrinsic name}
{x'x is illegal in Pascal}
.
.
PROCEDURE proc1;
FUNCTION $ALIAS 'D1'$ do_it (n : INTEGER): BOOLEAN;
BEGIN {do_it}