Class CustomCodeModule
- Namespace
- PolarStudio
- Assembly
- PolarStudio.dll
The CustomCodeModule object is used to load custom code (full modules) to execute custom scripts.
public class CustomCodeModule
- Inheritance
-
CustomCodeModule
- Inherited Members
- Extension Methods
Properties
Module
The compiled Polar Script module.
public Module Module { get; }
Property Value
- Module
Methods
Eval(object, string)
Evaluate a specific expression within the Custom Code Module. If this expression is not implemented within the custom module, it may be executed by the default code in the project. May raise an error if applicable.
public object Eval(object pContext, string pExpression)
Parameters
Returns
- object
The return value of the expression
Eval(object, string, ref string)
Evaluate a specific expression within the Custom Code Module. If this expression is not implemented within the custom module, it may be executed by the default code in the project. An error will not be raised but the ErrorMessage is passed back in the ByRef parameter pErrorMessage.
public object Eval(object pContext, string pExpression, ref string pErrorMessage)
Parameters
pContext
objectThe context for the script
pExpression
stringThe expression to evaluate
pErrorMessage
stringA by-ref parameter that will be filled with the error-message if applicable.
Returns
- object
The return value of the expression
ExecuteStatement(string)
Like Eval, but can execute statements. Errors will be thrown.
public void ExecuteStatement(string pExpression)
Parameters
pExpression
stringThe statement to run.
ExecuteStatement(string, ref string)
Like Eval, but can execute statements. Errors will not be thrown but the ErrorMessage is passed back in the ByRef parameter pErrorMessage.
public void ExecuteStatement(string pExpression, ref string pErrorMessage)
Parameters
pExpression
stringThe statement to run.
pErrorMessage
stringA by-ref parameter that will be filled with the error-message if applicable.
HasProcedure(string)
A boolean indicating a specifically named procedure has been implemented in the custom module. Will only test agains the custom module itself, not in the whole project.
public bool HasProcedure(string pProcedureName)
Parameters
pProcedureName
string
Returns
- bool
A True if the ProcedureName is implemented, false otherwise.
Procedures()
Returns a collection of procedures indexed by Name. This can be used to query the parameter-details for a procedure.
public Collection<Procedure> Procedures()
Returns
- Collection<Procedure>
A collection of procedures