[next] [tail] [up]

#### Types

The following integer types are defined in the System unit:

     Shortint = -128..127;
     SmallInt = -32768..32767;
     Longint  = $80000000..$7fffffff;
     byte     = 0..255;
     word     = 0..65535;
     dword    = longword;
     cardinal = longword;
     Integer  = smallint;

The following types are used for the functions that need compiler magic such as Val (588) or Str (580):

     StrLenInt = LongInt;
     ValSInt = Longint;
     ValUInt = Cardinal;
     ValReal = Extended;

The Real48 type is defined to emulate the old Turbo Pascal Real type:

     Real48 = Array[0..5] of byte;

The assignment operator has been overloaded so this type can be assigned to the Free Pascal native Double and Extended types. Real2Double (554).

The following character types are defined for Delphi compatibility:

     TAnsiChar   = Char;
     AnsiChar    = TAnsiChar;

And the following pointer types as well:

       PChar = ^char;
       pPChar = ^PChar;
       PAnsiChar   = PChar;
       PQWord      = ^QWord;
       PInt64      = ^Int64;
       pshortstring = ^shortstring;
       plongstring  = ^longstring;
       pansistring  = ^ansistring;
       pwidestring  = ^widestring;
       pextended    = ^extended;
       ppointer     = ^pointer;

For the SetJmp (569) and LongJmp (530) calls, the following jump bufer type is defined (for the I386 processor):

       jmp_buf = record
         ebx,esi,edi : Longint;
         bp,sp,pc : Pointer;
         end;
       PJmp_buf = ^jmp_buf;

The following records and pointers can be used to scan the entries in the string message handler tables:

       tmsgstrtable = record
          name : pshortstring;
          method : pointer;
       end;
       pmsgstrtable = ^tmsgstrtable;

       tstringmessagetable = record
          count : dword;
          msgstrtable : array[0..0] of tmsgstrtable;
       end;
       pstringmessagetable = ^tstringmessagetable;

The base class for all classes is defined as:

     Type
       TObject = Class
       Public
         constructor create;
         destructor destroy;virtual;
         class function newinstance : tobject;virtual;
         procedure freeinstance;virtual;
         function safecallexception(exceptobject : tobject;
           exceptaddr : pointer) : longint;virtual;
         procedure defaulthandler(var message);virtual;
         procedure free;
         class function initinstance(instance : pointer) : tobject;
         procedure cleanupinstance;
         function classtype : tclass;
         class function classinfo : pointer;
         class function classname : shortstring;
         class function classnameis(const name : string) : boolean;
         class function classparent : tclass;
         class function instancesize : longint;
         class function inheritsfrom(aclass : tclass) : boolean;
         class function inheritsfrom(aclass : tclass) : boolean;
         class function stringmessagetable : pstringmessagetable;
         procedure dispatch(var message);
         procedure dispatchstr(var message);
         class function methodaddress(const name : shortstring) : pointer;
         class function methodname(address : pointer) : shortstring;
         function fieldaddress(const name : shortstring) : pointer;
         procedure AfterConstruction;virtual;
         procedure BeforeDestruction;virtual;
         procedure DefaultHandlerStr(var message);virtual;
       end;
       TClass = Class Of TObject;
       PClass = ^TClass;

Unhandled exceptions can be treated using a constant of the TExceptProc type:

     TExceptProc = Procedure (Obj : TObject; Addr,Frame: Pointer);

Obj is the exception object that was used to raise the exception, Addr and Frame contain the exact address and stack frame where the exception was raised.

The TVarRec type is used to access the elements passed in a Array of Const argument to a function or procedure:

     Type
       PVarRec = ^TVarRec;
       TVarRec = record
         case VType : Longint of
         vtInteger    : (VInteger: Longint);
         vtBoolean    : (VBoolean: Boolean);
         vtChar       : (VChar: Char);
         vtExtended   : (VExtended: PExtended);
         vtString     : (VString: PShortString);
         vtPointer    : (VPointer: Pointer);
         vtPChar      : (VPChar: PChar);
         vtObject     : (VObject: TObject);
         vtClass      : (VClass: TClass);
         vtAnsiString : (VAnsiString: Pointer);
         vtWideString : (VWideString: Pointer);
         vtInt64      : (VInt64: PInt64);
       end;

The heap manager uses the TMemoryManager type:

       PMemoryManager = ^TMemoryManager;
       TMemoryManager = record
         Getmem      : Function(Size:Longint):Pointer;
         Freemem     : Function(var p:pointer):Longint;
         FreememSize : Function(var p:pointer;Size:Longint):Longint;
         AllocMem    : Function(Size:longint):Pointer;
         ReAllocMem  : Function(var p:pointer;Size:longint):Pointer;
         MemSize     : function(p:pointer):Longint;
         MemAvail    : Function:Longint;
         MaxAvail    : Function:Longint;
         HeapSize    : Function:Longint;
       end;

More information on using this record can be found in Programmers guide.

[next] [front] [up]