OSI/FTAM Programming Reference Manual

NonStop FTAM Programming Examples
HP NonStop OSI/FTAM Programming Reference Manual528611-001
G-212
Example 2 in TAL—Moving a File Between Two
Remote Systems (in Wait Mode)
1987
1988 PROC check_state;
1989
1990 BEGIN
1991
1992 !------------------------------------------------------------------!
1993 ! Check the state-result parameter for a failure. !
1994 !------------------------------------------------------------------!
1995
1996 IF ( state_result = ZFTM^VAL^STATE^FAILURE ) THEN
1997 BEGIN
1998 tempbuf ':=' "Bad state result received" -> @text_ptr;
1999 text_len := @text_ptr - @tempbuf;
2000 CALL WRITE ( termnum, outbuf, text_len );
2001
2002 tempbuf ':=' "Associations discarded" -> @text_ptr;
2003 text_len := @text_ptr - @tempbuf;
2004 CALL WRITE ( termnum, outbuf, text_len );
2005
2006 CALL abort_discard;
2007
2008 CALL STOP;
2009 END;
2010 END;
2011
2012
2013 ?PAGE "BAD_EVENT"
2014 !---------------------------------------------------------------------!
2015 ! !
2016 ! Name: bad_event !
2017 ! !
2018 ! Description: The bad_event procedure is called when an unexpected !
2019 ! event is received from one of the associations. The !
2020 ! event can be an abort indication. If an abort is !
2021 ! received, the procedure aborts the other association; !
2022 ! any other event results in aborts of both associations.!
2023 ! !
2024 ! Input: Event received on the association !
2025 ! !