Difference between revisions of "ON FINISH"

From Recital Documentation Wiki
Jump to: navigation, search
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Class==
 
Error Handling and Debugging
 
 
 
 
==Purpose==
 
==Purpose==
 
Execute a command when the Recital process ends
 
Execute a command when the Recital process ends
Line 22: Line 18:
 
<code lang="recital">
 
<code lang="recital">
 
procedure on_finish
 
procedure on_finish
if getsig() != 0
+
  if getsig() != 0
    dialog box "Signal received. signo = "+alltrim(str(getsig())) label "ON FINISH"
+
      dialog box "Signal received. signo = "+alltrim(str(getsig())) label "ON FINISH"
elseif error() > 0
+
  elseif error() > 0
    dialog box "Error received, error = "+alltrim(str(error())) label "ON FINISH"
+
      dialog box "Error received, error = "+alltrim(str(error())) label "ON FINISH"
else
+
  else
    dialog box "Successful exit" label "ON FINISH"
+
      dialog box "Successful exit" label "ON FINISH"
endif
+
  endif
 
return
 
return
  
Line 35: Line 31:
  
 
==Products==
 
==Products==
Recital Mirage Server, Recital Terminal Developer
+
Recital  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Commands]]
 
[[Category:Commands]]
 
[[Category:Error Handling and Debugging]]
 
[[Category:Error Handling and Debugging]]
 
[[Category:Error Handling and Debugging Commands]]
 
[[Category:Error Handling and Debugging Commands]]

Latest revision as of 15:47, 12 November 2009

Purpose

Execute a command when the Recital process ends


Syntax

ON FINISH <command>


See Also

ERROR(), GETSIG(), ON TERMINATION


Description

The ON FINISH command causes the specified <command> to be executed when the Recital process has finished executing. This can be used in conjunction with the GETSIG() and ERROR() functions to determine if the user exited by themselves or if they received a signal to terminate.


Example

procedure on_finish
  if getsig() != 0
      dialog box "Signal received. signo = "+alltrim(str(getsig())) label "ON FINISH"
  elseif error() > 0
      dialog box "Error received, error = "+alltrim(str(error())) label "ON FINISH"
  else
      dialog box "Successful exit" label "ON FINISH"
  endif
return
 
on finish do on_finish


Products

Recital