TAL Programmer's Guide
CRE Guidelines for TAL
Mixed-Language Programming
096254 Tandem Computers Incorporated 17–45
The following example initializes the CRE without saving messages:
?ENV COMMON
NAME initialize_CRE;
?SEARCH $SYSTEM.SYSTEM.TALLIB
?SOURCE $SYSTEM.SYSTEM.TALDECS (TAL_CRE_INITIALIZER_)
PROC mymain MAIN;
BEGIN
CALL TAL_CRE_INITIALIZER_; !Initialize the CRE
!Lots of code
END;
The following example initializes the CRE and saves ASSIGN and PARAM messages
but not the startup message:
?ENV COMMON
NAME initialize_CRE;
?SEARCH $SYSTEM.SYSTEM.TALLIB
?SOURCE $SYSTEM.SYSTEM.TALDECS (TAL_CRE_INITIALIZER_)
?SOURCE $SYSTEM.SYSTEM.CREDECS (INITIALIZATION)
PROC mymain MAIN;
BEGIN
CALL TAL_CRE_INITIALIZER_
(CRE^save^assign^message LOR CRE^save^param^message);
!Lots of code
END;
Your routine can manipulate the saved messages by calling SMU functions, as
described in the CRE Programmer’s Manual.
Terminating Programs At the end of execution:
1. A TAL module must call CRE_FILE_CLOSE_ for each file the TAL module has
opened.
2. The TAL module then must call CRE_TERMINATOR_ to clear the run-time
environment (as described in the CRE Programmer’s Guide).
3. CRE_TERMINATOR_ calls a run-time library termination routine for each
language in your program except TAL.
4. Each termination routine releases any resources and closes files used by routines
written in that language as follows:
It closes open standard files by calling CRE_FILE_CLOSE_.
It closes all other files by calling FILE_CLOSE_.
Each termination routine then passes control to CRE_TERMINATOR_.
5. CRE_TERMINATOR_ closes any remaining standard files, releases any system
resources used by the CRE, and calls PROCESS_STOP_.
6. PROCESS_STOP_ closes any remaining files left open by your program and
returns control to the operating system.