Click or drag to resize

MacroCompilerErrorHandler Delegate

X#
You can register a function / method with this prototype in the RuntimeState to intercept errors in the macro compiler

Namespace:  XSharp
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.24 GA
Syntax
 DELEGATE ICodeblock MacroCompilerErrorHandler(
	cMacro AS STRING,
	oEx AS Exception
)

Parameters

cMacro
Type: String
Source of the macro that causes the error
oEx
Type: Exception
Exception describing the problem

Return Value

Type: ICodeblock
An object that implements ICodeblock, or NULL to tell the macro compiler to throw the error/
Remarks
This delegate is called when the macro compiler encounters an error. The delegate can decide to return a codeblock that will be used instead of the original codeblock In theory you can 'patch' the cMacro and call the macro compiler again. However that may cause an other error, resulting in an endless loop.
See Also