OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide

TAL Program Example
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide424822-001
A-2
-- The printing of these attributes and objects is handled by two
-- procedures: print_attributes and print_object. Each takes as input
-- an array containing the attribute list to be printed. Again, the
-- program assumes certain attributes are present in the inbound root
-- object.
----------------------------------------------------------------------------
?inspect, symbols, nocode, noicode, nomap, nolmap
-- Include the GPI definitions file.
?nolist, source GPIDefs
?list
-----------------------------------------------------------------------------
-- The following DEFINEs were written to simplify the output of information
-- to the home terminal of the user.
--
-----------------------------------------------------------------------------
-- Simply print the string parameter 'x' to the screen
DEFINE printf( x ) =
BEGIN
outline ':=' x -> @outptr;
outlen := $INT(@outptr - @outline);
CALL WRITEX ( output_fn
, outline
, outlen
);
END #;
-- Print one integer 'y' at the end of the string 'x'
DEFINE printfd( x,y ) =
BEGIN
outline ':=' x -> @outptr;
CALL NUMOUT (tempstr, y, 10 , 5);
outptr ':=' tempstr FOR 5 -> @outptr;
outlen := $INT(@outptr - @outline);
CALL WRITEX ( output_fn
, outline
, outlen
);
END #;
-- Print one long integer 'y' at the end of the string 'x':
-- i.e., printfld ("big=",MAX_NUM) gives-> "big= 32767"
DEFINE printfld( x,y ) =
BEGIN
outline ':=' x -> @outptr;
CALL print_long_int (y, output_width, outptr);
@outptr := @outptr[output_width];
outlen := $INT(@outptr - @outline);
CALL WRITEX ( output_fn
, outline
, outlen
);
END #;
-- Print 'y' hex bytes in ascii from pointer 'z' at the end of string 'x':
-- i.e., printfx ("hi:",4,src) gives-> "hi:FE4D"
Note. A sample of program output appears at the end of this appendix.