4D v13

WR ON ERROR

Home

 
4D Write v13
WR ON ERROR

WR ON ERROR 


 

WR ON ERROR ( method ) 
Parameter Type   Description
method  String in Name of method

The WR ON ERROR command installs an interruption method defined and specified by method. This interruption method will be executed every time an error occurs during calls to 4D Write commands. This will allow monitoring of possible execution errors from within your application.

The called method will receive the 3 following parameters:

  • $1 represents the area,
  • $2 represents the error number,
  • $3 represents the error text.

Note: Due to database compilation, $1 and $2 must be declared as Long integers and $3 as Text.

Once method execution is finished, 4D will return to the interrupted formula.If method is an empty string, WR ON ERROR uninstalls the previously installed error method.

Example  

You want to install an error management method for 4D Write.

  ` Call method
 WR ON ERROR("WriteArea")
 
  ` The WriteArea method displays the number and the error description that provoked the call
 ALERT("Error number "+String($2)+Char(13)+$3)

 
PROPERTIES 

Product: 4D
Theme: WR Utilities
Number: 89178

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: 4D Write 6

 
SEE ALSO 

Appendix C: Error Codes
WR Error number
WR Get on error method
WR ON EVENT