OSI/FTAM Programming Reference Manual

NonStop FTAM Programming Examples
HP NonStop OSI/FTAM Programming Reference Manual528611-001
G-210
Example 2 in TAL—Moving a File Between Two
Remote Systems (in Wait Mode)
1909 ?PAGE "CHECK_ERROR"
1910 !---------------------------------------------------------------------!
1911 ! !
1912 ! Name: check_error !
1913 ! !
1914 ! Description: The check_error procedure checks error codes !
1915 ! returned by FTM procedure calls. If an error !
1916 ! code indicates that an error occurred, this !
1917 ! procedure displays a message, then aborts the !
1918 ! associations to the two remote systems, and exits !
1919 ! the program. !
1920 ! !
1921 ! Input: None !
1922 ! !
1923 ! Output: Error messages to terminal !
1924 ! !
1925 !---------------------------------------------------------------------!
1926
1927 PROC check_error;
1928
1929 BEGIN
1930
1931 !------------------------------------------------------------------!
1932 ! Check for an error condition. !
1933 !------------------------------------------------------------------!
1934
1935 IF ( error <> ZAPS^ERR^OK ) THEN
1936 BEGIN
1937
1938 !---------------------------------------------------------------!
1939 ! Display the error code. !
1940 !---------------------------------------------------------------!
1941
1942 tempbuf ':=' "ERROR # " -> @text_ptr;
1943 IF (error_code < 0) THEN
1944 BEGIN
1945 error_code := -error_code;
1946 text_ptr ':=' "-" -> @text_ptr;
1947 END;