Class TCasScriptProgram

Unit

Declaration

type TCasScriptProgram = class(TObject)

Description

Hierarchy

Overview

Methods

Public constructor Create;
Public destructor Destroy; override;
Public procedure ExecuteFunction(const FunctionName: string; const Parameters: array of TCasScriptValue; const IgnoreMissingFunction: boolean = false);

Properties

Public property Functions: TCasScriptUserFunctionList read FFunctions;
Public property Environment: TCasScriptEnvironment read FEnvironment write FEnvironment;

Description

Methods

Public constructor Create;
 
Public destructor Destroy; override;
 
Public procedure ExecuteFunction(const FunctionName: string; const Parameters: array of TCasScriptValue; const IgnoreMissingFunction: boolean = false);

Execute a user-defined function (from Functions list of this program).

  • Looks for given FunctionName.

    IgnoreMissingFunction says what to do in case of missing function: if true, it will be simply ignored (ExecuteFunction will silently do nothng). If false (default) then we will raise exception ECasScriptMissingFunction.

  • Sets function parameters to given values (number of parameters must match, otherwise ECasScriptError). Values from your parameters are set as our parameters TCasScriptParameterValue.SourceValue, so script can read and write your values.

  • Finally executes function body.

Properties

Public property Functions: TCasScriptUserFunctionList read FFunctions;
 
Public property Environment: TCasScriptEnvironment read FEnvironment write FEnvironment;

Environment (outside information) for this program.

This will be created and is owned by this TCasScriptProgram instance. You should take care to copy this reference to all expressions within this program (for example ParseProgram does this), this way all expressions share the same Environment instance.


Generated by PasDoc 0.16.0.