Units
Classes, Interfaces, Objects
Types
Variables
Constants
Functions, Procedures
Identifiers

Class TIFPSExec

Unit

ifps3

Declaration

type TIFPSExec = class(TObject)

Description

TIFPSExec is the core of the script engine executer

Fields

NameDescription
ExEx The error code
ExParam The optional parameter for the error
ExPos The position of the last error
ExProc The proc where the last error occured
FCurrentPosition The current position in the current proc
FCurrProc The current proc
FCurrStackBase Current stack base
FExportedVars The list of exported variables
FGlobalVars FGlobalVars contains the global variables of the current script
FMainProc The main proc no or -1 (no main proc)
FOnRunLine FOnRunLine event
FProcs FProcs contains all script procedures
FRegProcs List of all registered external functions
FResources The list of resources
FSpecialProcList List of SpecialProcs; See TIFPSExec.AddSpecialProc
FStack The current stack
FStatus The current status of the script engine
FTypes FTypes contains all types used by the script
MM MM is the memory manager used internally. It's needed to create and destroy variants

Methods

Overview

Public constructor Create;
Public destructor Destroy; Override;
Public class function About: string;
Public procedure AddResource(Proc, P: Pointer);
Public procedure AddSpecialProcImport(const FName: string; P: TIFPSOnSpecialProcImport; Tag: Pointer);
Public procedure Cleanup; Virtual;
Public procedure Clear; Virtual;
Public procedure ClearFunctionList;
Public procedure CMD_Err(EC: TIFError);
Public procedure CMD_Err2(EC: TIFError; const Param: string);
Public function CreateFloatVariant(FType: PIFTypeRec; Value: Extended): PIfVariant;
Public function CreateIntegerVariant(FType: PIFTypeRec; Value: Longint): PIfVariant;
Public function CreateStringVariant(FType: PIFTypeRec; const Value: string): PIfVariant;
Public procedure DeleteResource(P: Pointer);
Protected procedure ExceptionProc(proc, Position: Cardinal; Ex: TIFError; const s: string); Virtual;
Public function FindProcResouce(Proc: Pointer): Pointer;
Public function FindProcResouce2(Proc: Pointer; var StartAt: Longint): Pointer;
Public function FindType(StartAt: Cardinal; BaseType: TIFPSBaseType; var l: Cardinal): PIFTypeRec;
Public function FindType2(BaseType: TIFPSBaseType): PIFTypeRec;
Public function GetProc(const Name: string): Cardinal;
Public function GetType(const Name: string): Cardinal;
Public function GetTypeNo(l: Cardinal): PIFTypeRec;
Public function GetVar(const Name: string): Cardinal;
Public function GetVar2(const Name: string): PIFVariant;
Public function GetVarNo(C: Cardinal): PIFVariant;
Protected function ImportProc(const Name: ShortString; var proc: TIFProcRec): Boolean; Virtual;
Public function IsValidResource(Proc, P: Pointer): Boolean;
Public function LoadData(const s: string): TIFError; Virtual;
Public procedure Pause; Virtual;
Public function RegisterFunctionName(const Name: ShortString; ProcPtr: TIFProc; Ext1, Ext2: Pointer): PProcRec;
Protected procedure RunLine; virtual;
Public function RunProc(Params: TIfList; ProcNo: Cardinal): Boolean;
Public function RunScript: Boolean;
Public procedure Stop; Virtual;

Description

constructor Create;

Create an instance of the executer

destructor Destroy; Override;

Destroy this instance of the executer

class function About: string;

This function will return about information

procedure AddResource(Proc, P: Pointer);

Add a resource

procedure AddSpecialProcImport(const FName: string; P: TIFPSOnSpecialProcImport; Tag: Pointer);

Add a special proc import; this is used for the dll and class library

procedure Cleanup; Virtual;

Reset all variables in the script to zero

procedure Clear; Virtual;

Clear the currently loaded script

procedure ClearFunctionList;

Clear the function list

procedure CMD_Err(EC: TIFError);

Call CMD_Err to cause an error and stop the script

procedure CMD_Err2(EC: TIFError; const Param: string);

Call CMD_Err2 to cause an error and stop the script

function CreateFloatVariant(FType: PIFTypeRec; Value: Extended): PIfVariant;

Create a float variant

function CreateIntegerVariant(FType: PIFTypeRec; Value: Longint): PIfVariant;

Create an integer variant

function CreateStringVariant(FType: PIFTypeRec; const Value: string): PIfVariant;

create a string variant

procedure DeleteResource(P: Pointer);

Delete a resource

procedure ExceptionProc(proc, Position: Cardinal; Ex: TIFError; const s: string); Virtual;

ExceptionProc is called when an error occurs

function FindProcResouce(Proc: Pointer): Pointer;

Find a resource

function FindProcResouce2(Proc: Pointer; var StartAt: Longint): Pointer;

Find a resource

function FindType(StartAt: Cardinal; BaseType: TIFPSBaseType; var l: Cardinal): PIFTypeRec;

Search for a type (l is the starting position)

function FindType2(BaseType: TIFPSBaseType): PIFTypeRec;

Search for a type

function GetProc(const Name: string): Cardinal;

Get function that has been compiled with a name

function GetType(const Name: string): Cardinal;

Get Type that has been compiled with a name

function GetTypeNo(l: Cardinal): PIFTypeRec;

Return type no L

function GetVar(const Name: string): Cardinal;

Get variable that has been compiled with a name

function GetVar2(const Name: string): PIFVariant;

Get variable compiled with a name as a variant

function GetVarNo(C: Cardinal): PIFVariant;

Get variable no (C)

function ImportProc(const Name: ShortString; var proc: TIFProcRec): Boolean; Virtual;

ImportProc is called when the script needs to import an external function

function IsValidResource(Proc, P: Pointer): Boolean;

Check if P is a valid resource for Proc

function LoadData(const s: string): TIFError; Virtual;

Load data into the script engine

procedure Pause; Virtual;

Pause the script engine

function RegisterFunctionName(const Name: ShortString; ProcPtr: TIFProc; Ext1, Ext2: Pointer): PProcRec;

Register a function by name

procedure RunLine; virtual;

RunLine function

function RunProc(Params: TIfList; ProcNo: Cardinal): Boolean;

Use RunProc to call a script function. The Params will not be freed after the call

function RunScript: Boolean;

Run the current script

procedure Stop; Virtual;

Stop the script engine

Properties

Overview

Public CallCleanup: Boolean;
Public ExceptionCode: TIFError;
Public ExceptionPos: Cardinal;
Public ExceptionProcNo: Cardinal;
Public ExceptionString: string;
Public Id: Pointer;
Public MemoryManager: Pointer;
Public OnRunLine: TIFPSOnLineEvent;
Public Status: TIFStatus;

Description

CallCleanup: Boolean;

Set CallCleanup to false when you don't want the script engine to cleanup all variables after RunScript

ExceptionCode: TIFError;

Contains the last error code

ExceptionPos: Cardinal;

Contains the last error position

ExceptionProcNo: Cardinal;

Contains the last error proc

ExceptionString: string;

Contains the last error string

Id: Pointer;

Optional tag of the script engine

MemoryManager: Pointer;

The MemoryManager used when calling CreateVariant/DestroyVariant

OnRunLine: TIFPSOnLineEvent;

The OnRunLine event is called after each executed script line

Status: TIFStatus;

Status contains the current status of the scriptengine


Generated by rjPasDoc 0.7 on Wed 15 May 2002 19:21:35