4D v14

SVG_Read_last_error

Home

 
4D v14
SVG_Read_last_error

SVG_Read_last_error 


 

SVG_Read_last_error -> Function result 
Parameter Type   Description
Function result  Longint in Number of last error

The SVG_Read_last_error command returns the number of the last error that occurred during the execution of a 4D SVG component command and resets this error.

The error number returned can be specific to a component command or may be an error generated by 4D. The following errors are generated by the component:

8850Insufficient number of parameters
8851Invalid parameter type
8852Invalid reference
8853Incorrect value for attribute
8854The element does not accept this command
8855Invalid (ID not found in document) object name (symbol, marker, filter, etc.)
8856DTD file not found
8857Incorrect value for a parameter
8858Unknown error

Given the "SVG_error_mgmt" method of the example for the SVG_Set_error_handler command:

  `Installation of error-handling method
 $ Error_Method_Txt:=SVG_Set_error_handler("SVG_error_mgmt")
  `from now on it is the SVG_error_mgmt method that will be executed in the case of an error
 
  `Creation of new SVG document
 $SVG:=SVG_New(1200;900;"SVG Component Test";"";True)
 SVG_SET_VIEWBOX($SVG;0;0;1500;1000)
 
 If(SVG_Read_last_error=0)
 
    ...
 
 Else
  `The SVG_error_mgmt method has been called and has received the error number
 End if
 
  `Uninstalling of error-handling method
 SVG_Set_error_handler

Given the following SVG_error_mgmt method:

 C_LONGINT($1)
 C_TEXT($2)
 
  `Keep the error and the context
 errorNumber:=$1
 commandName:=$2
 
  `Set the OK system variable to 0
 OK:=0


This method can be used as follows:
  ` Installation of error-handling method
 $ Error_Method_Txt:=SVG_Set_error_handler("SVG_error_mgmt")
 
  ` Creation of new SVG document
 $SVG:=SVG_New(1200;900;" SVG Component Test ";"";True)
 SVG_SET_VIEWBOX($SVG;0;0;1500;1000)
 If(OK=1)
 
    ...
 
 Else
    ALERT("Error No."+String(errorNumber)+" during execution of the command \""+commandName+"\"")
 End if
 
  ` Uninstalling of error-handling method
 SVG_Set_error_handler

 
PROPERTIES 

Product: 4D
Theme: Utilities
Number: 65911

 
HISTORY 

Created: Composant 4D SVG v11.3

 
SEE ALSO 

SVG_Set_error_handler

 
ARTICLE USAGE

4D SVG Component ( 4D v13)
4D SVG Component ( 4D v12)
4D SVG Component ( Composant 4D SVG v11.4)
4D SVG Component ( 4D v14 R2)
4D SVG Component ( 4D v14)
4D SVG Component ( 4D v14 R3)
4D SVG Component ( 4D v14 R4)