Lugaru's Epsilon
Programmer's
Editor 14.04

Context:
Epsilon User's Manual and Reference
   Epsilon Extension Language
      . . .
      Initialization
      Statements
         . . .
         Return Statement
         Save_var Statements
         On_exit Statements
         Goto and Empty Statements
         Block
      Conversions
      . . .

Previous   Up    Next
Save_var Statements  Epsilon Extension Language   Goto and Empty Statements


Epsilon User's Manual and Reference > Epsilon Extension Language > Statements >

On_exit Statements

statement:
        on_exit statement

An on_exit statement tells Epsilon to run some code later, when the current function exits. It can be used to clean up temporary data. As with the save_var statement in the previous section, Epsilon will run the specified code no matter how the function exits, even if it calls another function which signals an error, and this aborts out of the calling function.

The statement to be executed later can use local or global variables, call other functions, and so forth. It can be a block or other complex type of statement, but it cannot use certain control flow statements: switch, case, default, break, continue, return, goto, or labels. And it cannot use on_exit, save_var, save_spot, or restore_vars( ) itself. (If the on_exit statement's code calls a function, that function can use any of these.)

The restore_vars( ) primitive also causes all pending on_exit statements to be executed at once, just as if the current function were about to exit.

All on_exit, save_var, and save_spot statements push their pending operations onto a stack, and they are executed in order when the function returns or when restore_vars( ) is used, newest to oldest.



Previous   Up    Next
Save_var Statements  Epsilon Extension Language   Goto and Empty Statements


Lugaru Epsilon Programmer's Editor 14.04 manual. Copyright (C) 1984, 2021 by Lugaru Software Ltd. All rights reserved.