IFSPas.Pas

Types:
TOnUses
TOnRunLine
TResourceFree
TIFPasScript
TIDispatchToIFVariant = function (ScriptEngine: TIFPasScript; Res: PIfVariant; I: IDispatch): Boolean;
TIFVariantToIDispatch = function (ScriptEngine: TIFPasScript; var Res: IDispatch; I: PIfVariant): Boolean;
Both these types are used to convert IDispatch to TIFVariant, within the COM library.

Variables:
IDispatchToIFVariantProc: TIDispatchToIFVariant = nil;
IFVariantToIDispatchProc: TIFVariantToIDispatch = nil;

Functions:
function GetClassVariable(Self: PIfVariant; ProcClass: PIFSClassType; const Name: string; var thevar: PIfVariant; AlsoProtected: Boolean): Boolean;
function GetClassVariable2(Self: PCreatedClass; ProcClass: PIFSClassType; const Name: string; var thevar: PIfVariant; AlsoProtected: Boolean): Boolean;
Returns a variable from the Class SELF. ProcClass is used to check if the classes are compatible and alsoProtected is used to also check protected and private parts. Name should be in uppercase. GetClassVariable2 is the real function. GetClassVariable calls GetClassVariable.

function GetClassProcedure(Self: PIfVariant; ProcClass: PIFSClassType; const Name: string; var proc: PProcedure; AlsoProtected: Boolean): Boolean;
Returns a procedure from the Class ProcClass. alsoProtected is used to also check protected and private parts. Name should be in uppercase.

function GetInheritedProc(CurrProc: PProcedure): PProcedure;
Returns the inherited procedure of CurrProc.

procedure RegisterStdLib(P: TIfPasScript; OnlySafe: Boolean);
Register some standard functions to the script engine:
Function StrGet(S : String; I : Integer) : Char;
Function StrSet(c : Char; I : Integer; var s : String) : Char;
Function Ord(C : Char) : Byte;
Function Chr(B : Byte) : Char;
Function StrToInt(s : string;def : Longint) : Longint;
Function IntToStr(i : Longint) : String;
Function Uppercase(s : string) : string;
Function Lowercase(s : string) : string;
Function Trim(s : string) : string;
Function Copy(S : String; Indx, Count : Integer) : String;
Procedure Delete(var S : String; Indx, Count : Integer);
Function Pos(SubStr, S : String) : Integer;
Procedure Insert(Source : String; var Dest : String; Indx : Integer);
Function Length(s : String) : Longint;
Function Sin(e : Extended) : Extended; (not when OnlySafe is true)
Function Cos(e : Extended) : Extended; (not when OnlySafe is true)
Function Sqrt(e : Extended) : Extended; (not when OnlySafe is true)
Function Round(e : Extended) : Longint; (not when OnlySafe is true)
Function Trunc(e : Extended) : Longint; (not when OnlySafe is true)
Function Int(e : Extended) : Longint; (not when OnlySafe is true)
Function Pi : Extended; (not when OnlySafe is true)
Function Abs(e : Extended) : Extended; (not when OnlySafe is true)
Function Sqrt(e : Extended) : Extended; (not when OnlySafe is true)
Function FloatToStr(e : Extended) : String; (not when OnlySafe is true)
Function Padl(s : string;I : longInt) : string;
Function Padr(s : string;I : longInt) : string;
Function Padz(s : string;I : longInt) : string;
Function Replicate(c : char;I : longInt) : string;
Function StringOfChar(c : char;I : longInt) : string;
procedure SetArrayLength(var u: array; Length: Longint);
function GetArrayLengtH(var u: array): Longint;