SVG_Read_last_error

4D - Documentation   Français   English   German   4D SVG Component, Command Theme List   4D SVG Component, Index   Back   Previous   Next

version 11.3


SVG_Read_last_error Error

ParameterTypeDescription
This command does not require any parameters
Function resultErrorNumber of last error

Description

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

Examples

1. 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

2. 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
      ` 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

See Also

SVG_Set_error_handler.


4D - Documentation   Français   English   German   4D SVG Component, Command Theme List   4D SVG Component, Index   Back   Previous   Next