*

RESUME

Contents


Resume is used in an error or interrupt routine, to go back to the instruction after than which caused the branch.

 

Syntax

   Resume

 

Examples

   # Opening a sequential file with error management (It
   # would also have been possible to test the existence of the file with
   # the filinfo function).

    FLAG_ERREUR = 0
    Onerrgo PB_OUVERTURE    :# in the event of an error go to the label
    Openi filpath("TXT","TEXTE","txt")     :# opening file
    Onerrgo    :# no branch on error
    If FLAG_ERREUR
       End     :# stop if an error occurs;
    Endif
   #... continuation of routine …
    End
   #
   # Error management routine
    PB_OUVERTURE
       Errbox "Problem opening file on line "-num$(errl)
       Errbox "Error no "-num$(errn)-":"-errmes$(errn)
       FLAG_ERREUR = errn
   
Resume # return to line after the error

   # When the break key is pressed, execution of the routine
   # is branched to the LECTURE label.
    Onintgo LECTURE    :# branch in case of interrupt
    Inter    :# the routine cannot be interrupted
    For [LNS]CLE(1)
       For [LNS]CLE
          Infbox num$(ZV)
       Next
       Infbox num$(TOTAL)
    Next
    End
   #
# Break routine
    LECTURE
       Call VERIF([ABV]CHAMP) From GESINTER
   
Resume

 

Description and comments

Resume, that ends an error or interrupt routine is used to resume the routine at the instruction following that where the error or interrupt occurred.

 

Comments

The Onerrgo declaration, that defines the label where the error routine starts, makes branching on error possible. Similarly, branch is possible following a break with the Onintgo instruction.

The return instruction after a Resume is that which follows the instruction at which the error or interrupt occurred. For control instructions, the following return points are obtained:

·         after Endcase (Case instruction),

·         after Endif (If instruction),

·         after Next (For instruction),

·         after Wend (While instruction),

·         after Until (Repeat instruction),

·         after Call (in a sub-programme).

When an End instruction is used to end an error management routine, rather than a Resume, the routine generating an error will be interrupted.

The list of errors and error codes is given in the programming manual annexes.

 

Associated errors

Error

Description

ERRET (32)

Resume without prior error or interrupt branch.

 

Associated key words

ONERRGO - ONINTGO - RETURN - END - ERRN - ERRL - ERRMES$ - END


CONTENTS]


Copyright © Sage 1999 - 2007