End

Use End to end execution of a routine or subprogram called by Call, Onerrgo, func, or fmet instruction.

Syntax

End
End EXPRESSION
Examples
# Example 1: A subprogram is called
  Call COMPUTE(ARRAY(1..20),RESULT)
  ...

Subprog COMPUTE(ARRAY,RESULT)
Const Integer ARRAY()
Variable Decimal RESULT
  RESULT=avg(ARRAY)/1+abs(max(ARRAY))
End : # Returns to the calling routine

# Example 2: A func is called
  RESULT=func CLEVER_COMPUTE(ARRAY(1..20))
  ...

Funprog CLEVER_COMPUTE(ARRAY)
Const Integer ARRAY()
End avg(ARRAY)/1+abs(max(ARRAY))

# Example 3: Error handling routine
Onerrgo ERROR_MANAGEMENT
  ...
# The code that executes here might be interrupted by an error
  ...

# ERROR_LIST is supposed to be an array containing the errors code that are considered as minor in the context
$ERROR_MANAGEMENT
If find(errnum,MINOR_ERROR_LIST)
  MINOR_ERROR=1
  Resume : # Returns to the instruction following the execution that threw an error, MINOR_ERROR is set
Endif
End

Description and comments

Associated errors

No associated errors.

See also

Call, Subprog, Funprog, Trbegin, Commit, Rollback, Onerrgo, fmet, func.