The system unit

The system unit contains the standard supported functions of Free Pascal. It is the same for all platforms. Basically it is the same as the system unit provided with Borland or Turbo Pascal.

Functions are listed in alphabetical order. Arguments of functions or procedures that are optional are put between square brackets.

The pre-defined constants and variables are listed in the first section. The second section contains an overview of all functions, grouped by functionality, and the last section contains the supported functions and procedures.

Integer 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 or :

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. .

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 and 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 \var{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 \progref.

Constants

The following constants define the maximum values that can be used with various types:

MaxSIntValue = High(ValSInt); MaxUIntValue = High(ValUInt); maxint = maxsmallint; maxLongint = $7fffffff; maxSmallint = 32767;

The following constants for file-handling are defined in the system unit:

Const fmclosed = $D7B0; fminput = $D7B1; fmoutput = $D7B2; fminout = $D7B3; fmappend = $D7B4; filemode : byte = 2;

The filemode variable is used when a non-text file is opened using Reset. It indicates how the file will be opened. filemode can have one of the following values:

0
The file is opened for reading.
1
The file is opened for writing.
2
The file is opened for reading and writing.

The default value is 2. Other values are possible but are operating system specific.

Further, the following non processor specific general-purpose constants are also defined:

const erroraddr : pointer = nil; errorcode : word = 0; { max level in dumping on error } max_frame_dump : word = 20;

Processor specific global constants are named Testxxxx where xxxx represents the processor number (such as Test8086, Test68000), and are used to determine on what generation of processor the program is running on.

The following constants are defined to access VMT entries:

vmtInstanceSize = 0; vmtParent = 8; vmtClassName = 12; vmtDynamicTable = 16; vmtMethodTable = 20; vmtFieldTable = 24; vmtTypeInfo = 28; vmtInitTable = 32; vmtAutoTable = 36; vmtIntfTable = 40; vmtMsgStrPtr = 44; vmtMethodStart = 48; vmtDestroy = vmtMethodStart; vmtNewInstance = vmtMethodStart+4; vmtFreeInstance = vmtMethodStart+8; vmtSafeCallException = vmtMethodStart+12; vmtDefaultHandler = vmtMethodStart+16; vmtAfterConstruction = vmtMethodStart+20; vmtBeforeDestruction = vmtMethodStart+24; vmtDefaultHandlerStr = vmtMethodStart+28;

The constant names should be used, and never their values, because the VMT table can change, breaking code that uses direct values.

The following constants will be used for the planned variant support:

varEmpty = $0000; varNull = $0001; varSmallint = $0002; varInteger = $0003; varSingle = $0004; varDouble = $0005; varCurrency = $0006; varDate = $0007; varOleStr = $0008; varDispatch = $0009; varError = $000A; varBoolean = $000B; varVariant = $000C; varUnknown = $000D; varByte = $0011; varString = $0100; varAny = $0101; varTypeMask = $0FFF; varArray = $2000; varByRef = $4000;

The following constants are used in the TVarRec record:

vtInteger = 0; vtBoolean = 1; vtChar = 2; vtExtended = 3; vtString = 4; vtPointer = 5; vtPChar = 6; vtObject = 7; vtClass = 8; vtWideChar = 9; vtPWideChar = 10; vtAnsiString = 11; vtCurrency = 12; vtVariant = 13; vtInterface = 14; vtWideString = 15; vtInt64 = 16; vtQWord = 17;

The ExceptProc is called when an unhandled exception occurs:

Const ExceptProc : TExceptProc = Nil;

It is set in the objpas unit, but it can be set by the programmer to change the default exception handling.

The following constants are defined to describe the operating system's file system:

LineEnding = #10; LFNSupport = true; DirectorySeparator = '/'; DriveSeparator = ':'; PathSeparator = ':'; FileNameCaseSensitive : Boolean = True;

The shown values are for unix platforms, but will be different on other platforms. The meaning of the constants is the following:

LineEnding
End of line marker. This constant is used when writing end of lines to text files.
LFNSupport
This is True if the system supports long file names, i.e. filenames that are not restricted to 8.3 characters.
DirectorySeparator
The character that is used as a directory separator, i.e. it appears between various parts of a path to a file.
DriveSeparator
On systems that support drive letters, this character separates the drive indication from the rest of a filename.
PathSeparator
This character can be found between elements in a series of paths (such as the contents of the PATH environment variable.
FileNameCaseSensitive
Indicates whether filenames are case sensitive.

When programming cross-platform, use these constants instead of hard-coded characters. This will enhance portability of an application.

Variables

The following variables are defined and initialized in the system unit:

var output,input,stderr : text; exitproc : pointer; exitcode : word; stackbottom : Cardinal;

The variables ExitProc, exitcode are used in the Free Pascal exit scheme. It works similarly to the one in Turbo Pascal:

When a program halts (be it through the call of the Halt function or Exit or through a run-time error), the exit mechanism checks the value of ExitProc. If this one is non-Nil, it is set to Nil, and the procedure is called. If the exit procedure exits, the value of ExitProc is checked again. If it is non-Nil then the above steps are repeated. So when an exit procedure must be installed, the old value of ExitProc should be saved (it may be non-Nil, since other units could have set it). In the exit procedure the value of ExitProc should be restored to the previous value, such that if it was non-Nil the exit-procedure can be called.

The ErrorAddr and ExitCode can be used to check for error-conditions. If ErrorAddr is non-Nil, a run-time error has occurred. If so, ExitCode contains the error code. If ErrorAddr is Nil, then {ExitCode} contains the argument to Halt or 0 if the program terminated normally.

ExitCode is always passed to the operating system as the exit-code of the current process.

The maximum error code under linux and unix like operating systems is 127.

Under GO32, the following constants are also defined :

const seg0040 = $0040; segA000 = $A000; segB000 = $B000; segB800 = $B800;

These constants allow easy access to the bios/screen segment via mem/absolute.

The randomize function uses a seed stored in the RandSeed variable:

RandSeed : Cardinal;

This variable is initialized in the initialization code of the system unit.

Other variables indicate the state of the application.

IsLibrary : boolean; IsMultiThread : boolean;

The IsLibrary variable is set to true if this module is a shared library instead of an application. The IsMultiThread variable is set to True if the application has spawned other threads, otherwise, and by default, it is set to False.

File handling functions

Functions concerning input and output from and to file.

NameDescription
Open a file in append mode
Assign a name to a file
Read data from a file into memory
Write data from memory to a file
Close a file
Check for end of file
Check for end of line
Delete file from disk
Position in file
Size of file
Write file buffers to disk
Return result of last file IO operation
Read from file into variable
Read from file into variable and goto next line
Rename file on disk
Open file for reading
Open file for writing
Set file position
Set file position to end of file
Set file position to end of line
Set size of file buffer
Truncate the file at position
Write variable to file
Write variable to file and append newline
Memory management functions

Functions concerning memory issues.

NameDescription
Return address of variable
Check if a pointer is valid
Compare 2 memory buffers byte per byte
Compare 2 memory buffers byte per byte
Compare 2 memory buffers byte per byte
Compare 2 memory buffers byte per byte
Return code segment
Free dynamically allocated memory
Return data segment
Fill memory region with 8-bit pattern
Fill memory region with certain character
Fill memory region with 32-bit pattern
Fill memory region with 16-bit pattern
Release allocated memory
Allocate new memory
Return current memory manager
Return highest index of open array or enumerated
Is the memory manager set
Return lowest index of open array or enumerated
Move data from one location in memory to another
MoveChar0Move data till first zero character
Dynamically allocate memory for variable
Return offset of variable
Combine segment and offset to pointer
Resize a memory block on the heap
Return segment
Set a memory manager
Return current stack pointer
Return stack segment register value
Mathematical routines

Functions connected to calculating and coverting numbers.

NameDescription
Calculate absolute value
Calculate inverse tangent
Calculate cosine of angle
Decrease value of variable
Exponentiate
Return fractional part of floating point value
Return high byte/word of value
Increase value of variable
Calculate integer part of floating point value
Calculate logarithm
Return low byte/word of value
Is a value odd or even ?
Return the value of pi
Raise float to integer power
Generate random number
Initialize random number generator
Round floating point value to nearest integer number
Calculate sine of angle
Calculate the square of a value
Calculate the square root of a value
Swap high and low bytes/words of a variable
Truncate a floating point value
String handling

All things connected to string handling.

NameDescription
Construct binary representation of integer
Convert ASCII code to character
Concatenate two strings
Copy part of a string
Delete part of a string
Construct hexadecimal representation of integer
Insert one string in another
Return length of string
Convert string to all-lowercase
Construct octal representation of integer
Calculate position of one string in another
Set length of a string
Set contents and length of a string
Convert number to string representation
Create string consisting of a number of characters
Convert string to all-uppercase
Convert string to number
Operating System functions

Functions that are connected to the operating system.

NameDescription
Change working directory
Return current working directory
Halt program execution
Number of parameters with which program was called
Retrieve parameters with which program was called
Make a directory
Remove a directory
Abort program execution with error condition
Miscellaneous functions

Functions that do not belong in one of the other categories.

NameDescription
Conditionally abort program with error
Abort current loop
Next cycle in current loop
Exclude an element from a set
Exit current function or procedure
Include an element into a set
Jump to execution point
Return ordinal value of enumerated type
Return previous value of ordinal type
Mark execution point for jump
Return size of variable or type
Return next value of ordinal type
Calculate absolute value Abs returns the absolute value of a variable. The result of the function has the same type as its argument, which can be any numerical type. None. Return address of a variable Addr returns a pointer to its argument, which can be any type, or a function or procedure name. The returned pointer isn't typed. The same result can be obtained by the @ operator, which can return a typed pointer (\progref). None Open a file in append mode Append opens an existing file in append mode. Any data written to F will be appended to the file. Only text files can be opened in append mode. After a call to Append, the file F becomes write-only. File sharing is not taken into account when calling Append. If the file doesn't exist when appending, a run-time error will be generated. This behaviour has changed on Windows and Linux platforms, where in versions prior to 1.0.6, the file would be created in append mode. Calculate inverse tangent Arctan returns the Arctangent of X, which can be any Real type. The resulting angle is in radial units. None Check validity of a given condition. With assertions on, Assert tests if expr is false, and if so, aborts the application with a Runtime error 227 and an optional error message in msg. If expr is true, program execution continues normally. If assertions are not enabled at compile time, this routine does nothing, and no code is generated for the Assert call. Enabling and disabling assertions at compile time is done via the \$C or \$ASSERTIONS compiler switches. These are global switches. The default behavior of the assert call can be changed by setting a new handler in the AssertErrorProc variable. Sysutils overrides the default handler to raise a EAssertionFailed exception. None. Assign a name to a file Assign assigns a name to F, which can be any file type. This call doesn't open the file, it just assigns a name to a file variable, and marks the file as closed. None. Check if a pointer is valid Assigned returns True if P is non-nil and retuns False of P is nil. The main use of Assigned is that Procedural variables, method variables and class-type variables also can be passed to Assigned. None Convert integer to string with binary representation. BinStr returns a string with the binary representation of Value. The string has at most cnt characters. (i.e. only the cnt rightmost bits are taken into account) To have a complete representation of any longint-type value, 32 bits are needed, i.e. cnt=32 None. Read data from an untyped file into memory Blockread reads count or less records from file F. A record is a block of bytes with size specified by the or statement. The result is placed in Buffer, which must contain enough room for Count records. The function cannot read partial records. If Result is specified, it contains the number of records actually read. If Result isn't specified, and less than Count records were read, a run-time error is generated. This behavior can be controlled by the \var{\{\$i\}} switch. Depending on the state of the \var{\{\$I\}} switch, a runtime error can be generated if there is an error. In the \var{\{\$I-\}} state, use IOResult to check for errors. Write data from memory to an untyped file BlockWrite writes count records from buffer to the file F.A record is a block of bytes with size specified by the or statement. If the records couldn't be written to disk, a run-time error is generated. This behavior can be controlled by the \var{\{\$i\}} switch. Depending on the state of the \var{\{\$I\}} switch, a runtime error can be generated if there is an error. In the \var{\{\$I-\}} state, use IOResult to check for errors. For the example, see . Exit current loop construct.

Break jumps to the statement following the end of the current repetitive statement. The code between the Break call and the end of the repetitive statement is skipped. The condition of the repetitive statement is NOT evaluated.

This can be used with For, var{repeat} and While statements.

Note that while this is a procedure, Break is a reserved word and hence cannot be redefined.

None.
Change current working directory. Chdir changes the working directory of the process to S. Depending on the state of the \var{\{\$I\}} switch, a runtime error can be generated if there is an error. In the \var{\{\$I-\}} state, use IOResult to check for errors. Convert byte value to character value Chr returns the character which has ASCII value X. None. Close a file Close flushes the buffer of the file F and closes F. After a call to Close, data can no longer be read from or written to F. To reopen a file closed with Close, it isn't necessary to assign the file again. A call to or is sufficient. Depending on the state of the \var{\{\$I\}} switch, a runtime error can be generated if there is an error. In the \var{\{\$I-\}} state, use IOResult to check for errors. Compare 2 memory buffers byte per byte

CompareByte compares two memory regions buf1,buf2 on a byte-per-byte basis for a total of len bytes.

The function returns one of the following values:

less than 0
if buf1 and buf2 contain different bytes in the first len bytes, and the first such byte is smaller in buf1 than the byte at the same position in buf2.
0
if the first len bytes in buf1 and buf2 are equal. \item [greater than 0] if buf1 and buf2 contain different bytes in the first len bytes, and the first such byte is larger in buf1 than the byte at the same position in buf2.
None.
ompare 2 memory buffers character per character

CompareChar compares two memory regions buf1,buf2 on a character-per-character basis for a total of len characters.

The CompareChar0 variant compares len bytes, or until a zero character is found.

The function returns one of the following values:

-1
if buf1 and buf2 contain different characters in the first len positions, and the first such character is smaller in buf1 than the character at the same position in buf2.
0
if the first len characters in buf1 and buf2 are equal.
1
if buf1 and buf2 contain different characters in the first len positions, and the first such character is larger in buf1 than the character at the same position in buf2.
None.
Compare 2 memory buffers DWord per DWord

CompareDWord compares two memory regions buf1,buf2 on a DWord-per-DWord basis for a total of len DWords. (A DWord is 4 bytes).

The function returns one of the following values:

-1
if buf1 and buf2 contain different DWords in the first len DWords, and the first such DWord is smaller in buf1 than the DWord at the same position in buf2.
0
if the first len DWords in buf1 and buf2 are equal.
1
if buf1 and buf2 contain different DWords in the first len DWords, and the first such DWord is larger in buf1 than the DWord at the same position in buf2.
None. ,
Compare 2 memory buffers word per word

CompareWord compares two memory regions buf1,buf2 on a Word-per-Word basis for a total of len Words. (A Word is 2 bytes).

The function returns one of the following values:

-1
if buf1 and buf2 contain different Words in the first len Words, and the first such Word is smaller in buf1 than the Word at the same position in buf2.
0
if the first len Words in buf1 and buf2 are equal.
1
if buf1 and buf2 contain different Words in the first len Words, and the first such Word is larger in buf1 than the Word at the same position in buf2.
None. ,
Append one string to another. Concat concatenates the strings S1,S2 etc. to one long string. The resulting string is truncated at a length of 255 bytes. The same operation can be performed with the + operation. None. Continue with next loop cycle.

Continue jumps to the end of the current repetitive statement. The code between the Continue call and the end of the repetitive statement is skipped. The condition of the repetitive statement is then checked again.

This can be used with For, var{repeat} and While statements.

Note that while this is a procedure, Continue is a reserved word and hence cannot be redefined.

None.
Copy part of a string. Copy returns a string which is a copy if the Count characters in S, starting at position Index. If Count is larger than the length of the string S, the result is truncated. If Index is larger than the length of the string S, then an empty string is returned. None. Calculate cosine of angle Cos returns the cosine of X, where X is an angle, in radians. If the absolute value of the argument is larger than \var{2\^{}63}, then the result is undefined. None. Return code segment CSeg returns the Code segment register. In Free Pascal, it returns always a zero, since Free Pascal is a 32 bit compiler. None. Decrease value of variable Dec decreases the value of X with Decrement. If Decrement isn't specified, then 1 is taken as a default. A range check can occur, or an underflow error, if an attempt it made to decrease X below its minimum value. Delete part of a string. Delete removes Count characters from string S, starting at position Index. All characters after the delected characters are shifted Count positions to the left, and the length of the string is adjusted. None. Free dynamically allocated memory

The first form Dispose releases the memory allocated with a call to . The pointer P must be typed. The released memory is returned to the heap.

The second form of Dispose accepts as a first parameter a pointer to an object type, and as a second parameter the name of a destructor of this object. The destructor will be called, and the memory allocated for the object will be freed.

An runtime error will occur if the pointer doesn't point to a location in the heap.
Return data segment DSeg returns the data segment register. In Free Pascal, it returns always a zero, since Free Pascal is a 32 bit compiler. None. Check for end of file Eof returns True if the file-pointer has reached the end of the file, or if the file is empty. In all other cases Eof returns False. If no file F is specified, standard input is assumed. Depending on the state of the \var{\{\$I\}} switch, a runtime error can be generated if there is an error. In the \var{\{\$I-\}} state, use IOResult to check for errors. Check for end of line Eof returns True if the file pointer has reached the end of a line, which is demarcated by a line-feed character (ASCII value 10), or if the end of the file is reached. In all other cases Eof returns False. If no file F is specified, standard input is assumed. It can only be used on files of type Text. None. Delete a file from disk Erase removes an unopened file from disk. The file should be assigned with Assign, but not opened with Reset or Rewrite Depending on the state of the \var{\{\$I\}} switch, a runtime error can be generated if there is an error. In the \var{\{\$I-\}} state, use IOResult to check for errors. Exlude element from a set if it is present.

Exclude removes E from the set S if it is included inthe set. E should be of the same type as the base type of the set S.

Thus, the two following statements do the same thing:

S:=S-[E]; Exclude(S,E);
If the type of the element E is not equal to the base type of the set S, the compiler will generate an error.
Exit current subroutine. Exit exits the current subroutine, and returns control to the calling routine. If invoked in the main program routine, exit stops the program. The optional argument X allows to specify a return value, in the case Exit is invoked in a function. The function result will then be equal to X. None. Exponentiate Exp returns the exponent of X, i.e. the number e to the power X. None. Get position in file Filepos returns the current record position of the file-pointer in file F. It cannot be invoked with a file of type Text. A compiler error will be generated if this is attempted. Depending on the state of the \var{\{\$I\}} switch, a runtime error can be generated if there is an error. In the \var{\{\$I-\}} state, use IOResult to check for errors. Size of file Filesize returns the total number of records in file F. It cannot be invoked with a file of type Text. (under linux and unix, this also means that it cannot be invoked on pipes). If F is empty, 0 is returned. Depending on the state of the \var{\{\$I\}} switch, a runtime error can be generated if there is an error. In the \var{\{\$I-\}} state, use IOResult to check for errors. Fill memory region with 8-bit pattern FillByte fills the memory starting at X with Count bytes with value equal to Value. This is useful for quickly zeroing out a memory location. When the size of the memory location to be filled out is a multiple of 2 bytes, it is better to use , and if it is a multiple of 4 bytes it is better to use , these routines are optimized for their respective sizes. No checking on the size of X is done. Fill memory region with certain character Fillchar fills the memory starting at X with Count bytes or characters with value equal to Value. No checking on the size of X is done. Fill memory region with 32-bit pattern Fillword fills the memory starting at X with Count DWords with value equal to Value. A DWord is 4 bytes in size. No checking on the size of X is done. Fill memory region with 16-bit pattern Fillword fills the memory starting at X with Count words with value equal to Value. A word is 2 bytes in size. No checking on the size of X is done. Write file buffers to disk Flush empties the internal buffer of an opened file F and writes the contents to disk. The file is \textit{not} closed as a result of this call. Depending on the state of the \var{\{\$I\}} switch, a runtime error can be generated if there is an error. In the \var{\{\$I-\}} state, use IOResult to check for errors. Return fractional part of floating point value. Frac returns the non-integer part of X. None. Release allocated memory Freemem releases the memory occupied by the pointer P, of size Count (in bytes), and returns it to the heap. P should point to the memory allocated to a dynamic variable. An error will occur when P doesn't point to the heap. Return the current directory Getdir returns in dir the current directory on the drive drivenr, where {drivenr} is 1 for the first floppy drive, 3 for the first hard disk etc. A value of 0 returns the directory on the current disk. On linux and unix systems, drivenr is ignored, as there is only one directory tree. An error is returned under dos, if the drive requested isn't ready. Allocate new memory on the heap

Getmem reserves Size bytes memory on the heap, and returns a pointer to this memory in p. If no more memory is available, nil is returned.

For an example, see .

None.
Return current memory manager

GetMemoryManager stores the current Memory Manager record in MemMgr.

For an example, see \progref.

None. .
Stop program execution. Halt stops program execution and returns control to the calling program. The optional argument Errnum specifies an exit value. If omitted, zero is returned. None. Convert integer value to string with hexadecimal representation. HexStr returns a string with the hexadecimal representation of Value. The string has exactly cnt charaters. (i.e. only the cnt rightmost nibbles are taken into account) To have a complete representation of a Longint-type value, 8 nibbles are needed, i.e. cnt=8. None. Return high byte/word of value. Hi returns the high byte or word from X, depending on the size of X. If the size of X is 4, then the high word is returned. If the size is 2 then the high byte is returned. Hi cannot be invoked on types of size 1, such as byte or char. None Return highest index of open array or enumerated

The return value of High depends on it's argument:

  1. If the argument is an ordinal type, High returns the highest value in the range of the given ordinal type.
  2. If the argument is an array type or an array type variable then High returns the highest possible value of it's index.
  3. If the argument is an open array identifier in a function or procedure, then High returns the highest index of the array, as if the array has a zero-based index.

The return type is always the same type as the type of the argument (This can lead to some nasty surprises !).

None.
Increase value of integer variable Inc increases the value of X with Increment. If Increment isn't specified, then 1 is taken as a default. If range checking is on, then A range check can occur, or an overflow error, when an attempt is made to increase X over its maximum value. Include element in set if it was not yet present.

Include includes E in the set S if it is not yet part of the set. E should be of the same type as the base type of the set S.

Thus, the two following statements do the same thing:

S:=S+[E]; Include(S,E);

For an example, see

If the type of the element E is not equal to the base type of the set S, the compiler will generate an error.
Search for a byte in a memory range. IndexByte searches the memory at buf for maximally len positions for the byte b and returns it's position if it found one. If b is not found then -1 is returned. The position is zero-based. Buf and Len are not checked to see if they are valid values. Search for a character in a memory range. IndexChar searches the memory at buf for maximally len positions for the character b and returns it's position if it found one. If b is not found then -1 is returned. The position is zero-based. The IndexChar0 variant stops looking if a null character is found, and returns -1 in that case. Buf and Len are not checked to see if they are valid values. Search for a DWord value in a memory range. IndexChar searches the memory at buf for maximally len positions for the DWord DW and returns it's position if it found one. If DW is not found then -1 is returned. The position is zero-based. Buf and Len are not checked to see if they are valid values. Search for a WORD value in a memory range. IndexChar searches the memory at buf for maximally len positions for the Word W and returns it's position if it found one. If W is not found then -1 is returned. Buf and Len are not checked to see if they are valid values. Insert one string in another. Insert inserts string Source in string S, at position Index, shifting all characters after Index to the right. The resulting string is truncated at 255 characters, if needed. (i.e. for shortstrings) None. Is the memory manager set IsMemoryManagerSet will return True if the memory manager has been set to another value than the system heap manager, it will return False otherwise. None. Calculate integer part of floating point value. Int returns the integer part of any Real X, as a Real. None. Return result of last file IO operation

IOresult contains the result of any input/output call, when the {\$i-} compiler directive is active, disabling IO checking. When the flag is read, it is reset to zero. If IOresult is zero, the operation completed successfully. If non-zero, an error occurred. The following errors can occur:

dos errors :

2
File not found.
3
Path not found.
4
Too many open files.
5
Access denied.
6
Invalid file handle.
12
Invalid file-access mode.
15
Invalid disk number.
16
Cannot remove current directory.
17
Cannot rename across volumes.

I/O errors :

100
Error when reading from disk.
101
Error when writing to disk.
102
File not assigned.
103
File not open.
104
File not opened for input.
105
File not opened for output.
106
Invalid number.

Fatal errors :

150
Disk is write protected.
151
Unknown device.
152
Drive not ready.
153
Unknown command.
154
CRC check failed.
155
Invalid drive specified..
156
Seek error on disk.
157
Invalid media type.
158
Sector not found.
159
Printer out of paper.
160
Error when writing to device.
161
Error when reading from device.
162
Hardware failure.
None. All I/O functions.
Calculate length of a string. Length returns the length of the string S, which is limited to 255 for shortstrings. If the strings S is empty, 0 is returned. Note: The length of the string S is stored in S[0] for shortstrings only. The Length fuction should always be used on ansistrings and widestrings. None. Calculate logarithm Ln returns the natural logarithm of the Real parameter X. X must be positive. An run-time error will occur when X is negative. Return low byte/word of value. Lo returns the low byte of its argument if this is of type Integer or Word. It returns the low word of its argument if this is of type Longint or Cardinal. None. Jump to address.

LongJmp jumps to the adress in the env jmp_buf, and restores the registers that were stored in it at the corresponding call. In effect, program flow will continue at the SetJmp call, which will return value instead of 0. If a value equal to zero is passed, it will be converted to 1 before passing it on. The call will not return, so it must be used with extreme care. This can be used for error recovery, for instance when a segmentation fault occurred.

For an example, see

None.
Return lowest index of open array or enumerated

The return value of Low depends on it's argument:

  1. If the argument is an ordinal type, Low returns the lowest value in the range of the given ordinal type.
  2. If the argument is an array type or an array type variable then Low returns the lowest possible value of it's index.

The return type is always the same type as the type of the argument.

for an example, see .

None.
Return lowercase version of a string. Lowercase returns the lowercase version of its argument C. If its argument is a string, then the complete string is converted to lowercase. The type of the returned value is the same as the type of the argument. None. Mark current memory position This routine is here for compatibility with Turbo Pascal, but it is not implemented and currently does nothing. None. Return size of largest free memory block

Maxavail returns the size, in bytes, of the biggest free memory block in the heap.

The heap grows dynamically if more memory is needed than is available.
None.
Return total available memory

Memavail returns the size, in bytes, of the free heap memory.

The heap grows dynamically if more memory is needed than is available. The heap size is not equal to the size of the memory available to the operating system, it is internal to the programs created by Free Pascal.
None.
Create a new directory.

Mkdir creates a new directory S.

For an example, see .

Depending on the state of the \var{\{\$I\}} switch, a runtime error can be generated if there is an error. In the \var{\{\$I-\}} state, use IOResult to check for errors.
Move data from one location in memory to another Move moves Count bytes from Source to Dest. If either Dest or Source is outside the accessible memory for the process, then a run-time error will be generated. Move data till first zero character MoveChar0 moves Count bytes from Src to Dest, and stops moving if a zero character is found. No checking is done to see if Count stays within the memory allocated to the process. Dynamically allocate memory for variable

New allocates a new instance of the type pointed to by P, and puts the address in P. If P is an object, then it is possible to specify the name of the constructor with which the instance will be created.

For an example, see .

If not enough memory is available, Nil will be returned.
Is a value odd or even ? Odd returns True if X is odd, or False otherwise. None. Convert integer to a string with octal representation. OctStr returns a string with the octal representation of Value. The string has exactly cnt charaters. None. Return offset of a variable. Ofs returns the offset of the address of a variable. This function is only supported for compatibility. In Free Pascal, it returns always the complete address of the variable, since Free Pascal is a 32 bit compiler. None. Return ordinal value of an ordinal type. Ord returns the Ordinal value of a ordinal-type variable X. None. Return number of command-line parameters passed to the program. Paramcount returns the number of command-line arguments. If no arguments were given to the running program, 0 is returned. None. Return value of a command-line argument.

Paramstr returns the L-th command-line argument. L must be between 0 and Paramcount, these values included. The zeroth argument is the path and file name with which the program was started.

The command-line parameters will be truncated to a length of 255, even though the operating system may support bigger command-lines. The Objpas unit (used in objfpc or delphi mode) define versions of Paramstr which return the full-length command-line arguments.

When the complete command-line must be accessed, the argv pointer should be used to retrieve the real values of the command-line parameters.

For an example, see .

None.
Return the value of PI. Pi returns the value of Pi (3.1415926535897932385). None. Search for substring in a string. Pos returns the index of Substr in S, if S contains Substr. In case Substr isn't found, 0 is returned. The search is case-sensitive. None Raise float to integer power

Power returns the value of base to the power expon. Base and expon can be of type Longint, in which case the result will also be a Longint.

The function actually returns Exp(expon*Ln(base))

None.
Return previous element for an ordinal type.

Pred returns the element that precedes the element that was passed to it. If it is applied to the first value of the ordinal type, and the program was compiled with range checking on (\var{\{\$R+\}}, then a run-time error will be generated.

for an example, see

Run-time error 201 is generated when the result is out of range.
Combine segment and offset to pointer

Ptr returns a pointer, pointing to the address specified by segment Sel and offset Off.

  1. In the 32-bit flat-memory model supported by Free Pascal, this function is obsolete.
  2. The returned address is simply the offset.
None.
Generate random number Random returns a random number larger or equal to 0 and strictly less than L. If the argument L is omitted, a Real number between 0 and 1 is returned. (0 included, 1 excluded) None. Initialize random number generator

Randomize initializes the random number generator of Free Pascal, by giving a value to Randseed, calculated with the system clock.

For an example, see .

None.
Read from a text file into variable Read reads one or more values from a file F, and stores the result in V1, V2, etc.; If no file F is specified, then standard input is read. If F is of type Text, then the variables V1, V2 etc. must be of type Char, Integer, Real, String or PChar. If F is a typed file, then each of the variables must be of the type specified in the declaration of F. Untyped files are not allowed as an argument. If no data is available, a run-time error is generated. This behavior can be controlled with the \var{\{\$i\}} compiler switch. Read from a text file into variable and goto next line

Read reads one or more values from a file F, and stores the result in V1, V2, etc. After that it goes to the next line in the file. The end of the line is marked by the LineEnding character sequence (which is platform dependent). The end-of-line marker is not considered part of the line and is ignored.

If no file F is specified, then standard input is read. The variables V1, V2 etc. must be of type Char, Integer, Real, String or PChar.

For an example, see .

If no data is available, a run-time error is generated. This behavior can be controlled with the \var{\{\$i\}} compiler switch.
Convert Turbo Pascal style real to double.

The Real2Double function converts a Turbo Pascal style real (6 bytes long) to a native Free Pascal double type. It can be used e.g. to read old binary TP files with FPC and convert them to Free Pacal binary files.

Note that the assignment operator has been overloaded so a Real48 type can be assigned directly to a double or extended.

None.
Release memory above mark point This routine is here for compatibility with Turbo Pascal, but it is not implemented and currently does nothing. None. Rename file on disk Rename changes the name of the assigned file F to S. F must be assigned, but not opened. Depending on the state of the \var{\{\$I\}} switch, a runtime error can be generated if there is an error. In the \var{\{\$I-\}} state, use IOResult to check for errors. Open file for reading Reset opens a file F for reading. F can be any file type. If F is a text file, or refers to standard I/O (e.g : '') then it is opened read-only, otherwise it is opened using the mode specified in filemode. If F is an untyped file, the record size can be specified in the optional parameter L. A default value of 128 is used. File sharing is not taken into account when calling Reset. Depending on the state of the \var{\{\$I\}} switch, a runtime error can be generated if there is an error. In the \var{\{\$I-\}} state, use IOResult to check for errors. Open file for writing Rewrite opens a file F for writing. F can be any file type. If F is an untyped or typed file, then it is opened for reading and writing. If F is an untyped file, the record size can be specified in the optional parameter L. Default a value of 128 is used. if Rewrite finds a file with the same name as F, this file is truncated to length 0. If it doesn't find such a file, a new file is created. Contrary to Turbo Pascal, Free Pascal opens the file with mode fmoutput. If it should be opened in fminout mode, an extra call to is needed. File sharing is not taken into account when calling Rewrite. Depending on the state of the \var{\{\$I\}} switch, a runtime error can be generated if there is an error. In the \var{\{\$I-\}} state, use IOResult to check for errors. Remove directory when empty. Rmdir removes the directory S. Depending on the state of the \var{\{\$I\}} switch, a runtime error can be generated if there is an error. In the \var{\{\$I-\}} state, use IOResult to check for errors. Round floating point value to nearest integer number. Round rounds X to the closest integer, which may be bigger or smaller than X. None. Generate a run-time error. Runerror stops the execution of the program, and generates a run-time error ErrorCode. None. Set file position Seek sets the file-pointer for file F to record Nr. Count. The first record in a file has Count=0. F can be any file type, except Text. If F is an untyped file, with no record size specified in or , 128 is assumed. Depending on the state of the \var{\{\$I\}} switch, a runtime error can be generated if there is an error. In the \var{\{\$I-\}} state, use IOResult to check for errors. Set file position to end of file SeekEof returns True is the file-pointer is at the end of the file. It ignores all whitespace. Calling this function has the effect that the file-position is advanced until the first non-whitespace character or the end-of-file marker is reached. If the end-of-file marker is reached, True is returned. Otherwise, False is returned. If the parameter F is omitted, standard Input is assumed. A run-time error is generated if the file F isn't opened. Set file position to end of line SeekEoln returns True is the file-pointer is at the end of the current line. It ignores all whitespace. Calling this function has the effect that the file-position is advanced until the first non-whitespace character or the end-of-line marker is reached. If the end-of-line marker is reached, True is returned. Otherwise, False is returned. The end-of-line marker is defined as #10, the LineFeed character. If the parameter F is omitted, standard Input is assumed. A run-time error is generated if the file F isn't opened. Return segment Seg returns the segment of the address of a variable. This function is only supported for compatibility. In Free Pascal, it returns always 0, since Free Pascal is a 32 bit compiler, segments have no meaning. None. Set a memory manager

SetMemoryManager sets the current memory manager record to MemMgr.

For an example, see \progref.

None.
Save current execution point. SetJmp fills env with the necessary data for a jump back to the point where it was called. It returns zero if called in this way. If the function returns nonzero, then it means that a call to with env as an argument was made somewhere in the program. None. Set length of a string. SetLength sets the length of the string S to Len. S can be an ansistring, a short string or a widestring. For ShortStrings, Len can maximally be 255. For AnsiStrings it can have any value. For AnsiString strings, SetLength {\em must} be used to set the length of the string. None. Set length of a string and copy buffer. SetString sets the length of the string S to Len and if Buf is non-nil, copies Len characters from Buf into S. S can be an ansistring, a short string or a widestring. For ShortStrings, Len can maximally be 255. None. Set size of text file internal buffer

SetTextBuf assigns an I/O buffer to a text file. The new buffer is located at Buf and is Size bytes long. If Size is omitted, then SizeOf(Buf) is assumed. The standard buffer of any text file is 128 bytes long. For heavy I/O operations this may prove too slow. The SetTextBuf procedure allows to set a bigger buffer for the IO of the application, thus reducing the number of system calls, and thus reducing the load on the system resources. The maximum size of the newly assigned buffer is 65355 bytes.

  • Never assign a new buffer to an opened file. A new buffer can be assigned immediately after a call to or Append, but not after the file was read from/written to. This may cause loss of data. If a new buffer must be assigned after read/write operations have been performed, the file should be flushed first. This will ensure that the current buffer is emptied.
  • Take care that the assigned buffer is always valid. If a local variable is assigned as a buffer, then after the program exits the local program block, the buffer will no longer be valid, and stack problems may occur.
No checking on Size is done.
Calculate sine of angle Sin returns the sine of its argument X, where X is an angle in radians. If the absolute value of the argument is larger than \var{2\^{}63}, then the result is undefined. None. Return size of a variable or type.

SizeOf returns the size, in bytes, of any variable or type-identifier.

This isn't really a RTL function. Its result is calculated at compile-time, and hard-coded in the executable.
None.
Return current stack pointer Sptr returns the current stack pointer. None. Calculate the square of a value. Sqr returns the square of its argument X. None. Calculate the square root of a value Sqrt returns the square root of its argument X, which must be positive. If X is negative, then a run-time error is generated. Return stack segment register value. SSeg returns the Stack Segment. This function is only supported for compatibility reasons, as Sptr returns the correct contents of the stackpointer. None. Convert a numerical value to a string. Str returns a string which represents the value of X. X can be any numerical type. The optional NumPLaces and Decimals specifiers control the formatting of the string. None. Return a string consisting of 1 character repeated N times.

StringOfChar creates a new String of length l and fills it with the character c.

It is equivalent to the following calls:

SetLength(StringOfChar,l); FillChar(Pointer(StringOfChar)^,Length(StringOfChar),c);
None.
Return next element of ordinal type.

Succ returns the element that succeeds the element that was passed to it. If it is applied to the last value of the ordinal type, and the program was compiled with range checking on (\var{\{\$R+\}}), then a run-time error will be generated.

for an example, see .

Run-time error 201 is generated when the result is out of range.
Swap high and low bytes/words of a variable Swap swaps the high and low order bytes of X if X is of type Word or Integer, or swaps the high and low order words of X if X is of type Longint or Cardinal. The return type is the type of X None. Truncate a floating point value. Trunc returns the integer part of X, which is always smaller than (or equal to) X in absolute value. None. Truncate the file at position Truncate truncates the (opened) file F at the current file position. Depending on the state of the \var{\{\$I\}} switch, a runtime error can be generated if there is an error. In the \var{\{\$I-\}} state, use IOResult to check for errors. , Convert a string to all uppercase. Upcase returns the uppercase version of its argument C. If its argument is a string, then the complete string is converted to uppercase. The type of the returned value is the same as the type of the argument. None. Calculate numerical value of a string. Val converts the value represented in the string S to a numerical value, and stores this value in the variable V, which can be of type Longint, Real and Byte. If the conversion isn't succesfull, then the parameter Code contains the index of the character in S which prevented the conversion. The string S is allowed to contain spaces in the beginning. The string S can contain a number in decimal, hexadecimal, binary or octal format, as described in the language reference. If the conversion doesn't succeed, the value of Code indicates the position where the conversion went wrong. Write variable to a text file Write writes the contents of the variables V1, V2 etc. to the file F. F can be a typed file, or a Text file. If F is a typed file, then the variables V1, V2 etc. must be of the same type as the type in the declaration of F. Untyped files are not allowed. If the parameter F is omitted, standard output is assumed. If F is of type Text, then the necessary conversions are done such that the output of the variables is in human-readable format. This conversion is done for all numerical types. Strings are printed exactly as they are in memory, as well as PChar types. The format of the numerical conversions can be influenced through the following modifiers: OutputVariable : NumChars [: Decimals ] This will print the value of OutputVariable with a minimum of NumChars characters, from which Decimals are reserved for the decimals. If the number cannot be represented with NumChars characters, NumChars will be increased, until the representation fits. If the representation requires less than NumChars characters then the output is filled up with spaces, to the left of the generated string, thus resulting in a right-aligned representation. If no formatting is specified, then the number is written using its natural length, with nothing in front of it if it's positive, and a minus sign if it's negative. Real numbers are, by default, written in scientific notation. If an error occurs, a run-time error is generated. This behavior can be controlled with the \var{\{\$i\}} switch. Write variable to a text file and append newline

WriteLn does the same as for text files, and emits a Carriage Return - LineFeed character pair after that. If the parameter F is omitted, standard output is assumed. If no variables are specified, a Carriage Return - LineFeed character pair is emitted, resulting in a new line in the file F.

Under linux and unix, the Carriage Return character is omitted, as customary in Unix environments.
If an error occurs, a run-time error is generated. This behavior can be controlled with the \var{\{\$i\}} switch.
A signed 8-bits integer A signed 16-bits integer A signed 32-bits integer An unsigned 8-bits integer An unsigned 16-bits integer An unsigned 32-bits integer An unsigned 32-bits integer. A signed 16-bits integer The system unit defines Integer as a signed 16-bit integer. But when DELPHI or OBJFPC mode are active, then the objpas unit redefines Integer as a 16-bit integer. Pointer to null-terminated string. Or the same as a pointer to an array of char. See the reference manual for more information about this type. Pointer to an array of pointers to null-terminated strings. Alias for 1-byte sized char. Alias for 1-byte sized char. Alias for type. Alias for type. UCS unicode character (unsigned 32 bit word) Pointer to Array of characters. Pointer to array of characters. String of characters. UTF-8 unicode (ansi) string. Pointer to Currency type. 32-Bit signed integer. Encoded Date-Time type. 32-bit signed integer. Pointer to single-sized float value. Pointer to double-sized float value. Pointer to currency type. Pointer to extended-sized float value. Pointer to type Pointer to type Pointer to type Pointer to type Pointer to type Pointer to type Pointer to LongWord type Pointer to type Pointer to type Pointer to QWord type Pointer to Int64 type Pointer to type. Pointer to a type Pointer to a pointer type. Pointer to a type. Pointer to a Boolean type. Pointer to a WordBool type. Pointer to a LongBool type. Pointer to a shortstring type. Pointer to an ansistring type. Pointer to a type. Pointer to an type. Wide char (16-bit sized char) Text line break style. (end of line character) Line-feed only (#10, unix style) Carriage-return, line-feed (#13#30, Windows style) Carriage-return (#13, Mac-OS style) Simple procedural type. Maximum String-size value. Maximum unsigned integer value. Maximum longint value. Maximum smallint value. Maximum integer value. Generic array of integer. Pointer to type Generic pointer array. Pointer to type Dynamic array of integer. Array of PChar Pointer to type. Maximum number of frames to show in error frame dump. Exit procedure pointer. Address where the last error occurred. Last error code. File mode: File is closed. File mode: File is open for reading. File mode: File is open for writing. File mode: File is open for reading and writing. File mode: File is open for writing, appending to the end. Current process ID. Default file mode for untyped files. Current command-line. Indicates whether more than one thread is running in the application. Indicate whether there was a stack error. Exit code for the program, will be communicated to the OS on exit. Seed for function. True if the current module is a library. Otherwise module is an excutable True for console applications, False for GUI applications. Current Thread ID. Standard output text file. Standard input text file. Alias for . Standard diagnostic output text file. Result of last I/O operation. Read-Only. Current stack bottom. Maximum stack length. Return index of a character in null-terminated array of char. IndexChar0 returns the index of the character b in the null-terminated array Buf. At most len characters will be searched, or the null character if it is encountered first. If the character is not found, 0 is returned. On error, 0 is returned. Compare two buffers character by character till a null-character is reached.

CompareChar0 compares 2 buffers buf1 and buf2 for a maximum length of len or till a null character is reached in either buffer. The result depends on the contents of the buffers:

< 0
If buf1 contains a character less than the corresponding character in buf2.
0
If both buffers are equal
> 0
If buf1 contains a character greater than the corresponding character in buf2.
None.
Prefetch a memory location Prefetch can be used to optimize the CPU behaviour by already loading a memory location. It is mainly used as a hint for those processors that support it. None. TP compatible real type (6 bytes) definition Convert a null-terminated string to a shortstring. Converts a null terminated string in P to a Pascal string, and returns this string. The string is truncated at 255 characters. None. Length of a null-terminated string. Returns the length of the null-terminated string P. None. Return a string of spaces Space returns a shortstring with length B, consisting of spaces. Make sure reference count of string is 1 UniqueString ensures that the ansistring S has reference count 1. It makes a copy of S if this is necesary, and returns the copy in S None. Set the end-of-line character for the given text file. SetTextLineEnding sets the end-of-line character for the text file F to Ending. By default, this is the string indicated by . None. Return the current frame get_frame returns a pointer to the current stack frame. Return the address of the caller. get_caller_frame returns a pointer to address ( the return address) of the caller of the routine which has as frame framebp. Return the frame pointer of the caller get_caller_frame returns a pointer to the frame of the caller of the routine which has as frame framebp. Dump stack to the given text file. Dump_Stack prints a stack dump to the file f, with base frame pointer bp The file f must be opened for writing or an error will occur. Add an exit procedure to the exit procedure chain. AddExitProc adds Proc to the exit procedure chain. At program exit, all procedures added in this way will be called in reverse order. None. Initialize exceptions. SysInitExceptions initializes the exception system. This procedure should never be called directly, it is taken care of by the RTL. Initialize standard input and output. SysInitStdIO initializes the standard input and output files: , and . This routine is called by the initialization code of the system unit, there should be no need to call it directly. Reset the floating point unit. SysResetFPU resets the floating point unit. There should normally be no need to call this unit; the compiler itself takes care of this. Generate an abstract error. AbstractError generates an abstract error (run-time error 211). If the constant is set, it will be called instead. This routine causes a run-time error 211. Format an address suitable for inclusion in a backtrace SysBackTraceStr will create a string representation of the address Addr, suitable for inclusion in a stack backtrace. None. Standard Assert failure implementation SysAssert is the standard implementation of the assertion failed code. It is the default value of the AssertErrorProc constant. It will print the assert message Msg together with the filename FName and linenumber LineNo to standard error output (StdErr) and will halt the program with exit code 227. The error address ErrorAddr is ignored. Type for formatting of backtrace dump. Standard error handler procedural type. Abstract error handler procedural type. Assert error handler procedural type. Standard backtrace formatting routine This handler is called to get a standard format for the backtrace routine. Custom error handling procedure.

If set, the ErrorProc constant is used when a run-time error occurs. If it is not set, then the standard error handling is done: a stack dump is performed, and the program exits with the indicated error code.

The SysUtils unit sets this procedure and raises an exception in its handler.

Custom abstract error handling procedure

If set, the AbstractErrorProc constant is used when an abstract error occurs. If it is not set, then the standard error handling is done: A stack dump is performed, and the program exits with error code 211.

The SysUtils unit sets this procedure and raises an exception in its handler.

Custom assert error handling procedure

If set, the AbstractErrorProc constant is used when an assert error occurs. If it is not set, then the standard error handling is done: The assertion error message is printed, together with the location of the assertion, and A stack dump is performed, and the program exits with error code 227.

The SysUtils unit sets this procedure and raises an exception in its handler.

Record type to store processor information. EBX register. ESI register EDI register BP register SP register PC register Pointer to record VMT Layout: Location of class instance size in VMT VMT Layout: location of pointer to parent VMT. VMT Layout: location of class name. VMT Layout: location of dynamic methods table. VMT Layout: Method table start. VMT Layout: Location of fields table. VMT Layout: Location of class type information. VMT Layout: ? VMT layout: ? VMT layout: Interface table VMT layout: message strings table. VMT layout: start of method table. VMT Layout: Location of destructor pointer. VMT Layout: location of NewInstance method. VMT Layout: location of FreeInstance method. VMT Layout: ? VMT Layout: ? VMT Layout: ? VMT Layout: ? VMT Layout: ? Alias for Text file type. Parent class for all classes. TObject is used as the parent class for all class definitions. It contains some standard methods that are available in all classes. Class of . Pointer to Record used in string message handler table. Message name Method to call Pointer to array of records. String message table container for class. Record used to describe the string messages handled by a class. It consists of a count, followed by an array of records. Number of messages in the string table. First record. Pointer to record. Pointer to type. Standard GUID representation type. Pointer to record. Interfaces table entry. tinterfaceentry is used to store the list of Interfaces of a class. This list is stored as an array of tinterfaceentry records. Unique GUID for this interface. Pointer to interface VTable. Offset Pointer to GUID string. Always assigned for COM. Pointer to record. Record to store list of interfaces of a class. Number of interfaces. Array of records. Base class of all classes. TObject is the parent root class for all classes in Object Pascal. If a class has no parent class explicitly declared, it is dependent on TObject. TObject introduces class methods that deal with the class' type information, and contains all necessary methods to create an instance at runtime, and to dispatch messages to the correct method (both string and integer messages). TObject Constructor Create creates a new instance of TObject. Currently it does nothing. It is also not virtual, so there is in principle no need to call it directly. Destroy TObject destructor.

Destroy is the destructor of TObject. It will clean up the memory assigned to the instance. Descendent classes should override destroy if they want to do additional clean-up. No other destructor should be implemented.

It is bad programming practice to call Destroy directly. It is better to call the Free method, because that one will check first if Self is different from Nil.

To clean up an instance and reset the refence to the instance, it is best to use the FreeAndNil function.

Create Free
Allocate memory on the heap for a new instance NewInstance allocates memory on the heap for a new instance of the current class. If the memory was allocated, the class will be initialized by a call to InitInstance. The function returns the newly initialized instance. If not enough memory is available, a Nil pointer may be returned, or an exception may be raised. Create InitInstance InstanceSize FreeInstance Clean up instance and free the memory reserved for the instance. FreeInstance cleans up an instance of the current class, and releases the heap memory occupied by the class instance. Destroy InitInstance NewInstance Handle exception object SafeCallException should be overridden to handle exceptions in a method marked with the savecall directive. The implementation in TObject simply returns zero. Default handler for integer message handlers. DefaultHandler is the default handler for messages. If a message has an unknown message ID (i.e. does not appear in the table with integer message handlers), then it will be passed to DefaultHandler by the Dispatch method. Dispatch DefaultHandlerStr Check for Nil and call destructor. Free will check the Self pointer and calls Destroy if it is different from Nil. This is a safer method than calling Destroy directly. If a reference to the object must be reset as well (a recommended technque), then the function FreeAndNil should be called. None. Destroy FreeAndNil Initialize a new class instance. InitInstance initializes the memory pointer to by Instance. This means that the VMT is initialized, and the interface pointers are set up correctly. The function returns the newly initialized instance. NewInstance Create Finalize the class instance.

CleanUpinstance finalizes the instance, i.e. takes care of all reference counted objects, by decreasing their reference count by 1, and freeing them if their count reaches zero.

Normally, CleanupInstance should never be called, it is called automatically when the object is freed with it's constructor.

None. Destroy Free InitInstance
Return a pointer to the type information for this class. ClassInfo returns a pointer to the type information for this class. This pointer can be used in the various type information routines. Return a "class of" pointer for the current class ClassType returns a class type reference for the current class. ClassInfo ClassName Return the current class name. ClassName returns the class name for the current class, in all-uppercase letters. To check for the class name, use the ClassNameIs class method. None. ClassInfo ClassType ClassNameIs Check whether the class name equals the given name. ClassNameIs checks whether Name equals the class name. It takes of case sensitivity, i.e. it converts both names to uppercase before comparing. ClassInfo ClassType ClassName Return the parent class. ClassParent returns the class of the parent class of the current class. This is always different from Nil, except for TObject. None. ClassInfo ClassType ClassNameIs Return the size of an instance. InstanceSize returns the number of bytes an instance takes in memory. This is Just the memory occupied by the class structure, and does not take into account any additional memory that might be allocated by the constructor of the class. None. InitInstance ClassName ClassInfo ClassType Chck wether class is an ancestor. InheritsFrom returns True if AClass is an ancestor class from the current class, and returns false if it is not. ClassName ClassInfo ClassType Return a pointer to the string message table. StringMessageTable returns a pointer to the string message table, which can be used to look up methods for dispatching a string message. It is used by the DispatchStr method. If there are no string message handlers, nil is returned. DispatchStr Dispatch Dispatch an integer message

Dispatch looks in the message handler table for a handler that handles message. The message is identified by the first dword (cardinal) in the message structure.

If no matching message handler is found, the message is passed to the DefaultHandler method, which can be overridden by descendent classes to add custom handling of messages.

DispatchStr DefaultHandler
Dispatch a string message. DispatchStr extracts the message identifier from Message and checks the message handler table to see if a handler for the message is found, and calls the handler, passing along the message. If no handler is found, the default DefaultHandlerStr is called. None. DefaultHandlerStr Dispatch DefaultHandler Return the address of a method MethodAddress returns the address of a method, searching the method by its name. The Name parameter specifies which method should be taken. The search is conducted in a case-insensitive manner. If no matching method is found, Nil is returned. MethodName FieldAddress Return the name of a method. MethodName searches the VMT for a method with the specified address and returns the name of the method. If no method with the matching address is found, an empty string is returned. MethodAddress FieldAddress Return the address of a field. FieldAddress returns the address of the field with name name. The address is the address of the field in the current class instance. If no field with the specified name is found, Nil is returned. MethodAddress MethodName Method called after the constructor was called. AfterConstruction is a method called after the constructor was called. It does nothing in the implementation of TObject and must be overridden by descendent classes to provide specific behaviour that is executed after the constructor has finished executing. (for instance, call an event handler) None. BeforeDestruction Create Method called before the destructor is called. BeforeDestruction is a method called before the destructor is called. It does nothing in the implementation of TObject and must be overridden by descendent classes to provide specific behaviour that is executed before the destructor has finished executing. (for instance, call an event handler) None. AfterConstruction Destroy Free Default handler for string messages. DefaultHandlerStr is called for string messages which have no handler associated with them in the string message handler table. The implementation of DefaultHandlerStr in TObject does nothing and mut be overridden by descendent classes to provide specific message handling behaviour. DispatchStr Dispatch DefaultHandler Exception handler procedural type Pointer to Exception handler procedural type Exception object TExceptObject is the exception description record which is found on the exception stack. Exception instance. Address where exception occurred Exception frame where exception occurred Next exception object on the stack. Reference count for this exception object Current exception handling procedure.

This constant points to the current exception handling procedure. This routine is called when an unhandled exception occurs, i.e. an exception that is not stopped by a except block.

If the handler is not set, the RTL will emit a run-time error 217 when an unhandler exception occurs.

It is set by the sysutils unit.

Procedure to raise an exception. List of currently raised exceptions. RaiseList returns a pointer to the list of currently raised exceptions (i.e. a pointer to the first exception block. Obtain a reference to the current exception object

AcquireExceptionObject returns the current exception object. It raises the reference count of the exception object, so it will not be freed. Calling this method is only valid within an except block.

The effect of this function is countered by re-raising an exception via raise;

To make sure that the exception object is released when it is no longer needed, must be called when the reference is no longer needed.

If there is no current exception, a run-time error 231 will occur.
Decrease the reference count of the current exception object.

ReleaseExceptionObject decreases the reference count of the current exception object. This should be called whenever a reference to the exception object was obtained via the call.

Calling this method is only valid within an except block.

If there is no current exception object, a run-time error 231 will occur.
TVarRec type: Integer TVarRec type: Boolean TVarRec type: Char TVarRec type: Extended TVarRec type: String TVarRec type: pointer TVarRec type: PChar TVarRec type: Object instance TVarRec type: Class type TVarRec type: Widechar TVarRec type: PWideChar TVarRec type: Ansistring TVarRec type: Currency TVarRec type: Variant TVarRec type: Interface TVarRec type: WideString TVarRec type: Int64 (signed 64-bit integer) TVarRec type: QWord (unsigned 64-bit integer) Pointer to type. Record describing an element in an array of const TVarRec is a record generated by the compiler for each element in a array of const call. The procedure that receives the constant array receives an array of TVarRec elements, with lower bound zero and high bound equal to the number of elements in the array minus one (as returned by High(Args)) Type with the correct size for index into a dynamic array. A variable of type tdynarrayindex will always have the correct size, suitable for serving as an index in a dynamic array. Pointer to type. Array of char. Type with the size of a small set Type with the size of a normal set Pointer to record Record describing the current memory manager TMemoryManager describes the memory manager. For more information about the memory manager, see the programmer's reference. Does the memory manager require a lock Function called when memory must be allocated on the heap. Function called when previously allocated memory can be freed again. Function called when previously allocated memory with a known size can be freed again. Same as getmem. Handler called when an allocated memory block should be resized Return the size of a memory block. Handler called when the heap status must be reported. Return the memory manager heap status. Record describing the mutex manager for the heap. When the heapmanager needs a lock, then the mutex manager is used to handle the lock. Initialize the mutex Finalize (i.e. dispose of) the mutex. Lock the mutex Unlock the mutex. Procedure to set the mutex manager. SetMemoryMutexManager sets the mutex manager used by the memory manager to MutexMgr. The current mutex manager is returned in MutexMgr None. Fixed size small blocks grow rate Grow rate for block less than 256 Kb. Grow rate for block larger than 256 Kb. Describe behaviour if getmem fails. ReturnNilIfGrowHeapFails describes what happens if there is no more memory available from the operating system. if set to True the memory manager will return Nil. If set to False then a run-time error will occur. System memory manager memory allocator. SysGetmem is the system memory manager implementation for System memory manager free routine. SysFreeem is the system memory manager implementation for System memory manager free routine. SysFreemSize is the system memory manager implementation for System memory manager: free size. SysFreemSize is the system memory manager implementation for System memory manager: Allocate memory SysFreemSize is the system memory manager implementation for System memory manager: attempt to resize memory. SysTryResizeMem is a help routine for the system memory manager implementation for , System memory manager: Reallocate memory SysReallocMem is a help routine for the system memory manager implementation for . Alias for Getmemory is an alias for . Alias for FreeMemory is an alias for . Return the size of a memory block. MemSize returns the size of a memory block on the heap. Passing an invalid pointer may lead to run-time errors (access violations). Alias for AllocMem is an alias for . Re-allocate memory on the heap

ReAllocMem resizes the memory pointed to by P so it has size Size. The value of P may change during this operation. The contents of the memory pointed to by P (if any) will be copied to the new location, but may be truncated if the newly allocated memory block is smaller in size. If a larger block is allocated, only the used memory is initialized, extra memory will not be zeroed out.

Note that P may be nil, in that case the behaviour of ReAllocMem is equivalent to Getmem.

Alias for ReAllocMemory is an alias for . Routine that can be called from assembler routines to get memory. AsmGetmem is a routine that can be called from assembler code to get memory. The assembler reader cannot decide which overloaded call should be used. AsmGetMem provides a unique name that can be called from assembler. Other than that it is completely equivalent to GetMem. Routine that can be called from assembler routines to release memory. AsmFreemem is a routine that can be called from assembler code to release previously alocated memory. The assembler reader cannot decide which overloaded call should be used. AsmFreeMem provides a unique name that can be called from assembler. Other than that it is completely equivalent to FreeMem. Type alias. This type should be considered opaque. It is used to describe file and other handles. Constant describing the current line ending character.

LineEnding is a constant which contains the current line-ending character. This character is system dependent, and is initialized by the system. It should not be set.

This constant is part of a set of constants that describe the OS characteristics. These constants should be used instead of hardcoding OS characteristics.

COnstant describing support for long filenames.

LFNSupport determines whether the current OS supports long file names, i.e. filenames that are not of the form 8.3 as on ancient DOS systems. If the value of this constant is True then long filenames are supported. If it is false, then not.

This constant is part of a set of constants that describe the OS characteristics. These constants should be used instead of hardcoding OS characteristics.

Character used to separate directory parts.

DirectorySeparator is the character used by the current operating system to separate directory parts in a pathname. This constant is system dependent, and should not be set.

This constant is part of a set of constants that describe the OS characteristics. These constants should be used instead of hardcoding OS characteristics.

Character used to separate directory parts.

On systems that support driveletters, the DriveSeparator constant denotes the character that separates the drive indicator from the directory part in a filename path.

This constant is part of a set of constants that describe the OS characteristics. These constants should be used instead of hardcoding OS characteristics.

Character used to separate paths in a search list

PathSeparator is the character used commonly on the current operating system to separate paths in a list of paths, such as the PATH environment variable.

This constant is part of a set of constants that describe the OS characteristics. These constants should be used instead of hardcoding OS characteristics.

OS treatment of filenames is case sensitive.

FileNameCaseSensitive is True if case is important when using filenames on the current OS. In this case, the OS will treat files with different cased names as different files. Note that this may depend on the filesystem: Unix operating systems that access a DOS or Windows partition will have this constant set to true, but when writing to the DOS partition, the casing is ignored.

This constant is part of a set of constants that describe the OS characteristics. These constants should be used instead of hardcoding OS characteristics.

Alias for

sLineBreak is an alias for and is supplied for Delphi compatibility.

This constant is part of a set of constants that describe the OS characteristics. These constants should be used instead of hardcoding OS characteristics.

Default line ending style.

DefaultTextLineBreakStyle contains the default OS setting for the type. It is initizliaed by the system unit, and is used to determine the default line ending when writing to text files.

This constant is part of a set of constants that describe the OS characteristics. These constants should be used instead of hardcoding OS characteristics.

Maximum exit code supported by the operating system. maxExitCode is the maximum value for the call. Value indicating an unused file handle (as reported by the OS). Value of the OS handle for the standard input file. Value of the OS handle for the standard output file. Value of the OS handle for the standard error-output file. Number of command-line arguments. argc contains the number of command-line arguments passed to the program by the OS. It is not available on all systems. Pointer to the array of command-line arguments argp contains a pointer to a nil-terminated array of null-terminated strings, containing the command-line arguments passed to the program by the OS. It is not available on all systems. Pointer to the array of environment variables envp contains a pointer to a nil-terminated array of null-terminated strings, containing the environment variables passed to the program by the OS. It is not available on all systems. Signed integer type which fits for sizes Unsigned Integer type which fits for sizes Signed integer type with same size as Pointer. PtrInt is an integer type which has always the same size as a pointer. When using integers which will be cast to pointers and vice versa, use this type, never the regular integer type. Unsigned integer type with same size as Pointer. PtrUInt is an unsigned integer type which has always the same size as a pointer. When using integers which will be cast to pointers and vice versa, use this type, never the regular Cardinal type. Val-Signed integer. Integer with teh same size as the return code of the function. Val-unsigned integer Integer with teh same size as the return code of the function. Pointer to Variant type. Pointer to OleVariant type. Pointer to . Pointer to link id="PWideChar"> type. UCS2 unicode character. Pointer to character. Pointer to text file. Alias for ErrOutput is provided for Delphi compatibility. FPC compiler internal procedure index: lo (word) FPC compiler internal procedure index: hi (word) FPC compiler internal procedure index: lo (long) FPC compiler internal procedure index: hi (long) FPC compiler internal procedure index: ord FPC compiler internal procedure index: length FPC compiler internal procedure index: chr FPC compiler internal procedure index: write FPC compiler internal procedure index: writeln FPC compiler internal procedure index: read FPC compiler internal procedure index: readln FPC compiler internal procedure index: concat FPC compiler internal procedure index: assigned FPC compiler internal procedure index: str FPC compiler internal procedure index: ofs FPC compiler internal procedure index: sizeof FPC compiler internal procedure index: typeof FPC compiler internal procedure index: val FPC compiler internal procedure index: reset FPC compiler internal procedure index: rewrite FPC compiler internal procedure index: low FPC compiler internal procedure index: high FPC compiler internal procedure index: seg FPC compiler internal procedure index: pred FPC compiler internal procedure index: succ FPC compiler internal procedure index: reset FPC compiler internal procedure index: rewrite FPC compiler internal procedure index: settextbuf FPC compiler internal procedure index: inc FPC compiler internal procedure index: dec FPC compiler internal procedure index: include FPC compiler internal procedure index: exclude FPC compiler internal procedure index: break FPC compiler internal procedure index: continue FPC compiler internal procedure index: assert FPC compiler internal procedure index: addr FPC compiler internal procedure index: typeinfo FPC compiler internal procedure index: setlength FPC compiler internal procedure index: finalize FPC compiler internal procedure index: new FPC compiler internal procedure index: dispose FPC compiler internal procedure index: exit FPC compiler internal procedure index: copy FPC compiler internal procedure index: initialize FPC compiler internal procedure index: leave FPC compiler internal procedure index: cycle FPC compiler internal procedure index: trunc FPC compiler internal procedure index: round FPC compiler internal procedure index: frac FPC compiler internal procedure index: abs FPC compiler internal procedure index: int FPC compiler internal procedure index: sqr FPC compiler internal procedure index: sqr FPC compiler internal procedure index: sqr FPC compiler internal procedure index: swap (word) FPC compiler internal procedure index: swap (long) FPC compiler internal procedure index: pi FPC compiler internal procedure index: sqrt FPC compiler internal procedure index: arctan FPC compiler internal procedure index: cos FPC compiler internal procedure index: exp FPC compiler internal procedure index: in FPC compiler internal procedure index: sin FPC compiler internal procedure index: lo (qword) FPC compiler internal procedure index: hi (qword) FPC compiler internal procedure index: cos (real) FPC compiler internal procedure index: pi FPC compiler internal procedure index: abs (real) FPC compiler internal procedure index: sqr (real) FPC compiler internal procedure index: sqrt (real) FPC compiler internal procedure index: arctan (real) FPC compiler internal procedure index: ln (real) FPC compiler internal procedure index: sin (real) FPC compiler internal procedure index: swap (qword) FPC compiler internal procedure index: prefetch FPC compiler internal procedure index: MMX FPC compiler internal procedure index: MMX FPC compiler internal procedure index: MMX FPC compiler internal procedure index: MMX FPC compiler internal procedure index: MMX FPC compiler internal procedure index: MMX Return aligned version of an address Align returns Address, aligned to Alignment bytes. None. Concert an array of string to an array of null-terminated strings

ArrayStringToPPchar creates an array of null-terminated strings that point to strings which are the same as the strings in the array S. The function returns a pointer to this array. The array and the strings it contains must be disposed of after being used, because it they are allocated on the heap.

The ReserveEntries parameter tells ArrayStringToPPchar to allocate room at the end of the array for another ReserveEntries entries.

If not enough memory is available, an error may occur.
Split string in list of null-terminated strings

StringToPPChar splits the string S in words, replacing any whitespace with zero characters. It returns a pointer to an array of pchars that point to the first letters of the words in S. This array is terminated by a Nil pointer.

The function does not add a zero character to the end of the string unless it ends on whitespace.

The function reserves memory on the heap to store the array of PChar; The caller is responsible for freeing this memory.

This function is only available on certain platforms.

None.
Variant type: Empty variant Variant type: variant Variant type: smallint (8 bit) Variant type: Integer (32-bit) Variant type: Single float Variant type: Double float Variant type: Currency Variant type: Date Variant type: OLE string (widestring) Variant type: dispatch interface Variant type: Error type Variant type: Boolean type Variant type: Variant (arrays only) Variant type: Unknown Variant type: Decimal (BCD) Variant type: Shortint (16 bit) Variant type: Byte (8 bit) Variant type: Word (16 bit) Variant type: Word (32 bit) Variant type: Integer (64-Bit) Variant type: Word (64-bit) Variant type: String Variant type: String Variant type: Any Variant type: Mask to extract type Variant type: variant Array Variant type: By reference Variant type: Word (64-bit) Type with size of variant type. Pointer to type. Pointer to type. Pointer to type. Pointer to type. Type describing variant array bounds. tvararraybound is used to describe one dimension in a variant array. Number of elements in this array dimension. Lower bound of this array dimension (index of first element). Type describing variant array tvararray is a record describing a variant array. It contains some general data, followed by a number of records equal to the number of dimensions in the array (dimcoun). Number of dimensions Array flags. Size of one element in the array. Lock (reference) count of the array. Pointer to the array data. Array describing the bounds in the array. array of records. Array of variant array coordinates Variant operation. tvarop describes a variant operation. It is mainly used for the variant manager to implement the various conversions and mathematical operations on a variant. Variant operation: Addition. Variant operation: Substraction Variant operation: multiplication Variant operation: division Variant operation: integer divide Variant operation: Modulus Variant operation: Shift left Variant operation: Shift right Variant operation: Binary AND operation Variant operation: Binary OR operation Variant operation: binary XOR operation. Variant operation: Compare Variant operation: negation. Variant operation: Binary NOT operation. Variant operation: Compare equal. Variant operation: Compare not equal Variant operation: Compare less than. Variant operation: Compare less than or equal to Variant operation: Compare larger than Variant operation: Compare larger than or equal Variant record. TVarData is a record representation of a variant. It contains the internal structure of a variant and is handled by the various variant handling routines. Type of variant. Pointer to record. Pointer to record. COM/OLE dispatch call argument description. tcalldesc is used to encode the arguments to a dispatch call to an OLE dual interface. It is used on windows only. It describes the arguments to a call. Call type. Number of arguments to call. Number of named arguments in the call. Types of arguments. COM/OLE dispatch call description. tcalldesc is used to encode a dispatch call to an OLE dispatch interface. It is used on windows only. It describes the dispath call call. Pointer to record Dispatch ID Result type. Arguments description. Record describing the variant manager. TVariantManager describes the variant manager as expected by the call. Called to convert a variant to an integer value Called to convert a variant to an int64 value Called to convert a variant to a word64 value Called to convert a variant to a boolean value Called to convert a variant to a value Called to convert a variant to a value Called to convert a variant to a value Called to convert a variant to a value Called to convert a variant to a value Called to convert a variant to a value Called to convert a variant to a value Called to convert a variant to a value Called to convert a value to a variant Called to convert a value to a variant Called to convert a value to a variant Called to convert a value to a variant Called to convert a value to a variant Called to convert a value to a variant Called to convert a value to a variant Called to convert a value to a variant Called to convert a value to a variant Called to convert a value to a variant Called to convert a value to a variant Called to convert a value to a variant Called to convert a value to a variant Called to convert a value to a variant Called to convert a value to a variant Called to perform a variant operation: Called to perform a variant operation: Called to perform a variant operation: Called to perform a variant operation: Called to perform a variant operation: Called to perform a variant operation: Called to perform a variant operation: Called to perform a variant operation: Called to perform a variant operation: Called to perform a variant operation: Called to perform a variant operation: Called to perform a variant operation: Called to perform a variant operation: Called to perform a variant operation: Called to perform a variant operation: Called to perform a variant operation: Pointer to record. Return the current variant manager. GetVariantManager returns the current variant manager in varmgr. Set the current variant manager. SetVariantManager sets the variant manager to varmgr. Determine if variant manager is currently set.

IsVariantManagerSet determines whether the variant manager was set to a correct variant manager. It returns True if it is, or False if it is not.

The routine checks all variant operation handlers, they should all be set correctly.

Callback to perform dispatch interface procedure call by name.

VarDispProc is called by the compiler if it needs to perform an interface call from a variant. For instance, the following call:

Var V : OleVariant; begin V.OpenDocument('c:\temp\mydoc.doc'); end;

is encoded by the compiler and passed to VarDispProc.

This pointer must be set by a routine that calls the OS COM handling routines.

Callback to perform dispatch interface procedure call by ID.

VarDispProc is called by the compiler if it needs to perform an interface call from a variant which contains a dispatch interface. For instance, the following call:

Var V : OleVariant; begin (V as IWord).OpenDocument('c:\temp\mydoc.doc'); end;

where IWord is a dispatch interface is encoded by the compiler and passed to DispCallByIDProc.

This pointer must be set by a routine that calls the OS COM handling routines.

Null variant Unassigned variant. Record describing current heap status. THeapStatus is the record describing the current heap status. It is returned by the call. Biggest heap size used. Biggest used part of heap memory. Current heap size. Current size of used heap memory. Current size of free heap memory. System implementation of SysGetHeapStatus is the system implementation of the call. Current heap size HeapSize returns the current heap size. The heap grows dynamically (as allowed by the OS) and the HeapSize reflects the current state of the heap.