4D v13

SVG_Set_error_handler

Home

 
4D v13
SVG_Set_error_handler

SVG_Set_error_handler 


 

SVG_Set_error_handler {( method )} -> Function result 
Parameter Type   Description
method  String in Name of method to install
Function result  String in Name of method previously installed

The SVG_Set_error_handler command can be used to install the host database method method that will be called in the case of an error and which returns the name of the previously installed method.

The commands of the component carry out a minimum of verifications when they are called: minimum number of parameters, validity of references, for the element to which a command is applied. The component thus handles errors in a structured manner and allows the host database to retrieve any errors.

When default functioning has not been modified, if an error occurs a beep is emitted and the command is interrupted.

The host database can retrieve the error number and the name of the faulty command in one of these methods. To do this, the host database must create a method that will receive the error number as the first parameter and the command name as the second parameter.

This method, if it is installed by the SVG_Set_error_handler command, will be called when an error occurs; in this case, no beep is generated by the code of the component.

If method is omitted or is an empty string, the method is uninstalled and the behavior changes back to the default behavior.

Note: The host database method that will be called by the component must have the "Shared by components and host database" property.

Example  

Installation of the SVG_error_mgmt method (host database method) as the error-handling method:

 $error:=SVG_Set_error_handler("SVG_error_mgmt")

Method code:

  ` SVG_error_mgmt method
 ALERT("Error No."+String($1)+" during execution of the command \""+$2+"\"")

 
PROPERTIES 

Product: 4D
Theme: Utilities
Number: 65912

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: Composant 4D SVG v11.3

 
SEE ALSO 

SVG_Read_last_error