OSI/FTAM Programming Guide

NonStop FTAM Programming Examples
HP NonStop OSI/FTAM Programming Guide528612-001
5-84
Writing a File: TAL Programming Example
1636 ?PAGE "CHECK_ERROR"
1637 !--------------------------------------------------------------------!
1638 ! !
1639 ! Name: check_error !
1640 ! !
1641 ! Description: The check_error procedure checks error codes !
1642 ! returned from FTM procedure calls. This !
1643 ! procedure displays a message, then discards !
1644 ! the association to the remote system, and ends !
1645 ! the program. !
1646 ! !
1647 !--------------------------------------------------------------------!
1648
1649 PROC check_error;
1650
1651 BEGIN
1652
1653 !----------------------------------------------------------------!
1654 ! Display the error code. !
1655 !----------------------------------------------------------------!
1656
1657 tempbuf ':=' "ERROR # " -> @text_ptr;
1658 IF (error < 0) THEN
1659 BEGIN
1660 error := -error;
1661 text_ptr ':=' "-" -> @text_ptr;
1662 END;
1663 @text_ptr := @text_ptr + DNUMOUT ( text_ptr
1664 , $DBL ( error )
1665 , BASE );
1666 text_len := @text_ptr - @tempbuf;
1667 CALL WRITE ( termnum, outbuf, text_len);
1668
1669 !----------------------------------------------------------------!
1670 ! Discard the API context information for the association !
1671 ! and stop the program. !
1672 !----------------------------------------------------------------!
1673
1674 CALL APS_DISCARD_ ( cepi );