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.

File handling functions

Functions concerning input and output from and to file.

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

| Name | Description
| 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 64-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
| Find byte-sized value in a memory range
| Find char-sized value in a memory range
| Find DWord-sized (32-bit) value in a memory range
| Find QWord-sized value in a memory range
| Find word-sized value in a memory range
| Is the memory manager set
| Return lowest index of open array or enumerated
| Move data from one location in memory to another
MoveChar0 | Move 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.

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

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

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

| Name | Description
| 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 (see the programmer's guide).
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 {$I} switch.
Depending on the state of the {$I} switch, a runtime error can be generated if there is an error. In the {$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 {$I} switch.

Depending on the state of the {$I} switch, a runtime error can be generated if there is an error. In the {$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 {$I} switch, a runtime error can be generated if there is an error. In the {$I-} state, use IOResult to check for errors.
Convert byte value to character value

Chr returns the character which has ASCII value X.

Historical note:

Originally, Pascal did not have typecasts and chr was a necessary function in order to do certain operations on ASCII values of characters. With the arrival of typecasting a generic approach became possible, making chr mostly obselete. However, chr is not considered deprecated and remains in wide use today.

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 {$I} switch, a runtime error can be generated if there is an error. In the {$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.
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, 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. Index is 1-based.

For dynamical arrays, Copy returns a new dynamical array of the same type as the original one, and copies Count elements from the old array, starting at position Index.

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

Note that calling this function may cause your program to wait: to determine whether you are at EOF, it is necessary to read data. If the file descriptor is not a real file (for instance for standard input or sockets) , then this call may seem to hang the program while it is waiting for data to appear or for the file descriptor to be closed.

Depending on the state of the {$I} switch, a runtime error can be generated if there is an error. In the {$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 {$I} switch, a runtime error can be generated if there is an error. In the {$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 {$I} switch, a runtime error can be generated if there is an error. In the {$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 {$I} switch, a runtime error can be generated if there is an error. In the {$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 {$I} switch, a runtime error can be generated if there is an error. In the {$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 the programmer's guide.

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.
4. If the argument is a set type then it returns the highest value of the underlying ordinal type.

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.

For dynamical arrays, the function returns the number of elements in the array.

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.
3. If the argument is an open array identifier in a function or procedure, then Low returns the lowest element of the array, which is always zero.
4. If the argument is a set type then it returns the lowest value of the underlying ordinal type.

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.
Create a new directory.

Mkdir creates a new directory S.

For an example, see .

Depending on the state of the {$I} switch, a runtime error can be generated if there is an error. In the {$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 buf1 to buf2, 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.

Historical note:

Originally, Pascal did not have typecasts and ord was a necessary function in order to do certain operations on non-integer ordinal types. With the arrival of typecasting a generic approach became possible, making ord mostly obselete. However ord is not considered deprecated and remains in wide use today.

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) defines versions of Paramstr which return the full-length command-line arguments, using ansistrings.

In the interest of portability, the ParamStr function tries to behave the same on all operating systems: like the original ParamStr function in Turbo Pascal. This means even on Unix, paramstr(0) returns the full path to the program executable. A notable exception is Mac OS X, where the return value depends on how the application was started. It may be that just the name of the application is returned (in case of a command-line launch)

In general, it's a bad idea to rely on the location of the binary. Often, this goes against best OS practices. Configuration data should (or can) not be stored next to the binary, but on designated locations. What locations these are, is very much operating system dependent. Therefore, ParamStr(0) should be used with care.

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 ({$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. 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.

In earlier versions of FPC, it was also allowed to read Pchar null-terminated strings, but this has been removed, since there is no buffer checking possible.

If no data is available, a run-time error is generated. This behavior can be controlled with the {$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 {$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.
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 {$I} switch, a runtime error can be generated if there is an error. In the {$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 {$I} switch, a runtime error can be generated if there is an error. In the {$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 {$I} switch, a runtime error can be generated if there is an error. In the {$I-} state, use IOResult to check for errors.
Remove directory when empty.
Rmdir
removes the directory S.
Depending on the state of the {$I} switch, a runtime error can be generated if there is an error. In the {$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.

In the case of .5, the algorithm uses "banker's rounding": .5 values are always rounded towards the even number.

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 {$I} switch, a runtime error can be generated if there is an error. In the {$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.

The SeekEOF function can only be used on real textfiles: when assigning the file to other kinds of (virtual) text files, the function may fail, although it will perform a number of tests to guard against wrong usage.
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 uses a flat 32/64 bit memory model. In such a memory model segments have no meaning.

None.
Set a memory manager

SetMemoryManager sets the current memory manager record to MemMgr.

For an example, see the programmer's guide.

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.

In the case of a dynamical array A, setlength sets the number of elements. The elements are numbered from index 0, so the count runs from 0 to Len-1. If Zero is specified, the array is cleared.

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 I/O 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 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 actual declaration of Str is not according to pascal syntax, and should be

procedure Str(var X: TNumericType[:NumPlaces[:Decimals]];var S: String)

Where the optional NumPlaces and Decimals specifiers control the formatting of the string: NumPlaces gives the total width of the string, and Decimals the number of decimals after the decimal separator char.

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 ({$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 {$I} switch, a runtime error can be generated if there is an error. In the {$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/enumerated value of a string.

Val converts the value represented in the string S to a numerical value or an enumerated valye, and stores this value in the variable V, which can be of type Longint, Real and Byte or any enumerated type. 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. For enumerated values, the string must be the name of the enumerated value. The name is searched case insensitively.

The conversion to enumerated exists only as of version 2.3.1 (or later) of the compiler.

If the conversion doesn't succeed, the value of Code indicates the position where the conversion went wrong. The value of V is then undefined.
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 {$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 {$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 32-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.
Generate run-time error
Error
generates a run-time error with an exit code corresponding to RunTimeError. This function is implemented for Delphi compatibility, and is not used by the Free Pascal Run-Time Library.
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)
Character(s) separating lines in text (files).

`tlbsLF: #10 tlbsCRLF: #13#10 tlbsCR: #13`

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.

Cmdline returns a pointer to the current command line. The ASCIIZ string cmdline points to contains the command line arguments, separated by spaces. Basically, this is the DOS convention. Cmdline can safey be used under Unix. Command line arguments containing spaces will be surrounded by double quotes, as is done in the Dos/Windows tradition. Because of this, the use of cmdline might be undesired under Unix.

Cmdline can be implemented either by a variable, typed constant, function or property. Because of this, you should not to write to it, or make a pointer point to it.

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, -1 is returned.
On error, -1 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, but additionally clear the allocated memory (filled with 0 bytes).
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).
Allocate and clear memory.
AllocMem
calls getmem , and clears the allocated memory, i.e. the allocated memory is filled with Size zero bytes.
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
argv
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 a signed integer type which has always the same size as a pointer. Ptrint is considered harmfull and should almost never be used in actual code, because pointers are normally unsigned. For example, consider the following code:

getmem(p,2048); {Assume the address of p becomes $7ffffff0.} q:=pointer(ptrint(p)+1024)); {Overflow error.} writeln(q>p); {Incorrect answer.}

Ptrint might have a valid use when two pointers are substracted from each other if it is unknown which pointer has the largest address. However, even in this case ptrint causes trouble in case the distance is larger than high(ptrint) and must be used with great care.

The introduction of the ptrint type was a mistake. Please use instead.

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 the same size as the return code of the function.
Val-unsigned integer
Integer with the 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
FPC internal compiler routine: abs_real
FPC internal compiler routine: AbstractErrorIntern
FPC internal compiler routine: Addref
FPC internal compiler routine: ansistr_append_ansistring
FPC internal compiler routine: ansistr_append_char
FPC internal compiler routine: ansistr_append_shortstring
FPC internal compiler routine: AnsiStr_Assign
FPC internal compiler routine: AnsiStr_CheckRange
FPC internal compiler routine: AnsiStr_CheckZero
FPC internal compiler routine: AnsiStr_Compare
FPC internal compiler routine: AnsiStr_Concat
FPC internal compiler routine: AnsiStr_Concat_multi
FPC internal compiler routine: ansistr_Copy
FPC internal compiler routine: ansistr_decr_ref
FPC internal compiler routine: AnsiStr_Float
FPC internal compiler routine: ansistr_incr_ref
FPC internal compiler routine: ansistr_int64
FPC internal compiler routine: ansistr_qword
FPC internal compiler routine: AnsiStr_SetLength
FPC internal compiler routine: AnsiStr_sint
FPC internal compiler routine: ansistr_to_chararray
FPC internal compiler routine: AnsiStr_To_ShortStr
FPC internal compiler routine: ansistr_to_widechararray
FPC internal compiler routine: AnsiStr_To_WideStr
FPC internal compiler routine: AnsiStr_uint
FPC internal compiler routine: ansistr_Unique
FPC internal compiler routine: arctan_real
FPC internal compiler routine: assert
FPC internal compiler routine: Catches
FPC internal compiler routine: chararray_Float
FPC internal compiler routine: chararray_int64
FPC internal compiler routine: chararray_qword
FPC internal compiler routine: chararray_sint
FPC internal compiler routine: CharArray_To_AnsiStr
FPC internal compiler routine: chararray_to_shortstr
FPC internal compiler routine: CharArray_To_WideStr
FPC internal compiler routine: chararray_uint
FPC internal compiler routine: char_copy
FPC internal compiler routine: Char_To_AnsiStr
FPC internal compiler routine: Char_To_WideStr
FPC internal compiler routine: class_as_intf
FPC internal compiler routine: cos_real
FPC internal compiler routine: DecRef
FPC internal compiler routine: divbyzero
FPC internal compiler routine: div_int64
FPC internal compiler routine: div_qword
FPC internal compiler routine: do_as
FPC internal compiler routine: do_is
FPC internal compiler routine: dynarray_clear
FPC internal compiler routine: dynarray_copy
FPC internal compiler routine: dynarray_decr_ref
FPC internal compiler routine: dynarray_high
FPC internal compiler routine: dynarray_incr_ref
FPC internal compiler routine: dynarray_length
FPC internal compiler routine: dynarray_setlength
FPC internal compiler routine: dynarray_to_variant
FPC internal compiler routine: exp_real
FPC internal compiler routine: finalize
FPC internal compiler routine: finalize_array
FPC internal compiler routine: frac_real
FPC internal compiler routine: freemem
FPC internal compiler routine: get_input
FPC internal compiler routine: getmem
FPC internal compiler routine: get_output
FPC internal compiler routine: help_constructor
FPC internal compiler routine: help_destructor
FPC internal compiler routine: help_fail
FPC internal compiler routine: in_exp_real
FPC internal compiler routine: in_fillchar_x
FPC internal compiler routine: in_frac_real
FPC internal compiler routine: in_get_caller_addr
FPC internal compiler routine: in_get_caller_frame
FPC internal compiler routine: in_get_frame
FPC internal compiler routine: in_int_real
FPC internal compiler routine: Initialize
FPC internal compiler routine: InitializeUnits
FPC internal compiler routine: in_move_x
FPC internal compiler routine: in_pi_real
FPC internal compiler routine: in_round_real
FPC internal compiler routine: in_slice
FPC internal compiler routine: interface_to_variant
FPC internal compiler routine: intf_as
FPC internal compiler routine: intf_assign
FPC internal compiler routine: intf_decr_ref
FPC internal compiler routine: intf_incr_ref
FPC internal compiler routine: int_real
FPC internal compiler routine: in_trunc_real
FPC internal compiler routine: iocheck
FPC internal compiler routine: ln_real
FPC internal compiler routine: mod_int64
FPC internal compiler routine: mod_qword
FPC internal compiler routine: mul_int64
FPC internal compiler routine: mul_qword
FPC internal compiler routine: overflow
FPC internal compiler routine: pchar_length
FPC internal compiler routine: PChar_To_AnsiStr
FPC internal compiler routine: pchar_to_shortstr
FPC internal compiler routine: PChar_To_WideStr
FPC internal compiler routine: pi_real
FPC internal compiler routine: PopAddrStack
FPC internal compiler routine: PopObjectStack
FPC internal compiler routine: PopSecondObjectStack
FPC internal compiler routine: PushExceptAddr
FPC internal compiler routine: PushExceptObj
FPC internal compiler routine: pwidechar_length
FPC internal compiler routine: PWideChar_To_AnsiStr
FPC internal compiler routine: PWideChar_To_ShortStr
FPC internal compiler routine: PWideChar_To_WideStr
FPC internal compiler routine: Raiseexception
FPC internal compiler routine: rangeerror
FPC internal compiler routine: Read_End
FPC internal compiler routine: ReadLn_End
FPC internal compiler routine: Read_Text_AnsiStr
FPC internal compiler routine: Read_Text_Char
FPC internal compiler routine: Read_Text_Float
FPC internal compiler routine: Read_Text_Int64
FPC internal compiler routine: Read_Text_PChar_As_Array
FPC internal compiler routine: Read_Text_PChar_As_Pointer
FPC internal compiler routine: Read_Text_QWord
FPC internal compiler routine: Read_Text_ShortStr
FPC internal compiler routine: Read_Text_SInt
FPC internal compiler routine: Read_Text_UInt
FPC internal compiler routine: ReRaise
FPC internal compiler routine: reset_typed
FPC internal compiler routine: rewrite_typed
FPC internal compiler routine: round_real
FPC internal compiler routine: set_add_sets
FPC internal compiler routine: set_comp_sets
FPC internal compiler routine: set_contains_sets
FPC internal compiler routine: set_create_element
FPC internal compiler routine: set_in_byte
FPC internal compiler routine: set_load_small
FPC internal compiler routine: set_mul_sets
FPC internal compiler routine: set_set_byte
FPC internal compiler routine: set_set_range
FPC internal compiler routine: set_sub_sets
FPC internal compiler routine: set_symdif_sets
FPC internal compiler routine: set_unset_byte
FPC internal compiler routine: shortstr_append_shortstr
FPC internal compiler routine: shortstr_compare
FPC internal compiler routine: shortstr_concat
FPC internal compiler routine: shortstr_Copy
FPC internal compiler routine: ShortStr_Float
FPC internal compiler routine: shortstr_int64
FPC internal compiler routine: shortstr_qword
FPC internal compiler routine: Shortstr_SetLength
FPC internal compiler routine: ShortStr_sint
FPC internal compiler routine: ShortStr_To_AnsiStr
FPC internal compiler routine: shortstr_to_chararray
FPC internal compiler routine: shortstr_to_shortstr
FPC internal compiler routine: shortstr_to_widechararray
FPC internal compiler routine: ShortStr_To_WideStr
FPC internal compiler routine: shortstr_uint
FPC internal compiler routine: sin_real
FPC internal compiler routine: sqr_real
FPC internal compiler routine: sqrt_real
FPC internal compiler routine: trunc_real
FPC internal compiler routine: typed_read
FPC internal compiler routine: typed_write
FPC internal compiler routine: Val_int64_AnsiStr
FPC internal compiler routine: val_int64_shortstr
FPC internal compiler routine: Val_int64_WideStr
FPC internal compiler routine: Val_qword_AnsiStr
FPC internal compiler routine: val_qword_shortstr
FPC internal compiler routine: Val_qword_WideStr
FPC internal compiler routine: Val_Real_AnsiStr
FPC internal compiler routine: Val_Real_ShortStr
FPC internal compiler routine: Val_Real_WideStr
FPC internal compiler routine: Val_SInt_AnsiStr
FPC internal compiler routine: Val_SInt_ShortStr
FPC internal compiler routine: Val_SInt_WideStr
FPC internal compiler routine: Val_UInt_AnsiStr
FPC internal compiler routine: Val_UInt_Shortstr
FPC internal compiler routine: Val_UInt_WideStr
FPC internal compiler routine: vararray_get
FPC internal compiler routine: vararray_put
FPC internal compiler routine: variant_copy
FPC internal compiler routine: variant_to_dynarray
FPC internal compiler routine: variant_to_interface
FPC internal compiler routine: WideCharArray_To_AnsiStr
FPC internal compiler routine: WideCharArray_To_ShortStr
FPC internal compiler routine: WideCharArray_To_WideStr
FPC internal compiler routine: WideStr_Assign
FPC internal compiler routine: WideStr_CheckRange
FPC internal compiler routine: WideStr_CheckZero
FPC internal compiler routine: WideStr_Compare
FPC internal compiler routine: WideStr_Concat
FPC internal compiler routine: WideStr_Concat_multi
FPC internal compiler routine: widestr_Copy
FPC internal compiler routine: WideStr_Decr_Ref
FPC internal compiler routine: WideStr_Float
FPC internal compiler routine: WideStr_Incr_Ref
FPC internal compiler routine: widestr_int64
FPC internal compiler routine: widestr_qword
FPC internal compiler routine: WideStr_SetLength
FPC internal compiler routine: WideStr_sint
FPC internal compiler routine: WideStr_To_AnsiStr
FPC internal compiler routine: widestr_to_chararray
FPC internal compiler routine: WideStr_To_ShortStr
FPC internal compiler routine: widestr_to_widechararray
FPC internal compiler routine: WideStr_uint
FPC internal compiler routine: widestr_Unique
FPC internal compiler routine: Write_End
FPC internal compiler routine: Writeln_End
FPC internal compiler routine: Write_Text_AnsiStr
FPC internal compiler routine: Write_Text_Boolean
FPC internal compiler routine: Write_Text_Char
FPC internal compiler routine: Write_Text_Float
FPC internal compiler routine: write_text_int64
FPC internal compiler routine: Write_Text_Pchar_as_Array
FPC internal compiler routine: Write_Text_PChar_As_Pointer
FPC internal compiler routine: write_text_qword
FPC internal compiler routine: Write_Text_ShortStr
FPC internal compiler routine: Write_Text_SInt
FPC internal compiler routine: Write_Text_UInt
FPC internal compiler routine: write_text_variant
FPC internal compiler routine: Write_Text_WideChar
FPC internal compiler routine: Write_Text_WideStr
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.
Type for Thread-IDs
This is an opaque type, it can differ from operating system to operating system.
Pointer to type.
A critical section.
TRTLCriticalSection
represents a critical section (a mutex). This is an opaque type, it can differ from operating system to operating system. No assumptions should be made about it's structure or contents.
Initialization routine

InitProc is a routine that can be called after all units were initialized. It can be set by units to execute code that can be initialized after all units were initialized.

When setting the value of InitProc, the previous value should always be saved, and called when the installed initialization routine has finished executing.
Get the current process ID
GetProcessID
returns the current process ID. The meaning of the return value of this call is system dependent.
None.
Get the current Thread ID.
GetThreadID
returns the current process ID. The meaning of the return value of this call is system dependent.
Interface call result: OK
Interface call result: Not OK
Interface call result: Error: not an interface
Interface call result: Unexpected error
Interface call result: Interface not implemented
Record describing a method.
TMethod
describes a general method pointer, and is used in Run-Time Type Information handling.
Pointer to method code.
Pointer to object instance.
Number of frames in the exception object
Pointer to array of frame pointers
Maximum number of frames to include in TExceptObject
Variant operation: Power
Callback to convert a variant to a TDatetime value.
Callback to convert a TDateTime value to a variant.
Callback to convert a variant to a currency value.
Callback to clear a variant.
Callback to increase reference count of a variant.
Callback to copy a variant
Callback to convert a variant to a ansistring.
Callback to convert a variant to a widestring.
Redimension a variant array
VarArrayRedim
re-sizes the first dimension of the variant array A, giving it a new high bound HighBound. Obviously, A must be a variant array for this function to work.
Internal type used by widestring routines. Do not use
Default size for a new thread's stack (32k by default).
Pointer to EventState, which is an opaque type.
Pointer to RTLEvent, which is an opaque type.
Thread function prototype
Callback type for synchronization event.
Callback for thread start in TThreadManager.
Callback for thread end in TThreadManager.
Generic thread handler callback for TThreadManager.
Callback type for thread switch in TThreadManager.
Callback type for thread termination in TThreadManager.
Callback type for thread priority setting in TThreadManager.
Callback type for thread priority getting in TThreadManager.
Callback type for retrieving thread ID in TThreadManager.
Generic callback type for critical section handling in TThreadManager.
Threadvar initialization callback type for TThreadManager.
Threadvar relocalization callback type for TThreadManager.
Threadvar allocation callback type for TThreadManager.
Threadvar release callback type for TThreadManager.
Generic callback type for handling eventstate in TThreadManager.
Wait for basic event callback type for TThreadManager.
callback type for creating eventstate in TThreadManager.
Generic TRTLEvent handling type for TThreadManager.
TRTLEvent timeout handling type for TThreadManager.
Callback type for creating a TRTLEvent type in TThreadManager.
Callback type for event sycnhronization in TThreadManager.
Thread manager record.

TThreadManager is a record that contains all callbacks needed for the thread handling routines of the Free Pascal Run-Time Library. The thread manager can be set by the procedure, and the current thread manager can be retrieved with the procedure.

The Windows RTL will set the thread manager automatically to a system thread manager, based on the Windows threading routines. Unix operating systems provide a unit cthreads which implements threads based on the C library POSIX thread routines. It is not included by default, because it would make the system unit dependent on the C library.

For more information about thread programming, see the programmer's guide.

Initialize the thread manager.
Clean up the thread manager.
Start a new thread.
End the current thread.
Suspend a running thread.
Resumt a suspended thread.
Kill a running thread.
Cause a threadswitch.
Wait for a thread to stop.
Set thread priority
Get thread priority.
Get current thread ID
Initialize a critical section.
Free a critical section
Enter a critical section
leave a critical section.
Initialize a thread variable.
Relocate a thread variable.
Allocate thread variables.
Release thread variables.
Create a basic event.
Destroy a basic event.
Reset a basic event.
Set a basic event
Wait for a basic event
Create an RTL event
Free an RTL event
Set an RTL event
Reset an RTL event
Wait for an RTL event.
Wait for an RTL event.
Synchronize an RTL event.
Wait for RTL event, with timeout.
Return the current thread manager

GetThreadManager returns the currently used thread manager in TM.

For more information about thread programming, see the programmer's guide.

Set the thread manager, optionally return the current thread manager.

SetThreadManager sets the thread manager to NewTM. If OldTM is given, SetThreadManager uses it to return the previously used thread manager.

The function returns True if the threadmanager was set succesfully, False if an error occurred.

For more information about thread programming, see the programmer's guide.

If an error occurred cleaning up the previous manager, or an error occurred initializing the new manager, False is returned.
Clear the threadmanager
SetNoThreadManager
clears the thread manager by setting the thread manager to an empty thread manager record.
Initialize a thread
Do not use, this is used internally by the thread manager.
Start a new thread.

BeginThread starts a new thread and executes ThreadFunction in the new thread. If P is specified, then it is passed to ThreadFunction. If ThreadId is specified, it is filled with the thread ID of the newly started thread. If StackSize is specified, it is set as the stack size for the new thread. If none is specified, a default stack size of 32Kb is used.

The function returns the thread ID on succes, or 0 if an error occurred.

On error, a nonzero value is returned.
End the current thread.

EndThread ends the current thread. If ExitCode is supplied, it is returned as the exit code for the thread to a function waiting for the thread to terminate (). If it is omitted, zero is used.

This function does not return.

Suspend a running thread.

SuspendThread suspends a running thread. The thread is identified with it's handle or ID threadHandle.

The function returns zero if succesful. A nonzero return value indicates failure.

If a failure occurred, a nonzero result is returned. The meaning is system dependent.
Resume a suspended thread.

ResumeThread causes a suspended thread (using ) to resume it's execution. The thread is identified with it's handle or ID threadHandle.

The function returns zero if succesful. A nonzero return value indicates failure.

If a failure occurred, a nonzero result is returned. The meaning is system dependent.
Signal possibility of thread switch

ThreadSwitch signals the operating system that the thread should be suspended and that another thread should be executed.

This call is a hint only, and may be ignored.

Kill a running thread

KillThread causes a running thread to be aborted. The thread is identified by it's handle or ID threadHandle.

The function returns zero if succesful. A nonzero return value indicates failure.

If a failure occurred, a nonzero result is returned. The meaning is system dependent.
Wait for a thread to terminate.

WaitForThreadTerminate waits for a thread to finish its execution. The thread is identified by it's handle or ID threadHandle. If the thread does not exit within TimeoutMs milliseconds, the function will return with an error value.

The function returns the exit code of the thread.

Set the priority of a thread.
ThreadSetPriority
sets the priority of thread TThreadID to Prio. Priority is a value between -15 and 15.
None.
Return the priority of a thread.
ThreadGetPriority
returns the priority of thread TThreadID to Prio. The returned priority is a value between -15 and 15.
None.
Return the id of the currently running thread.
GetCurrentThreadId
returns the ID of the currently running thread. It can be used in calls such as or
None.
Initialize a critical section

InitCriticalSection initializes a critical section CS for use. Before using a critical section with or the critical section should be initialized with InitCriticalSection.

When a critical section is no longer used, it should be disposed of with

Clean up a critical section.
DoneCriticalsection
cleans up the critical section CS. After a call to DoneCriticalsection, the critical section can no longer be used with or , unless it is again initialized with
Enter a critical section

EnterCriticalSection will suspend the current thread if another thread has currently entered the critical section. When the other thread has left the critical section (through ), the current thread resumes execution. The result is that only 1 thread is executing code which is protected by a EnterCriticalsection and LeaveCriticalSection pair.

The critical section must have been initialized with prior to a call to EnterCriticalsection.

A call to EnterCriticalsection must always be matched by a call to . To avoid problems, it is best to include the code to be execute in a try...finally block, as follows:

EnterCriticalSection(Section); Try // Code to be protected goes here. Finally LeaveCriticalSection(Section); end;

For performance reasons it is best to limit the code between the entering and leaving of a critical section as short as possible.

Leave a critical section

LeaveCriticalSection signals that the current thread is exiting the critical section CS it has entered with .

The critical section must have been initialized with prior to a call to EnterCriticalsection and LeaveCriticalSection.

Obsolete. Don't use
BasicEventCreate
is obsolete, use instead.
Obsolete. Don't use
basiceventdestroy
is obsolete. Use instead.
Obsolete. Don't use
basiceventResetEvent
is obsolete. Use instead.
Obsolete. Don't use
basiceventSetEvent
is obsolete. Use instead.
Obsolete. Don't use
basiceventwaitfor
is obsolete. Use instead.
Create a new RTL event

RTLEventCreate creates and initializes a new RTL event. RTL events are used to notify other threads that a certain condition is met, and to notify other threads of condition changes (conditional variables).

The function returns an initialized RTL event, which must be disposed of with

RTLEvent is used mainly for the synchronize method.

Destroy a RTL Event
RTLeventdestroy
destroys the RTL event State. After a call to RTLeventdestroy, the State RTL event may no longer be used.
Notify threads of the event.
RTLeventSetEvent
notifies other threads which are listening, that the event has occurred.
Reset an event
RTLeventResetEvent
resets the event: this should be used to undo the signaled state of an event. Resetting an event that is not set (or was already reset) has no effect.
Prepare the event for waiting.

RTLeventResetEvent signals that a thread is ready to start waiting on an event state. No event can be posted until a thread explicitly starts waiting on the event using .

Wait for an event.

RTLeventWaitFor suspends the thread till the event occurs. The event will occur when another thread calls on State.

By default, the thread will be suspended indefinitely. However, if TimeOut is specified, then the thread will resume after timeout milliseconds have elapsed.

Obsolete. Don't use
RTLeventsync
is obsolete, don't use it.
Internal constant for the threading system. Don't use.
Determine whether CTRL-Z marks the end of file.

CtrlZMarksEOF indicates whether on this system, an CTRL-Z character (ordinal 26) in a file marks the end of the file. This is False on most systems except on DOS.

To get DOS-compatible behaviour, this constant can be set to True

Convert ansi string to UTF-8 string

AnsiToUtf8 converts the ansistring S to a UTF-8 format, that is, it converts the string from whatever codepage is currently in use, to UTF-8.

The current codepage is fetched from the system, if internationalization support is enabled. It can be UTF-8, in which case the function simply returns S.

None.
Standard implementation of Ansi to Widestring conversion routine
DefaultAnsi2WideMove
simply copies each character of the null-terminated ansi-string Source to the corresponding WideChar in Dest. At most Len characters will be copied.
None.
Standard implementation of Widestring to Ansi conversion routine
DefaultWide2AnsiMove
simply copies each character from Source having an ordinal value of less than 255 to the corresponding character in Dest. Characters having an ordinal valuelarger than 255 will be replaced by question marks. At most Len characters will be copied.
None.
Set the length of a dynamic array

DynArraySetLength sets the length of the dynamical array a to the first dimCnt lengths specified in the array lengthVec. The dynamical array type is described in typeInfo which points to a record of type

It should never be necessary to call this function directly, the standard function should be used instead.

If an invalid pointer is specified, an error may occur.
Return FPC heap manager status information
Windows compatibility type for use in resources
This is an opaque type.
Windows compatibility type for use in resources
This is an opaque type.
Windows compatibility type for use in resources
This is an opaque type.
Dispatch interface
IDispatch
is the pascal definition of the Windows Dispatch interface definition.
Return IDs of named procedures
Return the ID of a procedure.
Return type information about properties
Return number of properties.
Invoke a dispatch method
Basic interface for all COM based interfaces
IInterface
is the basic interface from which all COM style interfaces descend.
Interface with RTTI associated with it.
IInvokable
is a descendent of , compiled in the {$M+} state, so Run-Time Type Information (RTTI) is generated for it.
Initialize threadvars
This routine should be called when threading is started. It is called by the compiler and should never be called manually, only from a thread manager.
None.
Basic interface for all COM-based interfaces
IUnknown
is defined by windows. It's the basic interface which all COM objects must implement. The definition does not contain any code.
Increase reference count of the interface
Return pointer to VMT table of interface
Decrease reference count of the interface
Locate a resource and return a handle to it.
FindResource
searches for a resource with name ResourceName and of type ResourceType in the executable or library identified by ModuleHandle. It returns a TResourceHandle which can be used to load the resource with .
None. In case the resource was not found, 0 is returned.
Free a loaded resource
FreeResource
unloads the resource identified by ResData from memory. The resource must have been loaded by . It returns True if the operation was succesful, False otherwise.
On error, False is returned.
Load a resource for use

LoadResource loads a resource identified by ResHandle from a module identified by ModuleHandleinto memory. It returns a handle to the resource.

Loaded resources must be unloaded again using the function.

On error, 0 is returned.
Lock a resource

LockResource locks a resource previously loaded by LoadResource into memory. This means that any attempt to modify the resource will fail while it is locked. The function returns a pointer to the resource location in memory.

The resource can be freed again using the function.

if the function fails, Nil is returned.
Return the size of a particular resource
SizeOfResource
returns the size of the resource identified by ResHandle in module identified by ModuleHandle. ResHandle should be obtained from a call to
In case of an error, 0 is returned.
Unlock a previously locked resource
UnlockResource
unlocks a previously locked resource. Note that this function does not exist on windows, it's only needed on other platforms.
The function returns False if it failed.
Alias for the PChar type.
Maximum number of OS chunks to be kept in memory
MaxKeptOSChunks
tells the heap manager how many free chunks of OS-allocated memory it should keep in memory. When freeing memory, it can happen that a memory block obtained from the OS is completely free. If more than MaxKeptOSChunks such blocks are free, then the heap manager will return them to the OS, to reduce memory requirements.
Constant defining the maximum length of filenames (including path)
This constant is system dependent.
Convert Big Endian-ordered integer to Native-ordered integer
BEToN
will rearrange the bytes in a Big-Endian number to the native order for the current processor. That is, for a big-endian processor, it will do nothing, and for a little-endian processor, it will invert the order of the bytes.
Convert Little Endian-ordered integer to Native-ordered integer
LEToN
will rearrange the bytes in a Little-Endian number to the native order for the current processor. That is, for a little-endian processor, it will do nothing, and for a big-endian processor, it will invert the order of the bytes.
Convert Native-ordered integer to a Big Endian-ordered integer
NToBE
will rearrange the bytes in a natively-ordered number to the Big-Endian order. That is, for a Little-Endian processor, it will invert the order of the bytes and for a big-endian processor, it will do nothing.
Convert Native-ordered integer to a Little Endian-ordered integer
NToLE
will rearrange the bytes in a natively-ordered number to the little-Endian order. That is, for a Big-Endian processor, it will invert the order of the bytes and for a Little-Endian processor, it will do nothing.
Pointer to IDispatch interface type
Pointer to TDynArrayTypeInfo type.
Pointer to PDispatch pointer type
Pointer to untyped pointer
Untyped pointer
Pointer to widestring type
Constant identifying an accelerator resouce
Constant identifying a bitmap resource
Constant identifying a cursor resource
Constant identifying a dialog resource
Constant identifying a font resource
Constant identifying a font directory resource
Constant identifying a group cursor resource
Constant identifying a group icon resource
Constant identifying an icon resource
Constant identifying a menu resource
Constant identifying a message data resource
Constant identifying a binary data resource
Constant identifying a string table resource
Constant identifying a version info resource
Mapping between runtime-error constants and program exit codes
This array is used by the routine to to convert a enumeration type to a process exit code.
Error handler for safecall errors
SafeCallErrorProc
is a Handler called in case of a safecall calling convention error. Error is the error number (passed by the Windows operating system) and Addr is the address where the error occurred.
Return a copy of the currently active widestring manager.

GetWideStringManager returns a copy of the currently active heap manager in Old

WideStrings are implemented in different ways on different platforms. Therefore, the Free Pascal Runtime library has no fixed implementation of widestring routines. Instead, it defines a WideString manager record, with callbacks that can be set to an implementation which is most efficient on the current platform. On windows, standard Windows routines will be used. On Unix and Linux, an implementation based on the C library is available (in unit cwstring).

It is possible to implement a custom widestring manager, optimized for the current application, without having to recompile the complete Run-Time Library.

Set the widestring manager

SetWideStringManager sets the current widestring manager to New. Optionally, it returns the currently active widestring manager in Old.

WideStrings are implemented in different ways on different platforms. Therefore, the Free Pascal Runtime library has no fixed implementation of widestring routines. Instead, it defines a WideString manager record, with callbacks that can be set to an implementation which is most efficient on the current platform. On windows, standard Windows routines will be used. On Unix and Linux, an implementation based on the C library is available (in unit cwstring).

It is possible to implement a custom widestring manager, optimized for the current application, without having to recompile the complete Run-Time Library.

Record containing the various callbacks of the widestring manager.
TWideStringManager
contains the definition of the widestring manager.
Convert an AnsiString to a WideString
Convert a WideString to an AnsiString
Convert a widestring to all-uppercase
Convert a widestring to all-lowercase
Compare 2 widestrings, case-sensitive
Compare 2 widestrings, case-insensitive
Return the length, in characters, of a widestring
Convert an ansistring to all-uppercase
Convert an ansistring to all-lowercase
Compare 2 ansistrings, case-sensitive
Compare 2 ansistrings, case-insensitive
Compare 2 null-terminated ansistrings, case-sensitive
Compare 2 null-terminated ansistrings, case-insensitive
Compare 2 null-terminated ansistrings, case-sensitive, for a maximum length
Compare 2 null-terminated ansistrings, case-insensitive, for a maximum length
Convert an ansistring to all-lowercase
Convert an ansistring to all-uppercase
Top location of the stack.
StackTop
contains the top of the stack for the current process. It is used to check the heap on some operating systems, and is set by the system unit initialization code. Do not use or modify this value.
Convert a string to an array of widechars.
StringToWideChar
converts an ansistring Src to a null-terminated array of WideChars. The destination for this array is pointed to by Dest, and contains room for at least DestSize widechars.
No validity checking is performed on Dest.
Return the status of the FPC heapmanager
SysGetFPCHeapStatus
returns the status of the default FPC heapmanager. It is set as the default value of the corresponding function.
None. The result of this function is bogus information if the current heapmanager is not the standard FPC heapmanager.
Type information for a dynamic array.
tdynarraytypeinfo
describes the structure of a multi-dimensional dynamical array. It is used in the call.
Kind of array.
Length of the Name of the array type. Name follows as Namelen characters.
Size of a single element in the array
Pointer to next dimension structure in case of a multidimensional array
Type (variant type) of element in the array
Error type, used in variants.
Record describing the state of the default FPC heap manager.
TFPCHeapStatus
describes the state of the FPC heap manager. This is not equivalent to the record defined by Delphi, which contains information not meaningful for the FPC heap manager. The heap status can be retrieved by the call.
Maximum allowed size for the heap, in bytes
Maximum used size for the heap, in bytes
Current heap size, in bytes
Currently used heap size, in bytes
Currently free memory on heap, in bytes
TObject descendent implementing the IInterface interface
TInterfacedClass
is a descendent of
TObject descendent implementing the IUnknown interface
TInterfacedObject
is a descendent of which implements the interface. It can be used as a base class for all classes which need reference counting.
Handle reference count properly.
AfterConstruction
overrides the basic method in TObject and adds some additional reference count handling.
None.
BeforeDestruction
Check reference count.
AfterConstruction
overrides the basic method in TObject and adds a reference count check: if the reference count is not zero, an error occurs.
A runtime-error 204 will be generated if the reference count is nonzero when the object is destroyed.
AfterConstruction
Create a new instance
NewInstance
initializes a new instance of
None.
Return the current reference count
RefCount
returns the current reference count. This reference count cannot be manipulated, except through the methods of . When it reaches zero, the class instance is destroyed.
Return a reference to an interface

GetInterface scans the interface tables and returns a reference to the interface iid. The reference is stored in Obj which should be an interface reference. It returns True if the interface was found, False if not.

The reference count of the interface is increased by this call.

If no interface was found, False is returned.
GetInterfaceByStr
Return an interface based on its GUID

GetInterfaceByStr returns in obj a pointer to the interface identified by iidstr. The function returns True if the interface is indeed implemented by the class, or False otherwise.

The iidstr is the unique GUID by which the interface was declared.

The function returns false if the requested interface is not implemented.
Return the interface table entry by GUID
GetInterfaceEntry
returns the internal interface table entry for the interface identified by iid (the GUID used in the declaration of the interface). If the interface is not implemented by the class, the function returns Nil.
Return the interface table entry by string
GetInterfaceEntryByStr
returns the internal interface table entry for the interface identified by iidstr (A string representation of the GUID used in the declaration of the interface). If the interface is not implemented by the class, the function returns Nil.
Return a pointer to the table of implemented interfaces for a class
GetInterfaceTable
returns a pointer to the internal table of implemented interfaces for a class. The result will always point to a valid address, if the class implements no interfaces the EntryCount field of the interface table will be zero.
Handle to a resource, for use in the resource loading routines
This is an opaque type.
Type of runtime-error for the Error procedure
TRuntimeError
is used in the procedure to indicate what kind of error should be reported.
Access Violation
Assertion failed error
Code set conversion error
User pressed CTRL-C
Division by zero error
An external exception occurred
Interface typecast error
Integer overflow error
Invalid (class) typecast error
Invalid operation error
Invalid pointer error
No error
Out of memory error
Overflow error
Privileged instruction error
Quit signal error
Range check error
Safecall (IDispInterface) error
Stack overflow error
Underflow error
Variant array bounds error
Variant array creation error
Variant Dispatch error.
Invalid variant operation error
Variant is not an array error.
Invalid typecase from variant
Division by zero error
Prototype for the safecall error handler
Prototype of a safecall error handler routine. Error is the error number (passed by the Windows operating system) and Addr is the address where the error occurred.
Error number
Address where error occurred
Convert a widestring to a UTF-8 encoded unicode string

UTF8Decode converts the widestring S to a UTF-8 encoded unicode string and returns the resulting string. It calls the low-level function to do the actual work.

For this function to work, a widestring manager must be installed.

Convert a UTF-8 encoded unicode string to a widestring

UTF8Encode converts the UTF-8 encoded unicode string S to a widestring and returns the resulting string. It calls the low-level function to do the actual work.

For this function to work, a widestring manager must be installed.

Convert a UTF-8 encoded unicode string to an ansistring

Utf8ToAnsi converts an utf8-encode unicode string to an ansistring. It converts the string to a widestring and then converts the widestring to an ansistring.

For this function to work, a widestring manager must be installed.

Convert a buffer with UTF-8 characters to widestring characters

Utf8ToUnicode converts the buffer in Source with a length of SourceBytes or for a maximum length of MaxChars (or MaxDestChars) widestring characters to the buffer pointed to by Dest.

The function returns the number of copied widestring characters.

For this function to work, a widestring manager must be installed.

On error, -1 is returned.
Cast a variant to a certain type
VarCast
converts the variant in Source to the type indicated in VarType and returns the result in dest. The VarType must be one of the pre-defined VarNNN constants.
If the conversion is not possible because the value cannot be correctly casted, then a run-time error or an exception may occur.
Record variant type
Convert a length-limited array of widechar to an ansistring
WideCharLenToString
converts at most Len widecharacters from the null-terminated widechar array S to an ansistring, and returns the ansistring.
No validity checking is performed on S. Passing an invalid pointer may lead to access violations.
Convert a length-limited array of widechar to an ansistring
WideCharLenToString
converts at most Len widecharacters from the null-terminated widechar array Src to an ansistring, and returns the ansistring in Dest.
No validity checking is performed on Src. Passing an invalid pointer may lead to access violations.
Convert a null-terminated array of widechar to an ansistring
WideCharToString
converts the null-terminated widechar array S to an ansistring, and returns the ansistring.
No validity checking is performed on Src. Passing an invalid pointer, or an improperly terminated array may lead to access violations.
Convert a null-terminated array of widechar to an ansistring
WideCharToString
converts the null-terminated widechar array S to an ansistring, and returns the ansistring in Dest.
No validity checking is performed on S. Passing an invalid pointer, or an improperly terminated array may lead to access violations.
Current widestring manager.
Contains the current widestring manager. Do not use directly.
Convert a widestring to a UCS-4 encoded string.
Swap endianness of the argument
SwapEndian
will swap the endianness of the bytes in its argument.
None.
Thread-safe increment
InterLockedIncrement
increments Target with 1 and returns the result. This is done in a thread-safe way (i.e. only one processor is accessing the variable at a time).
None.
Thread-safe decrement
InterLockedDecrement
decrements Target with 1 and returns the result. This is done in a thread-safe way. (i.e. only one processor is accessing the variable at a time).
None.
Exchange 2 integers in a thread-safe way
InterLockedExchange
stores Source in Target and returns the old value of Target. This is done in a thread-safe way, i.e., only one processor is accessing the Target variable at a time.
None.
Thread-safe add and exchange of 2 values
InterlockedDecrement
adds to Target the value of Source in a thread-safe way, and returns the old value of Target.This is done in a thread-safe way, i.e., only one processor is accessing the Target variable at a time.
None.
Conditional exchange
InterlockedCompareExchange
does an compare-and-exchange operation on the specified values in a thread-safe way. The function compares Target and Comparand and exchanges Target with NewValue if Target and Comparand are equal. It returns the old value of Target. This is done in a thread-safe way, i.e., only one processor is accessing the Target variable at a time.
None.
First 4 bytes of GUID
Bytes 5 and 6 of GUID
Bytes 7 and 8 of GUID
Bytes 9-17 of GUID
First 4 bytes of GUID
Bytes 5 and 6 of GUID
Bytes 7 and 8 of GUID
Bytes 9-17 of GUID
Integer value
Boolean value
Character value
Widechar value
Extended value
String value
Pointer value
PChar value (null-terminated string)
Object value (instance pointer)
Class pointer value (VMT pointer)
Widechar value
Ansistring value
Currency value
Variant value
Interface value
Widestring value
Int64 value
QWord value
Reserved byte
Reserved byte
Reserved byte
Smallint value
Integer value
Single value
Double value
Currency value
TDateTime value
OLE string value (specially allocated widestring)
Dispatch interface value
Error value
Boolean value
IUnknown interface value
Shortint value
Byte value
Word value
Longword value
Int64 value
QWord value
QWord value (?)
Ansistring value
Any valyue
Variant array value
Pointer value
Value as an array of longints
Value as an array of words
Value as an array of bytes
Total amount of available addressable memory
Total amount of uncommitted memory
Total amount of committed memory
Total amount of allocated memory
Total amount of free memory
Total amount of free small memory blocks
Total amount of free large memory blocks
Total amount of free process memory
Total bytes of overhead by memory manager
Last error code
Handler to get FPC heap status information.
Alias for real type
Do not use.
Do not use.
Do not use.
Do not use
Do not use
FPC compiler internal procedure index: pack
FPC compiler internal procedure index: unpack
FPC compiler internal procedure index: bitsizeof
IEC/IEEE floating-point exception flag: Invalid operation error
IEC/IEEE floating-point exception flag: ?
IEC/IEEE floating-point exception flag: Division by zero error
IEC/IEEE floating-point exception flag: Overflow error
IEC/IEEE floating-point exception flag: Underflow error
IEC/IEEE floating-point exception flag: ?
Current soft float exception mask
Current soft float exception flags
Raise floating point exception
float_raise
raises the floating point exceptions specified by .
Overload for variants
The assignment operator is overloaded for various types. This should be transparent to the user.
low part of GUID timestamp
Middle part of GUID timestamp
High part of GUID timestamp and version
High part of clock sequence of GUID
Low part of clock sequence of GUID
Node part of GUID
Dispatch interface entry type
This is an internal type for the compiler to encode calls to dispatch interfaces.
Standard entry
Virtual method
Statis method
Field value
Interface entry interface type
Padding bytes
Aggregated object

TAggregatedObject implements an object whose lifetime is governed by an external object (or interface). It does not implement the IUnknown interface by itself, but delegates all methods to the controller object, as exposed in the Controller property. In effect, the reference count of the aggregated object is the same as that of it's controller, and additionally, all interfaces of the controller are exposed by the aggregated object.

Note that the aggregated object maintains a non-counted reference to the controller.

Aggregated objects should be used when using delegation to implement reference counted objects: the delegated interfaces can be implemented safely by TAggregatedObject descendents.

Create Controller
Create a new instance of TAggregatedObject
Create
creates a new instance of TAggregatedObject on the heap, and stores a reference to aController, so it can be exposed in the Controller property.
If not enough memory is present on the heap, an exception will be raised. If the aController is Nil, exceptions will occur when any of the TAggregatedObject methods (actually, the IUnknown methods) are used.
Controller
Controlling instance

Controller exposes the controlling object, with all interfaces it has.

The value of the controller is set when the TAggregatedObject instance is created.

Function prototype for initializing a semaphore
TSempahoreInitHandler
is the function prototype for initializing a semaphore. It is used by the thread manager (ThreadManager.SemaphoreInit) to create semaphores. The function should return a pointer, usable by the other semaphore functions of the thread manager.
Function prototype for destroying a semaphore
TSemaphoreDestroyHandler
is the function prototype to destroy an existing semaphore, as returned by (ThreadManager.SemaphoreInit). It is used by the thread manager (ThreadManager.SemaphoreDestroy)
Function prototype for posting an event to a semaphore
TSemaphorePostHandler
is the function prototype to post an event to the semaphore. It should handle a pointer as returned by the ThreadManager.SemaphoreInit procedure. it's used by the thread manager ThreadManager.SemaphorePost.
Function prototype to wait on a semaphore
TSemaphoreWaitHandler
is the function prototype to wait on an event on the semaphore (which should be posted to the semaphore with ThreadManager.SemaphorePost). It should handle a pointer as eturned by the ThreadManager.SemaphoreInit procedure. it's used by the thread manager ThreadManager.SemaphoreWait.
Initialize (create) a new semaphore
Destroy (free) a semaphore created using SemaphoreInit.
Post an event on a semaphore created using SemaphoreInit.
Wait on a semaphore event posted by SemaphorePost.
Flush all standard files
FlushThread
flushes any buffers from standard file descriptors such as standard input/output/error. It should normally not be called by user code, but is executed when a thread exits.
Unsigned 64-bit integer
Pointer to unsigned integer of pointer size
Pointer to TDatetime
Executable entry point information structure
TEntryInformation
is used to initialize a Free Pascal program or library. Under normal circumstances, there should be no need to use this structure directly: it is used by the system unit and special linking units.
List of units to initialize/finalize
List of threadvar locations
Exit procedure
Main pascal code routine
Determine if valgrind is used or not
CTRL-C Handler prototype
TCtrlBreakHandler
is the prototype for the CTRL-C handler. If CtrlBreak is True then Ctrl-Break was hit, otherwise CTRL-C was hit. The handlers should return True to signal that the key-combination was handled. If False is returned, then default handling will be used, which by default means an exception will be raised if the sysutils unit is used.
Determines whether the current module is a library
ModuleIsLib
is set by the compiler when linking a library, program or package, and determines whether the current module is a library (or package) (True) or program (False).
Determines whether the current module is a package
ModuleIsLib
is set by the compiler when linking a library, program or package, and determines whether the current module is a package (True) or a library or program (False).
program compiled by CPP ?
ModuleIsCpp
is always false for FPC programs, it is provided for Delphi compatibility only.
Internal write string procedure
Internal read string procedure
Internal ABS function
Memory Read Barrier
ReadBarrier
is a low-level instruction to force a read barrier in the CPU: all memory reads before the instruction will be finished before this instruction, before memory reads after the instruction occur.
Memory Read Dependency Barrier
ReadDependencyBarrier
is a low-level instruction to force a read barrier in the CPU: all memory reads (loads) depending on previous loads are separate from the ones following the instruction.
Memory read/write barrier
ReadWriteBarrier
is a low-level instruction to force a read/write barrier in the CPU: both read (Loads) and write (stores) operations before and after the barrier are separate.
Memory write barrier
WriteBarrier
is a low-level instruction to force a write barrier in the CPU: write (store) operations before and after the barrier are separate.
Compare 2 shortstrings

ShortCompareText compares two shortstrings, S1 and S2, and returns the following result:

<0
  if S1<S2.
0
  if S1=S2.
>0
  if S1>S2.

The comparision of the two strings is case-insensitive. The function does not take internationalization settings into account, it simply compares ASCII values.

None.
CompareText
Called when a new thread is started.
Called when a thread has finished.
Create backtrace
DumpExceptionBackTrace
writes a backtrace of the current exception to the file f. If no exception is currently being raised, nothing is written. As much frames as available are written. If debug info is available, then file names and line numbers will be written as well.
No check is done to see whether f is opened for writing.
Initialize the FPU
SysInitFPU
initializes (resets) the floating point unit, if one is available. It is called for instance when a new thread is started.
System CTRL-C handler
SysSetCtrlBreakHandler
sets the CTRL-C handler to the Handler callback, and returns the previous value of the handler.
Put a value in a single cell of a variant array

VarArrayPut puts Value in the variant array A at the location indicated by Indices. Thus the statement

    VarArrayPut(A,B,[2,1]);

is equivalent to

    A[2,1]:=B;

The difference is that the previous is usable when the amount of indices is not known at compile time.

If the number of indices is wrong (or out of range) an exception may be raised.
Get a value from a single cell of a variant array

VarArrayGet returns the value in the variant array A at the location indicated by Indices. Thus the statement

    B:=VarArrayGet(A,[2,1]);

is equivalent to

    B:=A[2,1];

The difference is that the previous is usable when the amount of indices is not known at compile time.

If the number of indices is wrong (or out of range) an exception may be raised.
Called when a thread is initialized
Called when a thread ends
Relocate the heap to a different location
End the current thread
DoneThread
should be used to end the current thread. It performs the necessary housekeeping before actually ending the thread. Using the operating system calls to end the thread may result in data corruption or memory leaks.
File mask for all files on the current platform
AllFilesMask
is the wildcard that can be used to return all files in a directory. On windows and dos based systems, this will be '*.*', while for unix systems, this will be '*'.
Base class for contained objects
TContainedObject
is the base class for contained objects, i.e. objects that do not implement a reference counting mechanism themselves, but are owned by some other object which handles the reference counting mechanism. It implements the IUnknown interface and, more specifically, the QueryInterface method of IUnknown.
Character which separates the filename from the file extension.
ExtensionSeparator
is the character which separates the filename from the file extension. On all current platforms, this is the . (dot) character. All RTL filename handling routines use this constant.
Set of characters considered directory separators

AllowDirectorySeparators is the set of characters which are considered directory separators by the RTL units. By default, this is set to the most common directory separators: forward slash and backslash, so routines will work in a cross-platform manner, no matter which character was used:

    AllowDirectorySeparators : set of char = ['\','/'];

If a more strict behaviour is desired, then AllowDirectorySeparators can be set to the only character allowed on the current operating system, and all RTL routines that handle filenames (splitting filenames, extracting parts of the filename and so on) will use that character only.

Set of characters considered drive separators
AllowDriveSeparators
are the characters which are considered to separate the drive part from the directory part in a filename. This will be an empty set on systems that do not support drive letters. Other systems (dos, windows and OS/2) will have the colon (:) character as the only member of this set.
Unicode string character
UnicodeChar
is a single character from a UnicodeString. It equals WideChar in all respects.
Pointer to unicode character
PUnicodeChar
is a pointer to a unicode character, just like PChar is a pointer to a Char ansistring character.
Pointer to unicodestring
PUnicodeString
is a pointer to a UnicodeString string.
Fill memory range with QWord (64-bit) values
FillQWord
fills the memory location of x with Count times value. The size of the filled memory location is therefor 8*count bytes.
No checks are made to see if X actually has a minimum size of (Count*8) bytes. Therefor, other variables can be overwritten or the memory may be out of the accessible memory for the program. In the latter case a run-error or exception may be triggered.
Return the position of a QWord in a memory range

IndexQWord checks the first len qwords starting at Buf, and returns the position (zero-based) of b. If b does not appear in the first len qwords, then -1 is returned.

Note that the search is done on QWord boundaries, but that the address of buf need not be on a QWord boundary.

No check is done to see whether the indicated memory range is valid. If it is not, a run-error or exception may be triggered.
Rotate bits of a byte value to the right
RorByte
rotates the bits of the byte AValue with Dist positions to the right. If Dist is not specified, then 1 is assumed.
None.
Rotate bits of a byte value to the left
RolByte
rotates the bits of the byte AValue with Dist positions to the left. If Dist is not specified, then 1 is assumed.
None.
Rotate bits of a word value to the right
RorWord
rotates the bits of the word AValue with Dist positions to the right. If Dist is not specified, then 1 is assumed.
None.
Rotate bits of a word value to the left
RolWord
rotates the bits of the word AValue with Dist positions to the right. If Dist is not specified, then 1 is assumed.
None.
Rotate bits of a DWord (cardinal) value to the right
RorDWord
rotates the bits of the DWord (cardinal) AValue with Dist positions to the right. If Dist is not specified, then 1 is assumed.
None.
Rotate bits of a DWord (cardinal) value to the left
RolDWord
rotates the bits of the DWord (cardinal) AValue with Dist positions to the left. If Dist is not specified, then 1 is assumed.
None.
Rotate bits of a QWord (64-bit) value to the right
RorQWord
rotates the bits of the QWord (64-bit) AValue with Dist positions to the right. If Dist is not specified, then 1 is assumed.
None.
Rotate bits of a QWord (64-bit) value to the left
RorQWord
rotates the bits of the QWord (64-bit) AValue with Dist positions to the left. If Dist is not specified, then 1 is assumed.
None.
Round to nearest even number
Round down
Round up
Round in the direction of zero (down for positive, up for negative)
Rounding mode for softfloat

softfloat_rounding_mode determines how the software floating-point emulation routines do the rounding. The value can be one of the following:

float_round_nearest_even
float_round_down
float_round_up
float_round_to_zero

Convert unicode character to string

UnicodeCharToString converts a null-word-terminated array of unicode characters in S to an AnsiString value. It simply calls with the length of the string S.

This function requires the use of a widestring manager.

No checking is done to see if the pointer S is valid.
Convert an ansistring to a null-terminated array of unicode characters.

StringToUnicodeChar converts the ansistring S to a unicodestring and places the result in Dest. The size of the memory location pointed to by Dest must be given in DestSize. If the result string is longer than the available size, the result string will be truncated.

The function always returns Dest.

No check is performed to see whether Dest points to a valid memory location.
Convert a memory buffer with unicode characters to an ansistring

UnicodeCharLenToString converts the unicode characters in buffer S with at most len bytes length, to an ansistring and returns the result.

This function requires the use of a widestring manager.

No checking is done to see if the pointer S or length len are valid.
Convert a memory buffer with unicode characters to an ansistring

UnicodeCharLenToString converts the unicode characters in buffer S with at most len bytes length, to an ansistring and returns the result in Dest

This function does the same as .

No checking is done to see if the pointer S or length len are valid.
Convert a null-terminated memory buffer with unicode characters to an ansistring

UnicodeCharLenToString converts the unicode characters in buffer S up to the first null word, to an ansistring and returns the result in Dest

This function does the same as .

No checking is done to see if the pointer S is valid.
Standard widestring manager callback
DefaultUnicode2AnsiMove
is the standard callback used for the widestring manager when a unicode string must be converted to an ansistring. It replaces all words with value < 256 with their value as ASCII code.
None.
Standard widestring manager callback
DefaultAnsi2UnicodeMove
is the standard callback used for the widestring manager when an ansistring must be converted to a unicodestring. It simply copies over all characters from the ansistring to the unicodestring, no conversion whatsoever is performed.
Unicode string manager

TUnicodeStringManager is currently the same as the manager record. It performs the same functions: converting unicode strings to ansistrings and vice-versa, performing uppercase to lowercase transformations and comparing strings.

Callback used when a unicode/wide string must be converted to an ansistring
Callback used when an ansistring must be converted to a unicodestring/widestring.
Callback used when a unicode/wide string must be uppercased.
Callback used when a unicode/wide string must be lowercased.
Callback used when 2 unicode/wide strings must be compared
Callback used when 2 unicode/wide strings must be compared case-insensitively
Callback used when the character length of a unicode/wide string must be calculated
Callback used when an ansistring must be uppercased.
Callback used when an ansistring must be lowercased.
Callback used when 2 ansistrings must be compared.
Callback used when 2 ansistrings must be compared case insensitively.
Callback used when 2 ansistrings must be compared case insensitively
Callback used when 2 null-terminated ansistring arrays must be compared case insensitively
Callback used when 2 ansistring arrays must be compared up to a given length
Callback used when 2 ansistring arrays must be compared case insensitively up to agiven length
Callback used when a null-terminated ansistring array must be lowercased.
Callback used when a null-terminated ansistring array must be uppercased.
Called whenever a new thread is started.
Called whenever a thread ends.
Callback used whenever a unicode string must be converted to an ansistring.
Callback used whenever a ansistring must be converted to a unicode string.
Callback used to convert a unicode string to uppercase.
Callback used to convert a unicode string to lowercase.
Callback used to compare 2 unicode strings.
Callback used to compare 2 unicode strings case insensitively
Convert a unicode string to a UCS-4 string.

UnicodeStringToUCS4String converts a unicode string S to a UCS-4 encoded string, and returns the resulting string.

This function requires the widestring manager.

Convert a UCS-4 encoded string to a unicode string

UCS4StringToUnicodeString converts the UCS-4 encoded string S to a unicode string and returns the resulting string.

This function requires the widestring manager.

Return a copy of the currently active unicodetring manager.

GetUnicodeStringManager returns a copy of the currently active unicode string manager in Old

UnicodeStrings are implemented in different ways on different platforms. Therefore, the Free Pascal Runtime library has no fixed implementation of widestring routines. Instead, it defines a UnicodeStringManager record, with callbacks that can be set to an implementation which is most efficient on the current platform. On windows, standard Windows routines will be used. On Unix and Linux, an implementation based on the C library is available (in unit cwstring).

It is possible to implement a custom unicodestring manager, optimized for the current application, without having to recompile the complete Run-Time Library.

Set the unicodestring manager

SetUnicodeStringManager sets the current unicodestring manager to New. Optionally, it returns the currently active widestring manager in Old.

UnicodeStrings are implemented in different ways on different platforms. Therefore, the Free Pascal Runtime library has no fixed implementation of widestring routines. Instead, it defines a UnicodeString manager record, with callbacks that can be set to an implementation which is most efficient on the current platform. On windows, standard Windows routines will be used. On Unix and Linux, an implementation based on the C library is available (in unit cwstring).

It is possible to implement a custom unicodestring manager, optimized for the current application, without having to recompile the complete Run-Time Library.

Pointer to TVMT record
Virtual method table layout
TVMT
is a record describing the VMT of a class. It's various fields represent the available information in the VMT, as far as it is common to all classes.
Class instance size
Duplicate of class instance size (should equal -vInstanceSize)
Pointer to parent VMT
Pointer to shortstring with classname
Pointer to table with dynamic methods.
Pointer to table with virtual methods.
Pointer to table with field information
Pointer to class type info record.
Pointer to initialization information
Pointer to Automation interfaces table
Pointer to interfaces table
Pointer to string message dispatch table
Pointer to destructor
Pointer to NewInstance method
Pointer to FreeInstance method
?
Pointer to default message handler
Pointer to afterconstruction method.
Pointer to beforeconstruction method.
Pointer to default string message handler
Pointer to IInterface interface
Handle to resource
TFPResourceHandle
represents a handle to a binary resource and is used in the various resource calls. Its actual type and size may differ accross platforms.
Handle to module containing resource
TFPResourceHMODULE
represents a module (library, executable, other) in which a resource is located. It is used in the various resource calls. It is an opaque type: its actual type and size may differ accross platforms.
TFPResourceHGLOBAL
TFPResourceHGLOBAL
represents a handle to the global module containing a resource. It is used in the various resource calls. It is an opaque type: its actual type and size may differ accross platforms.
Resource type: Animated cursor
This constant can be used to specify a resource of type "animated cursor".
Resource type: Animated icon
This constant can be used to specify a resource of type "animated icon".
Resource type: HTML data
This constant can be used to specify a resource of type "HTML data".
Resource type: manifest
This constant can be used to specify a resource of type "Manifest".
Callback for resource type enumeration
EnumResTypeProc
is used in the call. It is called for all resources, and is passed the ModuleHandle, ResourceType values for each resource encountered. Additionally, the lParam parameter from the EnumResourceTypes is passed unaltered.
Callback for resource name enumeration
EnumResNameProc
s used in the call. It is called for all resources of the specified type, and is passed the ModuleHandle, ResourceType, ResourceName values for each resource encountered. Additionally, the lParam parameter from the EnumResourceNames is passed unaltered.
Callback for language resource enumeration
EnumResNameProc
s used in the call. It is called for all languages for a resource of the specified type and name, and is passed the ModuleHandle, ResourceName , ResourceName and IDLanguage values for each language encountered for the specified resource. Additionally, the lParam parameter from the EnumResourceLanguages is passed unaltered.
Check whether a resource is an internal resource
Is_IntResource
returns True if the resource type is internal (system predefined) resource or false if it is a user-defined resource type.
None.
Create a langauge ID
MakeLangID
creates a language ID from the primary and sub language IDS.
Enumerate available resource types
EnumResourceTypes
enumerates the types of all resources in the module ModuleHandle. For each resource available it calls EnumFunc and passes it ModuleHandle, the type of the resource, and lParam. It returns False if no resources are available for the specified module, or True if there are resources available.
None.
Enumerate available resource names for a specified resource type
EnumResourceNames
enumerates the names of all resources of type ResourceType in the module ModuleHandle. For each resource available it calls EnumFunc and passes it ModuleHandle, the type of the resource ResourceType, the name of the resource, and lParam. It returns False if no resources are available for the specified resource type and module, or True if there are resources available.
None.
Enumerate available languages for a resource of given type and name
EnumResourceLanguages
enumerates the available languages for a resource of given ResourceName and type ResourceType in the module ModuleHandle. For each language availanle, it calls EnumFunc and passes it ModuleHandle, the type of the resource ResourceType, the name of the resource ResourceName, the language ID, and lParam. It returns False if no resources are available for the specified resource type and module, or True if there are resources available.
None.
Find a resource based on type, name, language

FindResourceEx looks in module ModuleHandle for a resource of type ResourceType and name ResourceName with languague ID Language. Both Resourcename and ResourceName can be specified as a null-terminated array of characters, or as an AnsiString.

If the requested language/sublanguage is not found, then the search is conducted

1. with only primary language.
2. with the neutral language (LANG_NEUTRAL)
3. with the english language

If none of these has returned a match, then the first available language is returned.

If a match is found, a handle to the resource is returned. If none is found, an empty handle (nil or 0) is returned.

None.
Resource manager definition

TResourceManager is the record describing the resource manager. Depending on the kind of resources (internal, external), another resource managing handler is installed by the system. The resource manager record is used by all resource handling functions to do the actual work: for each function in the API, a handler function is available. People wishing to implement their own resource manager, must implement all handler functions in their implementation.

As soon as resources are used, the compiler will install a resource manager, depending on the platform, this may be an internal or an external resource manager.

Return the programs instance handle.
Handler for EnumResourceTypes.
Handler for EnumResourceNames.
Handler for EnumResourceLanguages.
Handler for FindResource
Handler for FindResourceEx
Handler for LoadResource
Handler for SizeOfResource
Handler for LockResource
Handler for UnLockResource
Handler for FreeResource
Return the currently active resource manager
GetResourceManager
returns the currently active resource manager record in Manager. There is always an active resource manager record.
None.
Set the resource manager

SetResourceManager sets the active resource manager to Manager. After a call to SetResourceManager, the functions in the Manager record will be used to handle resources.

Note that it is not supported to change resource managers on-the-fly: any resources or information about resources obtained should be discareded prior to a call to SetResourceManager. Typically, SetResourceManager should be called once, at program startup.

None.
(Unix only) callback for GetModuleByAddr
UnixGetModuleByAddrHook
is used on unix systems to retrieve a module name based on an address. It is used in the exeinfo unit to map addresses to module (programs or library) names.
exeinfo
Write variables to a string

WriteStr behaves like , except that it stores its output in the string variable S instead of a file. Semantically, the WriteStr call is equivalent to writing the arguments to a file using the Write call, and then reading them into S using the Read call from the same file:

var F : Text; begin Rewrite(F); Write(F,Args); Close(F); Reset(F); Read(F,S); Close(F); end;

Obviously, the WriteStr call does not use a temporary file.

WriteStr is defined in the ISO Extended Pascal standard. More information on the allowed arguments and the possible formatting can be found in the description of .

Read variables from a string

ReadStr behaves like , except that it reads its input from the string variable S instead of a file. Semantically, the ReadStr call is equivalent to writing the string to a file using the Write call, and then reading them into the various arguments Arg using the Read call from the same file:

var F : Text; begin Rewrite(F); Write(F,S); Close(F); Reset(F); Read(F,Args); Close(F); end;

Obviously, the ReadStr call does not use a temporary file.

ReadStr is defined in the ISO Extended Pascal standard. More information on the allowed arguments and the behaviour of the arguments can be found in the description of .

Create packed array from normal array

Pack will copy the elements of an unpacked array (A) to a packed array (Z). It will start the copy at the index denoted by StartIndex. The type of the index variable StartIndex must match the type of the index of A. The elements are always transferred to the beginning of the packed array Z. (i.e. it starts at Low(Z)).

Obviously, the type of the elements of the arrays A and Z must match.

Create unpacked array from packed array

UnPack will copy the elements of a packed array (Z) to an unpacked array (A). All elements in Z are copied to A, starting at index StartIndex in A. The type of the index variable StartIndex must match the type of the index of A.

Obviously, the type of the elements of the arrays A and Z must match.