OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide
TAL Program Example
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide—424822-001
A-36
string_offset, -- Offset of the start of the string
-- to read
string_length, -- Number of string to be read
data_string, -- Buffer to contain the strings
actual_number, -- The actual number of octets read
-- by this call
total_number ); -- Returns the total number of octets
-- in this value
IF (( local_rc = OM_RC_SUCCESS ) OR
( local_rc = ZGPI_RC_WARNING )) THEN
BEGIN
IF ( local_rc = ZGPI_RC_WARNING ) THEN
printfd (" WARNING! number: ", local_rc );
outline ':=' print_data[counter].text FOR 32 -> @outptr;
outptr ':=' data_string FOR FIRST_LINE_LEN -> @outptr ;
CALL WRITEX ( output_fn
, outline
, $INT(@outptr - @outline)
) ;
string_length := $UDBL(SECOND_LINE_LEN);
IF ( total_number > actual_number ) THEN
BEGIN
local_rc := GPI_OM_READ_
( read_object_id,
IM_T_TEXT, -- Attribute type
0D, -- Value position
string_offset, -- Offset of the start of the
-- string to read
string_length, -- Number of string to be read
data_string, -- Buffer to contain the strings
actual_number, -- The actual number of octets
-- read by this call
total_number ); -- The total number of octets
-- in this value
IF (( local_rc = OM_RC_SUCCESS ) OR
( local_rc = ZGPI_RC_WARNING )) THEN
BEGIN
IF ( local_rc = ZGPI_RC_WARNING ) THEN
printfd (" WARNING! number: ", local_rc );
outline ':=' " " ->
@outptr;
outptr ':=' data_string FOR SECOND_LINE_LEN -> @outptr ;
CALL WRITEX ( output_fn
, outline
, $INT(@outptr - @outline)
) ;
-- The constant, 59, used below is based on the
-- assumption that we are reading the same message that
-- that we previously transferred out.
IF ( total_number > 59D ) THEN
printf ("Note: There is more content in the buffer.");
END -- then
ELSE
BEGIN
CALL show_gpi_status (ZGPI_ANY);
END; -- else
END; -- then