OSI/AS Programming Manual
Example 1: Session Layer
Sample Programs
E–6 056783 Tandem Computers Incorporated
------------------------------------------------------------
--
-- Convert a signed integer into a displayable format.
--
------------------------------------------------------------
PROC local_numout( integer );
INT integer; -- i : integer to display
BEGIN
 IF ( integer < 0 ) THEN
 BEGIN
 outptr ':=' "-" -> @outptr;
 CALL NUMOUT( outptr, -integer, 10, 5 );
 END
 ELSE
 CALL NUMOUT( outptr, integer, 10, 5 );
 @outptr := @outptr[5];
END; -- proc local_numout
? PAGE
------------------------------------------------------------
--
-- Display an error message for those APS procedures that
-- return "error".
--
------------------------------------------------------------
PROC display_aps_error( error_proc );
INT error_proc; -- i : aps proc label
BEGIN
 CASE( error_proc ) OF
 BEGIN
 error_assoc_getparam_proc ->
 outline ':=' "APS_ASSOC_GETPARAM_" -> @outptr;
 error_data_getparam_proc ->
 outline ':=' "APS_DATA_GETPARAM_" -> @outptr;
 error_initialize_proc ->
 outline ':=' "APS_INITIALIZE_" -> @outptr;
 error_status_proc ->
 outline ':=' "APS_STATUS_" -> @outptr;
 END; -- case error_proc
 outptr ':=' " error: " -> @outptr;
 CALL local_numout( error );
 CALL WRITE( output, outline_w, @outptr '-' @outline );
 --
 -- A real application would take appropriate action.
 --
 CALL DEBUG;










