Unit IFS_VAR.PAS
Types:
TIfsError: TIfsError is used to store errors. (see below for error code)
PTypeManager
PTypeRec
TIfVariant
PVariableManager
PProcedureManager
TRegisteredProc
Constants:
Errors:
ENoError - No error has occured
ECanNotReadProperty - Can not read property, not used yet
ECanNotWriteProperty - Can not write property, not used yet
EUnknownIdentifier - The identifier is unknown
EIdentifierExpected - An identifier is expected
ESemicolonExpected - A semicolon is required
EBeginExpected - Begin is expected
EDuplicateIdentifier - Duplicate identifier
EUnexpectedEndOfFile - Unexpected end of file is occured
EColonExpected - An colon is expected
ESyntaxError - There was an error in the syntax
EStringError - A string error, usually, a string that has notended before the enter.
EErrorInStatement - Error in the statement
EAssignmentExpected - Assignment is expected
ETypeMismatch - Type is not the same.
EErrorInExpression - Error in the expresssion.
ERoundOpenExpected - A round open is expected
ERoundCloseExpected - A round close is expected
EVariableExpected - A variable is expected
ECommaExpected - A comma is expected
EThenExpected - Then is expected
EPeriodExpected - A period is expected
EParameterError - Parameter error, occurs when calling RunScriptProc.The ErrorPos gives the parameter number.
EToExpected - To expected
EDoExpected - Do expected
ERangeError - out of range
EOfExpected - Of expected
EndExpxcted - End expected
EOutOfRange - Out of range
EOpenBlockExpected - Open block expected
ECloseBlockExpected - Close block expected
EConstantExpected - Constant variable is expected
EIsExpected - The = was expected
EUnitNotFound - Unit was not found
EIntegerExpected - An integer is expected
ENotSupported - This is not supported in current version
EExitCommand - Internal use only: Exit is called
ECloseRoundExpected - Close round is expected
EUntilExpected - Until expected
Variant types:
CSV_NONE = Void/ERROR
CSV_UByte = Byte
CSV_SByte = ShortInt
CSV_UInt16 = Word
CSV_SInt16 = Integer (Delphi : SmallInt)
CSV_UInt32 = Longint (Delphi : Cardinal)
CSV_SInt32 = Longint
CSV_Char = Char
CSV_String = String
CSV_Real = Real
CSV_Single = Single
CSV_Double = Double
CSV_Extended = Extended
CSV_Comp = Comp
CSV_Bool = Boolean
CSV_Var = Variable in function call
CSV_Array = Array
CSV_Record = Record
Functions:
function CreateCajVariant(PType: PTypeRec): PIfVariant;
Create a variant with the type PType.
procedure SetType(p: PIfVariant; PType: PTypeRec);
Change the type of P.
procedure DestroyCajVariant(p: PIfVariant);
Destroy the variant.
function VM_Create(InheritFrom: PVariableManager): PVariableManager;
Create a variant manager, used to store variables.
procedure VM_Destroy(p: PVariableManager);
Destroy a veriable manager.
function VM_Add(P: PVariableManager; D: PIfVariant; const Name: string): PIfVariant;
Add an item to the variable manager.
procedure VM_Delete(p: PVariableManager; Idx: LongInt);
Delete an item frm the variable manager.
function VM_Get(p: PVariableManager; Idx: LongInt): PIfVariant;
Return an item from the variable manager as a TIfVariant.
{$IFDEF VARIANTSUPPORT}function VM_GetVariant(p: PVariableManager; Idx: LongInt): Variant;{$ENDIF}
Return an item from the variable manager as an Delphi variant. Only works in >= D4.
procedure VM_SetName(p: PVariableManager; Idx: LongInt; S: string);
Set the name of a variable
function VM_Count(p: PVariableManager): LongInt;
Return the number of items in the variable manager
function VM_Find(p: PVariableManager; const Name: string): LongInt;
Search for a name in the variable manager.
procedure VM_Clear(p: PVariableManager);
Clear the variable manager.
function PM_Create: PProcedureManager;
Create a procedure manager. Used to store internal and external procedures.
procedure PM_Destroy(p: PProcedureManager);
Destroy the procedure manager.
procedure PM_Clear(p: PProcedureManager);
Clear the procedure manager.
procedure PM_Add(p: PProcedureManager; const Spec: string; Addr: Pointer);
Add an item to the procedure manager.
procedure PM_Delete(p: PProcedureManager; I: LongInt);
Delete an item from the procedure manager.
function PM_Find(p: PProcedureManager; const Name: string): Integer;
Search in the procedure manager.
function PM_Get(p: PProcedureManager; i: LongInt): Pointer;
Return an item from the procedure manager.
function PM_GetSpec(p: PProcedureManager; i: LongInt): string;
Return an item from the procedure manager. (return the declaration).
function TM_Create: PTypeManager;
function TM_Add(P: PTypeManager; const Name: string; FType: Word; ex: Pointer): Pointer;
Add a type to the type manager.
function TM_Get(P: PTypeManager; const Name: string): PTypeRec;
Return an item from the type item.
procedure TM_Destroy(p: PTypeManager);
Destroy the type manager.
function DoMinus(p: PIfVariant): Boolean;
Do the variable in P * -1
function DoNot(p: PIfVariant): Boolean;
Not the variable in P
function Perform(Types: PTypeManager; V1: PIfVariant; v2: PIfVariant; T: TPerformType): Boolean;
Perform something on V1.
procedure SetInteger(p: PIfVariant; I: LongInt);
Set P to I
procedure SetReal(p: PIfVariant; i: Extended);
Set P to I
procedure SetString(p: PIfVariant; const I: string);
Set P to I
procedure SetBoolean(p: PIfVariant; i: Boolean);
Set P to I
function IsStringType(v: PIfVariant): Boolean;
Return if V is a string
function IsIntRealType(v: PIfVariant): Boolean;
Return if V is an integer or real number.
function IsIntegerType(v: PIfVariant): Boolean;
Return if V is an integer.
function IsBooleanType(v: PIfVariant): Boolean;
Return if V is a boolean.
function IsRealType(v: PIfVariant): Boolean;
Return if v is a real type.
function GetString(v: PIfVariant): string;
Return V as a string.
function GetReal(v: PIfVariant): Extended;
Return V as a real.
function GetInteger(v: PIfVariant): LongInt;
Return v as an integer.
function GetBoolean(v: PIfVariant): Boolean;
Return v as a boolean.
function GetVarLink(p: PIfVariant): PIfVariant;
Use this function to get the variable when it's used in function calls as a var parameter. Use it always.
function ErrorToString(e: TCS2Error): string;
Translate an error to a string.