OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide

TAL Program Example
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide424822-001
A-5
CALL CLOSE (receive);
-- Open the out file
CALL OPEN ( startup.output_file_name, output_fn );
IF <> THEN
BEGIN
CALL MYTERM ( startup.output_file_name );
CALL OPEN (startup.output_file_name,output_fn);
outline ':=' "Output file open error." -> @outptr;
outlen := $INT(@outptr - @outline);
CALL WRITEX ( output_fn, outline, outlen);
CALL ABEND;
END;
END; -- End proc gpiex_init
?page
---------------------------------------------------------------------------
-- Function Name: print_long_int --
-- --
-- Arguments: Long_int - long integer to be printed IN --
-- width - number of chars for the long integer OUT --
-- buff - buffer pointer for long integer OUT --
-- --
-- Description: This procedure will print a long (32 bit) integer --
-- to the output buffer in ASCII. This is similar --
-- to the Guardian system procedure call NUMOUT. --
---------------------------------------------------------------------------
PROC print_long_int ( long_int, width, buff);
INT(32)
long_int;
INT
.EXT width;
STRING
.EXT BUFF;
BEGIN
INT(32)
tmp,
tmp1;
INT
a,
t,
i := 0,
s,
num[0:9];
STRING
dec[0:9] := "0123456789";
tmp := long_int;
num[0] := 0;
for t := 0 to 9 DO
BEGIN
if tmp <> 0D then
BEGIN
tmp1 := tmp / 10D;
num[t] :=$ABS($INT(tmp - tmp1 * 10D));
tmp := tmp1;
END
ELSE
GOTO out;
END;
out:
buff[i] ':=' " ";
if long_int < 0D then
BEGIN