INTRINSIC and GLOBAL INTRINSIC [ HP Business BASIC/XL Reference Manual ] MPE/iX 5.0 Documentation
HP Business BASIC/XL Reference Manual
INTRINSIC and GLOBAL INTRINSIC
The INTRINSIC or GLOBAL INTRINSIC statement defines procedures or
functions that are not in the current program without requiring an
explicit definition of the entire procedure or function heading. The
external procedure or function either can be in an executable library or
can be linked with the current program after the current program is
compiled. A GLOBAL INTRINSIC statement must appear in the main program.
These intrinsics can be called from the main or any procedure or function
in the current program. An INTRINSIC statement defines intrinsics local
to the program unit that the definition occurs in. Local definitions
supersede global definitions.
Syntax
[GLOBAL] INTRINSIC [("fname")] identifier [ALIAS str_lit]
[{,} ]
[{;} identifier [ALIAS str_lit]]...
Parameters
GLOBAL Allowed only if the statement is in the main program.
If GLOBAL appears, the statement is a GLOBAL INTRINSIC
statement. If GLOBAL is omitted, the statement is an
INTRINSIC statement. A GLOBAL INTRINSIC statement
affects every program unit in the program. An INTRINSIC
statement affects only the program unit that contains
it.
Information supplied in an INTRINSIC statement overrides
information in a GLOBAL INTRINSIC statement, while the
program unit that contains the INTRINSIC statement is
executing.
fname Intrinsic file that contains the definitions of the
intrinsics in the list of intrinsics that follow. The
default is the default intrinsic file of the operating
system (SYSINTR.PUB.SYS on MPE XL).
identifier Internal name; name that HP Business BASIC/XL program
uses to call this intrinsic. If the intrinsic is a
function and the program calls it without the FNCALL
function, then identifier must be a legal function name;
that is, it must begin with FN, as in FNAdd. The actual
name to use for the call is returned from the definition
in the intrinsic file.
str_lit The alias is the name, if different from the name to be
used in the HP Business BASIC/XL program, of the
intrinsic in the fname file. The string provided is
assumed to be the case-sensitive name of the intrinsic
file entry. The actual name to use for the call is
returned from the definition in the intrinsic file.
Examples
The following examples show the use of the INTRINSIC statement. Lines
10, 20, and 50 show the GLOBAL option. Lines 30, 40 and 80 specify file
names, and the rest use the operating system default. Lines 50, 60, and
70 specify the actual procedure or function name with the ALIAS keyword
when the actual name is different than the internal HP Business BASIC/XL
name.
10 GLOBAL INTRINSIC Findjcw !Entry searched for is:
15 !FINDJCW in SYSINTR.PUB.SYS
20 GLOBAL INTRINSIC Fmtcalendar,Command,Read_char
30 INTRINSIC ("FILE1.LAB") Findjcw,Fmtcalendar,Command
40 INTRINSIC ("FILE2.MKTG") Put_char;Put_block;Open_file
50 GLOBAL INTRINSIC FNFind ALIAS "Find"
60 INTRINSIC FNStore ALIAS "Store",FNRetrieve ALIAS "Retrieve"
70 INTRINSIC FNAdd ALIAS "Add";FNSub ALIAS "Subtract"
80 INTRINSIC ("File3") Print_file ALIAS "print_file_info"
MPE/iX 5.0 Documentation