COBOL Manual for TNS and TNS/R Programs

Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs522555-006
9-64
ENTER
In the non-CRE environment (but not the CRE), an HP COBOL program cannot
call an HP C or HP C++ function for which any of these conditions are true:
°
The function directly or indirectly allocates or deallocates controlled storage.
°
The function performs HP C or HP C++ input-output operations.
°
The function directly or indirectly accesses the HP C function getenv.
Do not include the GIVING phrase in an ENTER statement that accesses an HP C
or HP C++ function whose type is a pointer or whose type designation includes the
modifier “unsigned.” The type “char” is included in this prohibition, because the
HP C compiler and the HP C++ compiler interpret it as the type “unsigned char.”
The type “signed char” is acceptable.
When the formal parameter for an HP C or HP C++ function is a scalar variable, its
type designation cannot include the modifier “unsigned.” The type “char” is include
in this prohibition, because the HP C and HP C++ compilers interpret it as the type
“unsigned char.” The type “signed char” is acceptable.
Because the names of HP C++ routines are often modified to reflect their classes
and argument types, it is recommended that HP COBOL programs call only regular
HP C++ functions, not constructs that are peculiar to HP C++ (such as member
functions and templates).
Restrictions on Calling FORTRAN Routines
Do not pass literals or expressions to FORTRAN routines. The FORTRAN
language has no way to specify that it expects to receive a parameter by value (all
parameters are passed to FORTRAN routines by reference).
If a program includes both HP COBOL and FORTRAN routines, these restrictions
apply to input-output operations:
°
All input-output operations done on a particular file must be performed within
one language or by routines provided by HP.
°
In the non-CRE environment (but not the CRE), an HP COBOL routine must
handle process termination. If execution terminates in FORTRAN code, the
run-time routines do not have a chance to complete any possible pending
input-output operations and lines of printer or terminal output are likely to be
lost.
°
In the CRE, the HP COBOL and FORTRAN routines can share IN, OUT, and
$RECEIVE files.
Restrictions on Calling Pascal Routines
In the non-CRE environment (but not in the CRE), an HP COBOL program cannot
call a Pascal routine that directly or indirectly allocates or deallocates controlled
storage or performs Pascal input-output operations.