type TIFPS3CompExec = class(TComponent)
![]() |
constructor Create(AOwner: TComponent); override; |
![]() |
destructor Destroy; override; |
![]() |
function AddFunction(Ptr: Pointer; const Decl: string): Boolean; |
![]() |
function AddFunctionEx(Ptr: Pointer; const Decl: string; CallingConv: TDelphiCallingConvention): Boolean; |
![]() |
function AddMethod(Slf, Ptr: Pointer; const Decl: string): Boolean; |
![]() |
function AddMethodEx(Slf, Ptr: Pointer; const Decl: string; CallingConv: TDelphiCallingConvention): Boolean; |
![]() |
function AddRegisteredPTRVariable(const VarName, VarType: string): Boolean; |
![]() |
function AddRegisteredVariable(const VarName, VarType: string): Boolean; |
![]() |
function Compile: Boolean; virtual; |
![]() |
function CompilerErrorToStr(I: Longint): string; |
![]() |
function Execute: Boolean; virtual; |
![]() |
function ExecuteFunction(const Params: array of Variant; const ProcName: string): Variant; |
![]() |
procedure GetCompiled(var data: string); |
![]() |
function GetProcMethod(const ProcName: string): TMethod; |
![]() |
function GetVariable(const Name: string): PIFVariant; |
![]() |
function LoadExec: Boolean; |
![]() |
procedure SetCompiled(const Data: string); |
![]() |
procedure SetPointerToData(const VarName: string; Data: Pointer; aType: TIFTypeRec); |
![]() |
function SetVarToInstance(const VarName: string; cl: TObject): Boolean; |
![]() |
procedure Stop; virtual; |
![]() |
function TranslatePositionPos(Proc, Position: Cardinal; var Pos: Cardinal; var fn: string): Boolean; |
![]() |
function TranslatePositionRC(Proc, Position: Cardinal; var Row, Col: Cardinal; var fn: string): Boolean; |
![]() |
constructor Create(AOwner: TComponent); override; |
Create an instance of the CompExec component
![]() |
destructor Destroy; override; |
Dstroy the CompExec component
![]() |
function AddFunction(Ptr: Pointer; const Decl: string): Boolean; |
Add a function to the script engine, with cdRegister
as a calling convention
![]() |
function AddFunctionEx(Ptr: Pointer; const Decl: string; CallingConv: TDelphiCallingConvention): Boolean; |
Add a function to the script engine
![]() |
function AddMethod(Slf, Ptr: Pointer; const Decl: string): Boolean; |
Add a method to the script engine, with cdRegister
as a calling convention
![]() |
function AddMethodEx(Slf, Ptr: Pointer; const Decl: string; CallingConv: TDelphiCallingConvention): Boolean; |
Add a method to the script engine, slf should be the self pointer, ptr should be the procedural pointer, for example: Form1.Show
AddMethod(Form1, @TForm1.Show, 'procedure Show;', cdRegister);
![]() |
function AddRegisteredPTRVariable(const VarName, VarType: string): Boolean; |
Add a variable to the script engine that can be used at runtime with the SetPointerToData
function
![]() |
function AddRegisteredVariable(const VarName, VarType: string): Boolean; |
Add a variable to the script engine that can be used at runtime with the GetVariable
function
![]() |
function Compile: Boolean; virtual; |
Compile the script
![]() |
function CompilerErrorToStr(I: Longint): string; |
Convert a compiler message to a string
![]() |
function Execute: Boolean; virtual; |
Execute the compiled script
![]() |
function ExecuteFunction(const Params: array of Variant; const ProcName: string): Variant; |
Execute a function
![]() |
procedure GetCompiled(var data: string); |
Returns the compiled data, first call Compile
![]() |
function GetProcMethod(const ProcName: string): TMethod; |
Get proc as TMethod, cast this to a method pointer and call it
![]() |
function GetVariable(const Name: string): PIFVariant; |
Returns the variable with the name Name
![]() |
function LoadExec: Boolean; |
Load data into the exec, you only need to call this when SuppressLoadData is true
![]() |
procedure SetCompiled(const Data: string); |
Load compiled data in the script engine
![]() |
procedure SetPointerToData(const VarName: string; Data: Pointer; aType: TIFTypeRec); |
Set a pointer variable to data
![]() |
function SetVarToInstance(const VarName: string; cl: TObject): Boolean; |
Set a variable to an object instance
![]() |
procedure Stop; virtual; |
Stop the script
![]() |
function TranslatePositionPos(Proc, Position: Cardinal; var Pos: Cardinal; var fn: string): Boolean; |
Translate a Proc+ByteCode position into an offset in the script
![]() |
function TranslatePositionRC(Proc, Position: Cardinal; var Row, Col: Cardinal; var fn: string): Boolean; |
Translate a Proc+ByteCode position into an row/col in the script
![]() |
property About: string; |
About this script engine
![]() |
property Comp: TIFPSPascalCompiler; |
PascalCompiler object
![]() |
property CompilerMessageCount: Longint; |
Returns the number of compiler messages
![]() |
property CompilerMessages[i: Longint]: TIFPSPascalCompilerMessage; |
Return compiler message number I
![]() |
property CompilerOptions: TIFPS3CompOptions; |
Compiler options
![]() |
property Defines: TStrings; |
Compiler Defines
![]() |
property Exec: TIFPSDebugExec; |
Exec object
![]() |
property ExecErrorByteCodePosition: Cardinal; |
The bytecode offset the runtime error occured in
![]() |
property ExecErrorCode: TIFError; |
Runtime errors: error code
![]() |
property ExecErrorCol: Cardinal; |
The Col in the script the error occured in, does not work when DebugInfo = False
![]() |
property ExecErrorFileName: string; |
Runtime errors: Exec Error filename
![]() |
property ExecErrorParam: string; |
Runtime errors: more information for the error
![]() |
property ExecErrorPosition: Cardinal; |
The offset in the script the error occured in, does not work when DebugInfo = False
![]() |
property ExecErrorProcNo: Cardinal; |
The procedure number the runtime error occured in
![]() |
property ExecErrorRow: Cardinal; |
The Row in the script the error occured in, does not work when DebugInfo = False
![]() |
property ExecErrorToString: string; |
Convert an errorcode + errorparam to a string
![]() |
property MainFileName: string; |
Main file name, this is only relevant to the errors
![]() |
property OnAfterExecute: TIFPS3CompExecEvent; |
OnAfterExecute is called when the script is done executing
![]() |
property OnCompile: TIFPS3CompExecEvent; |
OnCompile event is called when the script is about to be compiled
![]() |
property OnCompImport: TIFPS3ClOnCompImport; |
OnCompImport is called when you can import your functions and classes into the compiler
![]() |
property OnExecImport: TIFPS3ClOnExecImport; |
OnCompImport is called when you can import your functions and classes into the exec
![]() |
property OnExecute: TIFPS3CompExecEvent; |
OnExecute event is called when the script is about to the executed, useful for changing variables within the script
![]() |
property OnLine: TNotifyEvent; |
OnLine event, is called after each bytecode position, useful for checking messages to make sure longer scripts don't block the application
![]() |
property OnNeedFile: TIFPSCEOnNeedFile; |
OnNeedFile is called when the preprocessor is used and an include statement is used
![]() |
property OnVerifyProc: TIFPSCompExecVerifyProc; |
OnVerifyProc is called to check if a procedure matches the expected header
![]() |
property Plugins: TIFPS3CEPlugins; |
Plugins for this component
![]() |
property Running: Boolean; |
Is the script running now?
![]() |
property Script: TStrings; |
The current script
![]() |
property SuppressLoadData: Boolean; |
![]() |
property UseDebugInfo: Boolean; |
UseDebugInfo should be true when you want to use debug information, like position information in the script, it does make the executing a bit slower
![]() |
property UsePreProcessor: Boolean; |
Use the preprocessor, make sure the OnNeedFile event is assigned