FORTRAN Reference Manual
Mixed-Language Programming
FORTRAN Reference Manual—528615-001
13-14
Using GUARDIAN and CONSULT Directives
Examples of Guardian Calls
1. This example calls the FILEERROR procedure to obtain status information about a
file:
istatus = FILEERROR (ifilenum)
2. This example calls the FILEINFO procedure to determine the number of extents
allocated to a file:
CALL FILEINFO (ifilenum,,, ,,, ,,, ,,, ,,, ,inumexts)
The FILEINFO procedure actually has 26 parameters but only one required
parameter. In the example, IFILENUM is a required argument and INUMEXTS is
an optional argument.
The call skips 15 optional parameters by using commas to mark their positions in
the argument list. (There are 16 commas in the argument list, one to follow the
initial argument and 15 more to indicate the omitted arguments.)
Nine additional optional arguments are omitted from the end of the argument list.
Calls in Programs With Extended Data Space
If your FORTRAN program uses extended data space (that is, the program includes
EXTENDEDREF, LARGECOMMON, or LARGEDATA directives), you can use a data
item that is a formal parameter or resides in extended memory as an argument in a
procedure call if the dummy argument is passed by extended reference (doubleword
address), but not if it is passed by standard reference (word address).
Some C-series Guardian procedures expect pass-by-reference arguments to have
word addresses. Data items stored in extended data space and all formal parameters
in programs compiled with EXTENDEDREF, LARGECOMMON, or LARGEDATA
directives have doubleword addresses.
If you need to call a Guardian procedure that has a word, pass-by-reference argument,
but the argument you are passing is in extended memory, you can use a word
temporary variable when you call the Guardian procedure. Assign the value of the
extended-memory variable to the temporary variable. Use the temporary variable as an
argument to the procedure and then assign the value of the temporary variable to the
original variable after the call completes. The following example illustrates this:
?LARGEDATA error
?GUARDIAN fileinfo
integer error, error_temp
CALL fileinfo(5, error_temp)
error = error_temp
The ERROR parameter to the FILEINFO procedure is a word, pass-by-reference
parameter. Because the example specifies that ERROR is in extended memory










