EBitsError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when an error occurs in a method of TBits.

Declaration

Source position: classesh.inc line 141

type EBitsError = class(Exception)

Inheritance

EBitsError | Exception raised when an error occurs in a method of TBits.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

When an index of a bit in a TBits is out of the valid range (0 to Count-1) then a EBitsError exception is raised.

Documentation generated on: May 12 2018


EBitsError
Exception
 | HelpContext
 | Message
TObject


HelpContext (Exception)

Message (Exception)


EBitsError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Create (TObject)

Create (Exception)

CreateFmt (Exception)

CreateFmtHelp (Exception)

CreateHelp (Exception)

CreateRes (Exception)

CreateResFmt (Exception)

CreateResFmtHelp (Exception)

CreateResHelp (Exception)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

FieldAddress (TObject)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

SafeCallException (TObject)

StringMessageTable (TObject)

ToString (TObject)

ToString (Exception)

UnitName (TObject)


EBitsError

Exception

TObject


EClassNotFound

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when an unknown class is referenced in a streamed component.

Declaration

Source position: classesh.inc line 132

type EClassNotFound = class(EFilerError)

Inheritance

EClassNotFound | Exception raised when an unknown class is referenced in a streamed component.
|
EFilerError | Exception raised by the component streaming system if an error occurs.
|
EStreamError | Exception raised when an error occurs during read or write operations on a stream.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

When the streaming system needs to create a component, it looks for the class pointer (VMT) in the list of registered classes by its name. If this name is not found, then an EClassNotFound is raised.

See also

EFilerError

Exception raised by the component streaming system if an error occurs.


EClassNotFound
EFilerError
EStreamError
Exception
 | HelpContext
 | Message
TObject


EClassNotFound
EFilerError
EStreamError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EClassNotFound

EFilerError

EStreamError

Exception

TObject


EComponentError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when an error occurs in the component registration routines.

Declaration

Source position: classesh.inc line 143

type EComponentError = class(Exception)

Inheritance

EComponentError | Exception raised when an error occurs in the component registration routines.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

When an error occurs during the registration of a component, or when naming a component, then a EComponentError is raised. Possible causes are:

  1. An name with an illegal character was assigned to a component.
  2. A component with the same name and owner already exists.
  3. The component registration system isn't set up properly.

See also

TComponent | Base class for all components that need owner-owned functionality.
TComponent.Name | Name of the component.


EComponentError
Exception
 | HelpContext
 | Message
TObject


EComponentError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EComponentError

Exception

TObject


EFCreateError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when an error occurred during creation of a TFileStream stream.

Declaration

Source position: classesh.inc line 127

type EFCreateError = class(EStreamError)

Inheritance

EFCreateError | Exception raised when an error occurred during creation of a TFileStream stream.
|
EStreamError | Exception raised when an error occurs during read or write operations on a stream.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

When the operating system reports an error during creation of a new file in the Filestream Constructor, a EFCreateError is raised.

See also

EStreamError | Exception raised when an error occurs during read or write operations on a stream.
EFOpenError | Exception raised when an error occurred during creation of a TFileStream


EFCreateError
EStreamError
Exception
 | HelpContext
 | Message
TObject


EFCreateError
EStreamError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EFCreateError

EStreamError

Exception

TObject


EFilerError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised by the component streaming system if an error occurs.

Declaration

Source position: classesh.inc line 129

type EFilerError = class(EStreamError)

Inheritance

EFilerError | Exception raised by the component streaming system if an error occurs.
|
EStreamError | Exception raised when an error occurs during read or write operations on a stream.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

This class serves as an ancestor class for exceptions that are raised when an error occurs during component streaming. A EFilerError exception is raised when a class is registered twice.

See also

EStreamError | Exception raised when an error occurs during read or write operations on a stream.
EReadError | Exception raised if an error occurs while reading from a stream.


EFilerError
EStreamError
Exception
 | HelpContext
 | Message
TObject


EFilerError
EStreamError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EFilerError

EStreamError

Exception

TObject


EFOpenError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when an error occurred during creation of a TFileStream

Declaration

Source position: classesh.inc line 128

type EFOpenError = class(EStreamError)

Inheritance

EFOpenError | Exception raised when an error occurred during creation of a TFileStream
|
EStreamError | Exception raised when an error occurs during read or write operations on a stream.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

When the operating system reports an error during the opening of a file in the Filestream Constructor, a EFOpenError is raised.

See also

EStreamError | Exception raised when an error occurs during read or write operations on a stream.
EFCreateError | Exception raised when an error occurred during creation of a TFileStream stream.


EFOpenError
EStreamError
Exception
 | HelpContext
 | Message
TObject


EFOpenError
EStreamError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EFOpenError

EStreamError

Exception

TObject


EInvalidImage

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when the resource header needed for streaming of a component is invalid.

Declaration

Source position: classesh.inc line 134

type EInvalidImage = class(EFilerError)

Inheritance

EInvalidImage | Exception raised when the resource header needed for streaming of a component is invalid.
|
EFilerError | Exception raised by the component streaming system if an error occurs.
|
EStreamError | Exception raised when an error occurs during read or write operations on a stream.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

This exception is not used by Free Pascal but is provided for Delphi compatibility.


EInvalidImage
EFilerError
EStreamError
Exception
 | HelpContext
 | Message
TObject


EInvalidImage
EFilerError
EStreamError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EInvalidImage

EFilerError

EStreamError

Exception

TObject


EInvalidOperation

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when an invalid operation is performed. Obsolete.

Declaration

Source position: classesh.inc line 146

type EInvalidOperation = class(Exception)

Inheritance

EInvalidOperation | Exception raised when an invalid operation is performed. Obsolete.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

This exception is not used in Free Pascal, it is defined for Delphi compatibiliy purposes only.


EInvalidOperation
Exception
 | HelpContext
 | Message
TObject


EInvalidOperation
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EInvalidOperation

Exception

TObject


EListError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when an error occurs in lists handling.

Declaration

Source position: classesh.inc line 139

type EListError = class(Exception)

Inheritance

EListError | Exception raised when an error occurs in lists handling.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

If an error occurs in one of the TList or TStrings methods, then a EListError exception is raised. This can occur in one of the following cases:

  1. There is not enough memory to expand the list.
  2. The list tried to grow beyond its maximal capacity.
  3. An attempt was made to reduce the capacity of the list below the current element count.
  4. An attempt was made to set the list count to a negative value.
  5. A non-existent element of the list was referenced. (i.e. the list index was out of bounds)
  6. An attempt was made to move an item to a position outside the list's bounds.

See also

TList | Class to manage collections of pointers.
TStrings | Class to manage arrays or collections of strings


EListError
Exception
 | HelpContext
 | Message
TObject


EListError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EListError

Exception

TObject


EMethodNotFound

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

This exception is no longer used.

Declaration

Source position: classesh.inc line 133

type EMethodNotFound = class(EFilerError)

Inheritance

EMethodNotFound | This exception is no longer used.
|
EFilerError | Exception raised by the component streaming system if an error occurs.
|
EStreamError | Exception raised when an error occurs during read or write operations on a stream.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

This exception is no longer used in the streaming system. This error is replaced by a EReadError.

See also

EFilerError | Exception raised by the component streaming system if an error occurs.
EReadError | Exception raised if an error occurs while reading from a stream.


EMethodNotFound
EFilerError
EStreamError
Exception
 | HelpContext
 | Message
TObject


EMethodNotFound
EFilerError
EStreamError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EMethodNotFound

EFilerError

EStreamError

Exception

TObject


EObserver

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Error raised when an observer error occurs

Declaration

Source position: classesh.inc line 183

type EObserver = class(Exception)

Inheritance

EObserver | Error raised when an observer error occurs
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EObserver is an error that is raised when an object is registered as an observer, and it does not implement the IFPObserver interface.

See also

IFPObserver | Interface for an object to observe other objects.
IFPObserved.FPOAttachObserver | Attach a new observer to the object


EObserver
Exception
 | HelpContext
 | Message
TObject


EObserver
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EObserver

Exception

TObject


EOutOfResources

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when the system is out of resources.

Declaration

Source position: classesh.inc line 145

type EOutOfResources = class(EOutOfMemory)

Inheritance

EOutOfResources | Exception raised when the system is out of resources.
|
EOutOfMemory | Out of memory error.
|
EHeapMemoryError | Heap memory error
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

This exception is not used in Free Pascal, it is defined for Delphi compatibiliy purposes only.


EOutOfResources
EOutOfMemory
EHeapMemoryError
Exception
 | HelpContext
 | Message
TObject


EOutOfResources
EOutOfMemory
EHeapMemoryError
 | FreeInstance
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Create (TObject)

Create (Exception)

CreateFmt (Exception)

CreateFmtHelp (Exception)

CreateHelp (Exception)

CreateRes (Exception)

CreateResFmt (Exception)

CreateResFmtHelp (Exception)

CreateResHelp (Exception)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

FieldAddress (TObject)

Free (TObject)

FreeInstance (TObject)

FreeInstance (EHeapMemoryError)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

SafeCallException (TObject)

StringMessageTable (TObject)

ToString (TObject)

ToString (Exception)

UnitName (TObject)


EOutOfResources

EOutOfMemory

EHeapMemoryError

Exception

TObject


EParserError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when an error occurs during the parsing of streams.

Declaration

Source position: classesh.inc line 144

type EParserError = class(Exception)

Inheritance

EParserError | Exception raised when an error occurs during the parsing of streams.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

When an error occurs during the parsing of a stream, an EParserError is raised. Usually this indicates that an invalid token was found on the input stream, or the token read from the stream wasn't the expected token.

See also

TParser

Class to parse the contents of a stream containing text data.


EParserError
Exception
 | HelpContext
 | Message
TObject


EParserError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EParserError

Exception

TObject


EReadError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised if an error occurs while reading from a stream.

Declaration

Source position: classesh.inc line 130

type EReadError = class(EFilerError)

Inheritance

EReadError | Exception raised if an error occurs while reading from a stream.
|
EFilerError | Exception raised by the component streaming system if an error occurs.
|
EStreamError | Exception raised when an error occurs during read or write operations on a stream.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

If an error occurs when reading from a stream, a EReadError exception is raised. Possible causes for this are:

  1. Not enough data is available when reading from a stream
  2. The stream containing a component's data contains invalid data. this will occurr only when reading a component from a stream.

See also

EFilerError | Exception raised by the component streaming system if an error occurs.
EWriteError | Exception raised when an error occurs during writing to a stream.


EReadError
EFilerError
EStreamError
Exception
 | HelpContext
 | Message
TObject


EReadError
EFilerError
EStreamError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EReadError

EFilerError

EStreamError

Exception

TObject


EResNotFound

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when a resource, needed to initialize a component, is not found.

Declaration

Source position: classesh.inc line 135

type EResNotFound = class(Exception)

Inheritance

EResNotFound | Exception raised when a resource, needed to initialize a component, is not found.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

This exception is not used by Free Pascal but is provided for Delphi compatibility.


EResNotFound
Exception
 | HelpContext
 | Message
TObject


EResNotFound
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EResNotFound

Exception

TObject


EStreamError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when an error occurs during read or write operations on a stream.

Declaration

Source position: classesh.inc line 126

type EStreamError = class(Exception)

Inheritance

EStreamError | Exception raised when an error occurs during read or write operations on a stream.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

An EStreamError is raised when an error occurs during reading from or writng to a stream: Possible causes are

  1. Not enough data is available in the stream.
  2. Trying to seek beyond the beginning or end of the stream.
  3. Trying to set the capacity of a memory stream and no memory is available.
  4. Trying to write to a read-only stream, such as a resource stream.
  5. Trying to read from a write-only stream.

See also

EFCreateError

Exception raised when an error occurred during creation of a TFileStream stream.


EStreamError
Exception
 | HelpContext
 | Message
TObject


EStreamError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EStreamError

Exception

TObject


EStringListError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when an error occurs in a method of TStrings.

Declaration

Source position: classesh.inc line 142

type EStringListError = class(Exception)

Inheritance

EStringListError | Exception raised when an error occurs in a method of TStrings.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

When an error occurs in one of the methods of TStrings then an EStringListError is raised. This can have one of the following causes:

  1. There is not enough memory to expand the list.
  2. The list tried to grow beyond its maximal capacity.
  3. A non-existent element of the list was referenced. (i.e. the list index was out of bounds)
  4. An attempt was made to add a duplicate entry to a TStringList when TStringList.Duplicates is False.

See also

TStrings | Class to manage arrays or collections of strings
TStringList | Standard implementation of the TStrings class.


EStringListError
Exception
 | HelpContext
 | Message
TObject


EStringListError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EStringListError

Exception

TObject


EThread

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Thread error exception.

Declaration

Source position: classesh.inc line 1569

type EThread = class(Exception)

Inheritance

EThread | Thread error exception.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.


EThread
Exception
 | HelpContext
 | Message
TObject


EThread
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EThread

Exception

TObject


EThreadDestroyCalled

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when a thread is destroyed illegally.

Declaration

Source position: classesh.inc line 1571

type EThreadDestroyCalled = class(EThread)

Inheritance

EThreadDestroyCalled | Exception raised when a thread is destroyed illegally.
|
EThread | Thread error exception.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.


EThreadDestroyCalled
EThread
Exception
 | HelpContext
 | Message
TObject


EThreadDestroyCalled
EThread
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EThreadDestroyCalled

EThread

Exception

TObject


EThreadExternalException

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when an invalid operation is attempted on an external thread

Declaration

Source position: classesh.inc line 1570

type EThreadExternalException = class(EThread)

Inheritance

EThreadExternalException | Exception raised when an invalid operation is attempted on an external thread
|
EThread | Thread error exception.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EThreadExternalException is raised by for example TThread.CheckTerminated and TThread.SetReturnValue when the thread was not created by the Free Pascal program, but by an external code base (for example a DLL, or the calling application in a DLL).

See also

TThread.CheckTerminated | Check if the current thread has finished executing.
TThread.SetReturnValue | Set return value of a thread


EThreadExternalException
EThread
Exception
 | HelpContext
 | Message
TObject


EThreadExternalException
EThread
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EThreadExternalException

EThread

Exception

TObject


EWriteError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when an error occurs during writing to a stream.

Declaration

Source position: classesh.inc line 131

type EWriteError = class(EFilerError)

Inheritance

EWriteError | Exception raised when an error occurs during writing to a stream.
|
EFilerError | Exception raised by the component streaming system if an error occurs.
|
EStreamError | Exception raised when an error occurs during read or write operations on a stream.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

If an error occurs when writing to a stream, a EWriteError exception is raised. Possible causes for this are:

  1. The stream doesn't allow writing.
  2. An error occurred when writing a property to a stream.

See also

EFilerError | Exception raised by the component streaming system if an error occurs.
EReadError | Exception raised if an error occurs while reading from a stream.


EWriteError
EFilerError
EStreamError
Exception
 | HelpContext
 | Message
TObject


EWriteError
EFilerError
EStreamError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EWriteError

EFilerError

EStreamError

Exception

TObject


IDesignerNotify

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Designer notification interface

Declaration

Source position: classesh.inc line 1749

type IDesignerNotify = interface
procedure Modified; | Notify that the component is modified.
procedure Notification(); | Notification of owner changes
end;

Inheritance

IDesignerNotify

Designer notification interface

Description

IDesignerNotify is an interface that can be used to communicate changes to a designer mechanism. It offers functionality for detecting changes, and notifications when the component is destroyed.


IDesignerNotify


IDesignerNotify
 | Modified
 | Notification


Modified (IDesignerNotify)

Notification (IDesignerNotify)


IDesignerNotify.Modified

Notify that the component is modified.

Declaration

Source position: classesh.inc line 1751

procedure IDesignerNotify.Modified;

Description

Modified can be used to notify a designer of changes, indicating that components should be streamed.


IDesignerNotify.Notification

Notification of owner changes

Declaration

Source position: classesh.inc line 1752

procedure IDesignerNotify.Notification(

  AnObject: TPersistent;

  Operation: TOperation

);

Description

Notification is the interface counterpart of TComponent.Notification which is used to communicate adds to the components.

See also

TComponent.Notification

Called by components that are freed and which received a FreeNotification.


IFPObserved

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Interface implemented by an object that can be observed.

Declaration

Source position: classesh.inc line 166

type IFPObserved = interface
procedure FPOAttachObserver(); | Attach a new observer to the object
procedure FPODetachObserver(); | Remove an observer from the list of observers.
procedure FPONotifyObservers(); | Notify all observers
end;

Inheritance

IFPObserved

Interface implemented by an object that can be observed.

Description

IFPObserved is an interface which can be implemented in objects that must be observable. Objects that wish to observe the object can register themselves with the FPOAttachObserver call, and must be detached using the FPODetachObserver call.

This interface is not reference counted, so care must be taken that the ooFree message is sent with FPONotifyObservers when the object is freed.

See also

FPONotifyObservers


IFPObserved


IFPObserved
 | FPOAttachObserver
 | FPODetachObserver
 | FPONotifyObservers


FPOAttachObserver (IFPObserved)

FPODetachObserver (IFPObserved)

FPONotifyObservers (IFPObserved)


IFPObserved.FPOAttachObserver

Attach a new observer to the object

Declaration

Source position: classesh.inc line 168

procedure IFPObserved.FPOAttachObserver(

  AObserver: TObject

);

Description

FPOAttachObserver must be called with an object instance AObserver that implements the IFPObserver interface. The FPOObservedChanged method of the interface will be called whenever FPONotifyObservers is used to notify observers of a change. Objects implementing this interface should check that AObserver actually implements the IFPObserver interface.

Do not make assumptions on how the interface behaves if FPOAttachObserver is called more than once with the same interface. It may add the object to the list of observers unconditionally (in which case it will be notified twice) or it may check that it is not yet in the list.

Errors

If AObserver does not implement the IFPObserver interface, an EObserver exception must be raised. No other errors should be raised, other than a possible out of memory error.

See also

IFPObserver | Interface for an object to observe other objects.
FPOObservedChanged | Entry point for change notifications
FPONotifyObservers


IFPObserved.FPODetachObserver

Remove an observer from the list of observers.

Declaration

Source position: classesh.inc line 170

procedure IFPObserved.FPODetachObserver(

  AObserver: TObject

);

Description

FPODetachObserver removes the AObserver object from the list of observers. If it was not in the list, then this is silently accepted. Once removed, it will no longer receive notifications when FPOObservedChanged is called.

If the object was added more than once using FPOAttachObserver, then it depends on the implementor of the interface whether or FPODetachObserver must be called an equal number of times.

See also

IFPObserver | Interface for an object to observe other objects.
FPOObservedChanged | Entry point for change notifications
FPONotifyObservers
FPOAttachObserver


IFPObserved.FPONotifyObservers

Notify all observers

Declaration

Source position: classesh.inc line 172

procedure IFPObserved.FPONotifyObservers(

  ASender: TObject;

  AOperation: TFPObservedOperation;

  Data: Pointer

);

Description

FPONotifyObservers notifies all observers of the object that a change has occurred. It calls FPOObservedChanged on the IFPObserver interface of all attached objects, and passes on ASender (normally this is Self), AOperation and Data. What Data is, depends on the implementor of the interface.

There is no guaranteed order in which the change notifications are delivered to the observers. This is an implementation-specific detail, which should not be relied upon in any way.

See also

IFPObserver | Interface for an object to observe other objects.
FPOObservedChanged | Entry point for change notifications
FPODetachObserver
FPOAttachObserver


IFPObserver

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Interface for an object to observe other objects.

Declaration

Source position: classesh.inc line 177

type IFPObserver = interface

  procedure FPOObservedChanged();

Entry point for change notifications

end;

Inheritance

IFPObserver

Interface for an object to observe other objects.

Description

IFPObserver is the interface an object must implement if it wishes to receive change notifications from another object. The presence of this interface will be checked when the object registers itself using IFPObserver.FPOAttachObserver. The change notifications arrive because the FPOObservedChanged method is called by the observed object.

See also

IFPObserved | Interface implemented by an object that can be observed.
FPOAttachObserver | Attach a new observer to the object


IFPObserver


IFPObserver

FPOObservedChanged


FPOObservedChanged (IFPObserver)


IFPObserver.FPOObservedChanged

Entry point for change notifications

Declaration

Source position: classesh.inc line 179

procedure IFPObserver.FPOObservedChanged(

  ASender: TObject;

  Operation: TFPObservedOperation;

  Data: Pointer

);

Description

FPOObservedChanged is the method that is called by an observed object (IFPObserved) when it calls FPONotifyObservers The Sender is the object under observation, the Operation and Data are the parameters used in the call to FPONotifyObservers.

See also

IFPObserved | Interface implemented by an object that can be observed.
FPONotifyObservers | Notify all observers


IInterfaceComponentReference

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Interface for checking component references

Declaration

Source position: classesh.inc line 1744

type IInterfaceComponentReference = interface

  function GetComponent;

Return component instance

end;

Inheritance

IInterfaceComponentReference

Interface for checking component references

Description

IInterfaceComponentReference is an interface to return the component that implements a given interface. It is implemented by TComponent.

See also

TComponent

Base class for all components that need owner-owned functionality.


IInterfaceComponentReference


IInterfaceComponentReference

GetComponent


GetComponent (IInterfaceComponentReference)


IInterfaceComponentReference.GetComponent

Return component instance

Declaration

Source position: classesh.inc line 1746

function IInterfaceComponentReference.GetComponent: TComponent;

Description

GetComponent returns the component instance.

Errors

None.

See also

TComponent

Base class for all components that need owner-owned functionality.


IInterfaceList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Interface for maintaining a list of interfaces.

Declaration

Source position: classesh.inc line 1935

type IInterfaceList = interface
function Get(); | Retrieve an interface pointer from the list.
function GetCapacity; | Return the capacity of the list.
function GetCount; | Return the current number of elements in the list.
procedure Put(); | Write an item to the list
procedure SetCapacity(); | Set the capacity of the list
procedure SetCount(); | Set the number of items in the list
procedure Clear; | Clear the list
procedure Delete(); | Remove an interface from the list
procedure Exchange(); | Exchange 2 interfaces in the list
function First; | Return the first non-empty interface in the list.
function IndexOf(); | Return the index of an interface.
function Add(); | Add an interface to the list
procedure Insert(); | Insert an interface in the list.
function Last; | Returns the last non-nil interface in the list.
function Remove(); | Remove an interface from the list
procedure Lock; | Lock the list
procedure Unlock; | Unlock the list.
property Capacity: Integer; [rw] | Capacity of the list
property Count: Integer; [rw] | Current number of elements in the list.
property Items []: IUnknown; default; [rw] | Provides Index-based, sequential, access to the interfaces in the list.
end;

Inheritance

IInterfaceList

Interface for maintaining a list of interfaces.

Description

IInterfaceList is an interface for maintaining a list of interfaces, strongly resembling the standard TList class. It offers the same list of public methods as TList, with the exception that it uses interfaces instead of pointers.

All interfaces in the list should descend from IUnknown.

More detailed descriptions of how the various methods behave can be found in the TList reference.

See also

TList

Class to manage collections of pointers.


IInterfaceList
 | Capacity
 | Count
 | Items


Capacity (IInterfaceList)

Count (IInterfaceList)

Items (IInterfaceList)


IInterfaceList
 | Get
 | GetCapacity
 | GetCount
 | Put
 | SetCapacity
 | SetCount
 | Clear
 | Delete
 | Exchange
 | First
 | IndexOf
 | Add
 | Insert
 | Last
 | Remove
 | Lock
 | Unlock


Add (IInterfaceList)

Clear (IInterfaceList)

Delete (IInterfaceList)

Exchange (IInterfaceList)

First (IInterfaceList)

Get (IInterfaceList)

GetCapacity (IInterfaceList)

GetCount (IInterfaceList)

IndexOf (IInterfaceList)

Insert (IInterfaceList)

Last (IInterfaceList)

Lock (IInterfaceList)

Put (IInterfaceList)

Remove (IInterfaceList)

SetCapacity (IInterfaceList)

SetCount (IInterfaceList)

Unlock (IInterfaceList)


IInterfaceList


IInterfaceList.Add

Add an interface to the list

Declaration

Source position: classesh.inc line 1947

function IInterfaceList.Add(

  item: IUnknown

):Integer;

Description

Add adds the interface Item to the list, and returns the position at which it has been added.

See also

TList.Add | Adds a new pointer to the list.
IInterfaceList.Insert | Insert an interface in the list.
IInterfaceList.Delete | Remove an interface from the list


IInterfaceList.Capacity

Capacity of the list

Declaration

Source position: classesh.inc line 1953

property IInterfaceList.Capacity : Integer
  read GetCapacity
  write SetCapacity;

Description

Capacity is the maximum number of elements the list can hold without needing to reallocate memory for the list. It can be set to improve speed when adding a lot of items to the list.

See also

TList.Capacity | Current capacity (i.e. number of pointers that can be stored) of the list.
IInterfaceList.Count | Current number of elements in the list.


IInterfaceList.Clear

Clear the list

Declaration

Source position: classesh.inc line 1942

procedure IInterfaceList.Clear;

Description

Clear removes all interfaces from the list. All interfaces in the list will be cleared (i.e. their reference count will decrease with 1)

See also

TList.Clear

Clears the pointer list.


IInterfaceList.Count

Current number of elements in the list.

Declaration

Source position: classesh.inc line 1954

property IInterfaceList.Count : Integer
  read GetCount
  write SetCount;

Description

Count is the current number of elements in the list. Setting it to a larger number will allocate empty slots. Setting it to a smaller number will clear any interfaces that fall outside the new border.

See also

IInterfaceList.Capacity | Capacity of the list
TList.Count | Current number of pointers in the list.


IInterfaceList.Delete

Remove an interface from the list

Declaration

Source position: classesh.inc line 1943

procedure IInterfaceList.Delete(

  index: Integer

);

Description

Delete removes the interface at position Index from the list. It does this by explicitly clearing the interface and then removing the slot.

See also

TList.Clear | Clears the pointer list.
IInterfaceList.Add | Add an interface to the list
IInterfaceList.Delete | Remove an interface from the list
IInterfaceList.Insert | Insert an interface in the list.


IInterfaceList.Exchange

Exchange 2 interfaces in the list

Declaration

Source position: classesh.inc line 1944

procedure IInterfaceList.Exchange(

  index1: Integer;

  index2: Integer

);

Description

Exchange exchanges 2 interfaces in the list at locations index1 and Index2.

See also

TList.Exchange | Exchanges two pointers in the list.
IInterfaceList.Add | Add an interface to the list
IInterfaceList.Delete | Remove an interface from the list
IInterfaceList.Insert | Insert an interface in the list.


IInterfaceList.First

Return the first non-empty interface in the list.

Declaration

Source position: classesh.inc line 1945

function IInterfaceList.First: IUnknown;

Description

First returns the first non-empty interface in the list.

See also

TList.First | Returns the first non-nil pointer in the list.
IInterfaceList.IndexOf | Return the index of an interface.
IInterfaceList.Last | Returns the last non-nil interface in the list.


IInterfaceList.Get

Retrieve an interface pointer from the list.

Declaration

Source position: classesh.inc line 1936

function IInterfaceList.Get(

  i: Integer

):IUnknown;

Description

Get returns the interface pointer at position i in the list. It serves as the Read method for the Items property.

See also

IInterfaceList.Items | Provides Index-based, sequential, access to the interfaces in the list.
TList.Items | Provides access to the pointers in the list.


IInterfaceList.GetCapacity

Return the capacity of the list.

Declaration

Source position: classesh.inc line 1937

function IInterfaceList.GetCapacity: Integer;

Description

GetCapacity returns the current capacity of the list. It serves as the Read method for the Capacity property.

See also

IInterfaceList.Capacity | Capacity of the list
TList.Capacity | Current capacity (i.e. number of pointers that can be stored) of the list.


IInterfaceList.GetCount

Return the current number of elements in the list.

Declaration

Source position: classesh.inc line 1938

function IInterfaceList.GetCount: Integer;

Description

It serves as the Read method for the Count property.

See also

IInterfaceList.Count | Current number of elements in the list.
TList.Count | Current number of pointers in the list.


IInterfaceList.IndexOf

Return the index of an interface.

Declaration

Source position: classesh.inc line 1946

function IInterfaceList.IndexOf(

  item: IUnknown

):Integer;

Description

IndexOf returns the location in the list of the interface Item. If there is no such interface in the list, then -1 is returned.

See also

TList.IndexOf | Returns the index of a given pointer.
IInterfaceList.First | Return the first non-empty interface in the list.
IInterfaceList.Last | Returns the last non-nil interface in the list.


IInterfaceList.Insert

Insert an interface in the list.

Declaration

Source position: classesh.inc line 1948

procedure IInterfaceList.Insert(

  i: Integer;

  item: IUnknown

);

Description

Insert inserts the interface Item in the list, at position I, shifting all items one position.

See also

TList.Insert | Inserts a new pointer in the list at a given position.
IInterfaceList.Add | Add an interface to the list
IInterfaceList.Delete | Remove an interface from the list


IInterfaceList.Items

Provides Index-based, sequential, access to the interfaces in the list.

Declaration

Source position: classesh.inc line 1955

property IInterfaceList.Items[index: Integer] : IUnknown
  read Get
  write Put;
  default;

Description

Items is the default property of the interface list and provides index-based array access to the interfaces in the list. Allowed values for Index include 0 to Count-1

See also

IInterfaceList.Count | Current number of elements in the list.
TList.Items | Provides access to the pointers in the list.


IInterfaceList.Last

Returns the last non-nil interface in the list.

Declaration

Source position: classesh.inc line 1949

function IInterfaceList.Last: IUnknown;

Description

Last returns the last non-empty interface in the list.

See also

TList.Last | Returns the last non-nil pointer in the list.
IInterfaceList.First | Return the first non-empty interface in the list.
IInterfaceList.IndexOf | Return the index of an interface.


IInterfaceList.Lock

Lock the list

Declaration

Source position: classesh.inc line 1951

procedure IInterfaceList.Lock;

Description

Lock locks the list. After a call to lock, the object list can only be accessed by the current thread, untill UnLock is called.

See also

TInterfaceList.Lock | Lock the list
IInterfaceList.Unlock | Unlock the list.


IInterfaceList.Put

Write an item to the list

Declaration

Source position: classesh.inc line 1939

procedure IInterfaceList.Put(

  i: Integer;

  item: IUnknown

);

Description

Put writes the interface Item at position I in the list. It servers as the Write method for the Items property.

See also

IInterfaceList.Items | Provides Index-based, sequential, access to the interfaces in the list.
TList.Items | Provides access to the pointers in the list.


IInterfaceList.Remove

Remove an interface from the list

Declaration

Source position: classesh.inc line 1950

function IInterfaceList.Remove(

  item: IUnknown

):Integer;

Description

Remove searches for the first occurrence of Item in the list and deletes it.

See also

TList.Remove | Removes a value from the list.
IInterfaceList.Delete | Remove an interface from the list
IInterfaceList.IndexOf | Return the index of an interface.


IInterfaceList.SetCapacity

Set the capacity of the list

Declaration

Source position: classesh.inc line 1940

procedure IInterfaceList.SetCapacity(

  NewCapacity: Integer

);

Description

SetCapacity sets the capacity of the list to NewCapacity. It serves as the Write method for the Capacity property.

See also

IInterfaceList.Capacity | Capacity of the list
TList.Capacity | Current capacity (i.e. number of pointers that can be stored) of the list.


IInterfaceList.SetCount

Set the number of items in the list

Declaration

Source position: classesh.inc line 1941

procedure IInterfaceList.SetCount(

  NewCount: Integer

);

Description

SetCount sets the count of the list to NewCount. It serves as the Write method for the Capacity

See also

IInterfaceList.Count | Current number of elements in the list.
TList.Count | Current number of pointers in the list.


IInterfaceList.Unlock

Unlock the list.

Declaration

Source position: classesh.inc line 1952

procedure IInterfaceList.Unlock;

Description

Unlock unlocks a locked list. After a call to UnLock, other threads are again able to access the list.

See also

TInterfaceList.UnLock | UnLocks a locked list
IInterfaceList.Lock | Lock the list


IStreamPersist

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Persistence streaming interface.

Declaration

Source position: classesh.inc line 924

type IStreamPersist = interface
procedure LoadFromStream(); | Load persistent data from stream.
procedure SaveToStream(); | Save persistent data to stream.
end;

Inheritance

IStreamPersist

Persistence streaming interface.

Description

IStreamPersist defines an interface for object persistence streaming to a stream. Any class implementing this interface is expected to be able to save or load it's state from or to a stream.

See also

TPersistent | Base class for streaming system and persistent properties.
TComponent | Base class for all components that need owner-owned functionality.
TStream | Base class for streams.


IStreamPersist


IStreamPersist
 | LoadFromStream
 | SaveToStream


LoadFromStream (IStreamPersist)

SaveToStream (IStreamPersist)


IStreamPersist.LoadFromStream

Load persistent data from stream.

Declaration

Source position: classesh.inc line 925

procedure IStreamPersist.LoadFromStream(

  Stream: TStream

);

Description

LoadFromStream is the method called when the object should load it's state from the stream stream. It should be able to read the data which was written using the SavetoStream method.

See also

TPersistent | Base class for streaming system and persistent properties.
TComponent | Base class for all components that need owner-owned functionality.
TStream | Base class for streams.
IStreamPersist.SaveToStream | Save persistent data to stream.


IStreamPersist.SaveToStream

Save persistent data to stream.

Declaration

Source position: classesh.inc line 926

procedure IStreamPersist.SaveToStream(

  Stream: TStream

);

Description

SaveFromStream is the method called when the object should load it's state from the stream stream. The data written by this method should be readable by the LoadFromStream method.

See also

TPersistent | Base class for streaming system and persistent properties.
TComponent | Base class for all components that need owner-owned functionality.
TStream | Base class for streams.
IStreamPersist.LoadFromStream | Load persistent data from stream.


IStringsAdapter

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

IStringsAdapter Interface declaration.

Declaration

Source position: classesh.inc line 583

type IStringsAdapter = interface
procedure ReferenceStrings(); | Add a reference to the indicated strings.
procedure ReleaseStrings; | Release the reference to the strings.
end;

Inheritance

IStringsAdapter

IStringsAdapter Interface declaration.

Description

Is not yet supported in Free Pascal.

See also

TStrings

Class to manage arrays or collections of strings


IStringsAdapter


IStringsAdapter
 | ReferenceStrings
 | ReleaseStrings


ReferenceStrings (IStringsAdapter)

ReleaseStrings (IStringsAdapter)


IStringsAdapter.ReferenceStrings

Add a reference to the indicated strings.

Declaration

Source position: classesh.inc line 584

procedure IStringsAdapter.ReferenceStrings(

  S: TStrings

);


IStringsAdapter.ReleaseStrings

Release the reference to the strings.

Declaration

Source position: classesh.inc line 585

procedure IStringsAdapter.ReleaseStrings;


IVCLComObject

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Com automation Object interface

Declaration

Source position: classesh.inc line 1732

type IVCLComObject = interface
function GetTypeInfoCount(); | The IDispatch:GetTypeInfoCount call for automation servers
function GetTypeInfo(); | The IDispatch:GetTypeInfo call for automation servers
function GetIDsOfNames(); | The IDispatch:GetIDsOfNames call for automation servers.
function Invoke(); | The IDispatch:Invoke call for automation servers.
function SafeCallException(); | This method can be invoked if an exception occurs during Invoke
procedure FreeOnRelease; | Is called by TComponent.FreeOnRelease
end;

Inheritance

IVCLComObject

Com automation Object interface

Description

IVCLComObject is used by TComponent to implement the IUnknown interface used by COM automation servers. Partially, it is the translation to pascal of the IDispatch interface definition by Microsoft. If TComponent needs to return an IUnknown interface, it creates a IVCLComObject interface instead.

See also

TComponent.VCLComObject

Not implemented.


IVCLComObject


IVCLComObject
 | GetTypeInfoCount
 | GetTypeInfo
 | GetIDsOfNames
 | Invoke
 | SafeCallException
 | FreeOnRelease


FreeOnRelease (IVCLComObject)

GetIDsOfNames (IVCLComObject)

GetTypeInfo (IVCLComObject)

GetTypeInfoCount (IVCLComObject)

Invoke (IVCLComObject)

SafeCallException (IVCLComObject)


IVCLComObject.FreeOnRelease

Is called by TComponent.FreeOnRelease

Declaration

Source position: classesh.inc line 1741

procedure IVCLComObject.FreeOnRelease;

Description

FreeOnRelease is called by TComponent.FreeOnRelease for the IVCLComObject interface implemented by TComponent.

See also

TComponent.FreeOnRelease

Part of the IVCLComObject interface.


IVCLComObject.GetIDsOfNames

The IDispatch:GetIDsOfNames call for automation servers.

Declaration

Source position: classesh.inc line 1736

function IVCLComObject.GetIDsOfNames(

  const IID: TGuid;

  Names: Pointer;

  NameCount: Integer;

  LocaleID: Integer;

  DispIDs: Pointer

):HRESULT;

Description

GetIDsOfNames must return in DispIDs the dispatch Ids for the NameCount names of the methods listed in Names. The LocaleID indicates the locale of the caller.

Errors

On error, a nonzero (different from S_OK) return value must be returned.

See also

IVCLComObject.Invoke

The IDispatch:Invoke call for automation servers.


IVCLComObject.GetTypeInfo

The IDispatch:GetTypeInfo call for automation servers

Declaration

Source position: classesh.inc line 1735

function IVCLComObject.GetTypeInfo(

  Index: Integer;

  LocaleID: Integer;

  out TypeInfo

):HRESULT;

Description

GetTypeInfo must return the Index-th entry in the type information of the component in TypeInfo. The LocaleID argument can be used to indicate the locale of the caller, as different type information can be returned depending on the locale.

Errors

On error, a nonzero (different from S_OK) return value must be returned.

See also

IVCLComObject.GetTypeInfoCount

The IDispatch:GetTypeInfoCount call for automation servers


IVCLComObject.GetTypeInfoCount

The IDispatch:GetTypeInfoCount call for automation servers

Declaration

Source position: classesh.inc line 1734

function IVCLComObject.GetTypeInfoCount(

  out Count: Integer

):HRESULT;

Description

GetTypeInfoCount must return in Count either 0 or 1 to indicate that it provides type information (1) or not (0).

Errors

On error, a nonzero (different from S_OK) return value must be returned.

See also

IVCLComObject.GetTypeInfo

The IDispatch:GetTypeInfo call for automation servers


IVCLComObject.Invoke

The IDispatch:Invoke call for automation servers.

Declaration

Source position: classesh.inc line 1738

function IVCLComObject.Invoke(

  DispID: Integer;

  const IID: TGuid;

  LocaleID: Integer;

  Flags: Word;

  var Params;

  VarResult: Pointer;

  ExcepInfo: Pointer;

  ArgErr: Pointer

):HRESULT;

Description

Invoke must invoke the method designated by DispID. IID can be ignored. LocaleID is used by the caller to indicate the locale it is using. The Flags argument describes the context in which Invoke is called: a method, or property getter/setter. The Params argument contains the parameters to the call. The result should be in VarResult. On error, ExcepInfo and ArgError should be filled.

The function should return 0 (S_OK) if all went well.

See also

IVCLComObject.GetIDsOfNames

The IDispatch:GetIDsOfNames call for automation servers.


IVCLComObject.SafeCallException

This method can be invoked if an exception occurs during Invoke

Declaration

Source position: classesh.inc line 1740

function IVCLComObject.SafeCallException(

  ExceptObject: TObject;

  ExceptAddr: CodePointer

):HRESULT;

Description

SafeCallException is called to handle an exception during invocation of the Invoke method. The TObject implementation of this method returns E_UNEXPECTED.

See also

IVCLComObject.Invoke

The IDispatch:Invoke call for automation servers.


TAbstractObjectReader

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Abstract driver class to read stored component data.

Declaration

Source position: classesh.inc line 1122

type TAbstractObjectReader = class
public
function NextValue; virtual; abstract; | Returns the type of the next value in the stream.
function ReadValue; virtual; abstract; | Reads the type of the next value.
procedure BeginRootComponent; virtual; abstract; | Starts the reading of the root component.
procedure BeginComponent(); virtual; abstract; | Marks the reading of a new component.
function BeginProperty; virtual; abstract; | Marks the reading of a property value.
procedure Read(); virtual; abstract; | Read raw data from stream
procedure ReadBinary(); virtual; abstract; | Read binary data from the stream.
function ReadFloat; virtual; abstract; | Read a float value from the stream.
function ReadSingle; virtual; abstract; | Read a single (real-type) value from the stream.
function ReadDate; virtual; abstract; | Read a date value from the stream.
function ReadCurrency; virtual; abstract; | Read a currency value from the stream.
function ReadIdent(); virtual; abstract; | Read an identifier from the stream.
function ReadInt8; virtual; abstract; | Read an 8-bit integer from the stream.
function ReadInt16; virtual; abstract; | Read a 16-bit integer from the stream.
function ReadInt32; virtual; abstract; | Read a 32-bit integer from the stream.
function ReadInt64; virtual; abstract; | Read a 64-bit integer from the stream.
function ReadSet(); virtual; abstract; | Reads a set from the stream.
procedure ReadSignature; virtual; abstract; | Read resource signature
function ReadStr; virtual; abstract; | Read a shortstring from the stream
function ReadString(); virtual; abstract; | Read a string of type StringType from the stream.
function ReadWideString; virtual; abstract; | Read a widestring value from the stream.
function ReadUnicodeString; virtual; abstract; | Read a unicode string value
procedure SkipComponent(); virtual; abstract; | Skip till the end of the component.
procedure SkipValue; virtual; abstract; | Skip the current value.
end;

Inheritance

TAbstractObjectReader

Abstract driver class to read stored component data.
|

TObject

Description

The Free Pascal streaming mechanism, while compatible with Delphi's mechanism, differs from it in the sense that the streaming mechanism uses a driver class when streaming components. The TAbstractObjectReader class is the base driver class for reading property values from streams. It consists entirely of abstract methods, which must be implemented by descendant classes.

Different streaming mechanisms can be implemented by making a descendant from TAbstractObjectReader. The TBinaryObjectReader class is such a descendant class, which streams data in binary (Delphi compatible) format.

All methods described in this class, mustbe implemented by descendant classes.

See also

TBinaryObjectReader

Driver class descendant which reads component data stored in binary format.


TAbstractObjectReader


TAbstractObjectReader
 | NextValue
 | ReadValue
 | BeginRootComponent
 | BeginComponent
 | BeginProperty
 | Read
 | ReadBinary
 | ReadFloat
 | ReadSingle
 | ReadDate
 | ReadCurrency
 | ReadIdent
 | ReadInt8
 | ReadInt16
 | ReadInt32
 | ReadInt64
 | ReadSet
 | ReadSignature
 | ReadStr
 | ReadString
 | ReadWideString
 | ReadUnicodeString
 | SkipComponent
 | SkipValue


BeginComponent (TAbstractObjectReader)

BeginProperty (TAbstractObjectReader)

BeginRootComponent (TAbstractObjectReader)

NextValue (TAbstractObjectReader)

Read (TAbstractObjectReader)

ReadBinary (TAbstractObjectReader)

ReadCurrency (TAbstractObjectReader)

ReadDate (TAbstractObjectReader)

ReadFloat (TAbstractObjectReader)

ReadIdent (TAbstractObjectReader)

ReadInt16 (TAbstractObjectReader)

ReadInt32 (TAbstractObjectReader)

ReadInt64 (TAbstractObjectReader)

ReadInt8 (TAbstractObjectReader)

ReadSet (TAbstractObjectReader)

ReadSignature (TAbstractObjectReader)

ReadSingle (TAbstractObjectReader)

ReadStr (TAbstractObjectReader)

ReadString (TAbstractObjectReader)

ReadUnicodeString (TAbstractObjectReader)

ReadValue (TAbstractObjectReader)

ReadWideString (TAbstractObjectReader)

SkipComponent (TAbstractObjectReader)

SkipValue (TAbstractObjectReader)


TAbstractObjectReader.BeginComponent

Marks the reading of a new component.

Declaration

Source position: classesh.inc line 1127

public procedure TAbstractObjectReader.BeginComponent(

  var Flags: TFilerFlags;

  var AChildPos: Integer;

  var CompClassName: string;

  var CompName: string

); virtual; abstract;

Description

This method is called when the streaming process wants to start reading a new component.

Descendant classes should override this method to read the start of a component new component definition and return the needed arguments. Flags should be filled with any flags that were found at the component definition, as well as AChildPos. The CompClassName should be filled with the class name of the streamed component, and the CompName argument should be filled with the name of the component.

AChildPos is used to change the ordering in which components appear below their parent component when streaming descendant forms.

See also

TAbstractObjectReader.BeginRootComponent | Starts the reading of the root component.
TAbstractObjectReader.BeginProperty | Marks the reading of a property value.


TAbstractObjectReader.BeginProperty

Marks the reading of a property value.

Declaration

Source position: classesh.inc line 1129

public function TAbstractObjectReader.BeginProperty: string; virtual; abstract;

Description

BeginProperty is called by the streaming system when it wants to read a new property. The return value of the function is the name of the property which can be read from the stream.

See also

TAbstractObjectReader.BeginComponent

Marks the reading of a new component.


TAbstractObjectReader.BeginRootComponent

Starts the reading of the root component.

Declaration

Source position: classesh.inc line 1126

public procedure TAbstractObjectReader.BeginRootComponent; virtual; abstract;

Description

This function can be used to initialize the driver class for reading a component. It is called once at the beginning of the read process, and is immediately followed by a call to BeginComponent.

See also

TAbstractObjectReader.BeginComponent

Marks the reading of a new component.


TAbstractObjectReader.NextValue

Returns the type of the next value in the stream.

Declaration

Source position: classesh.inc line 1124

public function TAbstractObjectReader.NextValue: TValueType; virtual; abstract;

Description

This function should return the type of the next value in the stream, but should not read the actual value, i.e. the stream position should not be altered by this method. This is used to 'peek' in the stream what value is next.

See also

TAbstractObjectReader.ReadValue

Reads the type of the next value.


TAbstractObjectReader.Read

Read raw data from stream

Declaration

Source position: classesh.inc line 1132

public procedure TAbstractObjectReader.Read(

  var Buf;

  Count: LongInt

); virtual; abstract;

Description

Read is introduced for Delphi compatibility to read raw data from the component stream. This should not be used in production code as it will totally mess up the streaming.

See also

TBinaryObjectReader.Read | Read raw data from stream
TReader.Read | Read raw data from stream


TAbstractObjectReader.ReadBinary

Read binary data from the stream.

Declaration

Source position: classesh.inc line 1134

public procedure TAbstractObjectReader.ReadBinary(

  const DestData: TMemoryStream

); virtual; abstract;

Description

ReadBinary is called when binary data should be read from the stream (i.e. after ReadValue returned a valuetype of vaBinary). The data should be stored in the DestData memory stream by descendant classes.

See also

TAbstractObjectReader.ReadFloat | Read a float value from the stream.
TAbstractObjectReader.ReadDate | Read a date value from the stream.
TAbstractObjectReader.ReadSingle | Read a single (real-type) value from the stream.
TAbstractObjectReader.ReadIdent | Read an identifier from the stream.
TAbstractObjectReader.ReadInt8 | Read an 8-bit integer from the stream.
TAbstractObjectReader.ReadInt16 | Read a 16-bit integer from the stream.
TAbstractObjectReader.ReadInt32 | Read a 32-bit integer from the stream.
TAbstractObjectReader.ReadInt64 | Read a 64-bit integer from the stream.
TabstractObjectReader.ReadSet | Reads a set from the stream.
TabstractObjectReader.ReadStr | Read a shortstring from the stream
TabstractObjectReader.ReadString | Read a string of type StringType from the stream.


TAbstractObjectReader.ReadCurrency

Read a currency value from the stream.

Declaration

Source position: classesh.inc line 1140

public function TAbstractObjectReader.ReadCurrency: Currency; virtual; abstract;

Description

ReadCurrency is called when a currency-typed value should be read from the stream. This abstract method should be overidden by descendant classes, and should return the currency value read from the stream.

See also

TAbstractObjectWriter.WriteCurrency

Write a currency value to the stream


TAbstractObjectReader.ReadDate

Read a date value from the stream.

Declaration

Source position: classesh.inc line 1138

public function TAbstractObjectReader.ReadDate: TDateTime; virtual; abstract;

Description

ReadDate is called by the streaming system when it wants to read a date/time value from the stream (i.e. after ReadValue returned a valuetype of vaDate). The return value should be the date/time value. (This value can be stored as a float, since TDateTime is nothing but a float.)

See also

TAbstractObjectReader.ReadFloat | Read a float value from the stream.
TAbstractObjectReader.ReadSingle | Read a single (real-type) value from the stream.
TAbstractObjectReader.ReadIdent | Read an identifier from the stream.
TAbstractObjectReader.ReadInt8 | Read an 8-bit integer from the stream.
TAbstractObjectReader.ReadInt16 | Read a 16-bit integer from the stream.
TAbstractObjectReader.ReadInt32 | Read a 32-bit integer from the stream.
TAbstractObjectReader.ReadInt64 | Read a 64-bit integer from the stream.
TabstractObjectReader.ReadSet | Reads a set from the stream.
TabstractObjectReader.ReadStr | Read a shortstring from the stream
TabstractObjectReader.ReadString | Read a string of type StringType from the stream.


TAbstractObjectReader.ReadFloat

Read a float value from the stream.

Declaration

Source position: classesh.inc line 1136

public function TAbstractObjectReader.ReadFloat: Extended; virtual; abstract;

Description

ReadFloat is called by the streaming system when it wants to read a float from the stream (i.e. after ReadValue returned a valuetype of vaExtended). The return value should be the value of the float.

See also

TAbstractObjectReader.ReadFloat | Read a float value from the stream.
TAbstractObjectReader.ReadDate | Read a date value from the stream.
TAbstractObjectReader.ReadSingle | Read a single (real-type) value from the stream.
TAbstractObjectReader.ReadIdent | Read an identifier from the stream.
TAbstractObjectReader.ReadInt8 | Read an 8-bit integer from the stream.
TAbstractObjectReader.ReadInt16 | Read a 16-bit integer from the stream.
TAbstractObjectReader.ReadInt32 | Read a 32-bit integer from the stream.
TAbstractObjectReader.ReadInt64 | Read a 64-bit integer from the stream.
TabstractObjectReader.ReadSet | Reads a set from the stream.
TabstractObjectReader.ReadStr | Read a shortstring from the stream
TabstractObjectReader.ReadString | Read a string of type StringType from the stream.


TAbstractObjectReader.ReadIdent

Read an identifier from the stream.

Declaration

Source position: classesh.inc line 1141

public function TAbstractObjectReader.ReadIdent(

  ValueType: TValueType

):string; virtual; abstract;

Description

ReadIdent is called by the streaming system if it expects to read an identifier of type ValueType from the stream after a call to ReadValue returned vaIdent. The identifier should be returned as a string. Note that in some cases the identifier does not actually have to be in the stream. The following table indicates which identifiers must actually be read:

ValueType | Expected value
vaIdent | Read from stream.
vaNil | 'Nil'. This does not have to be read from the stream.
vaFalse | 'False'. This does not have to be read from the stream.
vaTrue | 'True'. This does not have to be read from the stream.
vaNull | 'Null'. This does not have to be read from the stream.

See also

TAbstractObjectReader.ReadFloat | Read a float value from the stream.
TAbstractObjectReader.ReadDate | Read a date value from the stream.
TAbstractObjectReader.ReadSingle | Read a single (real-type) value from the stream.
TAbstractObjectReader.ReadInt8 | Read an 8-bit integer from the stream.
TAbstractObjectReader.ReadInt16 | Read a 16-bit integer from the stream.
TAbstractObjectReader.ReadInt32 | Read a 32-bit integer from the stream.
TAbstractObjectReader.ReadInt64 | Read a 64-bit integer from the stream.
TabstractObjectReader.ReadSet | Reads a set from the stream.
TabstractObjectReader.ReadStr | Read a shortstring from the stream
TabstractObjectReader.ReadString | Read a string of type StringType from the stream.


TAbstractObjectReader.ReadInt8

Read an 8-bit integer from the stream.

Declaration

Source position: classesh.inc line 1142

public function TAbstractObjectReader.ReadInt8: ShortInt; virtual; abstract;

Description

ReadInt8 is called by the streaming process if it expects to read an integer value with a size of 8 bits (1 byte) from the stream (i.e. after ReadValue returned a valuetype of vaInt8). The return value is the value if the integer. Note that the size of the value in the stream does not actually have to be 1 byte.

See also

TAbstractObjectReader.ReadFloat | Read a float value from the stream.
TAbstractObjectReader.ReadDate | Read a date value from the stream.
TAbstractObjectReader.ReadSingle | Read a single (real-type) value from the stream.
TAbstractObjectReader.ReadIdent | Read an identifier from the stream.
TAbstractObjectReader.ReadInt16 | Read a 16-bit integer from the stream.
TAbstractObjectReader.ReadInt32 | Read a 32-bit integer from the stream.
TAbstractObjectReader.ReadInt64 | Read a 64-bit integer from the stream.
TabstractObjectReader.ReadSet | Reads a set from the stream.
TabstractObjectReader.ReadStr | Read a shortstring from the stream
TabstractObjectReader.ReadString | Read a string of type StringType from the stream.


TAbstractObjectReader.ReadInt16

Read a 16-bit integer from the stream.

Declaration

Source position: classesh.inc line 1143

public function TAbstractObjectReader.ReadInt16: SmallInt; virtual; abstract;

Description

ReadInt16 is called by the streaming process if it expects to read an integer value with a size of 16 bits (2 bytes) from the stream (i.e. after ReadValue returned a valuetype of vaInt16). The return value is the value if the integer. Note that the size of the value in the stream does not actually have to be 2 bytes.

See also

TAbstractObjectReader.ReadFloat | Read a float value from the stream.
TAbstractObjectReader.ReadDate | Read a date value from the stream.
TAbstractObjectReader.ReadSingle | Read a single (real-type) value from the stream.
TAbstractObjectReader.ReadIdent | Read an identifier from the stream.
TAbstractObjectReader.ReadInt8 | Read an 8-bit integer from the stream.
TAbstractObjectReader.ReadInt32 | Read a 32-bit integer from the stream.
TAbstractObjectReader.ReadInt64 | Read a 64-bit integer from the stream.
TabstractObjectReader.ReadSet | Reads a set from the stream.
TabstractObjectReader.ReadStr | Read a shortstring from the stream
TabstractObjectReader.ReadString | Read a string of type StringType from the stream.


TAbstractObjectReader.ReadInt32

Read a 32-bit integer from the stream.

Declaration

Source position: classesh.inc line 1144

public function TAbstractObjectReader.ReadInt32: LongInt; virtual; abstract;

Description

ReadInt32 is called by the streaming process if it expects to read an integer value with a size of 32 bits (4 bytes) from the stream (i.e. after ReadValue returned a valuetype of vaInt32). The return value is the value of the integer. Note that the size of the value in the stream does not actually have to be 4 bytes.

See also

TAbstractObjectReader.ReadFloat | Read a float value from the stream.
TAbstractObjectReader.ReadDate | Read a date value from the stream.
TAbstractObjectReader.ReadSingle | Read a single (real-type) value from the stream.
TAbstractObjectReader.ReadIdent | Read an identifier from the stream.
TAbstractObjectReader.ReadInt8 | Read an 8-bit integer from the stream.
TAbstractObjectReader.ReadInt16 | Read a 16-bit integer from the stream.
TAbstractObjectReader.ReadInt64 | Read a 64-bit integer from the stream.
TabstractObjectReader.ReadSet | Reads a set from the stream.
TabstractObjectReader.ReadStr | Read a shortstring from the stream
TabstractObjectReader.ReadString | Read a string of type StringType from the stream.


TAbstractObjectReader.ReadInt64

Read a 64-bit integer from the stream.

Declaration

Source position: classesh.inc line 1145

public function TAbstractObjectReader.ReadInt64: Int64; virtual; abstract;

Description

ReadInt64 is called by the streaming process if it expects to read an int64 value with a size of 64 bits (8 bytes) from the stream (i.e. after ReadValue returned a valuetype of vaInt64). The return value is the value if the integer. Note that the size of the value in the stream does not actually have to be 8 bytes.

See also

TAbstractObjectReader.ReadFloat | Read a float value from the stream.
TAbstractObjectReader.ReadDate | Read a date value from the stream.
TAbstractObjectReader.ReadSingle | Read a single (real-type) value from the stream.
TAbstractObjectReader.ReadIdent | Read an identifier from the stream.
TAbstractObjectReader.ReadInt8 | Read an 8-bit integer from the stream.
TAbstractObjectReader.ReadInt16 | Read a 16-bit integer from the stream.
TAbstractObjectReader.ReadInt32 | Read a 32-bit integer from the stream.
TabstractObjectReader.ReadSet | Reads a set from the stream.
TabstractObjectReader.ReadStr | Read a shortstring from the stream
TabstractObjectReader.ReadString | Read a string of type StringType from the stream.


TAbstractObjectReader.ReadSet

Reads a set from the stream.

Declaration

Source position: classesh.inc line 1146

public function TAbstractObjectReader.ReadSet(

  EnumType: Pointer

):Integer; virtual; abstract;

Description

This method is called by the streaming system if it expects to read a set from the stream (i.e. after ReadValue returned a valuetype of vaSet). The return value is the contents of the set, encoded in a bitmask the following way:

For each (enumerated) value in the set, the bit corresponding to the ordinal value of the enumerated value should be set. i.e. as 1 shl ord(value).

See also

TAbstractObjectReader.ReadFloat | Read a float value from the stream.
TAbstractObjectReader.ReadDate | Read a date value from the stream.
TAbstractObjectReader.ReadSingle | Read a single (real-type) value from the stream.
TAbstractObjectReader.ReadIdent | Read an identifier from the stream.
TAbstractObjectReader.ReadInt8 | Read an 8-bit integer from the stream.
TAbstractObjectReader.ReadInt16 | Read a 16-bit integer from the stream.
TAbstractObjectReader.ReadInt32 | Read a 32-bit integer from the stream.
TAbstractObjectReader.ReadInt64 | Read a 64-bit integer from the stream.
TabstractObjectReader.ReadStr | Read a shortstring from the stream
TabstractObjectReader.ReadString | Read a string of type StringType from the stream.


TAbstractObjectReader.ReadSignature

Read resource signature

Declaration

Source position: classesh.inc line 1147

public procedure TAbstractObjectReader.ReadSignature; virtual; abstract;

Description

ReadSignature reads the streaming signature from a stream. This method does nothing. It must be implemented by descendents that have a signature header in the stream. (such as binary streams)

See also

TAbstractObjectWriter.WriteSignature | Write stream signature to the stream
TBinaryObjectReader.ReadSignature | Reads the filer signature


TAbstractObjectReader.ReadSingle

Read a single (real-type) value from the stream.

Declaration

Source position: classesh.inc line 1137

public function TAbstractObjectReader.ReadSingle: Single; virtual; abstract;

Description

ReadSingle is called by the streaming system when it wants to read a single-type float from the stream (i.e. after ReadValue returned a valuetype of vaSingle). The return value should be the value of the float.

See also

TAbstractObjectReader.ReadFloat | Read a float value from the stream.
TAbstractObjectReader.ReadDate | Read a date value from the stream.
TAbstractObjectReader.ReadSingle | Read a single (real-type) value from the stream.
TAbstractObjectReader.ReadIdent | Read an identifier from the stream.
TAbstractObjectReader.ReadInt8 | Read an 8-bit integer from the stream.
TAbstractObjectReader.ReadInt16 | Read a 16-bit integer from the stream.
TAbstractObjectReader.ReadInt32 | Read a 32-bit integer from the stream.
TAbstractObjectReader.ReadInt64 | Read a 64-bit integer from the stream.
TabstractObjectReader.ReadSet | Reads a set from the stream.
TabstractObjectReader.ReadStr | Read a shortstring from the stream
TabstractObjectReader.ReadString | Read a string of type StringType from the stream.


TAbstractObjectReader.ReadStr

Read a shortstring from the stream

Declaration

Source position: classesh.inc line 1148

public function TAbstractObjectReader.ReadStr: string; virtual; abstract;

Description

ReadStr is called by the streaming system if it expects to read a string from the stream (i.e. after ReadValue returned a valuetype of vaLString,vaWstring or vaString). The return value is the string.

See also

TAbstractObjectReader.ReadFloat | Read a float value from the stream.
TAbstractObjectReader.ReadDate | Read a date value from the stream.
TAbstractObjectReader.ReadSingle | Read a single (real-type) value from the stream.
TAbstractObjectReader.ReadIdent | Read an identifier from the stream.
TAbstractObjectReader.ReadInt8 | Read an 8-bit integer from the stream.
TAbstractObjectReader.ReadInt16 | Read a 16-bit integer from the stream.
TAbstractObjectReader.ReadInt32 | Read a 32-bit integer from the stream.
TAbstractObjectReader.ReadInt64 | Read a 64-bit integer from the stream.
TabstractObjectReader.ReadSet | Reads a set from the stream.
TabstractObjectReader.ReadString | Read a string of type StringType from the stream.


TAbstractObjectReader.ReadString

Read a string of type StringType from the stream.

Declaration

Source position: classesh.inc line 1149

public function TAbstractObjectReader.ReadString(

  StringType: TValueType

):string; virtual; abstract;

Description

ReadStr is called by the streaming system if it expects to read a string from the stream (i.e. after ReadValue returned a valuetype of vaLString,vaWstring or vaString). The return value is the string.

See also

TAbstractObjectReader.ReadFloat | Read a float value from the stream.
TAbstractObjectReader.ReadDate | Read a date value from the stream.
TAbstractObjectReader.ReadSingle | Read a single (real-type) value from the stream.
TAbstractObjectReader.ReadIdent | Read an identifier from the stream.
TAbstractObjectReader.ReadInt8 | Read an 8-bit integer from the stream.
TAbstractObjectReader.ReadInt16 | Read a 16-bit integer from the stream.
TAbstractObjectReader.ReadInt32 | Read a 32-bit integer from the stream.
TAbstractObjectReader.ReadInt64 | Read a 64-bit integer from the stream.
TabstractObjectReader.ReadSet | Reads a set from the stream.
TabstractObjectReader.ReadStr | Read a shortstring from the stream


TAbstractObjectReader.ReadUnicodeString

Read a unicode string value

Declaration

Source position: classesh.inc line 1151

public function TAbstractObjectReader.ReadUnicodeString: UnicodeString; virtual; abstract;

Description

ReadUnicodeString should read a UnicodeString value from the stream. (indicated by the vaUString value type).

Descendant classes should override this method to actually read a UnicodeString value.

See also

TBinaryObjectWriter.WriteUnicodeString | Write a unicode string to the stream.
TAbstractObjectReader.ReadWideString | Read a widestring value from the stream.


TAbstractObjectReader.ReadValue

Reads the type of the next value.

Declaration

Source position: classesh.inc line 1125

public function TAbstractObjectReader.ReadValue: TValueType; virtual; abstract;

Description

This function returns the type of the next value in the stream and reads it. i.e. after the call to this method, the stream is positioned to read the value of the type returned by this function.

See also

TAbstractObjectReader.ReadValue

Reads the type of the next value.


TAbstractObjectReader.ReadWideString

Read a widestring value from the stream.

Declaration

Source position: classesh.inc line 1150

public function TAbstractObjectReader.ReadWideString: WideString; virtual; abstract;

Description

ReadWideString is called when a widestring-typed value should be read from the stream. This abstract method should be overidden by descendant classes.

See also

TAbstractObjectWriter.WriteWideString

Write a widestring value to the stream


TAbstractObjectReader.SkipComponent

Skip till the end of the component.

Declaration

Source position: classesh.inc line 1152

public procedure TAbstractObjectReader.SkipComponent(

  SkipComponentInfos: Boolean

); virtual; abstract;

Description

This method is used to skip the entire declaration of a component in the stream. Each descendant of TAbstractObjectReader should implement this in a way which is optimal for the implemented stream format.

See also

TAbstractObjectReader.BeginComponent | Marks the reading of a new component.
TAbstractObjectReader.SkipValue | Skip the current value.


TAbstractObjectReader.SkipValue

Skip the current value.

Declaration

Source position: classesh.inc line 1153

public procedure TAbstractObjectReader.SkipValue; virtual; abstract;

Description

SkipValue should be used when skipping a value in the stream; The method should determine the type of the value which should be skipped by itself, if this is necessary.

See also

TAbstractObjectReader.SkipComponent

Skip till the end of the component.


TAbstractObjectWriter

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Abstract driver class for writing component data.

Declaration

Source position: classesh.inc line 1333

type TAbstractObjectWriter = class
public
procedure BeginCollection; virtual; abstract; | Start writing a collection.
procedure BeginComponent(); virtual; abstract; | Start writing a component
procedure WriteSignature; virtual; abstract; | Write stream signature to the stream
procedure BeginList; virtual; abstract; | Start writing a list.
procedure EndList; virtual; abstract; | Mark the end of a list.
procedure BeginProperty(); virtual; abstract; | Start writing a property
procedure EndProperty; virtual; abstract; | Marks the end of writing of a property.
procedure Write(); virtual; abstract; | Write raw data to stream
procedure WriteBinary(); virtual; abstract; | Writes binary data to the stream.
procedure WriteBoolean(); virtual; abstract; | Writes a boolean value to the stream.
procedure WriteFloat(); virtual; abstract; | Writes a float value to the stream.
procedure WriteSingle(); virtual; abstract; | Writes a single-type real value to the stream.
procedure WriteDate(); virtual; abstract; | Writes a date type to the stream.
procedure WriteCurrency(); virtual; abstract; | Write a currency value to the stream
procedure WriteIdent(); virtual; abstract; | Writes an identifier to the stream.
procedure WriteInteger(); virtual; abstract; | Writes an integer value to the stream
procedure WriteUInt64(); virtual; abstract; | Write an unsigned 64-bit integer
procedure WriteVariant(); virtual; abstract; | Write a variant to the stream
procedure WriteMethodName(); virtual; abstract; | Writes a methodname to the stream.
procedure WriteSet(); virtual; abstract; | Writes a set value to the stream.
procedure WriteString(); virtual; abstract; | Writes a string value to the stream.
procedure WriteWideString(); virtual; abstract; | Write a widestring value to the stream
procedure WriteUnicodeString(); virtual; abstract; | Write a unicode string to the stream.
end;

Inheritance

TAbstractObjectWriter

Abstract driver class for writing component data.
|

TObject


TAbstractObjectWriter


TAbstractObjectWriter
 | BeginCollection
 | BeginComponent
 | WriteSignature
 | BeginList
 | EndList
 | BeginProperty
 | EndProperty
 | Write
 | WriteBinary
 | WriteBoolean
 | WriteFloat
 | WriteSingle
 | WriteDate
 | WriteCurrency
 | WriteIdent
 | WriteInteger
 | WriteUInt64
 | WriteVariant
 | WriteMethodName
 | WriteSet
 | WriteString
 | WriteWideString
 | WriteUnicodeString


BeginCollection (TAbstractObjectWriter)

BeginComponent (TAbstractObjectWriter)

BeginList (TAbstractObjectWriter)

BeginProperty (TAbstractObjectWriter)

EndList (TAbstractObjectWriter)

EndProperty (TAbstractObjectWriter)

Write (TAbstractObjectWriter)

WriteBinary (TAbstractObjectWriter)

WriteBoolean (TAbstractObjectWriter)

WriteCurrency (TAbstractObjectWriter)

WriteDate (TAbstractObjectWriter)

WriteFloat (TAbstractObjectWriter)

WriteIdent (TAbstractObjectWriter)

WriteInteger (TAbstractObjectWriter)

WriteMethodName (TAbstractObjectWriter)

WriteSet (TAbstractObjectWriter)

WriteSignature (TAbstractObjectWriter)

WriteSingle (TAbstractObjectWriter)

WriteString (TAbstractObjectWriter)

WriteUInt64 (TAbstractObjectWriter)

WriteUnicodeString (TAbstractObjectWriter)

WriteVariant (TAbstractObjectWriter)

WriteWideString (TAbstractObjectWriter)


TAbstractObjectWriter.BeginCollection

Start writing a collection.

Declaration

Source position: classesh.inc line 1339

public procedure TAbstractObjectWriter.BeginCollection; virtual; abstract;


TAbstractObjectWriter.BeginComponent

Start writing a component

Declaration

Source position: classesh.inc line 1340

public procedure TAbstractObjectWriter.BeginComponent(

  Component: TComponent;

  Flags: TFilerFlags;

  ChildPos: Integer

); virtual; abstract;


TAbstractObjectWriter.BeginList

Start writing a list.

Declaration

Source position: classesh.inc line 1343

public procedure TAbstractObjectWriter.BeginList; virtual; abstract;


TAbstractObjectWriter.BeginProperty

Start writing a property

Declaration

Source position: classesh.inc line 1345

public procedure TAbstractObjectWriter.BeginProperty(

  const PropName: string

); virtual; abstract;


TAbstractObjectWriter.EndList

Mark the end of a list.

Declaration

Source position: classesh.inc line 1344

public procedure TAbstractObjectWriter.EndList; virtual; abstract;


TAbstractObjectWriter.EndProperty

Marks the end of writing of a property.

Declaration

Source position: classesh.inc line 1346

public procedure TAbstractObjectWriter.EndProperty; virtual; abstract;


TAbstractObjectWriter.Write

Write raw data to stream

Declaration

Source position: classesh.inc line 1348

public procedure TAbstractObjectWriter.Write(

  const Buffer;

  Count: LongInt

); virtual; abstract;

Description

Write is introduced for Delphi compatibility to write raw data to the component stream. This should not be used in new production code as it will totally mess up the streaming.

See also

TBinaryObjectWriter.Write | Write raw data to stream
TWriter.Write | Write raw data to stream


TAbstractObjectWriter.WriteBinary

Writes binary data to the stream.

Declaration

Source position: classesh.inc line 1350

public procedure TAbstractObjectWriter.WriteBinary(

  const Buffer;

  Count: LongInt

); virtual; abstract;


TAbstractObjectWriter.WriteBoolean

Writes a boolean value to the stream.

Declaration

Source position: classesh.inc line 1351

public procedure TAbstractObjectWriter.WriteBoolean(

  Value: Boolean

); virtual; abstract;


TAbstractObjectWriter.WriteCurrency

Write a currency value to the stream

Declaration

Source position: classesh.inc line 1358

public procedure TAbstractObjectWriter.WriteCurrency(

  const Value: Currency

); virtual; abstract;

Description

WriteCurrency is called when a currency-typed value should be written to the stream. This abstract method should be overidden by descendant classes.

See also

TAbstractObjectReader.ReadCurrency

Read a currency value from the stream.


TAbstractObjectWriter.WriteDate

Writes a date type to the stream.

Declaration

Source position: classesh.inc line 1356

public procedure TAbstractObjectWriter.WriteDate(

  const Value: TDateTime

); virtual; abstract;


TAbstractObjectWriter.WriteFloat

Writes a float value to the stream.

Declaration

Source position: classesh.inc line 1354

public procedure TAbstractObjectWriter.WriteFloat(

  const Value: Extended

); virtual; abstract;


TAbstractObjectWriter.WriteIdent

Writes an identifier to the stream.

Declaration

Source position: classesh.inc line 1359

public procedure TAbstractObjectWriter.WriteIdent(

  const Ident: string

); virtual; abstract;


TAbstractObjectWriter.WriteInteger

Writes an integer value to the stream

Declaration

Source position: classesh.inc line 1360

public procedure TAbstractObjectWriter.WriteInteger(

  Value: Int64

); virtual; abstract;


TAbstractObjectWriter.WriteMethodName

Writes a methodname to the stream.

Declaration

Source position: classesh.inc line 1363

public procedure TAbstractObjectWriter.WriteMethodName(

  const Name: string

); virtual; abstract;


TAbstractObjectWriter.WriteSet

Writes a set value to the stream.

Declaration

Source position: classesh.inc line 1364

public procedure TAbstractObjectWriter.WriteSet(

  Value: LongInt;

  SetType: Pointer

); virtual; abstract;


TAbstractObjectWriter.WriteSignature

Write stream signature to the stream

Declaration

Source position: classesh.inc line 1342

public procedure TAbstractObjectWriter.WriteSignature; virtual; abstract;

Description

WriteSignature writes the streaming signature to a stream. This method does nothing, it must be implemented by descendents that have a signature header in the stream. (such as binary streams)

See also

TAbstractObjectReader.ReadSignature | Read resource signature
TBinaryObjectWriter.WriteSignature | Write stream signature to the stream


TAbstractObjectWriter.WriteSingle

Writes a single-type real value to the stream.

Declaration

Source position: classesh.inc line 1355

public procedure TAbstractObjectWriter.WriteSingle(

  const Value: Single

); virtual; abstract;


TAbstractObjectWriter.WriteString

Writes a string value to the stream.

Declaration

Source position: classesh.inc line 1365

public procedure TAbstractObjectWriter.WriteString(

  const Value: string

); virtual; abstract;


TAbstractObjectWriter.WriteUInt64

Write an unsigned 64-bit integer

Declaration

Source position: classesh.inc line 1361

public procedure TAbstractObjectWriter.WriteUInt64(

  Value: QWord

); virtual; abstract;

Description

WriteUInt64 must be overridden by descendant classes to write a 64-bit unsigned Value (valuetype vaQWord) to the stream.

Errors

None.

See also

TBinaryObjectWriter.WriteUInt64

Write an unsigned 64-bit integer


TAbstractObjectWriter.WriteUnicodeString

Write a unicode string to the stream.

Declaration

Source position: classesh.inc line 1367

public procedure TAbstractObjectWriter.WriteUnicodeString(

  const Value: UnicodeString

); virtual; abstract;

Description

WriteUnicodeString must be overridden by descendant classes to write a unicodestring (valuetype vaUString) value to the stream.

See also

TBinaryObjectWriter.WriteUnicodeString

Write a unicode string to the stream.


TAbstractObjectWriter.WriteVariant

Write a variant to the stream

Declaration

Source position: classesh.inc line 1362

public procedure TAbstractObjectWriter.WriteVariant(

  const Value: Variant

); virtual; abstract;

Description

WriteVariant must be overridden by descendant classes to write a simple variant type to the stream. WriteVariant does not write arrays types or complex types.

See also

TBinaryObjectWriter.WriteVariant

Write a variant to the stream


TAbstractObjectWriter.WriteWideString

Write a widestring value to the stream

Declaration

Source position: classesh.inc line 1366

public procedure TAbstractObjectWriter.WriteWideString(

  const Value: WideString

); virtual; abstract;

Description

WriteCurrency is called when a currency-typed value should be written to the stream. This abstract method should be overidden by descendant classes.

See also

TAbstractObjectReader.ReadWideString

Read a widestring value from the stream.


TBasicAction

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Abstract base class for all Actions.

Declaration

Source position: classesh.inc line 1901

type TBasicAction = class(TComponent)
public
constructor Create(); override; | Creates a new instance of a TBasicAction class.
destructor Destroy; override; | Destroys the action.
function HandlesTarget(); virtual; | Determines whether Target can be handled by this action
procedure UpdateTarget(); virtual; | Notify client controls when the action updates itself.
procedure ExecuteTarget(); virtual; | Executes the action on the Target object
function Execute; dynamic; | Triggers the OnExecute event
procedure RegisterChanges(); | Registers a new client with the action.
procedure UnRegisterChanges(); | Unregisters a client from the list of clients
function Update; virtual; | Triggers the OnUpdate event
property ActionComponent: TComponent; [rw] | Returns the component that initiated the action.
property OnExecute: TNotifyEvent; [rw] | Event triggered when the action executes.
property OnUpdate: TNotifyEvent; [rw] | Event trigged when the application is idle.
end;

Inheritance

TBasicAction | Abstract base class for all Actions.
|
TComponent,IUnknown,IInterfaceComponentReference | Base class for all components that need owner-owned functionality.
|
TPersistent,IFPObserved | Base class for streaming system and persistent properties.
|
TObject | Base class of all classes.

Description

TBasicAction implements a basic action class from which all actions are derived. It introduces all basic methods of an action, and implements functionality to maintain a list of clients, i.e. components that are connected with this action.

Do not create instances of TBasicAction. Instead, create a descendant class and create an instance of this class instead.

See also

TBasicActionLink | Link between actions and action clients (e.g. controls)
TComponent | Base class for all components that need owner-owned functionality.


TBasicAction
 |  | ActionComponent
TComponent
 | ro | ComObject
 | ro | Components
 | ro | ComponentCount
 |  | ComponentIndex
 | ro | ComponentState
 | ro | ComponentStyle
 |  | DesignInfo
 | ro | Owner
 |  | VCLComObject
pl |  | Name
pl |  | Tag
TPersistent
TObject


 | ro | ComObject (TComponent)
 | ro | ComponentCount (TComponent)
 |  | ComponentIndex (TComponent)
 | ro | Components (TComponent)
 | ro | ComponentState (TComponent)
 | ro | ComponentStyle (TComponent)
 |  | DesignInfo (TComponent)
pl |  | Name (TComponent)
 | ro | Owner (TComponent)
pl |  |


TBasicAction
 | Create
 | Destroy
 | HandlesTarget
 | UpdateTarget
 | ExecuteTarget
 | Execute
 | RegisterChanges
 | UnRegisterChanges
 | Update
TComponent
pt | Notification
 | WriteState
 | Create
 | Destroy
 | BeforeDestruction
 | DestroyComponents
 | Destroying
 | ExecuteAction
 | FindComponent
 | FreeNotification
 | RemoveFreeNotification
 | FreeOnRelease
 | GetEnumerator
 | GetNamePath
 | GetParentComponent
 | HasParent
 | InsertComponent
 | RemoveComponent
 | SafeCallException
 | SetSubComponent
 | UpdateAction
 | IsImplementorOf
 | ReferenceInterface
TPersistent
 | Destroy
 | Assign
 | FPOAttachObserver
 | FPODetachObserver
 | FPONotifyObservers
 | GetNamePath
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


 | AfterConstruction (TObject)
 | Assign (TPersistent)
 | BeforeDestruction (TObject)
 | BeforeDestruction (TComponent)
 | ClassInfo (TObject)
 | ClassName (TObject)
 | ClassNameIs (TObject)
 | ClassParent (TObject)
 | ClassType (TObject)
 | CleanupInstance (TObject)
 | Create (TObject)
 | Create (TComponent)
 | Create (TBasicAction)
 | DefaultHandler (TObject)
 | DefaultHandlerStr (TObject)
 | Destroy (TObject)
 | Destroy (TPersistent)
 | Destroy (TComponent)
 | Destroy (TBasicAction)
 | DestroyComponents (TComponent)
 | Destroying (TComponent)
 | Dispatch (TObject)
 | DispatchStr (TObject)
 | Equals (TObject)
 | Execute (TBasicAction)
 | ExecuteAction (TComponent)
 | ExecuteTarget (TBasicAction)
 | FieldAddress (TObject)
 | FindComponent (TComponent)
 | FPOAttachObserver (TPersistent)
 | FPODetachObserver (TPersistent)
 | FPONotifyObservers (TPersistent)
 | Free (TObject)
 | FreeInstance (TObject)
 | FreeNotification (TComponent)
 | FreeOnRelease (TComponent)
 | GetEnumerator (TComponent)
 | GetHashCode (TObject)
 | GetInterface (TObject)
 | GetInterfaceByStr (TObject)
 | GetInterfaceEntry (TObject)
 | GetInterfaceEntryByStr (TObject)
 | GetInterfaceTable (TObject)
 | GetInterfaceWeak (TObject)
 | GetNamePath (TPersistent)
 | GetNamePath (TComponent)
 | GetParentComponent (TComponent)
 | HandlesTarget (TBasicAction)
 | HasParent (TComponent)
 | InheritsFrom (TObject)
 | InitInstance (TObject)
 | InsertComponent (TComponent)
 | InstanceSize (TObject)
 | IsImplementorOf (TComponent)
 | MethodAddress (TObject)
 | MethodName (TObject)
 | newinstance (TObject)
pt | Notification (TComponent)
 | ReferenceInterface (TComponent)
 | RegisterChanges (TBasicAction)
 | RemoveComponent (TComponent)
 | RemoveFreeNotification (TComponent)
 | SafeCallException (TObject)
 | SafeCallException (TComponent)
 | SetSubComponent (TComponent)
 | StringMessageTable (TObject)
 | ToString (TObject)
 | UnitName (TObject)
 | UnRegisterChanges (TBasicAction)
 | Update (TBasicAction)
 | UpdateAction (TComponent)
 | UpdateTarget (TBasicAction)
 | WriteState (TComponent)


TBasicAction
 | OnExecute
 | OnUpdate
TComponent
TPersistent
TObject


OnExecute (TBasicAction)

OnUpdate (TBasicAction)


TBasicAction.ActionComponent

Returns the component that initiated the action.

Declaration

Source position: classesh.inc line 1922

public property TBasicAction.ActionComponent : TComponent
  read FActionComponent
  write FActionComponent;

Description

ActionComponent is set to the component that caused the action to execute, e.g. a toolbutton or a menu item. The property is set just before the action executes, and is reset to nil after the action was executed.

See also

Execute | Triggers the OnExecute event
OnExecute | Event triggered when the action executes.


TBasicAction.Create

Creates a new instance of a TBasicAction class.

Declaration

Source position: classesh.inc line 1913

public constructor TBasicAction.Create(

  AOwner: TComponent

); override;

Description

Create calls the inherited constructor, and then initializes the list of clients controls (or action lists).

Under normal circumstances it should not be necessary to create a TBasicAction descendant manually, actions are created in an IDE.

See also

Destroy

Destroys the action.

AssignClient


TBasicAction.Destroy

Destroys the action.

Declaration

Source position: classesh.inc line 1914

public destructor TBasicAction.Destroy; override;

Description

Destroy cleans up the list of client controls and then calls the inherited destructor.

An application programmer should not call Destroy directly; Instead Free should be called, if it needs to be called at all. Normally the controlling class (e.g. a TActionList) will destroy the action.


TBasicAction.Execute

Triggers the OnExecute event

Declaration

Source position: classesh.inc line 1918

public function TBasicAction.Execute: Boolean; dynamic;

Description

Execute triggers the OnExecute event, if one is assigned. It returns True if the event handler was called, False otherwise.


TBasicAction.ExecuteTarget

Executes the action on the Target object

Declaration

Source position: classesh.inc line 1917

public procedure TBasicAction.ExecuteTarget(

  Target: TObject

); virtual;

Description

ExecuteTarget performs the action on the Target object. In TBasicAction this method does nothing. Descendant classes should implement the action to be performed. For instance an action to post data in a dataset could call the Post method of the dataset.

An application programmer should never call ExecuteTarget directly.

See also

HandlesTarget | Determines whether Target can be handled by this action
UpdateTarget | Executes the action on the Target object
Execute | Triggers the OnExecute event


TBasicAction.HandlesTarget

Determines whether Target can be handled by this action

Declaration

Source position: classesh.inc line 1915

public function TBasicAction.HandlesTarget(

  Target: TObject

):Boolean; virtual;

Description

HandlesTarget returns True if Target is a valid client for this action and if so, if it is in a suitable state to execute the action. An application programmer should never need to call HandlesTarget directly, it will be called by the action itself when needed.

In TBasicAction this method is empty; descendant classes should override this method to implement appropriate checks.

See also

UpdateTarget | Notify client controls when the action updates itself.
ExecuteTarget | Executes the action on the Target object


TBasicAction.OnExecute

Event triggered when the action executes.

Declaration

Source position: classesh.inc line 1923

public property TBasicAction.OnExecute : TNotifyEvent
  read FOnExecute
  write SetOnExecute;

Description

OnExecute is the event triggered when the action is activated (executed). The event is triggered e.g. when the user clicks e.g. on a menu item or a button associated to the action. The application programmer should provide a OnExecute event handler to execute whatever code is necessary when the button is pressed or the menu item is chosen.

Note that assigning an OnExecute handler will result in the Execute method returning a True value. Predefined actions (such as dataset actions) will check the result of Execute and will not perform their normal task if the OnExecute handler was called.

See also

Execute | Triggers the OnExecute event
OnUpdate | Event trigged when the application is idle.


TBasicAction.OnUpdate

Event trigged when the application is idle.

Declaration

Source position: classesh.inc line 1924

public property TBasicAction.OnUpdate : TNotifyEvent
  read FOnUpdate
  write FOnUpdate;

Description

OnUpdate is the event triggered when the application is idle, and the action is being updated. The OnUpdate event can be used to set the state of the action, for instance disable it if the action cannot be executed at this point in time.

See also

Update | Triggers the OnUpdate event
OnExecute | Event triggered when the action executes.


TBasicAction.RegisterChanges

Registers a new client with the action.

Declaration

Source position: classesh.inc line 1919

public procedure TBasicAction.RegisterChanges(

  Value: TBasicActionLink

);

Description

RegisterChanges adds Value to the list of clients.

See also

UnregisterChanges

Unregisters a client from the list of clients


TBasicAction.UnRegisterChanges

Unregisters a client from the list of clients

Declaration

Source position: classesh.inc line 1920

public procedure TBasicAction.UnRegisterChanges(

  Value: TBasicActionLink

);

Description

UnregisterChanges removes Value from the list of clients. This is called for instance when the action is destroyed, or when the client is assigned a new action.

See also

UnregisterChanges | Unregisters a client from the list of clients
Destroy | Destroys the action.


TBasicAction.Update

Triggers the OnUpdate event

Declaration

Source position: classesh.inc line 1921

public function TBasicAction.Update: Boolean; virtual;

Description

Update triggers the OnUpdate event, if one is assigned. It returns True if the event was triggered, or False if no event was assigned.

Application programmers should never run Update directly. The Update method is called automatically by the action mechanism; Normally this is in the Idle time of an application. An application programmer should assign the OnUpdate event, and perform any checks in that handler.

See also

OnUpdate | Event trigged when the application is idle.
Execute | Triggers the OnExecute event
UpdateTarget | Notify client controls when the action updates itself.


TBasicAction.UpdateTarget

Notify client controls when the action updates itself.

Declaration

Source position: classesh.inc line 1916

public procedure TBasicAction.UpdateTarget(

  Target: TObject

); virtual;

Description

UpdateTarget should update the client control specified by Target when the action updates itself. In TBasicAction, the implementation of UpdateTarget is empty. Descendant classes should override and implement UpdateTarget to actually update the Target object.

An application programmer should never need to call HandlesTarget directly, it will be called by the action itself when needed.

See also

HandlesTarget | Determines whether Target can be handled by this action
ExecuteTarget | Executes the action on the Target object


TBasicActionClass

TBasicAction class reference.

Declaration

Source position: classesh.inc line 1929

type TBasicActionClass = class of TBasicAction;


TBasicActionLink

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Link between actions and action clients (e.g. controls)

Declaration

Source position: classesh.inc line 1878

type TBasicActionLink = class(TObject)
public
constructor Create(); virtual; | Creates a new instance of the TBasicActionLink class
destructor Destroy; override; | Destroys the TBasicActionLink instance.
function Execute(); virtual; | Calls the action's Execute method.
function Update; virtual; | Calls the action's Update method
property Action: TBasicAction; [rw] | The action to which the link was assigned.
property OnChange: TNotifyEvent; [rw] | Event handler triggered when the action's properties change
end;

Inheritance

TBasicActionLink | Link between actions and action clients (e.g. controls)
|
TObject | Base class of all classes.

Description

TBasicActionLink links an Action to its clients. With each client for an action, a TBasicActionLink class is instantiated to handle the communication between the action and the client. It passes events between the action and its clients, and thus presents the action with a uniform interface to the clients.

An application programmer should never use a TBasicActionLink instance directly; They are created automatically when an action is associated with a component. Component programmers should create specialized descendants of TBasicActionLink which communicate changes in the action to the component.

See also

TBasicAction

Abstract base class for all Actions.


TBasicActionLink

Action

TObject


Action (TBasicActionLink)


TBasicActionLink
 | Create
 | Destroy
 | Execute
 | Update
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Create (TObject)

Create (TBasicActionLink)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Destroy (TBasicActionLink)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

Execute (TBasicActionLink)

FieldAddress (TObject)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

SafeCallException (TObject)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)

Update (TBasicActionLink)


TBasicActionLink

OnChange

TObject


OnChange (TBasicActionLink)


TBasicActionLink.Action

The action to which the link was assigned.

Declaration

Source position: classesh.inc line 1893

public property TBasicActionLink.Action : TBasicAction
  read FAction
  write SetAction;

Description

Action represents the Action which was assigned to the client. Setting this property will unregister the client at the old action (if one existed) and registers the client at the new action.

See also

TBasicAction

Abstract base class for all Actions.


TBasicActionLink.Create

Creates a new instance of the TBasicActionLink class

Declaration

Source position: classesh.inc line 1889

public constructor TBasicActionLink.Create(

  AClient: TObject

); virtual;

Description

Create creates a new instance of a TBasicActionLink and assigns AClient as the client of the link.

Application programmers should never instantiate TBasicActionLink classes directly. An instance is created automatically when an action is assigned to a control (client).

Component programmers can override the create constructor to initialize further properties.

See also

Destroy

Destroys the TBasicActionLink instance.


TBasicActionLink.Destroy

Destroys the TBasicActionLink instance.

Declaration

Source position: classesh.inc line 1890

public destructor TBasicActionLink.Destroy; override;

Description

Destroy unregisters the TBasicActionLink with the action, and then calls the inherited destructor.

Application programmers should never call Destroy directly. If a link should be destroyed at all, the Free method should be called instead.

See also

Create

Creates a new instance of the TBasicActionLink class


TBasicActionLink.Execute

Calls the action's Execute method.

Declaration

Source position: classesh.inc line 1891

public function TBasicActionLink.Execute(

  AComponent: TComponent = Nil

):Boolean; virtual;

Description

Execute sets the ActionComponent property of the associated Action to AComponent and then calls the Action's execute method. After the action has executed, the ActionComponent property is cleared again.

The return value of the function is the return value of the Action's execute method.

Application programmers should never call Execute directly. This method will be called automatically when the associated control is activated. (e.g. a button is clicked on)

Component programmers should call Execute whenever the action should be activated.

See also

Action | The action to which the link was assigned.
TBasicAction.ActionComponent | Returns the component that initiated the action.
TBasicAction.Execute | Triggers the OnExecute event
TBasicAction.onExecute | Event triggered when the action executes.


TBasicActionLink.OnChange

Event handler triggered when the action's properties change

Declaration

Source position: classesh.inc line 1894

public property TBasicActionLink.OnChange : TNotifyEvent
  read FOnChange
  write FOnChange;

Description

OnChange is the event triggered when the action's properties change.

Application programmers should never need to assign this event. Component programmers can assign this event to have a client control reflect any changes in an Action's properties.

See also

Change | Executed whenever the Action is changed.
TBasicAction.Change | Calls the OnChange handler.


TBasicActionLink.Update

Calls the action's Update method

Declaration

Source position: classesh.inc line 1892

public function TBasicActionLink.Update: Boolean; virtual;

Description

Update calls the associated Action's Update methoda.

Component programmers can override the Update method to provide additional processing when the Update method occurs.


TBasicActionLinkClass

TBasicActionLink class reference.

Declaration

Source position: classesh.inc line 1897

type TBasicActionLinkClass = class of TBasicActionLink;


TBinaryObjectReader

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Driver class descendant which reads component data stored in binary format.

Declaration

Source position: classesh.inc line 1158

type TBinaryObjectReader = class(TAbstractObjectReader)
public
constructor Create(); | Creates a new binary data reader instance.
destructor Destroy; override; | Destroys the binary data reader.
function NextValue; override; | Return the type of the next value.
function ReadValue; override; | Read the next value in the stream
procedure BeginRootComponent; override; | Start reading the root component.
procedure BeginComponent(); override; | Start reading a component.
function BeginProperty; override; | Start reading a property.
procedure Read(); override; | Read raw data from stream
procedure ReadBinary(); override; | Start reading a binary value.
function ReadFloat; override; | Read a float value
function ReadSingle; override; | Read a single-size float value
function ReadDate; override; | Read a date.
function ReadCurrency; override; | Read a currency value from the stream.
function ReadIdent(); override; | Read an identifier
function ReadInt8; override; | Read an 8-bits integer.
function ReadInt16; override; | Read a 16-bits integer.
function ReadInt32; override; | Read a 32-bits integer.
function ReadInt64; override; | Read a 64-bits integer.
function ReadSet(); override; | Read a set
procedure ReadSignature; override; | Reads the filer signature
function ReadStr; override; | Read a short string
function ReadString(); override; | Read a string
function ReadWideString; override; | Read a widestring value from the stream.
function ReadUnicodeString; override; | Read a unicode string value
procedure SkipComponent(); override; | Skip a component's data
procedure SkipValue; override; | Skip a value's data
end;

Inheritance

TBinaryObjectReader | Driver class descendant which reads component data stored in binary format.
|
TAbstractObjectReader | Abstract driver class to read stored component data.
|
TObject

Description

The TBinaryObjectReader class reads component data stored in binary form in a file. For this, it overrides or implements all abstract methods from TAbstractObjectReader. No new functionality is added by this class, it is a driver class for the streaming system.

It should never be necessary to create an instance of this class directly. Instead, the TStream.WriteComponent call should be used.

See also

TAbstractObjectReader | Abstract driver class to read stored component data.
TBinaryObjectWriter | Driver class which stores component data in binary form.


TBinaryObjectReader

TAbstractObjectReader


TBinaryObjectReader
 | Create
 | Destroy
 | NextValue
 | ReadValue
 | BeginRootComponent
 | BeginComponent
 | BeginProperty
 | Read
 | ReadBinary
 | ReadFloat
 | ReadSingle
 | ReadDate
 | ReadCurrency
 | ReadIdent
 | ReadInt8
 | ReadInt16
 | ReadInt32
 | ReadInt64
 | ReadSet
 | ReadSignature
 | ReadStr
 | ReadString
 | ReadWideString
 | ReadUnicodeString
 | SkipComponent
 | SkipValue
TAbstractObjectReader
 | NextValue
 | ReadValue
 | BeginRootComponent
 | BeginComponent
 | BeginProperty
 | Read
 | ReadBinary
 | ReadFloat
 | ReadSingle
 | ReadDate
 | ReadCurrency
 | ReadIdent
 | ReadInt8
 | ReadInt16
 | ReadInt32
 | ReadInt64
 | ReadSet
 | ReadSignature
 | ReadStr
 | ReadString
 | ReadWideString
 | ReadUnicodeString
 | SkipComponent
 | SkipValue


BeginComponent (TAbstractObjectReader)

BeginComponent (TBinaryObjectReader)

BeginProperty (TAbstractObjectReader)

BeginProperty (TBinaryObjectReader)

BeginRootComponent (TAbstractObjectReader)

BeginRootComponent (TBinaryObjectReader)

Create (TBinaryObjectReader)

Destroy (TBinaryObjectReader)

NextValue (TAbstractObjectReader)

NextValue (TBinaryObjectReader)

Read (TAbstractObjectReader)

Read (TBinaryObjectReader)

ReadBinary (TAbstractObjectReader)

ReadBinary (TBinaryObjectReader)

ReadCurrency (TAbstractObjectReader)

ReadCurrency (TBinaryObjectReader)

ReadDate (TAbstractObjectReader)

ReadDate (TBinaryObjectReader)

ReadFloat (TAbstractObjectReader)

ReadFloat (TBinaryObjectReader)

ReadIdent (TAbstractObjectReader)

ReadIdent (TBinaryObjectReader)

ReadInt16 (TAbstractObjectReader)

ReadInt16 (TBinaryObjectReader)

ReadInt32 (TAbstractObjectReader)

ReadInt32 (TBinaryObjectReader)

ReadInt64 (TAbstractObjectReader)

ReadInt64 (TBinaryObjectReader)

ReadInt8 (TAbstractObjectReader)

ReadInt8 (TBinaryObjectReader)

ReadSet (TAbstractObjectReader)

ReadSet (TBinaryObjectReader)

ReadSignature (TAbstractObjectReader)

ReadSignature (TBinaryObjectReader)

ReadSingle (TAbstractObjectReader)

ReadSingle (TBinaryObjectReader)

ReadStr (TAbstractObjectReader)

ReadStr (TBinaryObjectReader)

ReadString (TAbstractObjectReader)

ReadString (TBinaryObjectReader)

ReadUnicodeString (TAbstractObjectReader)

ReadUnicodeString (TBinaryObjectReader)

ReadValue (TAbstractObjectReader)

ReadValue (TBinaryObjectReader)

ReadWideString (TAbstractObjectReader)

ReadWideString (TBinaryObjectReader)

SkipComponent (TAbstractObjectReader)

SkipComponent (TBinaryObjectReader)

SkipValue (TAbstractObjectReader)

SkipValue (TBinaryObjectReader)


TBinaryObjectReader.BeginComponent

Start reading a component.

Declaration

Source position: classesh.inc line 1181

public procedure TBinaryObjectReader.BeginComponent(

  var Flags: TFilerFlags;

  var AChildPos: Integer;

  var CompClassName: string;

  var CompName: string

); override;

Description

This method is simply the implementation for a binary stream of the abstract method introduced in TAbstractObjectReader


TBinaryObjectReader.BeginProperty

Start reading a property.

Declaration

Source position: classesh.inc line 1183

public function TBinaryObjectReader.BeginProperty: string; override;

Description

This method is simply the implementation for a binary stream of the abstract method introduced in TAbstractObjectReader


TBinaryObjectReader.BeginRootComponent

Start reading the root component.

Declaration

Source position: classesh.inc line 1180

public procedure TBinaryObjectReader.BeginRootComponent; override;

Description

BeginRootComponent starts reading the root component in a binary stream.

This method is simply the implementation for a binary stream of the abstract method introduced in TAbstractObjectReader


TBinaryObjectReader.Create

Creates a new binary data reader instance.

Declaration

Source position: classesh.inc line 1175

public constructor TBinaryObjectReader.Create(

  Stream: TStream;

  BufSize: Integer

);

Description

Create instantiates a new binary component data reader. The Stream stream is the stream from which data will be read. The BufSize argument is the size of the internal buffer that will be used by the reader. This can be used to optimize the reading process.

See also

TAbstractObjectReader

Abstract driver class to read stored component data.


TBinaryObjectReader.Destroy

Destroys the binary data reader.

Declaration

Source position: classesh.inc line 1176

public destructor TBinaryObjectReader.Destroy; override;

Description

Destroy frees the buffer allocated when the instance was created. It also positions the stream on the last used position in the stream (the buffering may cause the reader to read more bytes than were actually used.)

See also

TBinaryObjectReader.Create

Creates a new binary data reader instance.


TBinaryObjectReader.NextValue

Return the type of the next value.

Declaration

Source position: classesh.inc line 1178

public function TBinaryObjectReader.NextValue: TValueType; override;

Description

NextValue returns the type of the next value in a binary stream, but does not read the value.

This method is simply the implementation for a binary stream of the abstract method introduced in TAbstractObjectReader


TBinaryObjectReader.Read

Read raw data from stream

Declaration

Source position: classesh.inc line 1186

public procedure TBinaryObjectReader.Read(

  var Buf;

  Count: LongInt

); override;

Description

Read is introduced for Delphi compatibility to read raw data from the component stream. This should not be used in production code as it will totally mess up the streaming.

See also

TAbstractObjectReader.Read | Read raw data from stream
TReader.Read | Read raw data from stream


TBinaryObjectReader.ReadBinary

Start reading a binary value.

Declaration

Source position: classesh.inc line 1187

public procedure TBinaryObjectReader.ReadBinary(

  const DestData: TMemoryStream

); override;

Description

ReadBinary reads a binary valye from a binary stream.

This method is simply the implementation for a binary stream of the abstract method introduced in TAbstractObjectReader


TBinaryObjectReader.ReadCurrency

Read a currency value from the stream.

Declaration

Source position: classesh.inc line 1193

public function TBinaryObjectReader.ReadCurrency: Currency; override;

Description

var>ReadCurrency reads a currency-typed value from a binary stream. It is the implementation of the method introduced in TAbstractObjectReader.

See also

TAbstractObjectReader.ReadCurrency | Read a currency value from the stream.
TBinaryObjectWriter.WriteCurrency | Write a currency-valued type to a stream


TBinaryObjectReader.ReadDate

Read a date.

Declaration

Source position: classesh.inc line 1191

public function TBinaryObjectReader.ReadDate: TDateTime; override;

Description

ReadDate reads a date value from a binary stream.

This method is simply the implementation for a binary stream of the abstract method introduced in TAbstractObjectReader


TBinaryObjectReader.ReadFloat

Read a float value

Declaration

Source position: classesh.inc line 1189

public function TBinaryObjectReader.ReadFloat: Extended; override;

Description

ReadFloat reads a float value from a binary stream.

This method is simply the implementation for a binary stream of the abstract method introduced in TAbstractObjectReader


TBinaryObjectReader.ReadIdent

Read an identifier

Declaration

Source position: classesh.inc line 1194

public function TBinaryObjectReader.ReadIdent(

  ValueType: TValueType

):string; override;

Description

ReadIdent reads an identifier from a binary stream.

This method is simply the implementation for a binary stream of the abstract method introduced in TAbstractObjectReader


TBinaryObjectReader.ReadInt8

Read an 8-bits integer.

Declaration

Source position: classesh.inc line 1195

public function TBinaryObjectReader.ReadInt8: ShortInt; override;

Description

Read8Int reads an 8-bits signed integer from a binary stream.

This method is simply the implementation for a binary stream of the abstract method introduced in TAbstractObjectReader


TBinaryObjectReader.ReadInt16

Read a 16-bits integer.

Declaration

Source position: classesh.inc line 1196

public function TBinaryObjectReader.ReadInt16: SmallInt; override;

Description

Read16Int reads a 16-bits signed integer from a binary stream.

This method is simply the implementation for a binary stream of the abstract method introduced in TAbstractObjectReader


TBinaryObjectReader.ReadInt32

Read a 32-bits integer.

Declaration

Source position: classesh.inc line 1197

public function TBinaryObjectReader.ReadInt32: LongInt; override;

Description

Read32Int reads a 32-bits signed integer from a binary stream.

This method is simply the implementation for a binary stream of the abstract method introduced in TAbstractObjectReader


TBinaryObjectReader.ReadInt64

Read a 64-bits integer.

Declaration

Source position: classesh.inc line 1198

public function TBinaryObjectReader.ReadInt64: Int64; override;

Description

Read64Int reads a 64-bits signed integer from a binary stream.

This method is simply the implementation for a binary stream of the abstract method introduced in TAbstractObjectReader


TBinaryObjectReader.ReadSet

Read a set

Declaration

Source position: classesh.inc line 1199

public function TBinaryObjectReader.ReadSet(

  EnumType: Pointer

):Integer; override;

Description

ReadSet reads a set from a binary stream.

This method is simply the implementation for a binary stream of the abstract method introduced in TAbstractObjectReader


TBinaryObjectReader.ReadSignature

Reads the filer signature

Declaration

Source position: classesh.inc line 1200

public procedure TBinaryObjectReader.ReadSignature; override;

Description

ReadSignature is overridden by TBinaryObjectReader to read the signature (TPF0) from binary streams.

Errors

If the stream does not start with the correct signature, an EReadError exception is raised.

See also

TAbstractObjectReader.ReadSignature | Read resource signature
TAbstractObjectWriter.WriteSignature | Write stream signature to the stream
TBinaryObjectWriter.WriteSignature | Write stream signature to the stream


TBinaryObjectReader.ReadSingle

Read a single-size float value

Declaration

Source position: classesh.inc line 1190

public function TBinaryObjectReader.ReadSingle: Single; override;

Description

ReadSingle reads a single-sized float value from a binary stream.

This method is simply the implementation for a binary stream of the abstract method introduced in TAbstractObjectReader


TBinaryObjectReader.ReadStr

Read a short string

Declaration

Source position: classesh.inc line 1201

public function TBinaryObjectReader.ReadStr: string; override;

Description

ReadStr reads a short string from a binary stream.

This method is simply the implementation for a binary stream of the abstract method introduced in TAbstractObjectReader


TBinaryObjectReader.ReadString

Read a string

Declaration

Source position: classesh.inc line 1202

public function TBinaryObjectReader.ReadString(

  StringType: TValueType

):string; override;

Description

ReadStr reads a string of type StringType from a binary stream.

This method is simply the implementation for a binary stream of the abstract method introduced in TAbstractObjectReader


TBinaryObjectReader.ReadUnicodeString

Read a unicode string value

Declaration

Source position: classesh.inc line 1204

public function TBinaryObjectReader.ReadUnicodeString: UnicodeString; override;

Description

ReadUnicodeString is overridden by TBinaryObjectReaderto read a UnicodeString value from the binary stream.

See also

TAbstractObjectReader.ReadUnicodeString

Read a unicode string value


TBinaryObjectReader.ReadValue

Read the next value in the stream

Declaration

Source position: classesh.inc line 1179

public function TBinaryObjectReader.ReadValue: TValueType; override;

Description

NextValue reads the next value in a binary stream and returns the type of the read value.

This method is simply the implementation for a binary stream of the abstract method introduced in TAbstractObjectReader


TBinaryObjectReader.ReadWideString

Read a widestring value from the stream.

Declaration

Source position: classesh.inc line 1203

public function TBinaryObjectReader.ReadWideString: WideString; override;

Description

var>ReadWideString reads a widestring-typed value from a binary stream. It is the implementation of the method introduced in TAbstractObjectReader.

See also

TAbstractObjectReader.ReadWideString | Read a widestring value from the stream.
TBinaryObjectWriter.WriteWideString | Write a widestring-valued type to a stream


TBinaryObjectReader.SkipComponent

Skip a component's data

Declaration

Source position: classesh.inc line 1205

public procedure TBinaryObjectReader.SkipComponent(

  SkipComponentInfos: Boolean

); override;

Description

SkipComponent skips the data of a component in a binary stream.

This method is simply the implementation for a binary stream of the abstract method introduced in TAbstractObjectReader.


TBinaryObjectReader.SkipValue

Skip a value's data

Declaration

Source position: classesh.inc line 1206

public procedure TBinaryObjectReader.SkipValue; override;

Description

SkipComponent skips the data of the next value in a binary stream.

This method is simply the implementation for a binary stream of the abstract method introduced in TAbstractObjectReader


TBinaryObjectWriter

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Driver class which stores component data in binary form.

Declaration

Source position: classesh.inc line 1372

type TBinaryObjectWriter = class(TAbstractObjectWriter)
public
constructor Create(); | Creates a new instance of a binary object writer.
destructor Destroy; override; | Destroys an instance of the binary object writer.
procedure WriteSignature; override; | Write stream signature to the stream
procedure BeginCollection; override; | Start writing a collection.
procedure BeginComponent(); override; | Start writing a component
procedure BeginList; override; | Start writing a list.
procedure EndList; override; | Mark the end of a list.
procedure BeginProperty(); override; | Start writing a property
procedure EndProperty; override; | Marks the end of writing of a property.
procedure Write(); override; | Write raw data to stream
procedure WriteBinary(); override; | Writes binary data to the stream.
procedure WriteBoolean(); override; | Writes a boolean value to the stream.
procedure WriteFloat(); override; | Writes a float value to the stream.
procedure WriteSingle(); override; | Writes a single-type real value to the stream.
procedure WriteDate(); override; | Writes a date type to the stream.
procedure WriteCurrency(); override; | Write a currency-valued type to a stream
procedure WriteIdent(); override; | Writes an identifier to the stream.
procedure WriteInteger(); override; | Writes an integer value to the stream.
procedure WriteUInt64(); override; | Write an unsigned 64-bit integer
procedure WriteMethodName(); override; | Writes a methodname to the stream.
procedure WriteSet(); override; | Writes a set value to the stream.
procedure WriteStr(); | Write a string to the binary stream
procedure WriteString(); override; | Writes a string value to the stream.
procedure WriteWideString(); override; | Write a widestring-valued type to a stream
procedure WriteUnicodeString(); override; | Write a unicode string to the stream.
procedure WriteVariant(); override; | Write a variant to the stream
end;

Inheritance

TBinaryObjectWriter | Driver class which stores component data in binary form.
|
TAbstractObjectWriter | Abstract driver class for writing component data.
|
TObject


TBinaryObjectWriter

TAbstractObjectWriter


TBinaryObjectWriter
 | Create
 | Destroy
 | WriteSignature
 | BeginCollection
 | BeginComponent
 | BeginList
 | EndList
 | BeginProperty
 | EndProperty
 | Write
 | WriteBinary
 | WriteBoolean
 | WriteFloat
 | WriteSingle
 | WriteDate
 | WriteCurrency
 | WriteIdent
 | WriteInteger
 | WriteUInt64
 | WriteMethodName
 | WriteSet
 | WriteStr
 | WriteString
 | WriteWideString
 | WriteUnicodeString
 | WriteVariant
TAbstractObjectWriter
 | BeginCollection
 | BeginComponent
 | WriteSignature
 | BeginList
 | EndList
 | BeginProperty
 | EndProperty
 | Write
 | WriteBinary
 | WriteBoolean
 | WriteFloat
 | WriteSingle
 | WriteDate
 | WriteCurrency
 | WriteIdent
 | WriteInteger
 | WriteUInt64
 | WriteVariant
 | WriteMethodName
 | WriteSet
 | WriteString
 | WriteWideString
 | WriteUnicodeString


BeginCollection (TAbstractObjectWriter)

BeginCollection (TBinaryObjectWriter)

BeginComponent (TAbstractObjectWriter)

BeginComponent (TBinaryObjectWriter)

BeginList (TAbstractObjectWriter)

BeginList (TBinaryObjectWriter)

BeginProperty (TAbstractObjectWriter)

BeginProperty (TBinaryObjectWriter)

Create (TBinaryObjectWriter)

Destroy (TBinaryObjectWriter)

EndList (TAbstractObjectWriter)

EndList (TBinaryObjectWriter)

EndProperty (TAbstractObjectWriter)

EndProperty (TBinaryObjectWriter)

Write (TAbstractObjectWriter)

Write (TBinaryObjectWriter)

WriteBinary (TAbstractObjectWriter)

WriteBinary (TBinaryObjectWriter)

WriteBoolean (TAbstractObjectWriter)

WriteBoolean (TBinaryObjectWriter)

WriteCurrency (TAbstractObjectWriter)

WriteCurrency (TBinaryObjectWriter)

WriteDate (TAbstractObjectWriter)

WriteDate (TBinaryObjectWriter)

WriteFloat (TAbstractObjectWriter)

WriteFloat (TBinaryObjectWriter)

WriteIdent (TAbstractObjectWriter)

WriteIdent (TBinaryObjectWriter)

WriteInteger (TAbstractObjectWriter)

WriteInteger (TBinaryObjectWriter)

WriteMethodName (TAbstractObjectWriter)

WriteMethodName (TBinaryObjectWriter)

WriteSet (TAbstractObjectWriter)

WriteSet (TBinaryObjectWriter)

WriteSignature (TAbstractObjectWriter)

WriteSignature (TBinaryObjectWriter)

WriteSingle (TAbstractObjectWriter)

WriteSingle (TBinaryObjectWriter)

WriteStr (TBinaryObjectWriter)

WriteString (TAbstractObjectWriter)

WriteString (TBinaryObjectWriter)

WriteUInt64 (TAbstractObjectWriter)

WriteUInt64 (TBinaryObjectWriter)

WriteUnicodeString (TAbstractObjectWriter)

WriteUnicodeString (TBinaryObjectWriter)

WriteVariant (TAbstractObjectWriter)

WriteVariant (TBinaryObjectWriter)

WriteWideString (TAbstractObjectWriter)

WriteWideString (TBinaryObjectWriter)


TBinaryObjectWriter.Create

Creates a new instance of a binary object writer.

Declaration

Source position: classesh.inc line 1388

public constructor TBinaryObjectWriter.Create(

  Stream: TStream;

  BufSize: Integer

);


TBinaryObjectWriter.Destroy

Destroys an instance of the binary object writer.

Declaration

Source position: classesh.inc line 1389

public destructor TBinaryObjectWriter.Destroy; override;


TBinaryObjectWriter.Write

Write raw data to stream

Declaration

Source position: classesh.inc line 1401

public procedure TBinaryObjectWriter.Write(

  const Buffer;

  Count: LongInt

); override;

Description

Write is introduced for Delphi compatibility to write raw data to the component stream. This should not be used in new production code as it will totally mess up the streaming.

See also

TAbstractObjectWriter.Write | Write raw data to stream
TWriter.Write | Write raw data to stream


TBinaryObjectWriter.WriteCurrency

Write a currency-valued type to a stream

Declaration

Source position: classesh.inc line 1409

public procedure TBinaryObjectWriter.WriteCurrency(

  const Value: Currency

); override;

Description

WriteCurrency writes a currency-typed value to a binary stream. It is the implementation of the method introduced in TAbstractObjectWriter.

See also

TAbstractObjectWriter.WriteCurrency

Write a currency value to the stream


TBinaryObjectWriter.WriteSignature

Write stream signature to the stream

Declaration

Source position: classesh.inc line 1390

public procedure TBinaryObjectWriter.WriteSignature; override;

Description

WriteSignature is overridden by TBinaryObjectWriter to write the signature (TPF0) to binary streams.

See also

TAbstractObjectWriter.WriteSignature | Write stream signature to the stream
TAbstractObjectReader.ReadSignature | Read resource signature
TBinaryObjectReader.ReadSignature | Reads the filer signature


TBinaryObjectWriter.WriteStr

Write a string to the binary stream

Declaration

Source position: classesh.inc line 1415

public procedure TBinaryObjectWriter.WriteStr(

  const Value: string

);

Description

WriteStr writes a string value to the binary stream. It is exposed so it can be used in DefineProperties.


TBinaryObjectWriter.WriteUInt64

Write an unsigned 64-bit integer

Declaration

Source position: classesh.inc line 1412

public procedure TBinaryObjectWriter.WriteUInt64(

  Value: QWord

); override;

Description

WriteUInt64 is overridden by TBinaryObjectWriter to write an unsigned 64-bit integer (QWord) to the stream. It tries to use the smallest possible storage for the value that is passed. (largest valuetype will be vaQWord).

See also

TAbstractObjectWriter.WriteUInt64

Write an unsigned 64-bit integer


TBinaryObjectWriter.WriteUnicodeString

Write a unicode string to the stream.

Declaration

Source position: classesh.inc line 1418

public procedure TBinaryObjectWriter.WriteUnicodeString(

  const Value: UnicodeString

); override;

Description

WriteUnicodeString is overridden TBinaryObjectWriter to write a unicodestring (valuetype vaUString) value to the stream. It simply writes the character length and then all widecharacters.

See also

TAbstractObjectWriter.WriteUnicodeString

Write a unicode string to the stream.


TBinaryObjectWriter.WriteVariant

Write a variant to the stream

Declaration

Source position: classesh.inc line 1419

public procedure TBinaryObjectWriter.WriteVariant(

  const VarValue: Variant

); override;

Description

WriteVariant is overridden by TBinaryObjectWriter to write a simple variant type to the stream. WriteVariant does not write arrays types or complex types. Only null, integer (ordinal) float and string types are written.

Errors

If a non-supported type is written, then an EWriteError exception is.


TBinaryObjectWriter.WriteWideString

Write a widestring-valued type to a stream

Declaration

Source position: classesh.inc line 1417

public procedure TBinaryObjectWriter.WriteWideString(

  const Value: WideString

); override;

Description

WriteWidestring writes a widestring-typed value to a binary stream. It is the implementation of the method introduced in TAbstractObjectWriter.

See also

TAbstractObjectWriter.WriteWidestring

Write a widestring value to the stream


TBits

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Class to store collections of bits (binary values that can be 0 or 1)

Declaration

Source position: classesh.inc line 383

type TBits = class(TObject)
public
constructor Create(); virtual; | Creates a new bits collection.
destructor Destroy; override; | Destroys a bit collection
function GetFSize; | Returns the number of records used to store the bits.
procedure SetOn(); | Turn a particular bit on.
procedure Clear(); | Clears a particular bit.
procedure Clearall; | Clears all bits in the array.
procedure AndBits(); | Performs an and operation on the bits.
procedure OrBits(); | Performs an or operation on the bits.
procedure XorBits(); | Performs a xor operation on the bits.
procedure NotBits(); | Performs a not operation on the bits.
function Get(); | Retrieve the value of a particular bit
procedure Grow(); | Expands the bits array to the requested size.
function Equals(); | Determines whether the bits of 2 arrays are equal.
procedure SetIndex(); | Sets the start position for FindNextBit and FindPrevBit
function FindFirstBit(); | Find first bit with a particular value
function FindNextBit; | Searches the next bit with a particular value.
function FindPrevBit; | Searches the previous bit with a particular value.
function OpenBit; | Returns the position of the first bit that is set to False.
property Bits []: Boolean; default; [rw] | Access to all bits in the array.
property Size: LongInt; [rw] | Current size of the array of bits.
end;

Inheritance

TBits | Class to store collections of bits (binary values that can be 0 or 1)
|
TObject | Base class of all classes.

Description

TBits can be used to store collections of bits in an indexed array. This is especially useful for storing collections of booleans: Normally the size of a boolean is the size of the smallest enumerated type, i.e. 1 byte. Since a bit can take 2 values it can be used to store a boolean as well. Since TBits can store 8 bits in a byte, it takes 8 times less space to store an array of booleans in a TBits class then it would take to store them in a conventional array.

TBits introduces methods to store and retrieve bit values, apply masks, and search for bits.


TBits
 | Bits
 | Size
TObject


Bits (TBits)

Size (TBits)


TBits
 | Create
 | Destroy
 | GetFSize
 | SetOn
 | Clear
 | Clearall
 | AndBits
 | OrBits
 | XorBits
 | NotBits
 | Get
 | Grow
 | Equals
 | SetIndex
 | FindFirstBit
 | FindNextBit
 | FindPrevBit
 | OpenBit
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

AndBits (TBits)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Clear (TBits)

Clearall (TBits)

Create (TObject)

Create (TBits)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Destroy (TBits)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

Equals (TBits)

FieldAddress (TObject)

FindFirstBit (TBits)

FindNextBit (TBits)

FindPrevBit (TBits)

Free (TObject)

FreeInstance (TObject)

Get (TBits)

GetFSize (TBits)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

Grow (TBits)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

NotBits (TBits)

OpenBit (TBits)

OrBits (TBits)

SafeCallException (TObject)

SetIndex (TBits)

SetOn (TBits)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)

XorBits (TBits)


TBits

TObject


TBits.AndBits

Performs an and operation on the bits.

Declaration

Source position: classesh.inc line 405

public procedure TBits.AndBits(

  BitSet: TBits

);

Description

andbits performs an and operation on the bits in the array with the bits of array BitSet. If BitSet contains less bits than the current array, then all bits which have no counterpart in BitSet are cleared.

Errors

None.

See also

ClearAll | Clears all bits in the array.
OrBits | Performs an or operation on the bits.
XOrBits | Performs a xor operation on the bits.
NotBits | Performs a not operation on the bits.


TBits.Bits

Access to all bits in the array.

Declaration

Source position: classesh.inc line 420

public property TBits.Bits[Bit: LongInt] : Boolean
  read get
  write SetBit;
  default;

Description

Bits allows indexed access to all of the bits in the array. It gives True if the bit is 1, False otherwise; Assigning to this property will set, respectively clear the bit.

Errors

If an index is specified which is out of the allowed range then an EBitsError exception is raised.

See also

Size

Current size of the array of bits.


TBits.Clear

Clears a particular bit.

Declaration

Source position: classesh.inc line 403

public procedure TBits.Clear(

  Bit: LongInt

);

Description

Clear clears the bit at position bit. If the array If bit is at a position bigger than the current size, the collection is expanded to the required size using Grow.

Errors

If bit is larger than the maximum allowed bits array size or is negative, an EBitsError exception is raised.

See also

Bits | Access to all bits in the array.
seton | Clears a particular bit.


TBits.Clearall

Clears all bits in the array.

Declaration

Source position: classesh.inc line 404

public procedure TBits.Clearall;

Description

ClearAll clears all bits in the array, i.e. sets them to zero. ClearAll works faster than clearing all individual bits, since it uses the packed nature of the bits.

Errors

None.

See also

Bits | Access to all bits in the array.
clear | Clears a particular bit.


TBits.Create

Creates a new bits collection.

Declaration

Source position: classesh.inc line 399

public constructor TBits.Create(

  TheSize: LongInt = 0

); virtual;

Description

Create creates a new bit collection with initial size TheSize. The size of the collection can be changed later on.

All bits are initially set to zero.

See also

Destroy

Destroys a bit collection


TBits.Destroy

Destroys a bit collection

Declaration

Source position: classesh.inc line 400

public destructor TBits.Destroy; override;

Description

Destroy destroys a previously created bit collection and releases all memory used to store the bit collection.

Destroy should never be called directly, Free should be used instead.

Errors

None.

See also

Create

Creates a new bits collection.


TBits.Equals

Determines whether the bits of 2 arrays are equal.

Declaration

Source position: classesh.inc line 411

public function TBits.Equals(

  Obj: TObject

):Boolean; override; overload;

function TBits.Equals(

  BitSet: TBits

):Boolean; overload;

Description

equals returns True if all the bits in BitSet are the same as the ones in the current BitSet; if not, False is returned.

If the sizes of the two BitSets are different, the arrays are still reported equal when all the bits in the larger set, which are not present in the smaller set, are zero.

Errors

None.

See also

ClearAll | Clears all bits in the array.
andBits | Performs an and operation on the bits.
OrBits | Performs an or operation on the bits.
XOrBits | Performs a xor operation on the bits.


TBits.FindFirstBit

Find first bit with a particular value

Declaration

Source position: classesh.inc line 414

public function TBits.FindFirstBit(

  State: Boolean

):LongInt;

Description

FindFirstBit searches for the first bit with value State. It returns the position of this bit, or -1 if no such bit was found.

The search starts at position 0 in the array. If the first search returned a positive result, the found position is saved, and the FindNextBit and FindPrevBit will use this position to resume the search. To start a search from a certain position, the start position can be set with the SetIndex instead.

Errors

None.

See also

FindNextBit | Searches the next bit with a particular value.
FindPrevBit | Searches the previous bit with a particular value.
OpenBit | Returns the position of the first bit that is set to False.
SetIndex | Sets the start position for FindNextBit and FindPrevBit


TBits.FindNextBit

Searches the next bit with a particular value.

Declaration

Source position: classesh.inc line 415

public function TBits.FindNextBit: LongInt;

Description

FindNextBit resumes a previously started search. It searches for the next bit with the value specified in the FindFirstBit. The search is done towards the end of the array and starts at the position last reported by one of the Find calls or at the position set with SetIndex.

If another bit with the same value is found, its position is returned. If no more bits with the same value are present in the array, -1 is returned.

Errors

None.

See also

FindFirstBit | Find first bit with a particular value
FindPrevBit | Searches the previous bit with a particular value.
OpenBit | Returns the position of the first bit that is set to False.
SetIndex | Sets the start position for FindNextBit and FindPrevBit


TBits.FindPrevBit

Searches the previous bit with a particular value.

Declaration

Source position: classesh.inc line 416

public function TBits.FindPrevBit: LongInt;

Description

FindPrevBit resumes a previously started search. It searches for the previous bit with the value specified in the FindFirstBit. The search is done towards the beginning of the array and starts at the position last reported by one of the Find calls or at the position set with SetIndex.

If another bit with the same value is found, its position is returned. If no more bits with the same value are present in the array, -1 is returned.

Errors

None.

See also

FindFirstBit | Find first bit with a particular value
FindNextBit | Searches the next bit with a particular value.
OpenBit | Returns the position of the first bit that is set to False.
SetIndex | Sets the start position for FindNextBit and FindPrevBit


TBits.Get

Retrieve the value of a particular bit

Declaration

Source position: classesh.inc line 409

public function TBits.Get(

  Bit: LongInt

):Boolean;

Description

Get returns True if the bit at position bit is set, or False if it is not set.

Errors

If bit is not a valid bit index then an EBitsError exception is raised.

See also

Bits | Access to all bits in the array.
FindFirstBit | Find first bit with a particular value
seton | Turn a particular bit on.


TBits.GetFSize

Returns the number of records used to store the bits.

Declaration

Source position: classesh.inc line 401

public function TBits.GetFSize: LongInt;

Description

GetFSize returns the number of records used to store the current number of bits.

Errors

None.

See also

Size

Current size of the array of bits.


TBits.Grow

Expands the bits array to the requested size.

Declaration

Source position: classesh.inc line 410

public procedure TBits.Grow(

  NBit: LongInt

);

Description

Grow expands the bit array so it can at least contain nbit bits. If nbit is less than the current size, nothing happens.

Errors

If there is not enough memory to complete the operation, then an EBitsErroris raised.

See also

Size

Current size of the array of bits.


TBits.NotBits

Performs a not operation on the bits.

Declaration

Source position: classesh.inc line 408

public procedure TBits.NotBits(

  BitSet: TBits

);

Description

NotBits performs a not operation on the bits in the array with the bits of array Bitset.

If BitSet contains less bits than the current array, then all bits which have no counterpart in BitSet are left untouched.

Errors

None.

See also

ClearAll | Clears all bits in the array.
andBits | Performs an and operation on the bits.
OrBits | Performs an or operation on the bits.
XOrBits | Performs a xor operation on the bits.


TBits.OpenBit

Returns the position of the first bit that is set to False.

Declaration

Source position: classesh.inc line 419

public function TBits.OpenBit: LongInt;

Description

OpenBit returns the position of the first bit whose value is 0 (False), or -1 if no open bit was found. This call is equivalent to FindFirstBit(False), except that it doesn't set the position for the next searches.

Errors

None.

See also

FindNextBit | Find first bit with a particular value
FindPrevBit | Searches the previous bit with a particular value.
FindFirstBit | Find first bit with a particular value
SetIndex | Sets the start position for FindNextBit and FindPrevBit


TBits.OrBits

Performs an or operation on the bits.

Declaration

Source position: classesh.inc line 406

public procedure TBits.OrBits(

  BitSet: TBits

);

Description

andbits performs an or operation on the bits in the array with the bits of array BitSet.

If BitSet contains less bits than the current array, then all bits which have no counterpart in BitSet are left untouched.

If the current array contains less bits than BitSet then it is grown to the size of BitSet before the or operation is performed.

Errors

None.

See also

ClearAll | Clears all bits in the array.
andBits | Performs an and operation on the bits.
XOrBits | Performs a xor operation on the bits.
NotBits | Performs a not operation on the bits.


TBits.SetIndex

Sets the start position for FindNextBit and FindPrevBit

Declaration

Source position: classesh.inc line 413

public procedure TBits.SetIndex(

  Index: LongInt

);

Description

SetIndex sets the search start position forFindNextBit and FindPrevBit to Index. This means that these calls will start searching from position Index.

This mechanism provides an alternative to FindFirstBit which can also be used to position for the FindNextBit and FindPrevBit calls.

Errors

None.

See also

FindNextBit | Searches the next bit with a particular value.
FindPrevBit | Searches the previous bit with a particular value.
FindFirstBit | Find first bit with a particular value
OpenBit | Returns the position of the first bit that is set to False.


TBits.SetOn

Turn a particular bit on.

Declaration

Source position: classesh.inc line 402

public procedure TBits.SetOn(

  Bit: LongInt

);

Description

SetOn turns on the bit at position bit, i.e. sets it to 1. If bit is at a position bigger than the current size, the collection is expanded to the required size using Grow.

Errors

If bit is larger than the maximum allowed bits array size or is negative, an EBitsError exception is raised.

See also

Bits | Access to all bits in the array.
Clear | Clears a particular bit.


TBits.Size

Current size of the array of bits.

Declaration

Source position: classesh.inc line 421

public property TBits.Size : LongInt
  read FBSize
  write setSize;

Description

Size is the current size of the bit array. Setting this property will adjust the size; this is equivalent to calling Grow(Value-1)

Errors

If an invalid size (negative or too large) is specified, a EBitsError exception is raised.

See also

Bits

Access to all bits in the array.


TBits.XorBits

Performs a xor operation on the bits.

Declaration

Source position: classesh.inc line 407

public procedure TBits.XorBits(

  BitSet: TBits

);

Description

XorBits performs a xor operation on the bits in the array with the bits of array BitSet.

If BitSet contains less bits than the current array, then all bits which have no counterpart in BitSet are left untouched.

If the current array contains less bits than BitSet then it is grown to the size of BitSet before the xor operation is performed.

Errors

None.

See also

ClearAll | Clears all bits in the array.
andBits | Performs an and operation on the bits.
OrBits | Performs an or operation on the bits.
NotBits | Performs a not operation on the bits.


TBytesStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Stream of bytes

Declaration

Source position: classesh.inc line 995

type TBytesStream = class(TMemoryStream)
public
constructor Create(); overload; | Create a new instance of the stream, initializing it with an array of bytes
property Bytes: TBytes; [r] | The stream data as an array of bytes.
end;

Inheritance

TBytesStream | Stream of bytes
|
TMemoryStream | Standard implementation of a stream that stores its data in memory
|
TCustomMemoryStream | Abstract stream that stores its data in memory.
|
TStream | Base class for streams.
|
TObject | Base class of all classes.

Description

TBytesStream is a stream that uses an array of byte (TBytes) to keep the stream data. it overrides the TMemoryStream memory allocation routine to use the array of bytes. The array of bytes is exposed through the Bytes property.

See also

TBytes

TMemoryStream

Standard implementation of a stream that stores its data in memory

Bytes


TBytesStream
 | ro | Bytes
TMemoryStream
TCustomMemoryStream
 | ro | Memory
TStream
 |  | Position
 |  | Size
TObject


ro | Bytes (TBytesStream)
ro |


TBytesStream
 | Create
TMemoryStream
 | Destroy
 | Clear
 | LoadFromStream
 | LoadFromFile
 | SetSize
 | Write
TCustomMemoryStream
 | Read
 | Seek
 | SaveToStream
 | SaveToFile
TStream
 | Read
 | Write
 | Seek
 | ReadBuffer
 | WriteBuffer
 | CopyFrom
 | ReadComponent
 | ReadComponentRes
 | WriteComponent
 | WriteComponentRes
 | WriteDescendent
 | WriteDescendentRes
 | WriteResourceHeader
 | FixupResourceHeader
 | ReadResHeader
 | ReadByte
 | ReadWord
 | ReadDWord
 | ReadQWord
 | ReadAnsiString
 | WriteByte
 | WriteWord
 | WriteDWord
 | WriteQWord
 | WriteAnsiString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Clear (TMemoryStream)

CopyFrom (TStream)

Create (TObject)

Create (TBytesStream)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Destroy (TMemoryStream)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

FieldAddress (TObject)

FixupResourceHeader (TStream)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

LoadFromFile (TMemoryStream)

LoadFromStream (TMemoryStream)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

Read (TStream)

Read (TCustomMemoryStream)

ReadAnsiString (TStream)

ReadBuffer (TStream)

ReadByte (TStream)

ReadComponent (TStream)

ReadComponentRes (TStream)

ReadDWord (TStream)

ReadQWord (TStream)

ReadResHeader (TStream)

ReadWord (TStream)

SafeCallException (TObject)

SaveToFile (TCustomMemoryStream)

SaveToStream (TCustomMemoryStream)

Seek (TStream)

Seek (TCustomMemoryStream)

SetSize (TMemoryStream)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)

Write (TStream)

Write (TMemoryStream)

WriteAnsiString (TStream)

WriteBuffer (TStream)

WriteByte (TStream)

WriteComponent (TStream)

WriteComponentRes (TStream)

WriteDescendent (TStream)

WriteDescendentRes (TStream)

WriteDWord (TStream)

WriteQWord (TStream)

WriteResourceHeader (TStream)

WriteWord (TStream)


TBytesStream

TMemoryStream

TCustomMemoryStream

TStream

TObject


TBytesStream.Bytes

The stream data as an array of bytes.

Declaration

Source position: classesh.inc line 1002

public property TBytesStream.Bytes : TBytes
  read FBytes;

Description

Bytes provides byte-sized access to the array of bytes that represent the stream data. As a pointer value, it equals TCustomMemoryStream.Memory, meaning that Memory points to the first byte in the array.

See also

TBytes
TMemoryStream | Standard implementation of a stream that stores its data in memory
TCustomMemoryStream.Memory | Pointer to the data kept in the memory stream.


TBytesStream.Create

Create a new instance of the stream, initializing it with an array of bytes

Declaration

Source position: classesh.inc line 1001

public constructor TBytesStream.Create(

  const ABytes: TBytes

); overload;

Description

Create creates a new instance and initializes the memory with the data in ABytes.

See also

TBytes

TMemoryStream

Standard implementation of a stream that stores its data in memory

Bytes


TCollection

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Base class to manage collections of named objects.

Declaration

Source position: classesh.inc line 521

type TCollection = class(TPersistent)
public
constructor Create(); | Creates a new collection.
destructor Destroy; override; | Destroys the collection and frees all the objects it manages.
function Owner; | Owner of the collection.
function Add; | Creates and adds a new item to the collection.
procedure Assign(); override; | Assigns one collection to another.
procedure BeginUpdate; virtual; | Start an update batch.
procedure Clear; | Removes all items from the collection.
procedure EndUpdate; virtual; | Ends an update batch.
procedure Delete(); | Delete an item from the collection.
function GetEnumerator; | Create an IEnumerator instance
function GetNamePath; override; | Overrides TPersistent.GetNamePath to return a proper pathname.
function Insert(); | Insert an item in the collection.
function FindItemID(); | Searches for an Item in the collection, based on its TCollectionItem.ID property.
procedure Exchange(); | Exchange 2 items in the collection
procedure Sort(); | Sort the items in the collection
property Count: Integer; [r] | Number of items in the collection.
property ItemClass: TCollectionItemClass; [r] | Class pointer for each item in the collection.
property Items []: TCollectionItem; [rw] | Indexed array of items in the collection.
end;

Inheritance

TCollection | Base class to manage collections of named objects.
|
TPersistent,IFPObserved | Base class for streaming system and persistent properties.
|
TObject | Base class of all classes.

Description

TCollection implements functionality to manage a collection of named objects. Each of these objects needs to be a descendant of the TCollectionItem class. Exactly which type of object is managed can be seen from the TCollection.ItemClass property.

Normally, no TCollection is created directly. Instead, a descendants of TCollection and TCollectionItem are created as a pair.

See also

TCollectionItem

Basic object that is managed by a TCollection class.


TCollection
 | ro | Count
 | ro | ItemClass
 |  | Items
TPersistent
TObject


ro | Count (TCollection)
ro |


TCollection
 | Create
 | Destroy
 | Owner
 | Add
 | Assign
 | BeginUpdate
 | Clear
 | EndUpdate
 | Delete
 | GetEnumerator
 | GetNamePath
 | Insert
 | FindItemID
 | Exchange
 | Sort
TPersistent
 | Destroy
 | Assign
 | FPOAttachObserver
 | FPODetachObserver
 | FPONotifyObservers
 | GetNamePath
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


Add (TCollection)

AfterConstruction (TObject)

Assign (TPersistent)

Assign (TCollection)

BeforeDestruction (TObject)

BeginUpdate (TCollection)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Clear (TCollection)

Create (TObject)

Create (TCollection)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Delete (TCollection)

Destroy (TObject)

Destroy (TPersistent)

Destroy (TCollection)

Dispatch (TObject)

DispatchStr (TObject)

EndUpdate (TCollection)

Equals (TObject)

Exchange (TCollection)

FieldAddress (TObject)

FindItemID (TCollection)

FPOAttachObserver (TPersistent)

FPODetachObserver (TPersistent)

FPONotifyObservers (TPersistent)

Free (TObject)

FreeInstance (TObject)

GetEnumerator (TCollection)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

GetNamePath (TPersistent)

GetNamePath (TCollection)

InheritsFrom (TObject)

InitInstance (TObject)

Insert (TCollection)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

Owner (TCollection)

SafeCallException (TObject)

Sort (TCollection)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)


TCollection

TPersistent

TObject


TCollection.Add

Creates and adds a new item to the collection.

Declaration

Source position: classesh.inc line 551

public function TCollection.Add: TCollectionItem;

Description

Add instantiates a new item of class TCollection.ItemClass and adds it to the list. The newly created object is returned.

See also

TCollection.ItemClass | Class pointer for each item in the collection.
TCollection.Clear | Removes all items from the collection.


TCollection.Assign

Assigns one collection to another.

Declaration

Source position: classesh.inc line 552

public procedure TCollection.Assign(

  Source: TPersistent

); override;

Description

Assign assigns the contents of one collection to another. It does this by clearing the items list, and adding as much elements as there are in the Source collection; it assigns to each created element the contents of it's counterpart in the Source element.

Two collections cannot be assigned to each other if instances of the ItemClass classes cannot be assigned to each other.

Errors

If the objects in the collections cannot be assigned to one another, then an EConvertError is raised.

See also

TPersistent.Assign | Assign the contents of one class to another.
TCollectionItem | Basic object that is managed by a TCollection class.


TCollection.BeginUpdate

Start an update batch.

Declaration

Source position: classesh.inc line 553

public procedure TCollection.BeginUpdate; virtual;

Description

BeginUpdate is called at the beginning of a batch update. It raises the update count with 1.

Call BeginUpdate at the beginning of a series of operations that will change the state of the collection. This will avoid the call to TCollection.Update for each operation. At the end of the operations, a corresponding call to EndUpdate must be made. It is best to do this in the context of a Try ... finally block:

With MyCollection Do
    try
      BeginUpdate;
      // Some Lengthy operations
    finally
      EndUpdate;
    end;

This insures that the number of calls to BeginUpdate always matches the number of calls to TCollection.EndUpdate, even in case of an exception.

See also

TCollection.EndUpdate | Ends an update batch.
TCollection.Changed | Procedure called if an item is added to or removed from the collection.
TCollection.Update | Hander called when an item in the collection has changed.


TCollection.Clear

Removes all items from the collection.

Declaration

Source position: classesh.inc line 554

public procedure TCollection.Clear;

Description

Clear will clear the collection, i.e. each item in the collection is destroyed and removed from memory. After a call to Clear, Count is zero.

See also

TCollection.Add | Creates and adds a new item to the collection.
TCollectionItem.Destroy | Destroyes this collection item.
TCollection.Destroy | Destroys the collection and frees all the objects it manages.


TCollection.Count

Number of items in the collection.

Declaration

Source position: classesh.inc line 563

public property TCollection.Count : Integer
  read GetCount;

Description

Count contains the number of items in the collection.

Remark: The items in the collection are identified by their TCollectionItem.Index property, which is a zero-based index, meaning that it can take values between 0 and Count-1, borders included.

See also

TCollectionItem.Index | Index of the item in its managing collection TCollection.Items property.
TCollection.Items | Indexed array of items in the collection.


TCollection.Create

Creates a new collection.

Declaration

Source position: classesh.inc line 548

public constructor TCollection.Create(

  AItemClass: TCollectionItemClass

);

Description

Create instantiates a new instance of the TCollection class which will manage objects of class AItemClass. It creates the list used to hold all objects, and stores the AItemClass for the adding of new objects to the collection.

See also

TCollection.ItemClass | Class pointer for each item in the collection.
TCollection.Destroy | Destroys the collection and frees all the objects it manages.


TCollection.Delete

Delete an item from the collection.

Declaration

Source position: classesh.inc line 556

public procedure TCollection.Delete(

  Index: Integer

);

Description

Delete deletes the item at (zero based) position Index from the collection. This will result in a cnDeleted notification.

Errors

If an invalid index is specified, an EListError exception is raised.

See also

TCollection.Items | Indexed array of items in the collection.
TCollection.Insert | Insert an item in the collection.
TCollection.Clear | Removes all items from the collection.


TCollection.Destroy

Destroys the collection and frees all the objects it manages.

Declaration

Source position: classesh.inc line 549

public destructor TCollection.Destroy; override;

Description

Destroy first clears the collection, and then frees all memory allocated to this instance.

Don't call Destroy directly, call Free instead.

See also

TCollection.Create

Creates a new collection.


TCollection.EndUpdate

Ends an update batch.

Declaration

Source position: classesh.inc line 555

public procedure TCollection.EndUpdate; virtual;

Description

EndUpdate signals the end of a series of operations that change the state of the collection, possibly triggering an update event. It does this by decreasing the update count with 1 and calling TCollection.Changed it should always be used in conjunction with TCollection.BeginUpdate, preferably in the Finally section of a Try ... Finally block.

See also

TCollection.BeginUpdate | Start an update batch.
TCollection.Changed | Procedure called if an item is added to or removed from the collection.
TCollection.Update | Hander called when an item in the collection has changed.


TCollection.Exchange

Exchange 2 items in the collection

Declaration

Source position: classesh.inc line 561

public procedure TCollection.Exchange(

  const Index1: Integer;

  const index2: Integer

);

Description

Exchange exchanges the items at indexes Index1 and Index2 in the collection.

Errors

If one of the two indexes is invalid (less than zero or larger than the number of items) an EListError exception is raised.

See also

Items | Indexed array of items in the collection.
TCollectionItem.Index | Index of the item in its managing collection TCollection.Items property.


TCollection.FindItemID

Searches for an Item in the collection, based on its TCollectionItem.ID property.

Declaration

Source position: classesh.inc line 560

public function TCollection.FindItemID(

  ID: Integer

):TCollectionItem;

Description

FindItemID searches through the collection for the item that has a value of ID for its TCollectionItem.ID property, and returns the found item. If no such item is found in the collection, Nil is returned.

The routine performs a linear search, so this can be slow on very large collections.

See also

TCollection.Items | Indexed array of items in the collection.
TCollectionItem.ID | Initial index of this item.


TCollection.GetEnumerator

Create an IEnumerator instance

Declaration

Source position: classesh.inc line 557

public function TCollection.GetEnumerator: TCollectionEnumerator;

Description

GetEnumerator is the implementation of the IEnumerable interface for TCollection. It creates a TCollectionEnumerator instance and returns it's IEnumerator interface.

See also

TCollectionEnumerator | Implements IEnumerator for the TCollection class.
IEnumerator | Enumerator support interface
IEnumerable | Interface to retrieve an enumerator from a class.


TCollection.GetNamePath

Overrides TPersistent.GetNamePath to return a proper pathname.

Declaration

Source position: classesh.inc line 558

public function TCollection.GetNamePath: string; override;

Description

GetNamePath returns the name path for this collection. If the following conditions are satisfied:

  1. There is an owner object.
  2. The owner object returns a non-empty name path.
  3. The TCollection.Propname property is not empty

collection has an owner and the owning object has a name, then the function returns the owner name, followed by the propname. If one of the conditions is not satisfied, then the classname is returned.

See also

TCollection.GetOwner

TCollection.Propname

Name of the property that this collection represents.


TCollection.Insert

Insert an item in the collection.

Declaration

Source position: classesh.inc line 559

public function TCollection.Insert(

  Index: Integer

):TCollectionItem;

Description

Insert creates a new item instance and inserts it in the collection at position Index, and returns the new instance.

In contrast, TCollection.Add adds a new item at the end.

Errors

None.

See also

TCollection.Add | Creates and adds a new item to the collection.
TCollection.Delete | Delete an item from the collection.
TCollection.Items | Indexed array of items in the collection.


TCollection.ItemClass

Class pointer for each item in the collection.

Declaration

Source position: classesh.inc line 564

public property TCollection.ItemClass : TCollectionItemClass
  read FItemClass;

Description

ItemClass is the class pointer with which each new item in the collection is created. It is the value that was passed to the collection's constructor when it was created, and does not change during the lifetime of the collection.

See also

TCollectionItem | Basic object that is managed by a TCollection class.
TCollection.Items | Indexed array of items in the collection.


TCollection.Items

Indexed array of items in the collection.

Declaration

Source position: classesh.inc line 565

public property TCollection.Items[Index: Integer] : TCollectionItem
  read GetItem
  write SetItem;

Description

Items provides indexed access to the items in the collection. Since the array is zero-based, Index should be an integer between 0 and Count-1.

It is possible to set or retrieve an element in the array. When setting an element of the array, the object that is assigned should be compatible with the class of the objects in the collection, as given by the TCollection.ItemClass property.

Adding an element to the array can be done with the TCollection.Add method. The array can be cleared with the TCollection.Clear method. Removing an element of the array should be done by freeing that element.

See also

TCollection.Count | Number of items in the collection.
TCollection.ItemClass | Class pointer for each item in the collection.
TCollection.Clear | Removes all items from the collection.
TCollection.Add | Creates and adds a new item to the collection.


TCollection.Owner

Owner of the collection.

Declaration

Source position: classesh.inc line 550

public function TCollection.Owner: TPersistent;

Description

Owner returns a reference to the owner of the collection. This property is required by the object inspector to be able to show the collection.


TCollection.Sort

Sort the items in the collection

Declaration

Source position: classesh.inc line 562

public procedure TCollection.Sort(

  const Compare: TCollectionSortCompare

);

Description

Sort sorts the items in the collection, and uses the Compare procedure to compare 2 items in the collection. It is more efficient do use this method than to perform the sort manually, because the list items are manipulated directly.

For more information on how the Compare function should behave, see the TCollectionSortCompare type.

See also

TCollectionSortCompare

Callback to sort collection items


TCollectionEnumerator

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Implements IEnumerator for the TCollection class.

Declaration

Source position: classesh.inc line 506

type TCollectionEnumerator = class
public
constructor Create(); | Initialize a new instance of TCollectionEnumerator
function GetCurrent; | Return the current pointer in the list
function MoveNext; | Move the position of the enumerator to the next position in the collection.
property Current: TCollectionItem; [r] | Current pointer in the list
end;

Inheritance

TCollectionEnumerator

Implements IEnumerator for the TCollection class.
|

TObject

Description

TCollectionEnumerator implements the #rtl.system.IEnumerator interface for the TCollection class, so the TCollection class can be used in a for ... in loop. It is returned by the TCollection.GetEnumerator method of TCollection.

See also

TCollection | Base class to manage collections of named objects.
TCollection.GetEnumerator | Create an IEnumerator instance
#rtl.system.IEnumerator | Enumerator support interface


TCollectionEnumerator

ro

Current


ro


TCollectionEnumerator
 | Create
 | GetCurrent
 | MoveNext


Create (TCollectionEnumerator)

GetCurrent (TCollectionEnumerator)

MoveNext (TCollectionEnumerator)


TCollectionEnumerator


TCollectionEnumerator.Create

Initialize a new instance of TCollectionEnumerator

Declaration

Source position: classesh.inc line 511

public constructor TCollectionEnumerator.Create(

  ACollection: TCollection

);

Description

Create initializes a new instance of TCollectionEnumerator and keeps a reference to the collection ACollection that will be enumerated.

See also

TCollection

Base class to manage collections of named objects.


TCollectionEnumerator.Current

Current pointer in the list

Declaration

Source position: classesh.inc line 514

public property TCollectionEnumerator.Current : TCollectionItem
  read GetCurrent;

Description

Current redefines GetCurrent as a property.

See also

GetCurrent

Return the current pointer in the list


TCollectionEnumerator.GetCurrent

Return the current pointer in the list

Declaration

Source position: classesh.inc line 512

public function TCollectionEnumerator.GetCurrent: TCollectionItem;

Description

GetCurrent returns the current TCollectionItem instance in the enumerator.

Errors

No checking is done on the validity of the current position.

See also

MoveNext | Move the position of the enumerator to the next position in the collection.
TCollectionItem | Basic object that is managed by a TCollection class.


TCollectionEnumerator.MoveNext

Move the position of the enumerator to the next position in the collection.

Declaration

Source position: classesh.inc line 513

public function TCollectionEnumerator.MoveNext: Boolean;

Description

MoveNext puts the pointer on the next item in the collection, and returns True if this succeeded, or False if the pointer is past the last element in the list.

Errors

Note that if False is returned, calling GetCurrent will result in an exception.

See also

GetCurrent

Return the current pointer in the list


TCollectionItem

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Basic object that is managed by a TCollection class.

Declaration

Source position: classesh.inc line 482

type TCollectionItem = class(TPersistent)
public
constructor Create(); virtual; | Creates a new instance of this collection item.
destructor Destroy; override; | Destroyes this collection item.
function GetNamePath; override; | Returns the namepath of this collection item.
property Collection: TCollection; [rw] | Pointer to the collection managing this item.
property ID: Integer; [r] | Initial index of this item.
property Index: Integer; [rw] | Index of the item in its managing collection TCollection.Items property.
property DisplayName: string; [rw] | Name of the item, displayed in the object inspector.
end;

Inheritance

TCollectionItem | Basic object that is managed by a TCollection class.
|
TPersistent,IFPObserved | Base class for streaming system and persistent properties.
|
TObject | Base class of all classes.

Description

TCollectionItem and TCollection form a pair of base classes that manage a collection of named objects. The TCollectionItem is the named object that is managed, it represents one item in the collection. An item in the collection is represented by three properties: TCollectionItem.DisplayName, TCollection.Index and TCollectionItem.ID.

A TCollectionItem object is never created directly. To manage a set of named items, it is necessary to make a descendant of TCollectionItem to which needed properties and methods are added. This descendant can then be managed with a TCollection class. The managing collection will create and destroy it's items by itself, it should therefore never be necessary to create TCollectionItem descendants manually.

See also

TCollection

Base class to manage collections of named objects.


TCollectionItem
 |  | Collection
 | ro | ID
 |  | Index
 |  | DisplayName
TPersistent
TObject


TCollectionItem
 | Create
 | Destroy
 | GetNamePath
TPersistent
 | Destroy
 | Assign
 | FPOAttachObserver
 | FPODetachObserver
 | FPONotifyObservers
 | GetNamePath
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

Assign (TPersistent)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Create (TObject)

Create (TCollectionItem)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Destroy (TPersistent)

Destroy (TCollectionItem)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

FieldAddress (TObject)

FPOAttachObserver (TPersistent)

FPODetachObserver (TPersistent)

FPONotifyObservers (TPersistent)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

GetNamePath (TPersistent)

GetNamePath (TCollectionItem)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

SafeCallException (TObject)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)


TCollectionItem

TPersistent

TObject


TCollectionItem.Collection

Pointer to the collection managing this item.

Declaration

Source position: classesh.inc line 500

public property TCollectionItem.Collection : TCollection
  read FCollection
  write SetCollection;

Description

Collection points to the collection managing this item. This property can be set to point to a new collection. If this is done, the old collection will be notified that the item should no longer be managed, and the new collection is notified that it should manage this item as well.

See also

TCollection

Base class to manage collections of named objects.


TCollectionItem.Create

Creates a new instance of this collection item.

Declaration

Source position: classesh.inc line 497

public constructor TCollectionItem.Create(

  ACollection: TCollection

); virtual;

Description

Create instantiates a new item in a TCollection. It is called by the TCollection.Add function and should under normal circumstances never be called directly. called

See also

TCollectionItem.Destroy

Destroyes this collection item.


TCollectionItem.Destroy

Destroyes this collection item.

Declaration

Source position: classesh.inc line 498

public destructor TCollectionItem.Destroy; override;

Description

Destroy removes the item from the managing collection and Destroys the item instance.

This is the only way to remove items from a collection;

See also

TCollectionItem.Create

Creates a new instance of this collection item.


TCollectionItem.DisplayName

Name of the item, displayed in the object inspector.

Declaration

Source position: classesh.inc line 503

public property TCollectionItem.DisplayName : string
  read GetDisplayName
  write SetDisplayName;

Description

DisplayName contains the name of this item as shown in the object inspector. For TCollectionItem this returns always the class name of the managing collection, followed by the index of the item.

TCollectionItem does not implement any functionality to store the DisplayName property. The property can be set, but this will have no effect other than that the managing collection is notified of a change. The actual displayname will remain unchanged. To store the DisplayName property,TCollectionItem descendants should override the TCollectionItem.SetDisplayName and TCollectionItem.GetDisplayName to add storage functionality.

See also

TCollectionItem.Index | Index of the item in its managing collection TCollection.Items property.
TCollectionItem.ID | Initial index of this item.
TCollectionItem.GetDisplayName | Returns the TCollectionItem.DisplayName of the collectionitem
TCollectionItem.SetDisplayName | Write method for the TCollectionItem.DisplayName property


TCollectionItem.GetNamePath

Returns the namepath of this collection item.

Declaration

Source position: classesh.inc line 499

public function TCollectionItem.GetNamePath: string; override;

Description

GetNamePath overrides the TPersistent.GetNamePath method to return the name of the managing collection and appends its TCollectionItem.Index property.

See also

TCollectionItem.Collection | Pointer to the collection managing this item.
TPersistent.GetNamePath | Returns a string that can be used to identify the class instance.
TCollectionItem.Index | Index of the item in its managing collection TCollection.Items property.


TCollectionItem.ID

Initial index of this item.

Declaration

Source position: classesh.inc line 501

public property TCollectionItem.ID : Integer
  read FID;

Description

ID is the initial value of TCollectionItem.Index; it doesn't change after the index changes. It can be used to uniquely identify the item. The ID property doesn't change as items are added and removed from the collection.

While the TCollectionItem.Index property forms a continuous series, ID does not. If items are removed from the collection, their ID is not used again, leaving gaps. Only when the collection is initialiiy created, the ID and Index properties will be equal.

See also

TCollection.Items | Indexed array of items in the collection.
TCollectionItem.Index | Index of the item in its managing collection TCollection.Items property.


TCollectionItem.Index

Index of the item in its managing collection TCollection.Items property.

Declaration

Source position: classesh.inc line 502

public property TCollectionItem.Index : Integer
  read GetIndex
  write SetIndex;

Description

Index is the current index of the item in its managing collection's TCollection.Items property. This property may change as items are added and removed from the collection.

The index of an item is zero-based, i.e. the first item has index zero. The last item has index Count-1 where Count is the number of items in the collection.

The Index property of the items in a collection form a continuous series ranging from 0 to Count-1. The TCollectionItem.ID property does not form a continuous series, but can also be used to identify an item.

See also

TCollectionItem.ID | Initial index of this item.
TCollection.Items | Indexed array of items in the collection.


TCollectionItemClass

Class reference for TCollectionItem.

Declaration

Source position: classesh.inc line 517

type TCollectionItemClass = class of TCollectionItem;

Description

TCollectionItemClass is used by the TCollection.ItemClass property of TCollection to identify the descendant class of TCollectionItem which should be created and managed.

See also

TCollectionItem | Basic object that is managed by a TCollection class.
TCollection.ItemClass | Class pointer for each item in the collection.


TComponent

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Base class for all components that need owner-owned functionality.

Declaration

Source position: classesh.inc line 1770

type TComponent = class(TPersistent, IUnknown, IInterfaceComponentReference)
protected
procedure Notification(); virtual; | Called by components that are freed and which received a FreeNotification.
public
procedure WriteState(); virtual; | Writes the component to a stream.
constructor Create(); virtual; | Creates a new instance of the component.
destructor Destroy; override; | Destroys the instance of the component.
procedure BeforeDestruction; override; | Overrides standard BeforeDestruction.
procedure DestroyComponents; | Destroy child components.
procedure Destroying; | Called when the component is being destroyed
function ExecuteAction(); dynamic; | Standard action execution method.
function FindComponent(); | Finds and returns the named component in the owned components.
procedure FreeNotification(); | Ask the component to notify called when it is being destroyed.
procedure RemoveFreeNotification(); | Remove a component from the Free Notification list.
procedure FreeOnRelease; | Part of the IVCLComObject interface.
function GetEnumerator; | Create an IEnumerator instance
function GetNamePath; override; | Returns the name path of this component.
function GetParentComponent; dynamic; | Returns the parent component.
function HasParent; dynamic; | Does the component have a parent ?
procedure InsertComponent(); | Insert the given component in the list of owned components.
procedure RemoveComponent(); | Remove the given component from the list of owned components.
function SafeCallException(); override; | Part of the IVCLComObject Interface.
procedure SetSubComponent(); | Sets the csSubComponent style.
function UpdateAction(); dynamic; | Updates the state of an action.
property ComObject: IUnknown; [r] | Interface reference implemented by the component
function IsImplementorOf(); | Checks if the current component is the implementor of the interface
procedure ReferenceInterface(); | Interface implementation of Notification
property Components []: TComponent; [r] | Indexed list (zero-based) of all owned components.
property ComponentCount: Integer; [r] | Count of owned components
property ComponentIndex: Integer; [rw] | Index of component in it's owner's list.
property ComponentState: TComponentState; [r] | Current component's state.
property ComponentStyle: TComponentStyle; [r] | Current component's style.
property DesignInfo: LongInt; [rw] | Information for IDE designer.
property Owner: TComponent; [r] | Owner of this component.
property VCLComObject: Pointer; [rw] | Not implemented.
published
property Name: TComponentName; [rws] | Name of the component.
property Tag: PtrInt; [rw] | Tag value of the component.
end;

Inheritance

TComponent,IUnknown,IInterfaceComponentReference | Base class for all components that need owner-owned functionality.
|
TPersistent,IFPObserved | Base class for streaming system and persistent properties.
|
TObject | Base class of all classes.

Description

TComponent is the base class for any set of classes that needs owner-owned functionality, and which needs support for property streaming. All classes that should be handled by an IDE (Integrated Development Environment) must descend from TComponent, as it includes all support for streaming all its published properties.

Components can 'own' other components. TComponent introduces methods for enumerating the child components. It also allows to name the owned components with a unique name. Furthermore, functionality for sending notifications when a component is removed from the list or removed from memory alltogether is also introduced in TComponent

TComponent introduces a form of automatic memory management: When a component is destroyed, all its child components will be destroyed first.


TComponent
 | ro | ComObject
 | ro | Components
 | ro | ComponentCount
 |  | ComponentIndex
 | ro | ComponentState
 | ro | ComponentStyle
 |  | DesignInfo
 | ro | Owner
 |  | VCLComObject
pl |  | Name
pl |  | Tag
TPersistent
TObject


TComponent
pt | Notification
 | WriteState
 | Create
 | Destroy
 | BeforeDestruction
 | DestroyComponents
 | Destroying
 | ExecuteAction
 | FindComponent
 | FreeNotification
 | RemoveFreeNotification
 | FreeOnRelease
 | GetEnumerator
 | GetNamePath
 | GetParentComponent
 | HasParent
 | InsertComponent
 | RemoveComponent
 | SafeCallException
 | SetSubComponent
 | UpdateAction
 | IsImplementorOf
 | ReferenceInterface
TPersistent
 | Destroy
 | Assign
 | FPOAttachObserver
 | FPODetachObserver
 | FPONotifyObservers
 | GetNamePath
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


 | AfterConstruction (TObject)
 | Assign (TPersistent)
 | BeforeDestruction (TObject)
 | BeforeDestruction (TComponent)
 | ClassInfo (TObject)
 | ClassName (TObject)
 | ClassNameIs (TObject)
 | ClassParent (TObject)
 | ClassType (TObject)
 | CleanupInstance (TObject)
 | Create (TObject)
 | Create (TComponent)
 | DefaultHandler (TObject)
 | DefaultHandlerStr (TObject)
 | Destroy (TObject)
 | Destroy (TPersistent)
 | Destroy (TComponent)
 | DestroyComponents (TComponent)
 | Destroying (TComponent)
 | Dispatch (TObject)
 | DispatchStr (TObject)
 | Equals (TObject)
 | ExecuteAction (TComponent)
 | FieldAddress (TObject)
 | FindComponent (TComponent)
 | FPOAttachObserver (TPersistent)
 | FPODetachObserver (TPersistent)
 | FPONotifyObservers (TPersistent)
 | Free (TObject)
 | FreeInstance (TObject)
 | FreeNotification (TComponent)
 | FreeOnRelease (TComponent)
 | GetEnumerator (TComponent)
 | GetHashCode (TObject)
 | GetInterface (TObject)
 | GetInterfaceByStr (TObject)
 | GetInterfaceEntry (TObject)
 | GetInterfaceEntryByStr (TObject)
 | GetInterfaceTable (TObject)
 | GetInterfaceWeak (TObject)
 | GetNamePath (TPersistent)
 | GetNamePath (TComponent)
 | GetParentComponent (TComponent)
 | HasParent (TComponent)
 | InheritsFrom (TObject)
 | InitInstance (TObject)
 | InsertComponent (TComponent)
 | InstanceSize (TObject)
 | IsImplementorOf (TComponent)
 | MethodAddress (TObject)
 | MethodName (TObject)
 | newinstance (TObject)
pt | Notification (TComponent)
 | ReferenceInterface (TComponent)
 | RemoveComponent (TComponent)
 | RemoveFreeNotification (TComponent)
 | SafeCallException (TObject)
 | SafeCallException (TComponent)
 | SetSubComponent (TComponent)
 | StringMessageTable (TObject)
 | ToString (TObject)
 | UnitName (TObject)
 | UpdateAction (TComponent)
 | WriteState (TComponent)


TComponent

TPersistent

TObject


TComponent.BeforeDestruction

Overrides standard BeforeDestruction.

Declaration

Source position: classesh.inc line 1842

public procedure TComponent.BeforeDestruction; override;

Description

BeforeDestruction is overridden by TComponent to set the csDestroying flag in TComponent.ComponentState

See also

TComponent.ComponentState

Current component's state.


TComponent.ComObject

Interface reference implemented by the component

Declaration

Source position: classesh.inc line 1860

public property TComponent.ComObject : IUnknown
  read GetComObject;

Description

ComObject returns the COM interface represented by the component. If the component does not represent a COM interface, reading this property will raise an EComponentError.

See also

EComponentError

Exception raised when an error occurs in the component registration routines.


TComponent.ComponentCount

Count of owned components

Declaration

Source position: classesh.inc line 1864

public property TComponent.ComponentCount : Integer
  read GetComponentCount;

Description

ComponentCount returns the number of components that the current component owns. It can be used to determine the valid index range in the Component array.

See also

Components | Indexed list (zero-based) of all owned components.
Owner | Owner of this component.


TComponent.ComponentIndex

Index of component in it's owner's list.

Declaration

Source position: classesh.inc line 1865

public property TComponent.ComponentIndex : Integer
  read GetComponentIndex
  write SetComponentIndex;

Description

ComponentIndex is the index of the current component in its owner's list of components. If the component has no owner, the value of this property is -1.

See also

Components | Indexed list (zero-based) of all owned components.
ComponentCount | Count of owned components
Owner | Owner of this component.


TComponent.Components

Indexed list (zero-based) of all owned components.

Declaration

Source position: classesh.inc line 1863

public property TComponent.Components[Index: Integer] : TComponent
  read GetComponent;

Description

Components provides indexed access to the list of owned components. Index can range from 0 to ComponentCount-1.

See also

ComponentCount | Count of owned components
Owner | Owner of this component.


TComponent.ComponentState

Current component's state.

Declaration

Source position: classesh.inc line 1866

public property TComponent.ComponentState : TComponentState
  read FComponentState;

Description

ComponentState indicates the current state of the component. It is a set of flags which indicate the various stages in the lifetime of a component. The following values can occur in this set:

Component states
Flag | Meaning
csLoading | The component is being loaded from stream
csReading | Component properties are being read from stream.
csWriting | Component properties are weing written to stream.
csDestroying | The component or one of it's owners is being destoyed.
csAncestor | The component is being streamed as part of a frame
csUpdating | The component is being updated
csFixups | References to other components are being resolved
csFreeNotification | The component has freenotifications.
csInline | The component is being loaded as part of a frame
csDesignInstance | ? not used.

The component state is set by various actions such as reading it from stream, destroying it etc.

See also

SetAncestor | Sets the csAncestor state of the component.
SetDesigning | Sets the csDesigning state of the component.
SetInline
SetDesignInstance
Updating | Sets the state to csUpdating
Updated | Ends the csUpdating state.
Loaded | Called when the component has finished loading.


TComponent.ComponentStyle

Current component's style.

Declaration

Source position: classesh.inc line 1867

public property TComponent.ComponentStyle : TComponentStyle
  read FComponentStyle;


TComponent.Create

Creates a new instance of the component.

Declaration

Source position: classesh.inc line 1840

public constructor TComponent.Create(

  AOwner: TComponent

); virtual;

Description

Create creates a new instance of a TComponent class. If AOwner is not Nil, the new component attempts to insert itself in the list of owned components of the owner.

See also

Insert

Owner

Owner of this component.


TComponent.DesignInfo

Information for IDE designer.

Declaration

Source position: classesh.inc line 1868

public property TComponent.DesignInfo : LongInt
  read FDesignInfo
  write FDesignInfo;

Description

DesignInformation can be used by an IDE to store design information in the component. It should not be used by an application programmer.

See also

Tag

Tag value of the component.


TComponent.Destroy

Destroys the instance of the component.

Declaration

Source position: classesh.inc line 1841

public destructor TComponent.Destroy; override;

Description

Destroy sends a opRemove notification to all components in the free-notification list. After that, all owned components are destroyed by calling DestroyComponents (and hence removed from the list of owned components). When this is done, the component removes itself from its owner's child component list. After that, the parent's destroy method is called.

See also

Notification | Called by components that are freed and which received a FreeNotification.
Owner | Owner of this component.
DestroyComponents | Destroy child components.
Components | Indexed list (zero-based) of all owned components.


TComponent.DestroyComponents

Destroy child components.

Declaration

Source position: classesh.inc line 1843

public procedure TComponent.DestroyComponents;

Description

DestroyComponents calls the destructor of all owned components, till no more components are left in the Components array.

Calling the destructor of an owned component has as the effect that the component will remove itself from the list of owned components, if nothing has disrupted the sequence of destructors.

Errors

If an overridden 'destroy' method does not call it's intherited destructor or raises an exception, it's TComponent.Destroy destructor will not be called, which may result in an endless loop.

See also

Destroy | Destroys the instance of the component.
Components | Indexed list (zero-based) of all owned components.


TComponent.Destroying

Called when the component is being destroyed

Declaration

Source position: classesh.inc line 1844

public procedure TComponent.Destroying;

Description

Destroying sets the csDestroying flag in the component's state property, and does the same for all owned components.

It is not necessary to call Destroying directly, the destructor Destroy does this automatically.

See also

State

Destroy

Destroys the instance of the component.


TComponent.ExecuteAction

Standard action execution method.

Declaration

Source position: classesh.inc line 1845

public function TComponent.ExecuteAction(

  Action: TBasicAction

):Boolean; dynamic;

Description

ExecuteAction checks whether Action handles the current component, and if yes, calls the ExecuteAction method, passing itself as a parameter. The function returns True if the action handles the current component.

See also

TBasicAction | Abstract base class for all Actions.
TBasicAction.ExecuteAction
TBasicAction.HandlesTarget | Determines whether Target can be handled by this action
TComponent.UpdateAction | Updates the state of an action.


TComponent.FindComponent

Finds and returns the named component in the owned components.

Declaration

Source position: classesh.inc line 1846

public function TComponent.FindComponent(

  const AName: string

):TComponent;

Description

FindComponent searches the component with name AName in the list of owned components. If AName is empty, then Nil is returned.

See also

Components | Indexed list (zero-based) of all owned components.
Name | Name of the component.


TComponent.FreeNotification

Ask the component to notify called when it is being destroyed.

Declaration

Source position: classesh.inc line 1847

public procedure TComponent.FreeNotification(

  AComponent: TComponent

);

Description

FreeNotification inserts AComponent in the freenotification list. When the component is destroyed, the Notification method is called for all components in the freenotification list.

See also

Components | Indexed list (zero-based) of all owned components.
Notification | Called by components that are freed and which received a FreeNotification.
TComponent.RemoveFreeNotification | Remove a component from the Free Notification list.


TComponent.FreeOnRelease

Part of the IVCLComObject interface.

Declaration

Source position: classesh.inc line 1849

public procedure TComponent.FreeOnRelease;

Description

Provided for Delphi compatibility, but is not yet implemented.


TComponent.GetEnumerator

Create an IEnumerator instance

Declaration

Source position: classesh.inc line 1850

public function TComponent.GetEnumerator: TComponentEnumerator;

Description

GetEnumerator is the implementation of the IEnumerable interface for TComponent. It creates a TComponentEnumerator instance and returns it's IEnumerator interface. The enumerator enumerates all child components of the component instance.

See also

TComponentEnumerator | Implements IEnumerator for the TComponent class.
IEnumerator | Enumerator support interface
IEnumerable | Interface to retrieve an enumerator from a class.


TComponent.GetNamePath

Returns the name path of this component.

Declaration

Source position: classesh.inc line 1851

public function TComponent.GetNamePath: string; override;

Description

GetNamePath returns the name of the component as it will be shown in the object inspector.

TComponent overrides GetNamePath so it returns the Name property of the component.

See also

Name | Name of the component.
TPersistent.GetNamePath | Returns a string that can be used to identify the class instance.


TComponent.GetParentComponent

Returns the parent component.

Declaration

Source position: classesh.inc line 1852

public function TComponent.GetParentComponent: TComponent; dynamic;

Description

GetParentComponent can be implemented to return the parent component of this component. The implementation of this method in TComponent always returns Nil. Descendant classes must override this method to return the visual parent of the component.

See also

HasParent | Does the component have a parent ?
Owner | Owner of this component.


TComponent.HasParent

Does the component have a parent ?

Declaration

Source position: classesh.inc line 1853

public function TComponent.HasParent: Boolean; dynamic;

Description

HasParent can be implemented to return whether the parent of the component exists. The implementation of this method in TComponent always returns False, and should be overridden by descendant classes to return True when a parent is available. If HasParent returns True, then GetParentComponent will return the parent component.

See also

HasParent | Does the component have a parent ?
Owner | Owner of this component.


TComponent.InsertComponent

Insert the given component in the list of owned components.

Declaration

Source position: classesh.inc line 1854

public procedure TComponent.InsertComponent(

  AComponent: TComponent

);

Description

InsertComponent attempts to insert AComponent in the list with owned components. It first calls ValidateComponent to see whether the component can be inserted. It then checks whether there are no name conflicts by calling ValidateRename. If neither of these checks have raised an exception the component is inserted, and notified of the insert.

See also

RemoveComponent | Remove the given component from the list of owned components.
Insert
ValidateContainer | ??
ValidateRename | Called when a name change must be validated
Notification | Called by components that are freed and which received a FreeNotification.


TComponent.IsImplementorOf

Checks if the current component is the implementor of the interface

Declaration

Source position: classesh.inc line 1861

public function TComponent.IsImplementorOf(

  const Intf: IInterface

):Boolean;

Description

IsImplementorOf returns True if the current component implements the given interface. The interface should descend from IInterfaceComponentReference and the GetComponent method should return the current instance.

See also

IInterfaceComponentReference

Interface for checking component references


TComponent.Name

Name of the component.

Declaration

Source position: classesh.inc line 1872

published property TComponent.Name : TComponentName
  read FName
  write SetName
  stored False;

Description

Name is the name of the component. This name should be a valid identifier, i.e. must start with a letter or underscore, and can contain only letters, numbers and the underscore character. When attempting to set the name of a component, the name will be checked for validity. Furthermore, when a component is owned by another component, the name must be either empty or must be unique among the child component names.

By "letters", 7-bit letters are meant.

Errors

Attempting to set the name to an invalid value will result in an exception being raised.

See also

ValidateRename | Called when a name change must be validated
Owner | Owner of this component.


TComponent.Notification

Called by components that are freed and which received a FreeNotification.

Declaration

Source position: classesh.inc line 1803

protected procedure TComponent.Notification(

  AComponent: TComponent;

  Operation: TOperation

); virtual;

Description

Notification is called whenever a child component is destroyed, inserted or removed from the list of owned component. Components that were requested to send a notification when they are freed ((with FreeNotification) will also call Notification when they are freed.

The AComponent parameter specifies which component sends the notification, and Operation specifies whether the component is being inserted into or removed from the child component list, or whether it is being destroyed.

Descendants of TComponent can use FreeNotification to request notification of the destruction of another object. By overriding the Notification method, they can do special processing (typically, set a reference to this component to Nil) when this component is destroyed. The Notification method is called quite often in the streaming process, so speed should be a consideration when overriding this method.

See also

TOperation | Operation of which a component is notified.
TComponent.FreeNotification | Ask the component to notify called when it is being destroyed.
TComponent.RemoveFreeNotification | Remove a component from the Free Notification list.


TComponent.Owner

Owner of this component.

Declaration

Source position: classesh.inc line 1869

public property TComponent.Owner : TComponent
  read FOwner;

Description

Owner returns the owner of this component. The owner cannot be set except by explicitly inserting the component in another component's owned components list using that component's InsertComponent method, or by removing the component from it's owner's owned component list using the RemoveComponent method.

See also

Components | Indexed list (zero-based) of all owned components.
InsertComponent | Insert the given component in the list of owned components.
RemoveComponent | Remove the given component from the list of owned components.


TComponent.ReferenceInterface

Interface implementation of Notification

Declaration

Source position: classesh.inc line 1862

public procedure TComponent.ReferenceInterface(

  const intf: IInterface;

  op: TOperation

);

Description

ReferenceInterface can be used to notify an interface of a component operation: it is the equivalent of the TComponent.Notification method of TComponent for interfaces. If the interface implements IInterfaceComponentReference, then the component that implements the interface is notified of the given operation Op.

Errors

None.

See also

TComponent.Notification | Called by components that are freed and which received a FreeNotification.
IInterfaceComponentReference | Interface for checking component references


TComponent.RemoveComponent

Remove the given component from the list of owned components.

Declaration

Source position: classesh.inc line 1855

public procedure TComponent.RemoveComponent(

  AComponent: TComponent

);

Description

RemoveComponent will send an opRemove notification to AComponent and will then proceed to remove AComponent from the list of owned components.

See also

InsertComponent | Insert the given component in the list of owned components.
Remove
ValidateRename | Called when a name change must be validated
Notification | Called by components that are freed and which received a FreeNotification.


TComponent.RemoveFreeNotification

Remove a component from the Free Notification list.

Declaration

Source position: classesh.inc line 1848

public procedure TComponent.RemoveFreeNotification(

  AComponent: TComponent

);

Description

RemoveFreeNotification removes AComponent from the freenotification list.

See also

TComponent.FreeNotification

Ask the component to notify called when it is being destroyed.


TComponent.SafeCallException

Part of the IVCLComObject Interface.

Declaration

Source position: classesh.inc line 1856

public function TComponent.SafeCallException(

  ExceptObject: TObject;

  ExceptAddr: CodePointer

):HRESULT; override;

Description

Provided for Delphi compatibility, but not implemented.


TComponent.SetSubComponent

Sets the csSubComponent style.

Declaration

Source position: classesh.inc line 1858

public procedure TComponent.SetSubComponent(

  ASubComponent: Boolean

);

Description

SetSubComponent includes csSubComponent in the ComponentStyle property if ASubComponent is True, and excludes it again if ASubComponent is False.

See also

TComponent.ComponentStyle

Current component's style.


TComponent.Tag

Tag value of the component.

Declaration

Source position: classesh.inc line 1873

published property TComponent.Tag : PtrInt
  read FTag
  write FTag
  default 0;

Description

Tag can be used to store an integer value in the component. This value is streamed together with all other published properties. It can be used for instance to quickly identify a component in an event handler.

See also

Name

Name of the component.


TComponent.UpdateAction

Updates the state of an action.

Declaration

Source position: classesh.inc line 1859

public function TComponent.UpdateAction(

  Action: TBasicAction

):Boolean; dynamic;

Description

UpdateAction checks whether Action handles the current component, and if yes, calls the UpdateTarget method, passing itself as a parameter. The function returns True if the action handles the current component.

See also

TBasicAction | Abstract base class for all Actions.
TBasicAction.UpdateTarget | Notify client controls when the action updates itself.
TBasicAction.HandlesTarget | Determines whether Target can be handled by this action
TBasicAction.ExecuteAction


TComponent.VCLComObject

Not implemented.

Declaration

Source position: classesh.inc line 1870

public property TComponent.VCLComObject : Pointer
  read FVCLComObject
  write FVCLComObject;

Description

VCLComObject is not yet implemented in Free Pascal.


TComponent.WriteState

Writes the component to a stream.

Declaration

Source position: classesh.inc line 1839

public procedure TComponent.WriteState(

  Writer: TWriter

); virtual;

Description

WriteState writes the component's current state to a stream through the writer object writer. Values for all published properties of the component can be written to the stream. Normally there is no need to call WriteState directly. The streaming system calls WriteState itself.

The TComponent implementation of WriteState simply calls TWriter.WriteData. Descendant classes can, however, override WriteStateto provide additional processing of stream data.

See also

ReadState | Read the component's state from a stream.
TStream.WriteComponent | Write component data to the stream
TWriter.WriteData


TComponentClass

Class of TComponent

Declaration

Source position: classesh.inc line 1117

type TComponentClass = class of TComponent;

Description

The TComponentClass type is used when constructing TComponent descendant instances and when registering components.

See also

TComponent

Base class for all components that need owner-owned functionality.


TComponentEnumerator

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Implements IEnumerator for the TComponent class.

Declaration

Source position: classesh.inc line 1755

type TComponentEnumerator = class
public
constructor Create(); | Initialize a new instance of TComponentEnumerator
function GetCurrent; | Return the current pointer in the list
function MoveNext; | Move the position of the enumerator to the next position in the children of the component.
property Current: TComponent; [r] | Current pointer in the list
end;

Inheritance

TComponentEnumerator

Implements IEnumerator for the TComponent class.
|

TObject

Description

TComponentEnumerator implements the #rtl.system.IEnumerator interface for the TComponent class, so the TComponent class can be used in a for ... in loop over the TComponent.Components child components of the component. It is returned by the TComponent.GetEnumerator method of TComponent.

See also

TComponent | Base class for all components that need owner-owned functionality.
TComponent.GetEnumerator | Create an IEnumerator instance
#rtl.system.IEnumerator | Enumerator support interface


TComponentEnumerator

ro

Current


TComponentEnumerator
 | Create
 | GetCurrent
 | MoveNext


Create (TComponentEnumerator)

GetCurrent (TComponentEnumerator)

MoveNext (TComponentEnumerator)


TComponentEnumerator


TComponentEnumerator.Create

Initialize a new instance of TComponentEnumerator

Declaration

Source position: classesh.inc line 1760

public constructor TComponentEnumerator.Create(

  AComponent: TComponent

);

Description

Create initializes a new instance of TComponentEnumerator and keeps a reference to the component AComponent that will be enumerated.

See also

TComponent

Base class for all components that need owner-owned functionality.


TComponentEnumerator.Current

Current pointer in the list

Declaration

Source position: classesh.inc line 1763

public property TComponentEnumerator.Current : TComponent
  read GetCurrent;

Description

Current redefines GetCurrent as a property.

See also

GetCurrent

Return the current pointer in the list


TComponentEnumerator.GetCurrent

Return the current pointer in the list

Declaration

Source position: classesh.inc line 1761

public function TComponentEnumerator.GetCurrent: TComponent;

Description

GetCurrent returns the current TComponent child component instance in the enumerator.

Errors

No checking is done on the validity of the current position.

See also

MoveNext | Move the position of the enumerator to the next position in the children of the component.
TComponent.Components | Indexed list (zero-based) of all owned components.


TComponentEnumerator.MoveNext

Move the position of the enumerator to the next position in the children of the component.

Declaration

Source position: classesh.inc line 1762

public function TComponentEnumerator.MoveNext: Boolean;

Description

MoveNext puts the pointer on the next child in the components child components, and returns True if this succeeded, or False if the pointer is past the last child in the list.

Errors

Note that if False is returned, calling GetCurrent will result in an exception.

See also

GetCurrent

Return the current pointer in the list


TCustomMemoryStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Abstract stream that stores its data in memory.

Declaration

Source position: classesh.inc line 959

type TCustomMemoryStream = class(TStream)
public
function Read(); override; | Reads Count bytes from the stream into buffer.
function Seek(); override; | Sets a new position in the stream.
procedure SaveToStream(); | Writes the contents of the memory stream to another stream.
procedure SaveToFile(); | Writes the contents of the stream to a file.
property Memory: Pointer; [r] | Pointer to the data kept in the memory stream.
end;

Inheritance

TCustomMemoryStream | Abstract stream that stores its data in memory.
|
TStream | Base class for streams.
|
TObject | Base class of all classes.

Description

TCustomMemoryStream is the parent class for streams that stored their data in memory. It introduces all needed functions to handle reading from and navigating through the memory, and introduces a Memory property which points to the memory area where the stream data is kept.

The only thing which TCustomMemoryStream does not do is obtain memory to store data when writing data or the writing of data. This functionality is implemented in descendant streams such as TMemoryStream. The reason for this approach is that this way it is possible to create e.g. read-only descendants of TCustomMemoryStream that point to a fixed part in memory which can be read from, but not written to.

Remark: Since TCustomMemoryStream is an abstract class, do not create instances of TMemoryStream directly. Instead, create instances of descendants such as TMemoryStream.

See also

TMemoryStream | Standard implementation of a stream that stores its data in memory
TStream | Base class for streams.


TCustomMemoryStream
 | ro | Memory
TStream
 |  | Position
 |  | Size
TObject


TCustomMemoryStream
 | Read
 | Seek
 | SaveToStream
 | SaveToFile
TStream
 | Read
 | Write
 | Seek
 | ReadBuffer
 | WriteBuffer
 | CopyFrom
 | ReadComponent
 | ReadComponentRes
 | WriteComponent
 | WriteComponentRes
 | WriteDescendent
 | WriteDescendentRes
 | WriteResourceHeader
 | FixupResourceHeader
 | ReadResHeader
 | ReadByte
 | ReadWord
 | ReadDWord
 | ReadQWord
 | ReadAnsiString
 | WriteByte
 | WriteWord
 | WriteDWord
 | WriteQWord
 | WriteAnsiString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

CopyFrom (TStream)

Create (TObject)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

FieldAddress (TObject)

FixupResourceHeader (TStream)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

Read (TStream)

Read (TCustomMemoryStream)

ReadAnsiString (TStream)

ReadBuffer (TStream)

ReadByte (TStream)

ReadComponent (TStream)

ReadComponentRes (TStream)

ReadDWord (TStream)

ReadQWord (TStream)

ReadResHeader (TStream)

ReadWord (TStream)

SafeCallException (TObject)

SaveToFile (TCustomMemoryStream)

SaveToStream (TCustomMemoryStream)

Seek (TStream)

Seek (TCustomMemoryStream)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)

Write (TStream)

WriteAnsiString (TStream)

WriteBuffer (TStream)

WriteByte (TStream)

WriteComponent (TStream)

WriteComponentRes (TStream)

WriteDescendent (TStream)

WriteDescendentRes (TStream)

WriteDWord (TStream)

WriteQWord (TStream)

WriteResourceHeader (TStream)

WriteWord (TStream)


TCustomMemoryStream

TStream

TObject


TCustomMemoryStream.Memory

Pointer to the data kept in the memory stream.

Declaration

Source position: classesh.inc line 972

public property TCustomMemoryStream.Memory : Pointer
  read FMemory;

Description

Memory points to the memory area where stream keeps it's data. The property is read-only, so the pointer cannot be set this way.

Remark: Do not write to the memory pointed to by Memory, since the memory content may be read-only, and thus writing to it may cause errors.

See also

TStream.Size

The current size of the stream.


TCustomMemoryStream.Read

Reads Count bytes from the stream into buffer.

Declaration

Source position: classesh.inc line 968

public function TCustomMemoryStream.Read(

  var Buffer;

  Count: LongInt

):LongInt; override;

Description

Read reads Count bytes from the stream into the memory pointed to by buffer. It returns the number of bytes actually read.

This method overrides the TStream.Read method of TStream. It will read as much bytes as are still available in the memory area pointer to by Memory. After the bytes are read, the internal stream position is updated.

See also

TCustomMemoryStream.Memory | Pointer to the data kept in the memory stream.
TStream.Read | Reads data from the stream to a buffer and returns the number of bytes read.


TCustomMemoryStream.SaveToFile

Writes the contents of the stream to a file.

Declaration

Source position: classesh.inc line 971

public procedure TCustomMemoryStream.SaveToFile(

  const FileName: string

);

Description

SaveToFile writes the contents of the stream to a file with name FileName. It simply creates a filestream and writes the contents of the memorystream to this file stream using TCustomMemoryStream.SaveToStream.

Remark:

This method will work much faster than the use of the TStream.CopyFrom method:

Stream:=TFileStream.Create(fmCreate,FileName);
  Seek(0,soFromBeginning);
  Stream.CopyFrom(Self,Size);

because the CopyFrom method copies the contents in blocks, while SaveToFile writes the contents of the memory as one big block.

Errors

If an error occurs when creating or writing to the file, an EStreamError exception may occur.

See also

TCustomMemoryStream.SaveToStream | Writes the contents of the memory stream to another stream.
TFileStream | Stream that stores its data in a named file on disk.
TStream.CopyFrom | Copy data from one stream to another


TCustomMemoryStream.SaveToStream

Writes the contents of the memory stream to another stream.

Declaration

Source position: classesh.inc line 970

public procedure TCustomMemoryStream.SaveToStream(

  Stream: TStream

);

Description

SaveToStream writes the contents of the memory stream to Stream. The content of Stream is not cleared first. The current position of the memory stream is not changed by this action.

Remark:

This method will work much faster than the use of the TStream.CopyFrom method:

Seek(0,soFromBeginning);
  Stream.CopyFrom(Self,Size);

because the CopyFrom method copies the contents in blocks, while SaveToStream writes the contents of the memory as one big block.

Errors

If an error occurs when writing to Stream an EStreamError exception will be raised.

See also

TCustomMemoryStream.SaveToFile | Writes the contents of the stream to a file.
TStream.CopyFrom | Copy data from one stream to another


TCustomMemoryStream.Seek

Sets a new position in the stream.

Declaration

Source position: classesh.inc line 969

public function TCustomMemoryStream.Seek(

  const Offset: Int64;

  Origin: TSeekOrigin

):Int64; override;

Description

Seek overrides the abstract TStream.Seek method. It simply updates the internal stream position, and returns the new position.

Errors

No checking is done whether the new position is still a valid position, i.e. whether the position is still within the range 0..Size. Attempting a seek outside the valid memory range of the stream may result in an exception at the next read or write operation.

See also

TStream.Position | The current position in the stream.
TStream.Size | The current size of the stream.
TCustomMemoryStream.Memory | Pointer to the data kept in the memory stream.


TDataModule

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Container for non-visual components.

Declaration

Source position: classesh.inc line 2008

type TDataModule = class(TComponent)
public
constructor Create(); override; | Create a new instance of a TDataModule.
constructor CreateNew(); |
destructor Destroy; override; | Destroys the TDataModule instance.
procedure AfterConstruction; override; | Overrides standard TObject behaviour.
procedure BeforeDestruction; override; |
property DesignOffset: TPoint; [rw] | Position property needed for manipulation in an IDE.
property DesignSize: TPoint; [rw] | Size property needed for manipulation in an IDE.
property DesignPPI: Integer; [rw]
published
property OnCreate: TNotifyEvent; [rw] | Event handler, called when the datamodule is created.
property OnDestroy: TNotifyEvent; [rw] | Event handler, called when the datamodule is destroyed.
property OldCreateOrder: Boolean; [rw] | Determines when OnCreate and OnDestroy are triggered.
end;

Inheritance

TDataModule | Container for non-visual components.
|
TComponent,IUnknown,IInterfaceComponentReference | Base class for all components that need owner-owned functionality.
|
TPersistent,IFPObserved | Base class for streaming system and persistent properties.
|
TObject | Base class of all classes.

Description

TDataModule is a container for non-visual objects which can be used in an IDE to group non-visual objects which can be used by various other containers (forms) in a project. Notably, data access components are typically stored on a datamodule. Web components and services can also be implemented as descendants of datamodules.

TDataModule introduces some events which make it easier to program, and provides the needed streaming capabilities for persistent storage.

An IDE will typically allow to create a descendant of TDataModule which contains non-visual components in it's published property list.

See also

TDataModule.OnCreate

Event handler, called when the datamodule is created.


TDataModule
 |  | DesignOffset
 |  | DesignSize
 |  | DesignPPI
pl |  | OldCreateOrder
TComponent
 | ro | ComObject
 | ro | Components
 | ro | ComponentCount
 |  | ComponentIndex
 | ro | ComponentState
 | ro | ComponentStyle
 |  | DesignInfo
 | ro | Owner
 |  | VCLComObject
pl |  | Name
pl |  | Tag
TPersistent
TObject


 | ro | ComObject (TComponent)
 | ro | ComponentCount (TComponent)
 |  | ComponentIndex (TComponent)
 | ro | Components (TComponent)
 | ro | ComponentState (TComponent)
 | ro | ComponentStyle (TComponent)
 |  | DesignInfo (TComponent)
 |  | DesignOffset (TDataModule)
 |  | DesignPPI (TDataModule)
 |  | DesignSize (TDataModule)
pl |  | Name (TComponent)
pl |  | OldCreateOrder (TDataModule)
 | ro | Owner (TComponent)
pl |  |


TDataModule
 | Create
 | CreateNew
 | Destroy
 | AfterConstruction
 | BeforeDestruction
TComponent
pt | Notification
 | WriteState
 | Create
 | Destroy
 | BeforeDestruction
 | DestroyComponents
 | Destroying
 | ExecuteAction
 | FindComponent
 | FreeNotification
 | RemoveFreeNotification
 | FreeOnRelease
 | GetEnumerator
 | GetNamePath
 | GetParentComponent
 | HasParent
 | InsertComponent
 | RemoveComponent
 | SafeCallException
 | SetSubComponent
 | UpdateAction
 | IsImplementorOf
 | ReferenceInterface
TPersistent
 | Destroy
 | Assign
 | FPOAttachObserver
 | FPODetachObserver
 | FPONotifyObservers
 | GetNamePath
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


 | AfterConstruction (TObject)
 | AfterConstruction (TDataModule)
 | Assign (TPersistent)
 | BeforeDestruction (TObject)
 | BeforeDestruction (TComponent)
 | BeforeDestruction (TDataModule)
 | ClassInfo (TObject)
 | ClassName (TObject)
 | ClassNameIs (TObject)
 | ClassParent (TObject)
 | ClassType (TObject)
 | CleanupInstance (TObject)
 | Create (TObject)
 | Create (TComponent)
 | Create (TDataModule)
 | CreateNew (TDataModule)
 | DefaultHandler (TObject)
 | DefaultHandlerStr (TObject)
 | Destroy (TObject)
 | Destroy (TPersistent)
 | Destroy (TComponent)
 | Destroy (TDataModule)
 | DestroyComponents (TComponent)
 | Destroying (TComponent)
 | Dispatch (TObject)
 | DispatchStr (TObject)
 | Equals (TObject)
 | ExecuteAction (TComponent)
 | FieldAddress (TObject)
 | FindComponent (TComponent)
 | FPOAttachObserver (TPersistent)
 | FPODetachObserver (TPersistent)
 | FPONotifyObservers (TPersistent)
 | Free (TObject)
 | FreeInstance (TObject)
 | FreeNotification (TComponent)
 | FreeOnRelease (TComponent)
 | GetEnumerator (TComponent)
 | GetHashCode (TObject)
 | GetInterface (TObject)
 | GetInterfaceByStr (TObject)
 | GetInterfaceEntry (TObject)
 | GetInterfaceEntryByStr (TObject)
 | GetInterfaceTable (TObject)
 | GetInterfaceWeak (TObject)
 | GetNamePath (TPersistent)
 | GetNamePath (TComponent)
 | GetParentComponent (TComponent)
 | HasParent (TComponent)
 | InheritsFrom (TObject)
 | InitInstance (TObject)
 | InsertComponent (TComponent)
 | InstanceSize (TObject)
 | IsImplementorOf (TComponent)
 | MethodAddress (TObject)
 | MethodName (TObject)
 | newinstance (TObject)
pt | Notification (TComponent)
 | ReferenceInterface (TComponent)
 | RemoveComponent (TComponent)
 | RemoveFreeNotification (TComponent)
 | SafeCallException (TObject)
 | SafeCallException (TComponent)
 | SetSubComponent (TComponent)
 | StringMessageTable (TObject)
 | ToString (TObject)
 | UnitName (TObject)
 | UpdateAction (TComponent)
 | WriteState (TComponent)


TDataModule
pl | OnCreate
pl | OnDestroy
TComponent
TPersistent
TObject


pl | OnCreate (TDataModule)
pl |


TDataModule.AfterConstruction

Overrides standard TObject behaviour.

Declaration

Source position: classesh.inc line 2038

public procedure TDataModule.AfterConstruction; override;

Description

AfterConstruction calls the OnCreate handler if the OldCreateOrder property is False.

See also

TDataModule.OldCreateOrder | Determines when OnCreate and OnDestroy are triggered.
TDataModule.OnCreate | Event handler, called when the datamodule is created.


TDataModule.BeforeDestruction

Declaration

Source position: classesh.inc line 2039

public procedure TDataModule.BeforeDestruction; override;

Description

BeforeDestruction calls the OnDestroy handler if the OldCreateOrder property is False.

See also

TDataModule.OldCreateOrder | Determines when OnCreate and OnDestroy are triggered.
TDataModule.OnDestroy | Event handler, called when the datamodule is destroyed.


TDataModule.Create

Create a new instance of a TDataModule.

Declaration

Source position: classesh.inc line 2034

public constructor TDataModule.Create(

  AOwner: TComponent

); override;

Description

Create creates a new instance of the TDatamodule and calls TDatamodule.CreateNew. After that it reads the published properties from a stream using InitInheritedComponent if a descendant class is instantiated. If the OldCreateOrder property is True, the TDataModule.OnCreate event is called.

Errors

An exception can be raised during the streaming operation.

See also

TDataModule.CreateNew


TDataModule.CreateNew

Declaration

Source position: classesh.inc line 2035

public constructor TDataModule.CreateNew(

  AOwner: TComponent

);

constructor TDataModule.CreateNew(

  AOwner: TComponent;

  CreateMode: Integer

); virtual;

Description

CreateNew creates a new instance of the class, but bypasses the streaming mechanism. The CreateMode parameter (by default zero) is not used in TDataModule. If the AddDataModule handler is set, then it is called, with the newly created instance as an argument.

See also

TDataModule.Create | Create a new instance of a TDataModule.
AddDataModule | Handler called when a new TDataModule instance is created.
TDataModule.OnCreate | Event handler, called when the datamodule is created.


TDataModule.DesignOffset

Position property needed for manipulation in an IDE.

Declaration

Source position: classesh.inc line 2040

public property TDataModule.DesignOffset : TPoint
  read FDPos
  write FDPos;

Description

DesignOffset is the position of the datamodule when displayed in an IDE. It is streamed to the form file, and should not be used at run-time.

See also

TDataModule.DesignSize

Size property needed for manipulation in an IDE.


TDataModule.DesignPPI

Declaration

Source position: classesh.inc line 2042

public property TDataModule.DesignPPI : Integer
  read FDPPI
  write FDPPI;


TDataModule.DesignSize

Size property needed for manipulation in an IDE.

Declaration

Source position: classesh.inc line 2041

public property TDataModule.DesignSize : TPoint
  read FDSize
  write FDSize;

Description

DesignSize is the size of the datamodule when displayed in an IDE. It is streamed to the form file, and should not be used at run-time.

See also

TDataModule.DesignOffset

Position property needed for manipulation in an IDE.


TDataModule.Destroy

Destroys the TDataModule instance.

Declaration

Source position: classesh.inc line 2037

public destructor TDataModule.Destroy; override;

Description

Destroy destroys the TDataModule instance. If the OldCreateOrder property is True the OnDestroy event handler is called prior to destroying the data module.

Before calling the inherited destroy, the RemoveDataModule handler is called if it is set, and Self is passed as a parameter.

Errors

An event can be raised during the OnDestroy event handler.

See also

TDataModule.OnDestroy | Event handler, called when the datamodule is destroyed.
RemoveDataModule | Handler called when a TDataModule instance is freed.


TDataModule.OldCreateOrder

Determines when OnCreate and OnDestroy are triggered.

Declaration

Source position: classesh.inc line 2046

published property TDataModule.OldCreateOrder : Boolean
  read FOldOrder
  write FOldOrder;

Description

OldCreateOrder determines when exactly the OnCreate and OnDestroy event handlers are called.

If set to True, then the OnCreate event handler is called after the data module was streamed. If it is set to False, then the handler is called prior to the streaming process.

If set to True, then the OnDestroy event handler is called before the data module is removed from the streaming system. If it is set to False, then the handler is called after the data module was removed from the streaming process.

See also

TDataModule.OnDestroy | Event handler, called when the datamodule is destroyed.
TDataModule.OnCreate | Event handler, called when the datamodule is created.
TDataModule.Destroy | Destroys the TDataModule instance.
TDataModule.Create | Create a new instance of a TDataModule.
TDataModule.CreateNew |
TDataModule.OldCreateOrder | Determines when OnCreate and OnDestroy are triggered.


TDataModule.OnCreate

Event handler, called when the datamodule is created.

Declaration

Source position: classesh.inc line 2044

published property TDataModule.OnCreate : TNotifyEvent
  read FOnCreate
  write FOnCreate;

Description

The OnCreate event is triggered when the datamodule is created and streamed. The exact moment of triggering is dependent on the value of the OldCreateOrder property.

See also

TDataModule.Create | Create a new instance of a TDataModule.
TDataModule.CreateNew |
TDataModule.OldCreateOrder | Determines when OnCreate and OnDestroy are triggered.


TDataModule.OnDestroy

Event handler, called when the datamodule is destroyed.

Declaration

Source position: classesh.inc line 2045

published property TDataModule.OnDestroy : TNotifyEvent
  read FOnDestroy
  write FOnDestroy;

Description

The OnDestroy event is triggered when the datamodule is destroyed The exact moment of triggering is dependent on the value of the OldCreateOrder property.

See also

TDataModule.Destroy | Destroys the TDataModule instance.
TDataModule.OnCreate | Event handler, called when the datamodule is created.
TDataModule.Create | Create a new instance of a TDataModule.
TDataModule.CreateNew |
TDataModule.OldCreateOrder | Determines when OnCreate and OnDestroy are triggered.


TDataModuleClass

Class pointer for TDataModule

Declaration

Source position: classesh.inc line 2048

type TDataModuleClass = class of TDataModule;

Description

TDataModuleClass defines the class pointer for TDataModule.

See also

TDataModule

Container for non-visual components.


TFiler

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Class responsible for streaming of components.

Declaration

Source position: classesh.inc line 1093

type TFiler = class(TObject)
public
procedure DefineProperty(); virtual; abstract; |
procedure DefineBinaryProperty(); virtual; abstract; |
property Root: TComponent; [rw] | The root component is the initial component which is being streamed.
property LookupRoot: TComponent; [r] | Component used to look up ancestor components.
property Ancestor: TPersistent; [rw] | Ancestor component from which an inherited component is streamed.
property IgnoreChildren: Boolean; [rw] | Determines whether children will be streamed as well.
end;

Inheritance

TFiler | Class responsible for streaming of components.
|
TObject | Base class of all classes.


TFiler
 |  | Root
 | ro | LookupRoot
 |  | Ancestor
 |  | IgnoreChildren
TObject


TFiler
 | DefineProperty
 | DefineBinaryProperty
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Create (TObject)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

DefineBinaryProperty (TFiler)

DefineProperty (TFiler)

Destroy (TObject)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

FieldAddress (TObject)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

SafeCallException (TObject)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)


TFiler

TObject


TFiler.Ancestor

Ancestor component from which an inherited component is streamed.

Declaration

Source position: classesh.inc line 1110

public property TFiler.Ancestor : TPersistent
  read FAncestor
  write FAncestor;

Description

When streaming a component, this is the parent component. Only properties that differ from the parent's property value will be streamed.

See also

Root | The root component is the initial component which is being streamed.
LookupRoot | Component used to look up ancestor components.


TFiler.DefineBinaryProperty

Declaration

Source position: classesh.inc line 1105

public procedure TFiler.DefineBinaryProperty(

  const Name: string;

  ReadData: TStreamProc;

  WriteData: TStreamProc;

  HasData: Boolean

); virtual; abstract;


TFiler.DefineProperty

Declaration

Source position: classesh.inc line 1102

public procedure TFiler.DefineProperty(

  const Name: string;

  ReadData: TReaderProc;

  WriteData: TWriterProc;

  HasData: Boolean

); virtual; abstract;


TFiler.IgnoreChildren

Determines whether children will be streamed as well.

Declaration

Source position: classesh.inc line 1111

public property TFiler.IgnoreChildren : Boolean
  read FIgnoreChildren
  write FIgnoreChildren;

Description

By default, all children (i.e. owned objects) will also be streamed when streaming a component. This property can be used to prevent owned objects from being streamed.


TFiler.LookupRoot

Component used to look up ancestor components.

Declaration

Source position: classesh.inc line 1109

public property TFiler.LookupRoot : TComponent
  read FLookupRoot;

Description

When comparing inherited component's values against parent values, the values are compared with the component in LookupRoot. Initially, it is set to Root.

See also

Root

The root component is the initial component which is being streamed.


TFiler.Root

The root component is the initial component which is being streamed.

Declaration

Source position: classesh.inc line 1108

public property TFiler.Root : TComponent
  read FRoot
  write SetRoot;

Description

The streaming process will stream a component and all the components which it owns. The Root component is the component which is initially streamed.

See also

LookupRoot

Component used to look up ancestor components.


TFilerFlag

Flags used by the TFiler class

Declaration

Source position: classesh.inc line 1086

type TFilerFlag = (
ffInherited, | Stored object is an inherited object.
ffChildPos, | The position of the child on it's parent is included.
ffInline | Used for frames.
);

Description

The TFiler class uses this enumeration type to decide whether the streamed object was streamed as part of an inherited form or not.

See also

TFiler

Class responsible for streaming of components.


TFilerFlags

Set of TFilerFlag

Declaration

Source position: classesh.inc line 1087

type TFilerFlags = set of (
ffInherited, | Stored object is an inherited object.
ffChildPos, | The position of the child on it's parent is included.
ffInline | Used for frames.
);


TFileStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Stream that stores its data in a named file on disk.

Declaration

Source position: classesh.inc line 947

type TFileStream = class(THandleStream)
public
constructor Create(); | Creates a file stream.
destructor Destroy; override; | Destroys the file stream.
property FileName: string; [r] | The filename of the stream.
end;

Inheritance

TFileStream | Stream that stores its data in a named file on disk.
|
THandleStream | Base class for streams that are identified by an OS handle.
|
TStream | Base class for streams.
|
TObject | Base class of all classes.

Description

TFileStream is a TStream descendant that stores or reads it's data from a named file in the filesystem of the operating system.

To this end, it overrides some of the methods in TStream and implements them for the case of files on disk, and it adds the FileName property to the list of public properties.

See also

TFileStream.Create | Creates a file stream.
TStream | Base class for streams.


TFileStream
 | ro | FileName
THandleStream
 | ro | Handle
TStream
 |  | Position
 |  | Size
TObject


ro | FileName (TFileStream)
ro |


TFileStream
 | Create
 | Destroy
THandleStream
 | Create
 | Read
 | Write
 | Seek
TStream
 | Read
 | Write
 | Seek
 | ReadBuffer
 | WriteBuffer
 | CopyFrom
 | ReadComponent
 | ReadComponentRes
 | WriteComponent
 | WriteComponentRes
 | WriteDescendent
 | WriteDescendentRes
 | WriteResourceHeader
 | FixupResourceHeader
 | ReadResHeader
 | ReadByte
 | ReadWord
 | ReadDWord
 | ReadQWord
 | ReadAnsiString
 | WriteByte
 | WriteWord
 | WriteDWord
 | WriteQWord
 | WriteAnsiString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

CopyFrom (TStream)

Create (TObject)

Create (THandleStream)

Create (TFileStream)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Destroy (TFileStream)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

FieldAddress (TObject)

FixupResourceHeader (TStream)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

Read (TStream)

Read (THandleStream)

ReadAnsiString (TStream)

ReadBuffer (TStream)

ReadByte (TStream)

ReadComponent (TStream)

ReadComponentRes (TStream)

ReadDWord (TStream)

ReadQWord (TStream)

ReadResHeader (TStream)

ReadWord (TStream)

SafeCallException (TObject)

Seek (TStream)

Seek (THandleStream)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)

Write (TStream)

Write (THandleStream)

WriteAnsiString (TStream)

WriteBuffer (TStream)

WriteByte (TStream)

WriteComponent (TStream)

WriteComponentRes (TStream)

WriteDescendent (TStream)

WriteDescendentRes (TStream)

WriteDWord (TStream)

WriteQWord (TStream)

WriteResourceHeader (TStream)

WriteWord (TStream)


TFileStream

THandleStream

TStream

TObject


TFileStream.Create

Creates a file stream.

Declaration

Source position: classesh.inc line 951

public constructor TFileStream.Create(

  const AFileName: string;

  Mode: Word

);

constructor TFileStream.Create(

  const AFileName: string;

  Mode: Word;

  Rights: Cardinal

);

Description

Create creates a new instance of a TFileStream class. It opens the file AFileName with mode Mode, which can have one of the following values:

fmCreate | TFileStream.Create creates a new file if needed.
fmOpenRead | TFileStream.Create opens a file with read-only access.
fmOpenWrite | TFileStream.Create opens a file with write-only access.
fmOpenReadWrite | TFileStream.Create opens a file with read-write access.

These constants (except fmCreate) can be OR-ed with the following to specify how sharing and file locking is supposed to be handled:

fmShareCompat | Open file in DOS share-compatibility mode
fmShareExclusive | Lock file for exclusive use
fmShareDenyWrite | Lock file so other processes can only read.
fmShareDenyRead | Lock file so other processes cannot read.
fmShareDenyNone | Do not lock file.

Note that sharing is advisory on Unix-like platforms.

After the file has been opened in the requested mode and a handle has been obtained from the operating system, the inherited constructor is called.

Errors

If the file could not be opened in the requested mode, an EFOpenError exception is raised.

See also

TStream | Base class for streams.
TFileStream.FileName | The filename of the stream.
THandleStream.Create | Create a handlestream from an OS Handle.


TFileStream.Destroy

Destroys the file stream.

Declaration

Source position: classesh.inc line 953

public destructor TFileStream.Destroy; override;

Description

Destroy closes the file (causing possible buffered data to be written to disk) and then calls the inherited destructor.

Do not call destroy directly, instead call the Free method. Destroy does not check whether Self is nil, while Free does.

See also

TFileStream.Create

Creates a file stream.


TFileStream.FileName

The filename of the stream.

Declaration

Source position: classesh.inc line 954

public property TFileStream.FileName : string
  read FFilename;

Description

FileName is the name of the file that the stream reads from or writes to. It is the name as passed in the constructor of the stream; it cannot be changed. To write to another file, the stream must be freed and created again with the new filename.

See also

TFileStream.Create

Creates a file stream.


TFPList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Class to manage collections of pointers.

Declaration

Source position: classesh.inc line 218

type TFPList = class(TObject)
public
Type
TDirection = ( | Search direction for IndexOfItem
FromBeginning, | Start search at the beginning
FromEnd | Start search at the end.
);
destructor Destroy; override; | Destroys the list and releases the memory used to store the list elements.
procedure AddList(); | Add all pointers from another list
function Add(); | Adds a new pointer to the list.
procedure Clear; | Clears the pointer list.
procedure Delete(); | Removes a pointer from the list.
class procedure Error(); | Raises an EListError exception.
procedure Exchange(); | Exchanges two pointers in the list.
function Expand; | Increases the capacity of the list if needed.
function Extract(); | Remove the first occurrence of a pointer from the list.
function First; | Returns the first non-nil pointer in the list.
function GetEnumerator; | Create an IEnumerator instance
function IndexOf(); | Returns the index of a given pointer.
function IndexOfItem(); | Search an item in the list
procedure Insert(); | Inserts a new pointer in the list at a given position.
function Last; | Returns the last non-nil pointer in the list.
procedure Move(); | Moves a pointer from one position in the list to another.
procedure Assign(); | Assign performs the given operation on the list.
function Remove(); | Removes a value from the list.
procedure Pack; | Removes Nil pointers from the list and frees unused memory.
procedure Sort(); | Sorts the pointers in the list.
procedure ForEachCall(); | Call a procedure or method for each pointer in the list.
property Capacity: Integer; [rw] | Current capacity (i.e. number of pointers that can be stored) of the list.
property Count: Integer; [rw] | Current number of pointers in the list.
property Items []: Pointer; default; [rw] | Provides access to the pointers in the list.
property List: PPointerList; [r] | Memory array where pointers are stored.
end;

Inheritance

TFPList | Class to manage collections of pointers.
|
TObject | Base class of all classes.

Description

TFPList is a class that can be used to manage collections of pointers. It introduces methods and properties to store the pointers, search in the list of pointers, sort them. It manages its memory by itself, no intervention for that is needed. Contrary to TList, TFPList has no notification mechanism. If no notification mechanism is used, it is better to use TFPList instead of TList, as the performance of TFPList is much higher.

To manage collections of strings, it is better to use a TStrings descendant such as TStringList. To manage general objects, a TCollection class exists, from which a descendant can be made to manage collections of various kinds.

See also

TStrings | Class to manage arrays or collections of strings
TCollection | Base class to manage collections of named objects.


TFPList
 |  | Capacity
 |  | Count
 |  | Items
 | ro | List
TObject


TFPList
 | Destroy
 | AddList
 | Add
 | Clear
 | Delete
 | Error
 | Exchange
 | Expand
 | Extract
 | First
 | GetEnumerator
 | IndexOf
 | IndexOfItem
 | Insert
 | Last
 | Move
 | Assign
 | Remove
 | Pack
 | Sort
 | ForEachCall
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


Add (TFPList)

AddList (TFPList)

AfterConstruction (TObject)

Assign (TFPList)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Clear (TFPList)

Create (TObject)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Delete (TFPList)

Destroy (TObject)

Destroy (TFPList)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

Error (TFPList)

Exchange (TFPList)

Expand (TFPList)

Extract (TFPList)

FieldAddress (TObject)

First (TFPList)

ForEachCall (TFPList)

Free (TObject)

FreeInstance (TObject)

GetEnumerator (TFPList)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

IndexOf (TFPList)

IndexOfItem (TFPList)

InheritsFrom (TObject)

InitInstance (TObject)

Insert (TFPList)

InstanceSize (TObject)

Last (TFPList)

MethodAddress (TObject)

MethodName (TObject)

Move (TFPList)

newinstance (TObject)

Pack (TFPList)

Remove (TFPList)

SafeCallException (TObject)

Sort (TFPList)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)


TFPList

TObject


TFPList.Add

Adds a new pointer to the list.

Declaration

Source position: classesh.inc line 242

public function TFPList.Add(

  Item: Pointer

):Integer;

Description

Add adds a new pointer to the list after the last pointer (i.e. at position Count, thus increasing the item count with 1. If the list is at full capacity, the capacity of the list is expanded, using the Expand method.

To insert a pointer at a certain position in the list, use the Insert method instead.

See also

Delete | Removes a pointer from the list.
Grow
Insert | Inserts a new pointer in the list at a given position.


TFPList.AddList

Add all pointers from another list

Declaration

Source position: classesh.inc line 241

public procedure TFPList.AddList(

  AList: TFPList

);

Description

AddList adds all pointers from AList to the list. If a pointer is already present, it is added a second time.

See also

TFPList.Assign | Assign performs the given operation on the list.
TList.AddList | Add all pointers from another list


TFPList.Assign

Assign performs the given operation on the list.

Declaration

Source position: classesh.inc line 256

public procedure TFPList.Assign(

  ListA: TFPList;

  AOperator: TListAssignOp = laCopy;

  ListB: TFPList = Nil

);

Description

Assign can be used to merge or assign lists It is an extended version of the usual TPersistent.Assign mechanism. The arguments ListA and ListB are used as sources of pointers to add or remove elements from the current list, depending on the operation AOperation. The available operations are documented in the TListAssignOp type.

See also

TFPList.Add | Adds a new pointer to the list.
TFPList.Clear | Clears the pointer list.


TFPList.Capacity

Current capacity (i.e. number of pointers that can be stored) of the list.

Declaration

Source position: classesh.inc line 262

public property TFPList.Capacity : Integer
  read FCapacity
  write SetCapacity;

Description

Capacity contains the number of pointers the list can store before it starts to grow.

If a new pointer is added to the list using add or insert, and there is not enough memory to store the new pointer, then the list will try to allocate more memory to store the new pointer. Since this is a time consuming operation, it is important that this operation be performed as little as possible. If it is known how many pointers there will be before filling the list, it is a good idea to set the capacity first before filling. This ensures that the list doesn't need to grow, and will speed up filling the list.

See also

SetCapacity

Count

Current number of pointers in the list.


TFPList.Clear

Clears the pointer list.

Declaration

Source position: classesh.inc line 243

public procedure TFPList.Clear;

Description

Clear removes all pointers from the list, and sets the capacity to 0, thus freeing any memory allocated to maintain the list.

See also

Destroy

Destroys the list and releases the memory used to store the list elements.


TFPList.Count

Current number of pointers in the list.

Declaration

Source position: classesh.inc line 263

public property TFPList.Count : Integer
  read FCount
  write SetCount;

Description

Count is the current number of (possibly Nil) pointers in the list. Since the list is zero-based, the index of the largest pointer is Count-1.


TFPList.Delete

Removes a pointer from the list.

Declaration

Source position: classesh.inc line 244

public procedure TFPList.Delete(

  Index: Integer

);

Description

Delete removes the pointer at position Index from the list, shifting all following pointers one position up (or to the left).

The memory the pointer is pointing to is not deallocated.


TFPList.Destroy

Destroys the list and releases the memory used to store the list elements.

Declaration

Source position: classesh.inc line 240

public destructor TFPList.Destroy; override;

Description

Destroy destroys the list and releases the memory used to store the list elements. The elements themselves are in no way touched, i.e. any meomory they point to must be explicitly released before calling the destructor.


TFPList.Error

Raises an EListError exception.

Declaration

Source position: classesh.inc line 245

public class procedure TFPList.Error(

  const Msg: string;

  Data: PtrInt

);

Description

Error raises an EListError exception, with a message formatted with Msg and Data.


TFPList.Exchange

Exchanges two pointers in the list.

Declaration

Source position: classesh.inc line 246

public procedure TFPList.Exchange(

  Index1: Integer;

  Index2: Integer

);

Description

Exchange exchanges the pointers at positions Index1 and Index2. Both pointers must be withing the current range of the list, or an EListError exception will be raised.


TFPList.Expand

Increases the capacity of the list if needed.

Declaration

Source position: classesh.inc line 247

public function TFPList.Expand: TFPList;

Description

Expand increases the capacity of the list if the current element count matches the current list capacity.

The capacity is increased according to the following algorithm:

  1. If the capacity is less than 3, the capacity is increased with 4.
  2. If the capacity is larger than 3 and less than 8, the capacity is increased with 8.
  3. If the capacity is larger than 8, the capacity is increased with 16.

The return value is Self.

See also

Capacity

Current capacity (i.e. number of pointers that can be stored) of the list.


TFPList.Extract

Remove the first occurrence of a pointer from the list.

Declaration

Source position: classesh.inc line 248

public function TFPList.Extract(

  Item: Pointer

):Pointer;

Description

Extract searches for the first occurrence of Item in the list and deletes it from the list. If Item was found, it's value is returned. If Item was not found, Nil is returned.

See also

TFPList.Delete

Removes a pointer from the list.


TFPList.First

Returns the first non-nil pointer in the list.

Declaration

Source position: classesh.inc line 249

public function TFPList.First: Pointer;

Description

First returns the value of the first non-nil pointer in the list.

If there are no pointers in the list or all pointers equal Nil, then Nil is returned.

See also

Last

Returns the last non-nil pointer in the list.


TFPList.ForEachCall

Call a procedure or method for each pointer in the list.

Declaration

Source position: classesh.inc line 260

public procedure TFPList.ForEachCall(

  proc2call: TListCallback;

  arg: pointer

);

procedure TFPList.ForEachCall(

  proc2call: TListStaticCallback;

  arg: pointer

);

Description

ForEachCall iterates over all pointers in the list and calls proc2call, passing it the pointer and the additional arg data pointer. Proc2Call can be a method or a static procedure.

Errors

None.

See also

TListStaticCallback | Static method callback type for TFPList.ForEachCall
TListCallback | Method callback type for TFPList.ForEachCall


TFPList.GetEnumerator

Create an IEnumerator instance

Declaration

Source position: classesh.inc line 250

public function TFPList.GetEnumerator: TFPListEnumerator;

Description

GetEnumerator is the implementation of the IEnumerable interface for TFPList. It creates a TFPListEnumerator instance and returns it's IEnumerator interface.

See also

TFPListEnumerator | Implements IEnumerator for the TFPList class.
IEnumerator | Enumerator support interface
IEnumerable | Interface to retrieve an enumerator from a class.


TFPList.IndexOf

Returns the index of a given pointer.

Declaration

Source position: classesh.inc line 251

public function TFPList.IndexOf(

  Item: Pointer

):Integer;

Description

IndexOf searches for the pointer Item in the list of pointers, and returns the index of the pointer, if found.

If no pointer with the value Item was found, -1 is returned.


TFPList.IndexOfItem

Search an item in the list

Declaration

Source position: classesh.inc line 252

public function TFPList.IndexOfItem(

  Item: Pointer;

  Direction: TDirection

):Integer;

Description

IndexOfItem has the same function as the IndexOf function: it searches for Item in the list, and returns the index of the first found matching pointer. If none is found, -1 is returned.

In difference with the IndexOf function, it accepts a parameter Direction indicating the search direction: from the beginning of the list till the end of the list, or from the end of the list till the beginning. The IndexOf function starts at the beginning of the list. The search direction is only important if the item can appear multiple times in the list.

See also

TFPList.TDirection | Search direction for IndexOfItem
TFPList.IndexOf | Returns the index of a given pointer.


TFPList.Insert

Inserts a new pointer in the list at a given position.

Declaration

Source position: classesh.inc line 253

public procedure TFPList.Insert(

  Index: Integer;

  Item: Pointer

);

Arguments

Index | Position where to insert
Item | Pointer to be inserted.

Description

Insert inserts pointer Item at position Index in the list. All pointers starting from Index are shifted to the right.

If Index is not a valid position, then a EListError exception is raised.

See also

Add | Adds a new pointer to the list.
Delete | Removes a pointer from the list.


TFPList.Items

Provides access to the pointers in the list.

Declaration

Source position: classesh.inc line 264

public property TFPList.Items[Index: Integer] : Pointer
  read Get
  write Put;
  default;

Description

Items is used to access the pointers in the list. It is the default property of the TFPList class, so it can be omitted.

The list is zero-based, so Index must be in the range 0 to Count-1.


TFPList.Last

Returns the last non-nil pointer in the list.

Declaration

Source position: classesh.inc line 254

public function TFPList.Last: Pointer;

Description

Last returns the value of the last non-nil pointer in the list.

If there are no pointers in the list or all pointers equal Nil, then Nil is returned.

See also

First

Returns the first non-nil pointer in the list.


TFPList.List

Memory array where pointers are stored.

Declaration

Source position: classesh.inc line 265

public property TFPList.List : PPointerList
  read FList;

Description

List points to the memory space where the pointers are stored. This can be used to quickly copy the list of pinters to another location.


TFPList.Move

Moves a pointer from one position in the list to another.

Declaration

Source position: classesh.inc line 255

public procedure TFPList.Move(

  CurIndex: Integer;

  NewIndex: Integer

);

Description

Move moves the pointer at position CurIndex to position NewIndex. This is done by storing the value at position CurIndex, deleting the pointer at position CurIndex, and reinserting the value at position NewIndex

If CurIndex or Newindex are not inside the valid range of indices, an EListError exception is raised.

See also

Exchange

Exchanges two pointers in the list.


TFPList.Pack

Removes Nil pointers from the list and frees unused memory.

Declaration

Source position: classesh.inc line 258

public procedure TFPList.Pack;

Description

Pack removes all nil pointers from the list. The capacity of the list is then set to the number of pointers in the list. This method can be used to free unused memory if the list has grown to very large sizes and has a lot of unneeded nil pointers in it.

See also

TFPList.Clear

Clears the pointer list.


TFPList.Remove

Removes a value from the list.

Declaration

Source position: classesh.inc line 257

public function TFPList.Remove(

  Item: Pointer

):Integer;

Description

Remove searches Item in the list, and, if it finds it, deletes the item from the list. Only the first occurrence of Item is removed.

See also

Delete | Removes a pointer from the list.
IndexOf | Returns the index of a given pointer.
Insert | Inserts a new pointer in the list at a given position.


TFPList.Sort

Sorts the pointers in the list.

Declaration

Source position: classesh.inc line 259

public procedure TFPList.Sort(

  Compare: TListSortCompare

);

Description

Sort> sorts the pointers in the list. Two pointers are compared by passing them to the Compare function. The result of this function determines how the pointers will be sorted:

  • If the result of this function is negative, the first pointer is assumed to be 'less' than the second and will be moved before the second in the list.
  • If the function result is positive, the first pointer is assumed to be 'greater than' the second and will be moved after the second in the list.
  • if the function result is zero, the pointers are assumed to be 'equal' and no moving will take place.

The sort is done using a quicksort algorithm.


TFPList.TDirection

Search direction for IndexOfItem

Declaration

Source position: classesh.inc line 239

public type TFPList.TDirection = (
FromBeginning, | Start search at the beginning
FromEnd | Start search at the end.
);

Description

TFPList.TDirection is used to indicate where the TFPList.IndexOfItem search algorithm starts it search: at the beginning of the list or at the end of the list.

See also

TFPList.IndexOfItem

Search an item in the list


TFPListEnumerator

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Implements IEnumerator for the TFPList class.

Declaration

Source position: classesh.inc line 207

type TFPListEnumerator = class
public
constructor Create(); | Initialize a new instance of TFPListEnumerator
function GetCurrent; | Return the current pointer in the list
function MoveNext; | Move the position of the enumerator to the next position in the list.
property Current: Pointer; [r] | Current pointer in the list
end;

Inheritance

TFPListEnumerator

Implements IEnumerator for the TFPList class.
|

TObject

Description

TFPListEnumerator implements the #rtl.system.IEnumerator interface for the TFPList class, so the TFPList class can be used in a for ... in loop. It is returned by the TFPList.GetEnumerator method of TFPList.

See also

TFPList | Class to manage collections of pointers.
TFPList.GetEnumerator | Create an IEnumerator instance
#rtl.system.IEnumerator | Enumerator support interface


TFPListEnumerator

ro

Current


TFPListEnumerator
 | Create
 | GetCurrent
 | MoveNext


Create (TFPListEnumerator)

GetCurrent (TFPListEnumerator)

MoveNext (TFPListEnumerator)


TFPListEnumerator


TFPListEnumerator.Create

Initialize a new instance of TFPListEnumerator

Declaration

Source position: classesh.inc line 212

public constructor TFPListEnumerator.Create(

  AList: TFPList

);

Description

Create initializes a new instance of TFPListEnumerator and keeps a reference to the list AList that will be enumerated.

See also

TFPList

Class to manage collections of pointers.


TFPListEnumerator.Current

Current pointer in the list

Declaration

Source position: classesh.inc line 215

public property TFPListEnumerator.Current : Pointer
  read GetCurrent;

Description

Current redefines GetCurrent as a property.

See also

GetCurrent

Return the current pointer in the list


TFPListEnumerator.GetCurrent

Return the current pointer in the list

Declaration

Source position: classesh.inc line 213

public function TFPListEnumerator.GetCurrent: Pointer;

Description

GetCurrent returns the current pointer in the enumerator.

Errors

No checking is done on the validity of the current position.

See also

MoveNext

Move the position of the enumerator to the next position in the list.


TFPListEnumerator.MoveNext

Move the position of the enumerator to the next position in the list.

Declaration

Source position: classesh.inc line 214

public function TFPListEnumerator.MoveNext: Boolean;

Description

MoveNext puts the pointer on the next item in the list, and returns True if this succeeded, or False if the pointer is past the last element in the list.

Errors

Note that if False is returned, calling GetCurrent will result in an exception.

See also

GetCurrent

Return the current pointer in the list


THandleStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Base class for streams that are identified by an OS handle.

Declaration

Source position: classesh.inc line 931

type THandleStream = class(TStream)
public
constructor Create(); | Create a handlestream from an OS Handle.
function Read(); override; | Overrides standard read method.
function Write(); override; | Overrides standard write method.
function Seek(); override; | Overrides the Seek method.
property Handle: THandle; [r] | The OS handle of the stream.
end;

Inheritance

THandleStream | Base class for streams that are identified by an OS handle.
|
TStream | Base class for streams.
|
TObject | Base class of all classes.

Description

THandleStream is an abstract descendant of the TStream class that provides methods for a stream to handle all reading and writing to and from a handle, provided by the underlying OS. To this end, it overrides the Read and Write methods of TStream.

Remark:
  • ThandleStream does not obtain a handle from the OS by itself, it just handles reading and writing to such a handle by wrapping the system calls for reading and writing; Descendant classes should obtain a handle from the OS by themselves and pass it on in the inherited constructor.
  • Contrary to Delphi, no seek is implemented for THandleStream, since pipes and sockets do not support this. The seek is implemented in descendant methods that support it.

See also

TStream | Base class for streams.
TFileStream | Stream that stores its data in a named file on disk.


THandleStream
 | ro | Handle
TStream
 |  | Position
 |  | Size
TObject


THandleStream
 | Create
 | Read
 | Write
 | Seek
TStream
 | Read
 | Write
 | Seek
 | ReadBuffer
 | WriteBuffer
 | CopyFrom
 | ReadComponent
 | ReadComponentRes
 | WriteComponent
 | WriteComponentRes
 | WriteDescendent
 | WriteDescendentRes
 | WriteResourceHeader
 | FixupResourceHeader
 | ReadResHeader
 | ReadByte
 | ReadWord
 | ReadDWord
 | ReadQWord
 | ReadAnsiString
 | WriteByte
 | WriteWord
 | WriteDWord
 | WriteQWord
 | WriteAnsiString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

CopyFrom (TStream)

Create (TObject)

Create (THandleStream)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

FieldAddress (TObject)

FixupResourceHeader (TStream)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

Read (TStream)

Read (THandleStream)

ReadAnsiString (TStream)

ReadBuffer (TStream)

ReadByte (TStream)

ReadComponent (TStream)

ReadComponentRes (TStream)

ReadDWord (TStream)

ReadQWord (TStream)

ReadResHeader (TStream)

ReadWord (TStream)

SafeCallException (TObject)

Seek (TStream)

Seek (THandleStream)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)

Write (TStream)

Write (THandleStream)

WriteAnsiString (TStream)

WriteBuffer (TStream)

WriteByte (TStream)

WriteComponent (TStream)

WriteComponentRes (TStream)

WriteDescendent (TStream)

WriteDescendentRes (TStream)

WriteDWord (TStream)

WriteQWord (TStream)

WriteResourceHeader (TStream)

WriteWord (TStream)


THandleStream

TStream

TObject


THandleStream.Create

Create a handlestream from an OS Handle.

Declaration

Source position: classesh.inc line 938

public constructor THandleStream.Create(

  AHandle: THandle

);

Description

Create creates a new instance of a THandleStream class. It stores AHandle in an internal variable and then calls the inherited constructor.

See also

TStream

Base class for streams.


THandleStream.Handle

The OS handle of the stream.

Declaration

Source position: classesh.inc line 942

public property THandleStream.Handle : THandle
  read FHandle;

Description

Handle represents the Operating system handle to which reading and writing is done. The handle can be read only, i.e. it cannot be set after the THandlestream instance was created. It should be passed to the constructor THandleStream.Create

See also

THandleStream | Base class for streams that are identified by an OS handle.
THandleStream.Create | Create a handlestream from an OS Handle.


THandleStream.Read

Overrides standard read method.

Declaration

Source position: classesh.inc line 939

public function THandleStream.Read(

  var Buffer;

  Count: LongInt

):LongInt; override;

Description

Read overrides the Read method of TStream. It uses the Handle property to read the Count bytes into Buffer

If no error occurs while reading, the number of bytes actually read will be returned.

Errors

If the operating system reports an error while reading from the handle, -1 is returned.

See also

TStream.Read | Reads data from the stream to a buffer and returns the number of bytes read.
THandleStream.Write | Overrides standard write method.
THandleStream.Handle | The OS handle of the stream.


THandleStream.Seek

Overrides the Seek method.

Declaration

Source position: classesh.inc line 941

public function THandleStream.Seek(

  const Offset: Int64;

  Origin: TSeekOrigin

):Int64; override;

Description

seek uses the FileSeek method to position the stream on the desired position. Note that handle stream descendants (notably pipes) can override the method to prevent the seek.


THandleStream.Write

Overrides standard write method.

Declaration

Source position: classesh.inc line 940

public function THandleStream.Write(

  const Buffer;

  Count: LongInt

):LongInt; override;

Description

Write overrides the Write method of TStream. It uses the Handle property to write the Count bytes from Buffer.

If no error occurs while writing, the number of bytes actually written will be returned.

Errors

If the operating system reports an error while writing to the handle, 0 is returned.

See also

TStream.Read | Reads data from the stream to a buffer and returns the number of bytes read.
THandleStream.Write | Overrides standard write method.
THandleStream.Handle | The OS handle of the stream.


TInterfacedPersistent

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TPersistent descendant which implements the IInterface interface

Declaration

Source position: classesh.inc line 453

type TInterfacedPersistent = class(TPersistent, IInterface)
public
function QueryInterface(); virtual; | Implementation of IInterface.QueryInterface
procedure AfterConstruction; override; | Overrides the standard AfterConstruction method.
end;

Inheritance

TInterfacedPersistent,IInterface | TPersistent descendant which implements the IInterface interface
|
TPersistent,IFPObserved | Base class for streaming system and persistent properties.
|
TObject | Base class of all classes.

Description

TInterfacedPersistent is a direct descendant of TPersistent which implements the #rtl.system.IInterface interface. In particular, it implements the QueryInterface as a public method.

See also

IInterface

Basic interface for all COM based interfaces


TInterfacedPersistent

TPersistent

TObject


TInterfacedPersistent
 | QueryInterface
 | AfterConstruction
TPersistent
 | Destroy
 | Assign
 | FPOAttachObserver
 | FPODetachObserver
 | FPONotifyObservers
 | GetNamePath
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

AfterConstruction (TInterfacedPersistent)

Assign (TPersistent)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Create (TObject)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Destroy (TPersistent)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

FieldAddress (TObject)

FPOAttachObserver (TPersistent)

FPODetachObserver (TPersistent)

FPONotifyObservers (TPersistent)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

GetNamePath (TPersistent)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

QueryInterface (TInterfacedPersistent)

SafeCallException (TObject)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)


TInterfacedPersistent.AfterConstruction

Overrides the standard AfterConstruction method.

Declaration

Source position: classesh.inc line 462

public procedure TInterfacedPersistent.AfterConstruction; override;

Description

AfterConstruction is overridden to do some extra interface housekeeping: a reference to the IInterface interface of the owning class is obtained (if it exists).


TInterfacedPersistent.QueryInterface

Implementation of IInterface.QueryInterface

Declaration

Source position: classesh.inc line 461

public function TInterfacedPersistent.QueryInterface(

  const IID: TGuid;

  out Obj

):HRESULT; virtual;

Description

QueryInterface simply calls GetInterface using the specified IID, and returns the correct values.

See also

TObject.GetInterface

Return a reference to an interface


TInterfaceList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Standard implementation of the IInterfaceList interface.

Declaration

Source position: classesh.inc line 1971

type TInterfaceList = class(TInterfacedObject, IInterfaceList)
public
constructor Create; | Create a new instance of TInterfaceList
destructor Destroy; override; | Destroys the list of interfaces
procedure Clear; | Removes all interfaces from the list.
procedure Delete(); | Delete an interface from the list.
procedure Exchange(); | Exchange 2 interfaces in the list
function First; | Returns the first non-Nil element in the list.
function GetEnumerator; | Create an IEnumerator instance
function IndexOf(); | Returns the index of an interface.
function Add(); | Add an interface to the list
procedure Insert(); | Insert an interface to the list
function Last; | Returns the last non-Nil element in the list.
function Remove(); | Remove an interface from the list
procedure Lock; | Lock the list
procedure Unlock; | UnLocks a locked list
function Expand; | Expands the list
property Capacity: Integer; [rw] | The current capacity of the list.
property Count: Integer; [rw] | The current number of elements in the list.
property Items []: IUnknown; default; [rw] | Array-based access to the list's items.
end;

Inheritance

TInterfaceList,IInterfaceList | Standard implementation of the IInterfaceList interface.
|
TInterfacedObject,IUnknown | TObject descendent implementing the IUnknown interface
|
TObject | Base class of all classes.

Description

TInterfaceList is a standard implementation of the IInterfaceList interface. It uses a TThreadList instance to store the list of interfaces.

See also

IInterfaceList | Interface for maintaining a list of interfaces.
TList | Class to manage collections of pointers.


TInterfaceList
 |  | Capacity
 |  | Count
 |  | Items
TInterfacedObject
 | ro | RefCount
TObject


TInterfaceList
 | Create
 | Destroy
 | Clear
 | Delete
 | Exchange
 | First
 | GetEnumerator
 | IndexOf
 | Add
 | Insert
 | Last
 | Remove
 | Lock
 | Unlock
 | Expand
TInterfacedObject
 | AfterConstruction
 | BeforeDestruction
 | NewInstance
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


Add (TInterfaceList)

AfterConstruction (TObject)

AfterConstruction (TInterfacedObject)

BeforeDestruction (TObject)

BeforeDestruction (TInterfacedObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Clear (TInterfaceList)

Create (TObject)

Create (TInterfaceList)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Delete (TInterfaceList)

Destroy (TObject)

Destroy (TInterfaceList)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

Exchange (TInterfaceList)

Expand (TInterfaceList)

FieldAddress (TObject)

First (TInterfaceList)

Free (TObject)

FreeInstance (TObject)

GetEnumerator (TInterfaceList)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

IndexOf (TInterfaceList)

InheritsFrom (TObject)

InitInstance (TObject)

Insert (TInterfaceList)

InstanceSize (TObject)

Last (TInterfaceList)

Lock (TInterfaceList)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

NewInstance (TInterfacedObject)

Remove (TInterfaceList)

SafeCallException (TObject)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)

Unlock (TInterfaceList)


TInterfaceList

TInterfacedObject

TObject


TInterfaceList.Add

Add an interface to the list

Declaration

Source position: classesh.inc line 1991

public function TInterfaceList.Add(

  item: IUnknown

):Integer;

Description

Add is the implementation of the IInterfaceList.Add method. It adds an interface to the list, and returns the location of the new element in the list. This operation will increment the reference count of the interface.

See also

IInterfaceList.Add | Add an interface to the list
TInterfaceList.Delete | Delete an interface from the list.
TInterfaceList.Insert | Insert an interface to the list
TList.Add | Adds a new pointer to the list.
TFPList.Add | Adds a new pointer to the list.


TInterfaceList.Capacity

The current capacity of the list.

Declaration

Source position: classesh.inc line 2000

public property TInterfaceList.Capacity : Integer
  read GetCapacity
  write SetCapacity;

Description

Capacity is the number of elements that the list can contain without needing to allocate more memory.

See also

IInterfaceList.Capacity | Capacity of the list
TInterfaceList.Count | The current number of elements in the list.
TList.Capacity | Current capacity (i.e. number of pointers that can be stored) of the list.
TFPList.Capacity | Current capacity (i.e. number of pointers that can be stored) of the list.


TInterfaceList.Clear

Removes all interfaces from the list.

Declaration

Source position: classesh.inc line 1985

public procedure TInterfaceList.Clear;

Description

Clear is the implementation of the IInterfaceList.Clear method. It removes all interfaces from the list. It does this by setting each element in the list to Nil, in this way the reference count of each interface in the list is descreased.

See also

IInterfaceList.Clear | Clear the list
Add | Add an interface to the list
Destroy | Destroys the list of interfaces
TList.Clear | Clears the pointer list.
TFPList.Clear | Clears the pointer list.


TInterfaceList.Count

The current number of elements in the list.

Declaration

Source position: classesh.inc line 2001

public property TInterfaceList.Count : Integer
  read GetCount
  write SetCount;

Description

Count is the number of elements in the list. This can include Nil elements. Note that the elements are zero-based, and thus are indexed from 0 to Count-1.

See also

IInterfaceList.Count | Current number of elements in the list.
TInterfaceList.Items | Array-based access to the list's items.
TInterfaceList.Capacity | The current capacity of the list.
TList.Count | Current number of pointers in the list.
TFPList.Count | Current number of pointers in the list.


TInterfaceList.Create

Create a new instance of TInterfaceList

Declaration

Source position: classesh.inc line 1982

public constructor TInterfaceList.Create;

Description

Create creates a new instance of the TInterfaceList class. It sets up the internal structures needed to store the list of interfaces.

See also

Destroy

Destroys the list of interfaces


TInterfaceList.Delete

Delete an interface from the list.

Declaration

Source position: classesh.inc line 1986

public procedure TInterfaceList.Delete(

  index: Integer

);

Description

Delete is the implementation of the IInterfaceList.Delete method. It clears the slot first and then removes the element from the list.

See also

IInterfaceList.Delete | Remove an interface from the list
TInterfaceList.Remove | Remove an interface from the list
TInterfaceList.Add | Add an interface to the list
TList.Delete | Removes a pointer from the list.
TFPList.Delete | Removes a pointer from the list.


TInterfaceList.Destroy

Destroys the list of interfaces

Declaration

Source position: classesh.inc line 1983

public destructor TInterfaceList.Destroy; override;

Description

Destroy first calls Clear and then frees the TInterfaceList instance from memory.

Note that the Clear method decreases the reference count of all interfaces.

See also

Create | Create a new instance of TInterfaceList
Clear | Removes all interfaces from the list.


TInterfaceList.Exchange

Exchange 2 interfaces in the list

Declaration

Source position: classesh.inc line 1987

public procedure TInterfaceList.Exchange(

  index1: Integer;

  index2: Integer

);

Description

Exchange is the implementation of the IInterfaceList.Exchange method. It exchanges the position of 2 interfaces in the list.

See also

IInterfaceList.Exchange | Exchange 2 interfaces in the list
TInterfaceList.Delete | Delete an interface from the list.
TInterfaceList.Add | Add an interface to the list
TList.Exchange | Exchanges two pointers in the list.
TFPList.Exchange | Exchanges two pointers in the list.


TInterfaceList.Expand

Expands the list

Declaration

Source position: classesh.inc line 1998

public function TInterfaceList.Expand: TInterfaceList;

Description

Expand calls the expand method from the internally used list. It returns itself.

See also

TList.Expand

Increases the capacity of the list if needed.


TInterfaceList.First

Returns the first non-Nil element in the list.

Declaration

Source position: classesh.inc line 1988

public function TInterfaceList.First: IUnknown;

Description

First is the implementation of the IInterfaceList.First method. It returns the first non-Nil element from the list.

See also

IInterfaceList.First | Return the first non-empty interface in the list.
TList.First | Returns the first non-nil pointer in the list.


TInterfaceList.GetEnumerator

Create an IEnumerator instance

Declaration

Source position: classesh.inc line 1989

public function TInterfaceList.GetEnumerator: TInterfaceListEnumerator;

Description

GetEnumerator is the implementation of the IEnumerable interface for TInterfaceList. It creates a TInterfaceListEnumerator instance and returns it's IEnumerator interface. The enumerator enumerates all interfaces in the list.

See also

TInterfaceListEnumerator | Implements IEnumerator for the TInterfaceList class.
IEnumerator | Enumerator support interface
IEnumerable | Interface to retrieve an enumerator from a class.


TInterfaceList.IndexOf

Returns the index of an interface.

Declaration

Source position: classesh.inc line 1990

public function TInterfaceList.IndexOf(

  item: IUnknown

):Integer;

Description

IndexOf is the implementation of the IInterfaceList.IndexOf method. It returns the zero-based index in the list of the indicated interface, or -1 if the index is not in the list.

See also

IInterfaceList.IndexOf | Return the index of an interface.
TList.IndexOf | Returns the index of a given pointer.


TInterfaceList.Insert

Insert an interface to the list

Declaration

Source position: classesh.inc line 1992

public procedure TInterfaceList.Insert(

  i: Integer;

  item: IUnknown

);

Description

Insert is the implementation of the IInterfaceList.Insert method. It inserts an interface in the list at the indicated position. This operation will increment the reference count of the interface.

See also

IInterfaceList.Insert | Insert an interface in the list.
TInterfaceList.Delete | Delete an interface from the list.
TInterfaceList.Add | Add an interface to the list
TList.Insert | Inserts a new pointer in the list at a given position.
TFPList.Insert | Inserts a new pointer in the list at a given position.


TInterfaceList.Items

Array-based access to the list's items.

Declaration

Source position: classesh.inc line 2002

public property TInterfaceList.Items[Index: Integer] : IUnknown
  read Get
  write Put;
  default;

Description

Items provides indexed access to the elements in the list. Note that the elements are zero-based, and thus are indexed from 0 to Count-1. The items are read-write. It is not possible to add elements to the list by accessing an element with index larger or equal to Count.

See also

IInterfaceList.Items | Provides Index-based, sequential, access to the interfaces in the list.
TInterfaceList.Count | The current number of elements in the list.
TList.Items | Provides access to the pointers in the list.
TFPList.Items | Provides access to the pointers in the list.


TInterfaceList.Last

Returns the last non-Nil element in the list.

Declaration

Source position: classesh.inc line 1993

public function TInterfaceList.Last: IUnknown;

Description

Last is the implementation of the IInterfaceList.Last method. It returns the last non-Nil element from the list.

See also

IInterfaceList.Last | Returns the last non-nil interface in the list.
TInterfaceList.First | Returns the first non-Nil element in the list.
TList.Last | Returns the last non-nil pointer in the list.
TFPList.Last | Returns the last non-nil pointer in the list.


TInterfaceList.Lock

Lock the list

Declaration

Source position: classesh.inc line 1995

public procedure TInterfaceList.Lock;

Description

Lock locks the list. It is the implementation of the IInterfaceList.Lock method. It limits access to the list to the current thread.

See also

IInterfaceList.Lock | Lock the list
TInterfaceList.UnLock | UnLocks a locked list
TThreadList.LockList | Locks the list for exclusive access.


TInterfaceList.Remove

Remove an interface from the list

Declaration

Source position: classesh.inc line 1994

public function TInterfaceList.Remove(

  item: IUnknown

):Integer;

Description

Remove is the implementation of the IInterfaceList.Remove method. It removes the first occurrence of the interface from the list.

See also

IInterfaceList.Remove | Remove an interface from the list
TInterfaceList.Delete | Delete an interface from the list.
TInterfaceList.IndexOf | Returns the index of an interface.
TList.Remove | Removes a value from the list.
TFPList.Remove | Removes a value from the list.


TInterfaceList.Unlock

UnLocks a locked list

Declaration

Source position: classesh.inc line 1996

public procedure TInterfaceList.Unlock;

Description

UnLock unlocks the list. It is the implementation of the IInterfaceList.UnLock method. After a call to unlock, the current thread releases the list for manipulation by other threads.

See also

IInterfaceList.UnLock | Unlock the list.
TInterfaceList.Lock | Lock the list
TThreadList.UnLockList | Unlocks the list after it was locked.


TInterfaceListEnumerator

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Implements IEnumerator for the TInterfaceList class.

Declaration

Source position: classesh.inc line 1960

type TInterfaceListEnumerator = class
public
constructor Create(); | Initialize a new instance of TInterfaceListEnumerator
function GetCurrent; | Return the current pointer in the list
function MoveNext; | Move the position of the enumerator to the next position in the children of the component.
property Current: IUnknown; [r] | Current pointer in the list
end;

Inheritance

TInterfaceListEnumerator

Implements IEnumerator for the TInterfaceList class.
|

TObject

Description

TInterfaceListEnumerator implements the #rtl.system.IEnumerator interface for the TInterfaceList class, so the TInterfaceList class can be used in a for ... in loop over the TInterfaceList.Components child components of the component. It is returned by the TInterfaceList.GetEnumerator method of TInterfaceList.

See also

TInterfaceList | Standard implementation of the IInterfaceList interface.
TInterfaceList.GetEnumerator | Create an IEnumerator instance
#rtl.system.IEnumerator | Enumerator support interface


TInterfaceListEnumerator

ro

Current


TInterfaceListEnumerator
 | Create
 | GetCurrent
 | MoveNext


Create (TInterfaceListEnumerator)

GetCurrent (TInterfaceListEnumerator)

MoveNext (TInterfaceListEnumerator)


TInterfaceListEnumerator


TInterfaceListEnumerator.Create

Initialize a new instance of TInterfaceListEnumerator

Declaration

Source position: classesh.inc line 1965

public constructor TInterfaceListEnumerator.Create(

  AList: TInterfaceList

);

Description

Create initializes a new instance of TInterfaceListEnumerator and keeps a reference to the component AComponent that will be enumerated.

See also

TInterfaceList

Standard implementation of the IInterfaceList interface.


TInterfaceListEnumerator.Current

Current pointer in the list

Declaration

Source position: classesh.inc line 1968

public property TInterfaceListEnumerator.Current : IUnknown
  read GetCurrent;

Description

Current redefines GetCurrent as a property.

See also

GetCurrent

Return the current pointer in the list


TInterfaceListEnumerator.GetCurrent

Return the current pointer in the list

Declaration

Source position: classesh.inc line 1966

public function TInterfaceListEnumerator.GetCurrent: IUnknown;

Description

GetCurrent returns the current interface in the TInterfaceList list.

Errors

No checking is done on the validity of the current position.

See also

MoveNext

Move the position of the enumerator to the next position in the children of the component.

TInterfaceList.Components


TInterfaceListEnumerator.MoveNext

Move the position of the enumerator to the next position in the children of the component.

Declaration

Source position: classesh.inc line 1967

public function TInterfaceListEnumerator.MoveNext: Boolean;

Description

MoveNext puts the pointer on the next interface in the list, and returns True if this succeeded, or False if the pointer is past the last interface in the list.

Errors

Note that if False is returned, calling GetCurrent will result in an exception.

See also

GetCurrent

Return the current pointer in the list


TList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Class to manage collections of pointers.

Declaration

Source position: classesh.inc line 298

type TList = class(TObject, IFPObserved)
public
constructor Create; | Class to manage collections of pointers.
destructor Destroy; override; | Destroys the list and releases the memory used to store the list elements.
procedure FPOAttachObserver(); | Add an observer to the list of observers
procedure FPODetachObserver(); | Remove an observer from the list of observers
procedure FPONotifyObservers(); | Notify observers of changes in the list
procedure AddList(); | Add all pointers from another list
function Add(); | Adds a new pointer to the list.
procedure Clear; virtual; | Clears the pointer list.
procedure Delete(); | Removes a pointer from the list.
class procedure Error(); virtual; | Raises an EListError exception.
procedure Exchange(); | Exchanges two pointers in the list.
function Expand; | Increases the capacity of the list if needed.
function Extract(); | Remove the first occurrence of a pointer from the list.
function First; | Returns the first non-nil pointer in the list.
function GetEnumerator; | Create an IEnumerator instance
function IndexOf(); | Returns the index of a given pointer.
procedure Insert(); | Inserts a new pointer in the list at a given position.
function Last; | Returns the last non-nil pointer in the list.
procedure Move(); | Moves a pointer from one position in the list to another.
procedure Assign(); | Copy the contents of other lists.
function Remove(); | Removes a value from the list.
procedure Pack; | Removes Nil pointers from the list and frees unused memory.
procedure Sort(); | Sorts the pointers in the list.
property Capacity: Integer; [rw] | Current capacity (i.e. number of pointers that can be stored) of the list.
property Count: Integer; [rw] | Current number of pointers in the list.
property Items []: Pointer; default; [rw] | Provides access to the pointers in the list.
property List: PPointerList; [r] | Memory array where pointers are stored.
end;

Inheritance

TList,IFPObserved | Class to manage collections of pointers.
|
TObject | Base class of all classes.

Description

TList is a class that can be used to manage collections of pointers. It introduces methods and properties to store the pointers, search in the list of pointers, sort them. It manages its memory by itself, no intervention for that is needed. It has an event notification mechanism which allows to notify of list changes. This slows down some of TList mechanisms, and if no notification is used, TFPList may be used instead.

To manage collections of strings, it is better to use a TStrings descendant such as TStringList. To manage general objects, a TCollection class exists, from which a descendant can be made to manage collections of various kinds.

See also

TStrings | Class to manage arrays or collections of strings
TCollection | Base class to manage collections of named objects.


TList
 |  | Capacity
 |  | Count
 |  | Items
 | ro | List
TObject


TList
 | Create
 | Destroy
 | FPOAttachObserver
 | FPODetachObserver
 | FPONotifyObservers
 | AddList
 | Add
 | Clear
 | Delete
 | Error
 | Exchange
 | Expand
 | Extract
 | First
 | GetEnumerator
 | IndexOf
 | Insert
 | Last
 | Move
 | Assign
 | Remove
 | Pack
 | Sort
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


Add (TList)

AddList (TList)

AfterConstruction (TObject)

Assign (TList)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Clear (TList)

Create (TObject)

Create (TList)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Delete (TList)

Destroy (TObject)

Destroy (TList)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

Error (TList)

Exchange (TList)

Expand (TList)

Extract (TList)

FieldAddress (TObject)

First (TList)

FPOAttachObserver (TList)

FPODetachObserver (TList)

FPONotifyObservers (TList)

Free (TObject)

FreeInstance (TObject)

GetEnumerator (TList)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

IndexOf (TList)

InheritsFrom (TObject)

InitInstance (TObject)

Insert (TList)

InstanceSize (TObject)

Last (TList)

MethodAddress (TObject)

MethodName (TObject)

Move (TList)

newinstance (TObject)

Pack (TList)

Remove (TList)

SafeCallException (TObject)

Sort (TList)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)


TList

TObject


TList.Add

Adds a new pointer to the list.

Declaration

Source position: classesh.inc line 327

public function TList.Add(

  Item: Pointer

):Integer;

Description

Add adds a new pointer to the list after the last pointer (i.e. at position Count, thus increasing the item count with 1. If the list is at full capacity, the capacity of the list is expanded, using the Grow method.

To insert a pointer at a certain position in the list, use the Insert method instead.

See also

Delete | Removes a pointer from the list.
Grow
Insert | Inserts a new pointer in the list at a given position.


TList.AddList

Add all pointers from another list

Declaration

Source position: classesh.inc line 326

public procedure TList.AddList(

  AList: TList

);

Description

AddList adds all pointers from AList to the list. If a pointer is already present, it is added a second time.

See also

TList.Assign | Copy the contents of other lists.
TFPList.AddList | Add all pointers from another list


TList.Assign

Copy the contents of other lists.

Declaration

Source position: classesh.inc line 340

public procedure TList.Assign(

  ListA: TList;

  AOperator: TListAssignOp = laCopy;

  ListB: TList = Nil

);

Description

Assign can be used to merge or assign lists It is an extended version of the usual TPersistent.Assign mechanism. The arguments ListA and ListB are used as sources of pointers to add or remove elements from the current list, depending on the operation AOperation. The available operations are documented in the TListAssignOp type.

See also

TList.Clear

Clears the pointer list.


TList.Capacity

Current capacity (i.e. number of pointers that can be stored) of the list.

Declaration

Source position: classesh.inc line 344

public property TList.Capacity : Integer
  read GetCapacity
  write SetCapacity;

Description

Capacity contains the number of pointers the list can store before it starts to grow.

If a new pointer is added to the list using add or insert, and there is not enough memory to store the new pointer, then the list will try to allocate more memory to store the new pointer. Since this is a time consuming operation, it is important that this operation be performed as little as possible. If it is known how many pointers there will be before filling the list, it is a good idea to set the capacity first before filling. This ensures that the list doesn't need to grow, and will speed up filling the list.

See also

SetCapacity

Count

Current number of pointers in the list.


TList.Clear

Clears the pointer list.

Declaration

Source position: classesh.inc line 328

public procedure TList.Clear; virtual;

Description

Clear removes all pointers from the list, and sets the capacity to 0, thus freeing any memory allocated to maintain the list.

See also

Destroy

Destroys the list and releases the memory used to store the list elements.


TList.Count

Current number of pointers in the list.

Declaration

Source position: classesh.inc line 345

public property TList.Count : Integer
  read GetCount
  write SetCount;

Description

Count is the current number of (possibly Nil) pointers in the list. Since the list is zero-based, the index of the largest pointer is Count-1.


TList.Create

Class to manage collections of pointers.

Declaration

Source position: classesh.inc line 321

public constructor TList.Create;

Description

TList.Create creates a new instance of TList. It clears the list and prepares it for use.

See also

TList | Class to manage collections of pointers.
TList.Destroy | Destroys the list and releases the memory used to store the list elements.


TList.Delete

Removes a pointer from the list.

Declaration

Source position: classesh.inc line 329

public procedure TList.Delete(

  Index: Integer

);

Description

Delete removes the pointer at position Index from the list, shifting all following pointers one position up (or to the left).

The memory the pointer is pointing to is not deallocated.


TList.Destroy

Destroys the list and releases the memory used to store the list elements.

Declaration

Source position: classesh.inc line 322

public destructor TList.Destroy; override;

Description

Destroy destroys the list and releases the memory used to store the list elements. The elements themselves are in no way touched, i.e. any meomory they point to must be explicitly released before calling the destructor.


TList.Error

Raises an EListError exception.

Declaration

Source position: classesh.inc line 330

public class procedure TList.Error(

  const Msg: string;

  Data: PtrInt

); virtual;

Description

Error raises an EListError exception, with a message formatted with Msg and Data.


TList.Exchange

Exchanges two pointers in the list.

Declaration

Source position: classesh.inc line 331

public procedure TList.Exchange(

  Index1: Integer;

  Index2: Integer

);

Description

Exchange exchanges the pointers at positions Index1 and Index2. Both pointers must be withing the current range of the list, or an EListError exception will be raised.


TList.Expand

Increases the capacity of the list if needed.

Declaration

Source position: classesh.inc line 332

public function TList.Expand: TList;

Description

Expand increases the capacity of the list if the current element count matches the current list capacity.

The capacity is increased according to the following algorithm:

  1. If the capacity is less than 3, the capacity is increased with 4.
  2. If the capacity is larger than 3 and less than 8, the capacity is increased with 8.
  3. If the capacity is larger than 8, the capacity is increased with 16.

The return value is Self.

See also

Capacity

Current capacity (i.e. number of pointers that can be stored) of the list.


TList.Extract

Remove the first occurrence of a pointer from the list.

Declaration

Source position: classesh.inc line 333

public function TList.Extract(

  item: Pointer

):Pointer;

Description

Extract searched for an occurrence of item, and if a match is found, the match is deleted from the list. If no match is found, nothing is deleted. If Item was found, the result is Item. If Item was not found, the result is Nil. A lnExtracted notification event is triggered if an element is extracted from the list.

See also

TList.Delete | Removes a pointer from the list.
TList.IndexOf | Returns the index of a given pointer.
TList.Remove | Removes a value from the list.


TList.First

Returns the first non-nil pointer in the list.

Declaration

Source position: classesh.inc line 334

public function TList.First: Pointer;

Description

First returns the value of the first non-nil pointer in the list.

If there are no pointers in the list or all pointers equal Nil, then Nil is returned.

See also

Last

Returns the last non-nil pointer in the list.


TList.FPOAttachObserver

Add an observer to the list of observers

Declaration

Source position: classesh.inc line 323

public procedure TList.FPOAttachObserver(

  AObserver: TObject

);

Description

FPOAttachObserver is part of the implementation of the IFPObserved interface in Tlist. It adds a new observer to the list of observers. Calling this multiple times will add the observed object multiple times to the list.

Errors

An EObserver exception may be raised if AObject does not implement the IFPObserver interface.

See also

IFPObserver | Interface for an object to observe other objects.
IFPObserved.FPOAttachObserver | Attach a new observer to the object
IFPObserved | Interface implemented by an object that can be observed.


TList.FPODetachObserver

Remove an observer from the list of observers

Declaration

Source position: classesh.inc line 324

public procedure TList.FPODetachObserver(

  AObserver: TObject

);

Description

FPODetachObserver is part of the implementation of the IFPObserved interface in Tlist. It removes the first found instance of the observer from the list of observers.

See also

IFPObserved | Interface implemented by an object that can be observed.
IFPObserved.FPODetachObserver | Remove an observer from the list of observers.
IFPObserver | Interface for an object to observe other objects.


TList.FPONotifyObservers

Notify observers of changes in the list

Declaration

Source position: classesh.inc line 325

public procedure TList.FPONotifyObservers(

  ASender: TObject;

  AOperation: TFPObservedOperation;

  Data: Pointer

);

Description

FPONotifyObservers is called to notify observers of changes in the list. The following notifications are sent:

ooAddItem
when a pointer is added. Data is the pointer that is added.
ooDeleteItem
when a pointer is deleted or extracted. Data is the pointer that is deleted or extracted.
ooChange
called when 2 pointers are exchanged.
ooFree
Called when the list is freed.

See also

FPODetachObserver

FPOAttachObserver

Add

Exchange

Delete

Delete part of a string.

Extract


TList.GetEnumerator

Create an IEnumerator instance

Declaration

Source position: classesh.inc line 335

public function TList.GetEnumerator: TListEnumerator;

Description

GetEnumerator is the implementation of the IEnumerable interface for TList. It creates a TListEnumerator instance and returns it's IEnumerator interface.

See also

TListEnumerator | Implements IEnumerator for the TList class.
IEnumerator | Enumerator support interface
IEnumerable | Interface to retrieve an enumerator from a class.


TList.IndexOf

Returns the index of a given pointer.

Declaration

Source position: classesh.inc line 336

public function TList.IndexOf(

  Item: Pointer

):Integer;

Description

IndexOf searches for the pointer Item in the list of pointers, and returns the index of the pointer, if found.

If no pointer with the value Item was found, -1 is returned.


TList.Insert

Inserts a new pointer in the list at a given position.

Declaration

Source position: classesh.inc line 337

public procedure TList.Insert(

  Index: Integer;

  Item: Pointer

);

Arguments

Index | Position where to insert
Item | Pointer to be inserted.

Description

Insert inserts pointer Item at position Index in the list. All pointers starting from Index are shifted to the right.

If Index is not a valid position, then a EListError exception is raised.

See also

Add | Adds a new pointer to the list.
Delete | Removes a pointer from the list.


TList.Items

Provides access to the pointers in the list.

Declaration

Source position: classesh.inc line 346

public property TList.Items[Index: Integer] : Pointer
  read Get
  write Put;
  default;

Description

Items is used to access the pointers in the list. It is the default property of the TList class, so it can be omitted.

The list is zero-based, so Index must be in the range 0 to Count-1.


TList.Last

Returns the last non-nil pointer in the list.

Declaration

Source position: classesh.inc line 338

public function TList.Last: Pointer;

Description

Last returns the value of the last non-nil pointer in the list.

If there are no pointers in the list or all pointers equal Nil, then Nil is returned.

See also

First

Returns the first non-nil pointer in the list.


TList.List

Memory array where pointers are stored.

Declaration

Source position: classesh.inc line 347

public property TList.List : PPointerList
  read GetList;

Description

List points to the memory space where the pointers are stored. This can be used to quickly copy the list of pinters to another location.


TList.Move

Moves a pointer from one position in the list to another.

Declaration

Source position: classesh.inc line 339

public procedure TList.Move(

  CurIndex: Integer;

  NewIndex: Integer

);

Description

Move moves the pointer at position CurIndex to position NewIndex. This is done by storing the value at position CurIndex, deleting the pointer at position CurIndex, and reinserting the value at position NewIndex

If CurIndex or Newindex are not inside the valid range of indices, an EListError exception is raised.

See also

Exchange

Exchanges two pointers in the list.


TList.Pack

Removes Nil pointers from the list and frees unused memory.

Declaration

Source position: classesh.inc line 342

public procedure TList.Pack;

Description

Pack removes all nil pointers from the list. The capacity of the list is then set to the number of pointers in the list. This method can be used to free unused memory if the list has grown to very large sizes and has a lot of unneeded nil pointers in it.

See also

TList.Clear

Clears the pointer list.


TList.Remove

Removes a value from the list.

Declaration

Source position: classesh.inc line 341

public function TList.Remove(

  Item: Pointer

):Integer;

Description

Remove searches Item in the list, and, if it finds it, deletes the item from the list. Only the first occurrence of Item is removed.

See also

Delete | Removes a pointer from the list.
IndexOf | Returns the index of a given pointer.
Insert | Inserts a new pointer in the list at a given position.


TList.Sort

Sorts the pointers in the list.

Declaration

Source position: classesh.inc line 343

public procedure TList.Sort(

  Compare: TListSortCompare

);

Description

Sort> sorts the pointers in the list. Two pointers are compared by passing them to the Compare function. The result of this function determines how the pointers will be sorted:

  • If the result of this function is negative, the first pointer is assumed to be 'less' than the second and will be moved before the second in the list.
  • If the function result is positive, the first pointer is assumed to be 'greater than' the second and will be moved after the second in the list.
  • if the function result is zero, the pointers are assumed to be 'equal' and no moving will take place.

The sort is done using a quicksort algorithm.


TListAssignOp

List assign operation

Declaration

Source position: classesh.inc line 204

type TListAssignOp = (
laCopy, | Clear list and copy all strings from second list.
laAnd, | Remove all elements not first second list
laOr, | Add all elements from second (and optional third) list, eliminate duplicates
laXor, | Remove elements in second lists, Add all elements from second list not in first list
laSrcUnique, | Just keep all elements that exist only in source list
laDestUnique | Keep all elements that exists only in list2
);

Description

This type determines what operation TList.Assign or TFPList.assign performs.

See also

TList.Assign | Copy the contents of other lists.
TFPList.assign | Assign performs the given operation on the list.


TListCallback

Method callback type for TFPList.ForEachCall

Declaration

Source position: classesh.inc line 198

type TListCallback = Types.TListCallback;

Description

TListCallback is the method callback prototype for the function that is passed to the TFPList.ForEachCall call. The data argument will be filled with all the pointers in the list (one per call) and the arg argument is the Arg argument passed to the ForEachCall call.

See also

TFPList.ForEachCall | Call a procedure or method for each pointer in the list.
TListStaticCallback | Static method callback type for TFPList.ForEachCall


TListEnumerator

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Implements IEnumerator for the TList class.

Declaration

Source position: classesh.inc line 287

type TListEnumerator = class
public
constructor Create(); | Initialize a new instance of TListEnumerator
function GetCurrent; | Return the current pointer in the list
function MoveNext; | Move the position of the enumerator to the next position in the list.
property Current: Pointer; [r] | Current pointer in the list
end;

Inheritance

TListEnumerator

Implements IEnumerator for the TList class.
|

TObject

Description

TListEnumerator implements the #rtl.system.IEnumerator interface for the TList class, so the TList class can be used in a for ... in loop. It is returned by the TList.GetEnumerator method of TList.

See also

TList | Class to manage collections of pointers.
TList.GetEnumerator | Create an IEnumerator instance
#rtl.system.IEnumerator | Enumerator support interface


TListEnumerator

ro

Current


TListEnumerator
 | Create
 | GetCurrent
 | MoveNext


Create (TListEnumerator)

GetCurrent (TListEnumerator)

MoveNext (TListEnumerator)


TListEnumerator


TListEnumerator.Create

Initialize a new instance of TListEnumerator

Declaration

Source position: classesh.inc line 292

public constructor TListEnumerator.Create(

  AList: TList

);

Description

Create initializes a new instance of TListEnumerator and keeps a reference to the list AList that will be enumerated.

See also

TList

Class to manage collections of pointers.


TListEnumerator.Current

Current pointer in the list

Declaration

Source position: classesh.inc line 295

public property TListEnumerator.Current : Pointer
  read GetCurrent;

Description

Current redefines GetCurrent as a property.

See also

GetCurrent

Return the current pointer in the list


TListEnumerator.GetCurrent

Return the current pointer in the list

Declaration

Source position: classesh.inc line 293

public function TListEnumerator.GetCurrent: Pointer;

Description

GetCurrent returns the current pointer in the enumerator.

Errors

No checking is done on the validity of the current position.

See also

MoveNext

Move the position of the enumerator to the next position in the list.


TListEnumerator.MoveNext

Move the position of the enumerator to the next position in the list.

Declaration

Source position: classesh.inc line 294

public function TListEnumerator.MoveNext: Boolean;

Description

MoveNext puts the pointer on the next item in the list, and returns True if this succeeded, or False if the pointer is past the last element in the list.

Errors

Note that if False is returned, calling GetCurrent will result in an exception.

See also

GetCurrent

Return the current pointer in the list


TMemoryStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Standard implementation of a stream that stores its data in memory

Declaration

Source position: classesh.inc line 977

type TMemoryStream = class(TCustomMemoryStream)
public
destructor Destroy; override; | Frees any allocated memory and destroys the memory stream.
procedure Clear; | Zeroes the position, capacity and size of the stream.
procedure LoadFromStream(); | Loads the contents of a stream into memory.
procedure LoadFromFile(); | Loads the contents of a file into memory.
procedure SetSize(); override; | Sets the size for the memory stream.
function Write(); override; | Writes data to the stream's memory.
end;

Inheritance

TMemoryStream | Standard implementation of a stream that stores its data in memory
|
TCustomMemoryStream | Abstract stream that stores its data in memory.
|
TStream | Base class for streams.
|
TObject | Base class of all classes.

Description

TMemoryStream is a TStream descendant that stores it's data in memory. It descends directly from TCustomMemoryStream and implements the necessary to allocate and de-allocate memory directly from the heap. It implements the Write method which is missing in TCustomMemoryStream.

TMemoryStream also introduces methods to load the contents of another stream or a file into the memory stream.

It is not necessary to do any memory management manually, as the stream will allocate or de-allocate memory as needed. When the stream is freed, all allocated memory will be freed as well.

See also

TCustomMemoryStream | Abstract stream that stores its data in memory.
TStream | Base class for streams.


TMemoryStream
TCustomMemoryStream
 | ro | Memory
TStream
 |  | Position
 |  | Size
TObject


TMemoryStream
 | Destroy
 | Clear
 | LoadFromStream
 | LoadFromFile
 | SetSize
 | Write
TCustomMemoryStream
 | Read
 | Seek
 | SaveToStream
 | SaveToFile
TStream
 | Read
 | Write
 | Seek
 | ReadBuffer
 | WriteBuffer
 | CopyFrom
 | ReadComponent
 | ReadComponentRes
 | WriteComponent
 | WriteComponentRes
 | WriteDescendent
 | WriteDescendentRes
 | WriteResourceHeader
 | FixupResourceHeader
 | ReadResHeader
 | ReadByte
 | ReadWord
 | ReadDWord
 | ReadQWord
 | ReadAnsiString
 | WriteByte
 | WriteWord
 | WriteDWord
 | WriteQWord
 | WriteAnsiString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Clear (TMemoryStream)

CopyFrom (TStream)

Create (TObject)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Destroy (TMemoryStream)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

FieldAddress (TObject)

FixupResourceHeader (TStream)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

LoadFromFile (TMemoryStream)

LoadFromStream (TMemoryStream)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

Read (TStream)

Read (TCustomMemoryStream)

ReadAnsiString (TStream)

ReadBuffer (TStream)

ReadByte (TStream)

ReadComponent (TStream)

ReadComponentRes (TStream)

ReadDWord (TStream)

ReadQWord (TStream)

ReadResHeader (TStream)

ReadWord (TStream)

SafeCallException (TObject)

SaveToFile (TCustomMemoryStream)

SaveToStream (TCustomMemoryStream)

Seek (TStream)

Seek (TCustomMemoryStream)

SetSize (TMemoryStream)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)

Write (TStream)

Write (TMemoryStream)

WriteAnsiString (TStream)

WriteBuffer (TStream)

WriteByte (TStream)

WriteComponent (TStream)

WriteComponentRes (TStream)

WriteDescendent (TStream)

WriteDescendentRes (TStream)

WriteDWord (TStream)

WriteQWord (TStream)

WriteResourceHeader (TStream)

WriteWord (TStream)


TMemoryStream

TCustomMemoryStream

TStream

TObject


TMemoryStream.Clear

Zeroes the position, capacity and size of the stream.

Declaration

Source position: classesh.inc line 986

public procedure TMemoryStream.Clear;

Description

Clear sets the position and size to 0, and sets the capacity of the stream to 0, thus freeing all memory allocated for the stream.

See also

TStream.Size | The current size of the stream.
TStream.Position | The current position in the stream.
TCustomMemoryStream.Memory | Pointer to the data kept in the memory stream.


TMemoryStream.Destroy

Frees any allocated memory and destroys the memory stream.

Declaration

Source position: classesh.inc line 985

public destructor TMemoryStream.Destroy; override;

Description

Destroy clears the memory stream, thus in effect freeing any memory allocated for it, and then frees the memory stream.


TMemoryStream.LoadFromFile

Loads the contents of a file into memory.

Declaration

Source position: classesh.inc line 988

public procedure TMemoryStream.LoadFromFile(

  const FileName: string

);

Description

LoadFromFile loads the contents of the file with name FileName into the memory stream. The current contents of the memory stream is replaced by the contents of the file. Memory is allocated as needed.

The LoadFromFile method simply creates a filestream and then calls the TMemoryStream.LoadFromStream method.

See also

TMemoryStream.LoadFromStream

Loads the contents of a stream into memory.


TMemoryStream.LoadFromStream

Loads the contents of a stream into memory.

Declaration

Source position: classesh.inc line 987

public procedure TMemoryStream.LoadFromStream(

  Stream: TStream

);

Description

LoadFromStream loads the contents of Stream into the memorybuffer of the stream. Any previous contents of the memory stream are overwritten. Memory is allocated as needed.

Remark:

The LoadFromStream uses the Size property of Stream to determine how much memory must be allocated. Some streams do not allow the stream size to be determined, so care must be taken when using this method.

This method will work much faster than the use of the TStream.CopyFrom method:

Seek(0,soFromBeginning);
  CopyFrom(Stream,Stream.Size);

because the CopyFrom method copies the contents in blocks, while LoadFromStream reads the contents of the stream as one big block.

Errors

If an error occurs when reading from the stream, an EStreamError may occur.

See also

TStream.CopyFrom | Copy data from one stream to another
TMemoryStream.LoadFromFile | Loads the contents of a file into memory.


TMemoryStream.SetSize

Sets the size for the memory stream.

Declaration

Source position: classesh.inc line 989

public procedure TMemoryStream.SetSize(

  const NewSize: Int64

); override;

Description

SetSize sets the size of the memory stream to NewSize. This will set the capacity of the stream to NewSize and correct the current position in the stream when needed.

See also

TStream.Position | The current position in the stream.
TStream.Size | The current size of the stream.


TMemoryStream.Write

Writes data to the stream's memory.

Declaration

Source position: classesh.inc line 990

public function TMemoryStream.Write(

  const Buffer;

  Count: LongInt

):LongInt; override;

Description

Write writes Count bytes from Buffer to the stream's memory, starting at the current position in the stream. If more memory is needed than currently allocated, more memory will be allocated. Any contents in the memory stream at the current position will be overwritten. The function returns the number of bytes actually written (which should under normal circumstances always equal Count).

This method overrides the TStream.Write method.

Errors

If no more memory could be allocated, then an exception will be raised.

See also

TCustomMemoryStream.Read

Reads Count bytes from the stream into buffer.


TOwnedCollection

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TCollection descendant which maintains owner information.

Declaration

Source position: classesh.inc line 568

type TOwnedCollection = class(TCollection)

public

  constructor Create();

Create a new TOwnerCollection instance.

end;

Inheritance

TOwnedCollection | TCollection descendant which maintains owner information.
|
TCollection | Base class to manage collections of named objects.
|
TPersistent,IFPObserved | Base class for streaming system and persistent properties.
|
TObject | Base class of all classes.

Description

TOwnedCollection automatically maintains owner information, so it can be displayed in an IDE. Collections that should be displayed in an IDE should descend from TOwnedCollection or must implement a GetOwner function.

See also

TCollection

Base class to manage collections of named objects.


TOwnedCollection
TCollection
 | ro | Count
 | ro | ItemClass
 |  | Items
TPersistent
TObject


TOwnedCollection
 | Create
TCollection
 | Create
 | Destroy
 | Owner
 | Add
 | Assign
 | BeginUpdate
 | Clear
 | EndUpdate
 | Delete
 | GetEnumerator
 | GetNamePath
 | Insert
 | FindItemID
 | Exchange
 | Sort
TPersistent
 | Destroy
 | Assign
 | FPOAttachObserver
 | FPODetachObserver
 | FPONotifyObservers
 | GetNamePath
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


Add (TCollection)

AfterConstruction (TObject)

Assign (TPersistent)

Assign (TCollection)

BeforeDestruction (TObject)

BeginUpdate (TCollection)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Clear (TCollection)

Create (TObject)

Create (TCollection)

Create (TOwnedCollection)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Delete (TCollection)

Destroy (TObject)

Destroy (TPersistent)

Destroy (TCollection)

Dispatch (TObject)

DispatchStr (TObject)

EndUpdate (TCollection)

Equals (TObject)

Exchange (TCollection)

FieldAddress (TObject)

FindItemID (TCollection)

FPOAttachObserver (TPersistent)

FPODetachObserver (TPersistent)

FPONotifyObservers (TPersistent)

Free (TObject)

FreeInstance (TObject)

GetEnumerator (TCollection)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

GetNamePath (TPersistent)

GetNamePath (TCollection)

InheritsFrom (TObject)

InitInstance (TObject)

Insert (TCollection)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

Owner (TCollection)

SafeCallException (TObject)

Sort (TCollection)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)


TOwnedCollection

TCollection

TPersistent

TObject


TOwnedCollection.Create

Create a new TOwnerCollection instance.

Declaration

Source position: classesh.inc line 574

public constructor TOwnedCollection.Create(

  AOwner: TPersistent;

  AItemClass: TCollectionItemClass

);

Description

Create creates a new instance of TOwnedCollection and stores the AOwner references. It will the value returned in the TCollection.Owner property of the collection. The ItemClass class reference is passed on to the inherited constructor, and will be used to create new instances in the Insert and Add methods.

See also

TCollection.Create | Creates a new collection.
TCollection.Owner | Owner of the collection.


TOwnerStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Stream which uses a second stream as a source

Declaration

Source position: classesh.inc line 912

type TOwnerStream = class(TStream)
public
constructor Create(); | Create a new instance of TOwnerStream.
destructor Destroy; override; | Destroys the TOwnerStream instance and the source stream.
property Source: TStream; [r] | Reference to the source stream.
property SourceOwner: Boolean; [rw] | Indicates whether the ownerstream owns it's source
end;

Inheritance

TOwnerStream | Stream which uses a second stream as a source
|
TStream | Base class for streams.
|
TObject | Base class of all classes.

Description

TOwnerStream can be used when creating stream chains such as when using encryption and compression streams. It keeps a reference to the source stream and will automatically free the source stream when ready (if the SourceOwner property is set to True).

See also

TStream | Base class for streams.
TOwnerStream.Source | Reference to the source stream.
TOwnerStream.SourceOwner | Indicates whether the ownerstream owns it's source


TOwnerStream
 | ro | Source
 |  | SourceOwner
TStream
 |  | Position
 |  | Size
TObject


TOwnerStream
 | Create
 | Destroy
TStream
 | Read
 | Write
 | Seek
 | ReadBuffer
 | WriteBuffer
 | CopyFrom
 | ReadComponent
 | ReadComponentRes
 | WriteComponent
 | WriteComponentRes
 | WriteDescendent
 | WriteDescendentRes
 | WriteResourceHeader
 | FixupResourceHeader
 | ReadResHeader
 | ReadByte
 | ReadWord
 | ReadDWord
 | ReadQWord
 | ReadAnsiString
 | WriteByte
 | WriteWord
 | WriteDWord
 | WriteQWord
 | WriteAnsiString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

CopyFrom (TStream)

Create (TObject)

Create (TOwnerStream)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Destroy (TOwnerStream)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

FieldAddress (TObject)

FixupResourceHeader (TStream)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

Read (TStream)

ReadAnsiString (TStream)

ReadBuffer (TStream)

ReadByte (TStream)

ReadComponent (TStream)

ReadComponentRes (TStream)

ReadDWord (TStream)

ReadQWord (TStream)

ReadResHeader (TStream)

ReadWord (TStream)

SafeCallException (TObject)

Seek (TStream)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)

Write (TStream)

WriteAnsiString (TStream)

WriteBuffer (TStream)

WriteByte (TStream)

WriteComponent (TStream)

WriteComponentRes (TStream)

WriteDescendent (TStream)

WriteDescendentRes (TStream)

WriteDWord (TStream)

WriteQWord (TStream)

WriteResourceHeader (TStream)

WriteWord (TStream)


TOwnerStream

TStream

TObject


TOwnerStream.Create

Create a new instance of TOwnerStream.

Declaration

Source position: classesh.inc line 917

public constructor TOwnerStream.Create(

  ASource: TStream

);

Description

Create instantiates a new instance of TOwnerStream and stores the reference to AStream. If SourceOwner is True, the soure stream will also be freed when the instance is destroyed.

See also

TOwnerStream.Destroy | Destroys the TOwnerStream instance and the source stream.
TOwnerStream.Source | Reference to the source stream.
TOwnerStream.SourceOwner | Indicates whether the ownerstream owns it's source


TOwnerStream.Destroy

Destroys the TOwnerStream instance and the source stream.

Declaration

Source position: classesh.inc line 918

public destructor TOwnerStream.Destroy; override;

Description

Destroy frees the source stream if the SourceOwner property is True.

See also

TOwnerStream.Create | Create a new instance of TOwnerStream.
TOwnerStream.Source | Reference to the source stream.
TOwnerStream.SourceOwner | Indicates whether the ownerstream owns it's source


TOwnerStream.Source

Reference to the source stream.

Declaration

Source position: classesh.inc line 919

public property TOwnerStream.Source : TStream
  read FSource;

Description

Source is the source stream. It should be used by descendant streams to access the source stream to read from or write to.

Do not free the Source reference directly if SourceOwner is True. In that case the owner stream instance will free the source stream itself.

See also

TOwnerStream.Create

Create a new instance of TOwnerStream.


TOwnerStream.SourceOwner

Indicates whether the ownerstream owns it's source

Declaration

Source position: classesh.inc line 920

public property TOwnerStream.SourceOwner : Boolean
  read Fowner
  write FOwner;

Description

SourceOwner indicates whether the TOwnerStream owns it's Source stream or not. If this property is True then the Source stream is freed when the TOwnerStream instance is freed.

See also

TOwnerStream.Source | Reference to the source stream.
TOwnerStream.Destroy | Destroys the TOwnerStream instance and the source stream.


TParser

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Class to parse the contents of a stream containing text data.

Declaration

Source position: classesh.inc line 1505

type TParser = class(TObject)
public
constructor Create(); | Creates a new parser instance.
destructor Destroy; override; | Destroys the parser instance.
procedure CheckToken(); | Checks whether the token if of the given type.
procedure CheckTokenSymbol(); | Checks whether the token equals the given symbol
procedure Error(); | Raises an EParserError exception with the given message
procedure ErrorFmt(); | Raises an EParserError exception and formats the message.
procedure ErrorStr(); | Raises an EParserError exception with the given message
procedure HexToBinary(); | Writes hexadecimal data to a stream.
function NextToken; | Reads the next token and returns its type.
function SourcePos; | Returns the current position in the stream.
function TokenComponentIdent; | Returns the path of a subcomponent starting from the current token.
function TokenFloat; | Returns the current token as a float.
function TokenInt; | Returns the current token as an integer.
function TokenString; | Returns the current token as a string.
function TokenWideString; | Returns the current token as a widestring
function TokenSymbolIs(); | Returns True if the token equals the given symbol.
property FloatType: Char; [r] | The type of a float token.
property SourceLine: Integer; [r] | Current source line number.
property Token: Char; [r] | The type of the current token.
end;

Inheritance

TParser | Class to parse the contents of a stream containing text data.
|
TObject | Base class of all classes.

Description

This class breaks a stream of text data in tokens. Its primary use is to help reading the contents of a form file (usually a file with dfm, xfm or lfm extension), and for this reason it isn't suitable to be used as a general parser.

The parser is always positioned on a certain token, whose type is stored in the Token property. Various methods are provided to obtain the token value in the desired format.

To advance to the next token, invoke NextToken method.

See also

TParser.Token | The type of the current token.
TParser.NextToken | Reads the next token and returns its type.


TParser
 | ro | FloatType
 | ro | SourceLine
 | ro | Token
TObject


ro | FloatType (TParser)
ro | SourceLine (TParser)
ro |


TParser
 | Create
 | Destroy
 | CheckToken
 | CheckTokenSymbol
 | Error
 | ErrorFmt
 | ErrorStr
 | HexToBinary
 | NextToken
 | SourcePos
 | TokenComponentIdent
 | TokenFloat
 | TokenInt
 | TokenString
 | TokenWideString
 | TokenSymbolIs
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

BeforeDestruction (TObject)

CheckToken (TParser)

CheckTokenSymbol (TParser)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Create (TObject)

Create (TParser)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Destroy (TParser)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

Error (TParser)

ErrorFmt (TParser)

ErrorStr (TParser)

FieldAddress (TObject)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

HexToBinary (TParser)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

NextToken (TParser)

SafeCallException (TObject)

SourcePos (TParser)

StringMessageTable (TObject)

TokenComponentIdent (TParser)

TokenFloat (TParser)

TokenInt (TParser)

TokenString (TParser)

TokenSymbolIs (TParser)

TokenWideString (TParser)

ToString (TObject)

UnitName (TObject)


TParser

TObject


TParser.CheckToken

Checks whether the token if of the given type.

Declaration

Source position: classesh.inc line 1545

public procedure TParser.CheckToken(

  T: Char

);

Errors

If current token isn't of type T, an EParserError exception is raised.

See also

TParser.Token

The type of the current token.


TParser.CheckTokenSymbol

Checks whether the token equals the given symbol

Declaration

Source position: classesh.inc line 1546

public procedure TParser.CheckTokenSymbol(

  const S: string

);

Description

CheckTokenSymbol performs a case-insensitive comparison of current token value with S.

Current token must be of type toSymbol, otherwise an EParserError exception is raised.

Errors

If the comparison fails, or current token isn't a symbol, an EParserError exception is raised.

See also

TParser.TokenSymbolIs | Returns True if the token equals the given symbol.
toSymbol | Value returned by TParser.Token when a symbol was found in the input stream.


TParser.Create

Creates a new parser instance.

Declaration

Source position: classesh.inc line 1543

public constructor TParser.Create(

  Stream: TStream

);

Description

Create creates a new TParser instance, using Stream as the stream to read data from, and reads the first token from the stream.

Errors

If an error occours while parsing the first token, an EParserError exception is raised.

See also

TParser.NextToken | Reads the next token and returns its type.
TParser.Token | The type of the current token.


TParser.Destroy

Destroys the parser instance.

Declaration

Source position: classesh.inc line 1544

public destructor TParser.Destroy; override;

Errors

None.


TParser.Error

Raises an EParserError exception with the given message

Declaration

Source position: classesh.inc line 1547

public procedure TParser.Error(

  const Ident: string

);


TParser.ErrorFmt

Raises an EParserError exception and formats the message.

Declaration

Source position: classesh.inc line 1548

public procedure TParser.ErrorFmt(

  const Ident: string;

  const Args: array of Const

);


TParser.ErrorStr

Raises an EParserError exception with the given message

Declaration

Source position: classesh.inc line 1549

public procedure TParser.ErrorStr(

  const Message: string

);


TParser.FloatType

The type of a float token.

Declaration

Source position: classesh.inc line 1561

public property TParser.FloatType : Char
  read fFloatType;

Description

Floating point numbers can be postfixed with a character specifying the type of floating point value. When specified, this property holds the character postfixed to the number.

It can be one of the following values:

s or S | Value is a single.
c or C | Value is a currency.
d or D | Value is a date.

If Token isn't toFloat or one of the above characters wasn't specified, FloatType is the null character (zero).

See also

TParser.NextToken | Reads the next token and returns its type.
TParser.Token | The type of the current token.
TParser.TokenFloat | Returns the current token as a float.
toFloat | Value returned by TParser.Token when a floating point value was found in the input stream.


TParser.HexToBinary

Writes hexadecimal data to a stream.

Declaration

Source position: classesh.inc line 1550

public procedure TParser.HexToBinary(

  Stream: TStream

);

Description

HexToBinary reads a sequence of hexadecimal characters from the input stream and converts them to a sequence of bytes which is written to Stream. Each byte is represented by two contiguous hexadecimal characters.

Whitespace is allowed between hexadecimal characters if it doesn't appear between two characters that form the same byte.

HexToBinary stops when the first non-hexadecimal and non-whitespace character is found, or the end of the input stream is reached.

Remark:

This method begins reading after the current token: that is, current token, even if it's a valid hexadecimal value, isn't included.

Errors

If a single hexadecimal character is found, an EParserError exception is raised.


TParser.NextToken

Reads the next token and returns its type.

Declaration

Source position: classesh.inc line 1551

public function TParser.NextToken: Char;

Description

NextToken parses the next token in the stream and returns its type. The type of the token can also be retrieved later reading Token property.

If the end of the stream is reached, toEOF is returned.

For details about token types, see TParser.Token

Errors

If an error occours while parsing the token, an EParserError exception is raised.

See also

TParser.Token

The type of the current token.


TParser.SourceLine

Current source line number.

Declaration

Source position: classesh.inc line 1562

public property TParser.SourceLine : Integer
  read fSourceLine;

See also

TParser.SourcePos

Returns the current position in the stream.


TParser.SourcePos

Returns the current position in the stream.

Declaration

Source position: classesh.inc line 1552

public function TParser.SourcePos: LongInt;

Description

Remark: This is not the character position relative to the current source line, but the byte offset from the beginning of the stream.

Errors

None.

See also

TParser.SourceLine

Current source line number.


TParser.Token

The type of the current token.

Declaration

Source position: classesh.inc line 1563

public property TParser.Token : Char
  read fToken;

Description

This property holds the type of the current token. When Token isn't one of the special token types (whose value can be retrieved with specific methods) it is the character representing the current token.

Special token types:

toEOF | Value returned by TParser.Token when the end of the input stream was reached.
toSymbol | Value returned by TParser.Token when a symbol was found in the input stream.
toString | Value returned by TParser.Token when a string was found in the input stream.
toInteger | Value returned by TParser.Token when an integer was found in the input stream.
toFloat | Value returned by TParser.Token when a floating point value was found in the input stream.
toWString | Value returned by TParser.Token when a widestring was found in the input stream.

To advance to the next token, use NextToken method.

See also

TParser.CheckToken | Checks whether the token if of the given type.
TParser.NextToken | Reads the next token and returns its type.
TParser.TokenComponentIdent | Returns the path of a subcomponent starting from the current token.
TParser.TokenFloat | Returns the current token as a float.
TParser.TokenInt | Returns the current token as an integer.
TParser.TokenString | Returns the current token as a string.
TParser.TokenWideString | Returns the current token as a widestring


TParser.TokenComponentIdent

Returns the path of a subcomponent starting from the current token.

Declaration

Source position: classesh.inc line 1553

public function TParser.TokenComponentIdent: string;

Description

If current token is toSymbol, TokenComponentIdent tries to find subcomponent names separated by a dot (.). The returned string is the longest subcomponent path found. If there are no subcomponents, current symbol is returned.

Remark:

After this method has been called, subsequent calls to TokenString or TokenWideString return the same value returned by TokenComponentIdent.

Example

If source stream contains a.b.c and TParser is positioned on the first token (a), this method returns a.b.c.

Errors

If Token isn't toSymbol, or no valid symbol is found after a dot, an EParserError exception is raised.

See also

TParser.NextToken | Reads the next token and returns its type.
TParser.Token | The type of the current token.
TParser.TokenString | Returns the current token as a string.
TParser.TokenWideString | Returns the current token as a widestring
toSymbol | Value returned by TParser.Token when a symbol was found in the input stream.


TParser.TokenFloat

Returns the current token as a float.

Declaration

Source position: classesh.inc line 1555

public function TParser.TokenFloat: Extended;

Description

If current token type is toFloat, this method returns the token value as a float.

To specify a negative number, no space must exist between unary minus and number.

Floating point numbers can be postfixed with a character that specifies the floating point type. See FloatType for further information.

Remark:

In the input stream the decimal separator, if present, must be a dot (.).

Errors

If Token isn't toFloat, an EParserError exception is raised.

See also

TParser.FloatType | The type of a float token.
TParser.NextToken | Reads the next token and returns its type.
TParser.Token | The type of the current token.
toFloat | Value returned by TParser.Token when a floating point value was found in the input stream.


TParser.TokenInt

Returns the current token as an integer.

Declaration

Source position: classesh.inc line 1557

public function TParser.TokenInt: Int64;

Description

If current token type is toInteger, this method returns the token value as an integer.

In the input stream an integer can be an hexadecimal (prefixed by '$' character) or decimal number. Decimal numbers can be prefixed by an unary minus: if this is the case, no space must exist between minus and number.

Errors

If Token isn't toInteger, an EConvertError exception is raised.

See also

TParser.NextToken | Reads the next token and returns its type.
TParser.Token | The type of the current token.
toInteger | Value returned by TParser.Token when an integer was found in the input stream.


TParser.TokenString

Returns the current token as a string.

Declaration

Source position: classesh.inc line 1558

public function TParser.TokenString: string;

Description

If current token type is toString or toWString, this method returns the contents of the string. That is, enclosing quotes are removed, embedded quotes are unescaped and control strings are converted to the appropriate sequence of characters.

If current token type isn't a string, a string containing the token representation in the input stream is returned, without any conversion: hexadecimal integers are returned with the leading $, and floating point suffixes like s, c or d are kept. For tokens whose type isn't a special type, return value of TokenString equals Token.

Remark:

If Token is toWString, TokenWideString should be used instead.

Errors

None.

See also

TParser.NextToken | Reads the next token and returns its type.
TParser.TokenWideString | Returns the current token as a widestring
TParser.Token | The type of the current token.
toString | Value returned by TParser.Token when a string was found in the input stream.
toWString | Value returned by TParser.Token when a widestring was found in the input stream.


TParser.TokenSymbolIs

Returns True if the token equals the given symbol.

Declaration

Source position: classesh.inc line 1560

public function TParser.TokenSymbolIs(

  const S: string

):Boolean;

Description

TokenSymbolIs performs a case-insensitive comparison of current token value with S.

If current token isn't of type toSymbol, or comparison fails, False is returned.

Errors

None.

See also

TParser.CheckTokenSymbol | Checks whether the token equals the given symbol
TParser.Token | The type of the current token.


TParser.TokenWideString

Returns the current token as a widestring

Declaration

Source position: classesh.inc line 1559

public function TParser.TokenWideString: WideString;

Description

If current token type is toWString, this method returns the contents of the string. That is, enclosing quotes are removed, embedded quotes are unescaped and control strings are converted to the appropriate sequence of characters.

If current token isn't a widestring, TokenWideString behaviour is the same as TokenString.

Errors

None.

See also

TParser.NextToken | Reads the next token and returns its type.
TokenString | Returns the current token as a string.
TParser.Token | The type of the current token.
toWString | Value returned by TParser.Token when a widestring was found in the input stream.


TPersistent

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Base class for streaming system and persistent properties.

Declaration

Source position: classesh.inc line 428

type TPersistent = class(TObject, IFPObserved)
public
destructor Destroy; override; | Destroys the TPersistent instance.
procedure Assign(); virtual; | Assign the contents of one class to another.
procedure FPOAttachObserver(); | Add an observer to the list of observers.
procedure FPODetachObserver(); | Remove an observer from the list of observers
procedure FPONotifyObservers(); | Notify observers of changes.
function GetNamePath; virtual; | Returns a string that can be used to identify the class instance.
end;

Inheritance

TPersistent,IFPObserved | Base class for streaming system and persistent properties.
|
TObject | Base class of all classes.

Description

TPersistent is the basic class for the streaming system. Since it is compiled in the {$M+} state, the compiler generates RTTI (Run-Time Type Information) for it and all classes that descend from it. This information can be used to stream all properties of classes.

It also introduces functionality to assign the contents of 2 classes to each other.

TPersistent implements the IFPObserved interface for the benefit of descendant classes, but does not call IFPObserved.FPONotifyObservers. Descendants such as TStrings and TCollection and TCollectionItem do use it.

See also

TComponent | Base class for all components that need owner-owned functionality.
IFPObserved | Interface implemented by an object that can be observed.
TStrings | Class to manage arrays or collections of strings
TCollection | Base class to manage collections of named objects.
TCollectionItem | Basic object that is managed by a TCollection class.


TPersistent

TObject


TPersistent
 | Destroy
 | Assign
 | FPOAttachObserver
 | FPODetachObserver
 | FPONotifyObservers
 | GetNamePath
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

Assign (TPersistent)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Create (TObject)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Destroy (TPersistent)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

FieldAddress (TObject)

FPOAttachObserver (TPersistent)

FPODetachObserver (TPersistent)

FPONotifyObservers (TPersistent)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

GetNamePath (TPersistent)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

SafeCallException (TObject)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)


TPersistent.Assign

Assign the contents of one class to another.

Declaration

Source position: classesh.inc line 438

public procedure TPersistent.Assign(

  Source: TPersistent

); virtual;

Description

Assign copies the contents of Source to Self, if the classes of the destination and source classes are compatible.

The TPersistent implementation of Assign does nothing but calling the AssignTo method of source. This means that if the destination class does not know how to assign the contents of the source class, the source class instance is asked to assign itself to the destination class. This means that it is necessary to implement only one of the two methods so that two classes can be assiged to one another.

Remark:

In general, a statement of the form

Destination:=Source;

(where Destination and Source are classes) does not achieve the same as a statement of the form

Destination.Assign(Source);

After the former statement, both Source and Destination will point to the same object. The latter statemtent will copy the contents of the Source class to the Destination class.

See also

AssignTo

Generic assignment function.


TPersistent.Destroy

Destroys the TPersistent instance.

Declaration

Source position: classesh.inc line 437

public destructor TPersistent.Destroy; override;

Description

Destroy disposes of the persistent object. This method should never be called directly. Instead the Free method should be used.


TPersistent.FPOAttachObserver

Add an observer to the list of observers.

Declaration

Source position: classesh.inc line 439

public procedure TPersistent.FPOAttachObserver(

  AObserver: TObject

);

Description

FPOAttachObserver is part of the implementation of the IFPObserved interface in TPersistent. It adds a new observer to the list of observers. Calling this multiple times will add the observed object multiple times to the list.

Errors

An EObserver exception may be raised if AObject does not implement the IFPObserver interface.

See also

IFPObserver | Interface for an object to observe other objects.
IFPObserved.FPOAttachObserver | Attach a new observer to the object
IFPObserved | Interface implemented by an object that can be observed.


TPersistent.FPODetachObserver

Remove an observer from the list of observers

Declaration

Source position: classesh.inc line 440

public procedure TPersistent.FPODetachObserver(

  AObserver: TObject

);

Description

FPODetachObserver is part of the implementation of the IFPObserved interface in TPersistent. It removes the first found instance of the observer from the list of observers.

See also

IFPObserved | Interface implemented by an object that can be observed.
IFPObserved.FPODetachObserver | Remove an observer from the list of observers.
IFPObserver | Interface for an object to observe other objects.


TPersistent.FPONotifyObservers

Notify observers of changes.

Declaration

Source position: classesh.inc line 441

public procedure TPersistent.FPONotifyObservers(

  ASender: TObject;

  AOperation: TFPObservedOperation;

  Data: Pointer

);

Description

FPONotifyObservers can be called to notify observers of changes in the object. This method simply passes on the parameters that it receives to all attached IFPObserver interfaces.

TPersistent does not call FPONotifyObservers. It is implemented for the benefit of descendant classes.

See also

IFPObserved | Interface implemented by an object that can be observed.
IFPObserved.FPONotifyObservers | Notify all observers
IFPObserver | Interface for an object to observe other objects.


TPersistent.GetNamePath

Returns a string that can be used to identify the class instance.

Declaration

Source position: classesh.inc line 442

public function TPersistent.GetNamePath: string; virtual;

Description

GetNamePath returns a string that can be used to identify the class instance. This can be used to display a name for this instance in a Object designer.

GetNamePath constructs a name by recursively prepending the Classname of the Owner instance to the Classname of this instance, separated by a dot.

See also

TPersistent.GetOwner

Returns the owner of the component.


TPersistentClass

Class reference type for TPersistent.

Declaration

Source position: classesh.inc line 449

type TPersistentClass = class of TPersistent;

Description

TPersistentClass is the class reference type for the TPersistent class.

See also

TPersistent

Base class for streaming system and persistent properties.


TProxyStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Proxy stream for the IStream interface

Declaration

Source position: classesh.inc line 898

type TProxyStream = class(TStream)
public
constructor Create(); | Create a new instance of the TProxyStream class.
function Read(); override;
function Write(); override;
function Seek(); override;
procedure Check(); virtual; | Check errors
end;

Inheritance

TProxyStream | Proxy stream for the IStream interface
|
TStream | Base class for streams.
|
TObject | Base class of all classes.

Description

TProxyStream is a proxy class for the #rtl.types.IStream interface. It implements all stream methods by relaying them to the IStream interface.

See also

#rtl.types.IStream | COM stream abstraction
TStreamAdapter | Implements IStream for TStream descendants


TProxyStream
TStream
 | Position
 | Size
TObject


Position (TStream)

Size (TStream)


TProxyStream
 | Create
 | Read
 | Write
 | Seek
 | Check
TStream
 | Read
 | Write
 | Seek
 | ReadBuffer
 | WriteBuffer
 | CopyFrom
 | ReadComponent
 | ReadComponentRes
 | WriteComponent
 | WriteComponentRes
 | WriteDescendent
 | WriteDescendentRes
 | WriteResourceHeader
 | FixupResourceHeader
 | ReadResHeader
 | ReadByte
 | ReadWord
 | ReadDWord
 | ReadQWord
 | ReadAnsiString
 | WriteByte
 | WriteWord
 | WriteDWord
 | WriteQWord
 | WriteAnsiString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

BeforeDestruction (TObject)

Check (TProxyStream)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

CopyFrom (TStream)

Create (TObject)

Create (TProxyStream)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

FieldAddress (TObject)

FixupResourceHeader (TStream)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

Read (TStream)

Read (TProxyStream)

ReadAnsiString (TStream)

ReadBuffer (TStream)

ReadByte (TStream)

ReadComponent (TStream)

ReadComponentRes (TStream)

ReadDWord (TStream)

ReadQWord (TStream)

ReadResHeader (TStream)

ReadWord (TStream)

SafeCallException (TObject)

Seek (TStream)

Seek (TProxyStream)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)

Write (TStream)

Write (TProxyStream)

WriteAnsiString (TStream)

WriteBuffer (TStream)

WriteByte (TStream)

WriteComponent (TStream)

WriteComponentRes (TStream)

WriteDescendent (TStream)

WriteDescendentRes (TStream)

WriteDWord (TStream)

WriteQWord (TStream)

WriteResourceHeader (TStream)

WriteWord (TStream)


TProxyStream

TStream

TObject


TProxyStream.Check

Check errors

Declaration

Source position: classesh.inc line 908

public procedure TProxyStream.Check(

  err: Integer

); virtual;

Description

Check will check the result of the IStream interface. This method must be overridden by descendant classes to return interface-specific errors.

See also

#rtl.types.IStream

COM stream abstraction


TProxyStream.Create

Create a new instance of the TProxyStream class.

Declaration

Source position: classesh.inc line 904

public constructor TProxyStream.Create(

  const Stream: IStream

);

Description

Create initializes a new instance of the TProxyStream class. It saves var stream for use in the other methods.

See also

#rtl.types.IStream

COM stream abstraction


TReader

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Generic reader object which reads component data from any given source.

Declaration

Source position: classesh.inc line 1237

type TReader = class(TFiler)
public
constructor Create(); | Creates a new reader class
destructor Destroy; override; | Destroys a reader class.
procedure BeginReferences; | Initializes the component referencing mechanism.
procedure CheckValue(); | Raises an exception if the next value in the stream is not of type Value
procedure DefineProperty(); override; | Reads a user-defined property from the stream.
procedure DefineBinaryProperty(); override; | Reads a user-defined binary property from the stream.
function EndOfList; | Returns true if the stream contains an end-of-list marker.
procedure EndReferences; | Finalizes the component referencing mechanism.
procedure FixupReferences; | Tries to resolve all unresolved component references.
function NextValue; | Returns the type of the next value.
procedure Read(); virtual; | Read raw data from stream
function ReadBoolean; | Reads a boolean from the stream.
function ReadChar; | Reads a character from the stream.
function ReadWideChar; | Read widechar from the stream
function ReadUnicodeChar; | Read unicode character
procedure ReadCollection(); | Reads a collection from the stream.
function ReadComponent(); | Starts reading a component from the stream.
procedure ReadComponents(); | Starts reading child components from the stream.
function ReadFloat; | Reads a float from the stream.
function ReadSingle; | Reads a single-type real from the stream.
function ReadDate; | Reads a date from the stream
function ReadCurrency; | Read a currency value from the stream.
function ReadIdent; | Reads an identifier from the stream.
function ReadInteger; | Reads an integer from the stream
function ReadInt64; | Reads a 64-bit integer from the stream.
function ReadSet(); | Read a set value from the stream
procedure ReadListBegin; | Checks for the beginning of a list.
procedure ReadListEnd; | Checks for the end of a list.
function ReadRootComponent(); | Starts reading a root component.
function ReadVariant; | Read a variant from the stream
procedure ReadSignature; | Read stream signature from the stream
function ReadString; | Reads a string from the stream.
function ReadWideString; | Read a WideString value from the stream.
function ReadUnicodeString; | Read a UnicodeString value from the stream
function ReadValue; | Reads the next value type from the stream.
procedure CopyValue(); | Copy a value to a writer.
property Driver: TAbstractObjectReader; [r] | The driver in use for streaming the data.
property Owner: TComponent; [rw] | Owner of the component being read
property Parent: TComponent; [rw] | Parent of the component being read.
property OnError: TReaderError; [rw] | Handler called when an error occurs.
property OnPropertyNotFound: TPropertyNotFoundEvent; [rw] | Handler for treating missing properties.
property OnFindMethod: TFindMethodEvent; [rw] | Handler to find or change a method address.
property OnSetMethodProperty: TSetMethodPropertyEvent; [rw] | Handler for setting method properties.
property OnSetName: TSetNameEvent; [rw] | Handler called when setting a component name.
property OnReferenceName: TReferenceNameEvent; [rw] | Handler called when another component is referenced.
property OnAncestorNotFound: TAncestorNotFoundEvent; [rw] | Handler called when the ancestor component cannot be found.
property OnCreateComponent: TCreateComponentEvent; [rw] | Handler called when a component needs to be created.
property OnFindComponentClass: TFindComponentClassEvent; [rw] | Handler called when a component class reference needs to be found.
property OnReadStringProperty: TReadWriteStringPropertyEvent; [rw] | Handler for translating strings when read from the stream.
end;

Inheritance

TReader | Generic reader object which reads component data from any given source.
|
TFiler | Class responsible for streaming of components.
|
TObject | Base class of all classes.

Description

The TReader class is a reader class that implements generic component streaming capabilities, independent of the format of the data in the stream. It uses a driver class TAbstractObjectReader to do the actual reading of data. The interface of the TReader class should be identical to the interface in Delphi.

Note that the TReader design is such that it can read a single component from a stream. It will read all children of this component, but it is not designed to read multiple components in succession from one stream.

It should never be necessary to create an instance of this class directly. Instead, the TStream.ReadComponent call should be used.

See also

TFiler | Class responsible for streaming of components.
TWriter | Object to write component data to an arbitrary format.
TAbstractObjectReader | Abstract driver class to read stored component data.


TReader
 | ro | Driver
 |  | Owner
 |  | Parent
TFiler
 |  | Root
 | ro | LookupRoot
 |  | Ancestor
 |  | IgnoreChildren
TObject


ro | Driver (TReader)
 | IgnoreChildren (TFiler)
ro | LookupRoot (TFiler)
 | Owner (TReader)
 | Parent (TReader)
 | Root (TFiler)


TReader
 | Create
 | Destroy
 | BeginReferences
 | CheckValue
 | DefineProperty
 | DefineBinaryProperty
 | EndOfList
 | EndReferences
 | FixupReferences
 | NextValue
 | Read
 | ReadBoolean
 | ReadChar
 | ReadWideChar
 | ReadUnicodeChar
 | ReadCollection
 | ReadComponent
 | ReadComponents
 | ReadFloat
 | ReadSingle
 | ReadDate
 | ReadCurrency
 | ReadIdent
 | ReadInteger
 | ReadInt64
 | ReadSet
 | ReadListBegin
 | ReadListEnd
 | ReadRootComponent
 | ReadVariant
 | ReadSignature
 | ReadString
 | ReadWideString
 | ReadUnicodeString
 | ReadValue
 | CopyValue
TFiler
 | DefineProperty
 | DefineBinaryProperty
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

BeforeDestruction (TObject)

BeginReferences (TReader)

CheckValue (TReader)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

CopyValue (TReader)

Create (TObject)

Create (TReader)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

DefineBinaryProperty (TFiler)

DefineBinaryProperty (TReader)

DefineProperty (TFiler)

DefineProperty (TReader)

Destroy (TObject)

Destroy (TReader)

Dispatch (TObject)

DispatchStr (TObject)

EndOfList (TReader)

EndReferences (TReader)

Equals (TObject)

FieldAddress (TObject)

FixupReferences (TReader)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

NextValue (TReader)

Read (TReader)

ReadBoolean (TReader)

ReadChar (TReader)

ReadCollection (TReader)

ReadComponent (TReader)

ReadComponents (TReader)

ReadCurrency (TReader)

ReadDate (TReader)

ReadFloat (TReader)

ReadIdent (TReader)

ReadInt64 (TReader)

ReadInteger (TReader)

ReadListBegin (TReader)

ReadListEnd (TReader)

ReadRootComponent (TReader)

ReadSet (TReader)

ReadSignature (TReader)

ReadSingle (TReader)

ReadString (TReader)

ReadUnicodeChar (TReader)

ReadUnicodeString (TReader)

ReadValue (TReader)

ReadVariant (TReader)

ReadWideChar (TReader)

ReadWideString (TReader)

SafeCallException (TObject)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)


TReader
 | OnError
 | OnPropertyNotFound
 | OnFindMethod
 | OnSetMethodProperty
 | OnSetName
 | OnReferenceName
 | OnAncestorNotFound
 | OnCreateComponent
 | OnFindComponentClass
 | OnReadStringProperty
TFiler
TObject


OnAncestorNotFound (TReader)

OnCreateComponent (TReader)

OnError (TReader)

OnFindComponentClass (TReader)

OnFindMethod (TReader)

OnPropertyNotFound (TReader)

OnReadStringProperty (TReader)

OnReferenceName (TReader)

OnSetMethodProperty (TReader)

OnSetName (TReader)


TReader.BeginReferences

Initializes the component referencing mechanism.

Declaration

Source position: classesh.inc line 1271

public procedure TReader.BeginReferences;

Description

When streaming components, the streaming mechanism keeps a list of existing components that can be referenced to. This method initializes up that system.


TReader.CheckValue

Raises an exception if the next value in the stream is not of type Value

Declaration

Source position: classesh.inc line 1272

public procedure TReader.CheckValue(

  Value: TValueType

);


TReader.CopyValue

Copy a value to a writer.

Declaration

Source position: classesh.inc line 1314

public procedure TReader.CopyValue(

  Writer: TWriter

);

Description

CopyValue reads the next value from the reader stream, and writes it to the passed Writer.


TReader.Create

Creates a new reader class

Declaration

Source position: classesh.inc line 1269

public constructor TReader.Create(

  Stream: TStream;

  BufSize: Integer

);


TReader.DefineBinaryProperty

Reads a user-defined binary property from the stream.

Declaration

Source position: classesh.inc line 1276

public procedure TReader.DefineBinaryProperty(

  const Name: string;

  AReadData: TStreamProc;

  WriteData: TStreamProc;

  HasData: Boolean

); override;


TReader.DefineProperty

Reads a user-defined property from the stream.

Declaration

Source position: classesh.inc line 1273

public procedure TReader.DefineProperty(

  const Name: string;

  AReadData: TReaderProc;

  WriteData: TWriterProc;

  HasData: Boolean

); override;


TReader.Destroy

Destroys a reader class.

Declaration

Source position: classesh.inc line 1270

public destructor TReader.Destroy; override;


TReader.Driver

The driver in use for streaming the data.

Declaration

Source position: classesh.inc line 1315

public property TReader.Driver : TAbstractObjectReader
  read FDriver;


TReader.EndOfList

Returns true if the stream contains an end-of-list marker.

Declaration

Source position: classesh.inc line 1279

public function TReader.EndOfList: Boolean;


TReader.EndReferences

Finalizes the component referencing mechanism.

Declaration

Source position: classesh.inc line 1280

public procedure TReader.EndReferences;

Description

When streaming components, the streaming mechanism keeps a list of existing components that can be referenced to. This method cleans up that system.


TReader.FixupReferences

Tries to resolve all unresolved component references.

Declaration

Source position: classesh.inc line 1281

public procedure TReader.FixupReferences;


TReader.NextValue

Returns the type of the next value.

Declaration

Source position: classesh.inc line 1282

public function TReader.NextValue: TValueType;


TReader.OnAncestorNotFound

Handler called when the ancestor component cannot be found.

Declaration

Source position: classesh.inc line 1324

public property TReader.OnAncestorNotFound : TAncestorNotFoundEvent
  read FOnAncestorNotFound
  write FOnAncestorNotFound;


TReader.OnCreateComponent

Handler called when a component needs to be created.

Declaration

Source position: classesh.inc line 1325

public property TReader.OnCreateComponent : TCreateComponentEvent
  read FOnCreateComponent
  write FOnCreateComponent;


TReader.OnError

Handler called when an error occurs.

Declaration

Source position: classesh.inc line 1318

public property TReader.OnError : TReaderError
  read FOnError
  write FOnError;


TReader.OnFindComponentClass

Handler called when a component class reference needs to be found.

Declaration

Source position: classesh.inc line 1326

public property TReader.OnFindComponentClass : TFindComponentClassEvent
  read FOnFindComponentClass
  write FOnFindComponentClass;


TReader.OnFindMethod

Handler to find or change a method address.

Declaration

Source position: classesh.inc line 1320

public property TReader.OnFindMethod : TFindMethodEvent
  read FOnFindMethod
  write FOnFindMethod;


TReader.OnPropertyNotFound

Handler for treating missing properties.

Declaration

Source position: classesh.inc line 1319

public property TReader.OnPropertyNotFound : TPropertyNotFoundEvent
  read FOnPropertyNotFound
  write FOnPropertyNotFound;

Description

OnPropertyNotFound can be used to take appropriate action when a property is read from a stream and no such property is found in the RTTI information of the Instance that is being read from the stream. It can be set at runtime, or at designtime by an IDE.

For more information about the meaning of the various arguments to the event handler, see TPropertyNotFoundEvent.

See also

TPropertyNotFoundEvent | Callback for the TReader.OnPropertyNotFound event.
TReader.OnSetMethodProperty | Handler for setting method properties.
TReader.OnReadStringProperty | Handler for translating strings when read from the stream.


TReader.OnReadStringProperty

Handler for translating strings when read from the stream.

Declaration

Source position: classesh.inc line 1327

public property TReader.OnReadStringProperty : TReadWriteStringPropertyEvent
  read FOnReadStringProperty
  write FOnReadStringProperty;

Description

OnReadStringProperty is called whenever a string property is read from the stream. It can be used e.g. by a translation mechanism to translate the strings on the fly, when a form is loaded. See TReadWriteStringPropertyEvent for a description of the various parameters.

See also

TReader.OnPropertyNotFound | Handler for treating missing properties.
TReader.OnSetMethodProperty | Handler for setting method properties.
TReadWriteStringPropertyEvent | Callback for the TReader.OnReadStringProperty event handler


TReader.OnReferenceName

Handler called when another component is referenced.

Declaration

Source position: classesh.inc line 1323

public property TReader.OnReferenceName : TReferenceNameEvent
  read FOnReferenceName
  write FOnReferenceName;


TReader.OnSetMethodProperty

Handler for setting method properties.

Declaration

Source position: classesh.inc line 1321

public property TReader.OnSetMethodProperty : TSetMethodPropertyEvent
  read FOnSetMethodProperty
  write FOnSetMethodProperty;

Description

OnSetMethodProperty can be set to handle the setting of method properties. This handler can be used by an IDE to prevent methods from actually being assigned when an object is being streamed in the designer.

See also

TReader.OnReadStringProperty | Handler for translating strings when read from the stream.
TReader.OnPropertyNotFound | Handler for treating missing properties.


TReader.OnSetName

Handler called when setting a component name.

Declaration

Source position: classesh.inc line 1322

public property TReader.OnSetName : TSetNameEvent
  read FOnSetName
  write FOnSetName;


TReader.Owner

Owner of the component being read

Declaration

Source position: classesh.inc line 1316

public property TReader.Owner : TComponent
  read FOwner
  write FOwner;


TReader.Parent

Parent of the component being read.

Declaration

Source position: classesh.inc line 1317

public property TReader.Parent : TComponent
  read FParent
  write FParent;


TReader.Read

Read raw data from stream

Declaration

Source position: classesh.inc line 1285

public procedure TReader.Read(

  var Buf;

  Count: LongInt

); virtual;

Description

Read is introduced for Delphi compatibility to read raw data from the component stream. This should not be used in new production code as it will totally mess up the streaming.

See also

TAbstractObjectReader.Read | Read raw data from stream
TBinaryObjectReader.Read | Read raw data from stream


TReader.ReadBoolean

Reads a boolean from the stream.

Declaration

Source position: classesh.inc line 1287

public function TReader.ReadBoolean: Boolean;


TReader.ReadChar

Reads a character from the stream.

Declaration

Source position: classesh.inc line 1288

public function TReader.ReadChar: Char;


TReader.ReadCollection

Reads a collection from the stream.

Declaration

Source position: classesh.inc line 1291

public procedure TReader.ReadCollection(

  Collection: TCollection

);


TReader.ReadComponent

Starts reading a component from the stream.

Declaration

Source position: classesh.inc line 1292

public function TReader.ReadComponent(

  Component: TComponent

):TComponent;


TReader.ReadComponents

Starts reading child components from the stream.

Declaration

Source position: classesh.inc line 1293

public procedure TReader.ReadComponents(

  AOwner: TComponent;

  AParent: TComponent;

  Proc: TReadComponentsProc

);


TReader.ReadCurrency

Read a currency value from the stream.

Declaration

Source position: classesh.inc line 1300

public function TReader.ReadCurrency: Currency;

Description

ReadCurrency reads a currency typed value from the stream and returns the result. This method does nothing except call the driver method of the driver being used.

See also

TWriter.WriteCurrency

Write a currency value to the stream


TReader.ReadDate

Reads a date from the stream

Declaration

Source position: classesh.inc line 1298

public function TReader.ReadDate: TDateTime;


TReader.ReadFloat

Reads a float from the stream.

Declaration

Source position: classesh.inc line 1296

public function TReader.ReadFloat: Extended;


TReader.ReadIdent

Reads an identifier from the stream.

Declaration

Source position: classesh.inc line 1301

public function TReader.ReadIdent: string;


TReader.ReadInt64

Reads a 64-bit integer from the stream.

Declaration

Source position: classesh.inc line 1303

public function TReader.ReadInt64: Int64;


TReader.ReadInteger

Reads an integer from the stream

Declaration

Source position: classesh.inc line 1302

public function TReader.ReadInteger: LongInt;


TReader.ReadListBegin

Checks for the beginning of a list.

Declaration

Source position: classesh.inc line 1305

public procedure TReader.ReadListBegin;


TReader.ReadListEnd

Checks for the end of a list.

Declaration

Source position: classesh.inc line 1306

public procedure TReader.ReadListEnd;


TReader.ReadRootComponent

Starts reading a root component.

Declaration

Source position: classesh.inc line 1307

public function TReader.ReadRootComponent(

  ARoot: TComponent

):TComponent;


TReader.ReadSet

Read a set value from the stream

Declaration

Source position: classesh.inc line 1304

public function TReader.ReadSet(

  EnumType: Pointer

):Integer;

Description

ReadSet reads a set of elements with type EnumType and returns them as an integer where each element is encoded in a bit of the integer. Thus, at most an enumerated type with 32 elements can be read with this function.

Errors

No checking is performed on the validity of EnumType. It is assumed to be a valid PTypeInfo pointer.

See also

TWriter.WriteSet

Write a set value to the stream


TReader.ReadSignature

Read stream signature from the stream

Declaration

Source position: classesh.inc line 1309

public procedure TReader.ReadSignature;

Description

ReadSignature is called when starting to read a root component from a stream. Some streams contain a signature (header) to detect whether the stream contains correct data.

Errors

If the stream does not start with the correct signature, an EReadError exception will be raised.

See also

TAbstractObjectReader.ReadSignature | Read resource signature
TAbstractObjectWriter.WriteSignature | Write stream signature to the stream


TReader.ReadSingle

Reads a single-type real from the stream.

Declaration

Source position: classesh.inc line 1297

public function TReader.ReadSingle: Single;


TReader.ReadString

Reads a string from the stream.

Declaration

Source position: classesh.inc line 1310

public function TReader.ReadString: string;


TReader.ReadUnicodeChar

Read unicode character

Declaration

Source position: classesh.inc line 1290

public function TReader.ReadUnicodeChar: UnicodeChar;

Description

ReadUnicodeChar reads a single unicode character from the stream. It does this by reading a UnicodeString string from the stream and returning the first character.

Errors

If the string has a length different from 1, an EReadError exception will occur.

See also

TReader.ReadUnicodeString

Read a UnicodeString value from the stream


TReader.ReadUnicodeString

Read a UnicodeString value from the stream

Declaration

Source position: classesh.inc line 1312

public function TReader.ReadUnicodeString: UnicodeString;

Description

ReadUnicodeString reads a UnicodeString string from the stream. The stream can contain a string from any type, it will be converted to UniCodeString.

See also

TAbstractObjectReader.ReadUnicodeString | Read a unicode string value
TWriter.WriteUnicodeString | Write a unicode string to the stream.


TReader.ReadValue

Reads the next value type from the stream.

Declaration

Source position: classesh.inc line 1313

public function TReader.ReadValue: TValueType;


TReader.ReadVariant

Read a variant from the stream

Declaration

Source position: classesh.inc line 1308

public function TReader.ReadVariant: Variant;

Description

ReadVariant reads the next value from the stream and returns it as a variant. No variant array can be read from the stream, only single values.

Errors

If no variant manager is installed, the function will raise an EReadError exception. If the next value is not a simple value, again an EReadError exception is raised. exception is

See also

TBinaryObjectWriter.WriteVariant

Write a variant to the stream


TReader.ReadWideChar

Read widechar from the stream

Declaration

Source position: classesh.inc line 1289

public function TReader.ReadWideChar: WideChar;

Description

TReader.ReadWideChar reads a widechar from the stream. This actually reads a widestring and returns the first character.

See also

TReader.ReadWideString | Read a WideString value from the stream.
TWriter.WriteWideChar | Write widechar to stream


TReader.ReadWideString

Read a WideString value from the stream.

Declaration

Source position: classesh.inc line 1311

public function TReader.ReadWideString: WideString;

Description

ReadWidestring reads a widestring typed value from the stream and returns the result. This method does nothing except call the driver method of the driver being used.

See also

TWriter.WriteWideString

Write a widestring value to the stream


TReaderError

Event handler type, called when an error occurs during the streaming.

Declaration

Source position: classesh.inc line 1221

type TReaderError = procedure(

  Reader: TReader;

  const Message: string;

  var Handled: Boolean

) of object;


TReaderProc

Reader procedure used by DefineProperties

Declaration

Source position: classesh.inc line 1089

type TReaderProc = procedure(

  Reader: TReader

) of object;

Description

The TReaderProc reader procedure is a callback procedure which will be used by a TPersistent descendant to read user properties from a stream during the streaming process. The Reader argument is the writer object which can be used read properties from the stream.


TRecall

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Helper class for storing published properties

Declaration

Source position: classesh.inc line 467

type TRecall = class(TObject)
public
constructor Create(); | Creates a new instance of TRecall.
destructor Destroy; override; | Copies the stored properties to the reference object and destroys the TRecall instance.
procedure Store; | Assigns the reference instance to the storage instance.
procedure Forget; | Clear the reference property.
property Reference: TPersistent; [r] | The reference object.
end;

Inheritance

TRecall | Helper class for storing published properties
|
TObject | Base class of all classes.

Description

TRecall is a helper class used to copy published properties of a class (the reference object) in another class (the storage object). The reference object and storage object must be assignable to each other.

The TRecall can be used to store the state of a persistent class, and restore it at a later time.

When a TRecall object is created, it gets passed a reference instance and a storage instance. It immediately stores the properties of the reference object in the storage object.

The Store method can be called throughout the lifetime of the reference object to update the stored properties.

When the TRecall instance is destroyed then the properties are copied from the storage object to the reference object. The storage object is freed automatically.

If the properties should not be copied back from the storage to the reference object, the Forget can be called.

See also

TRecall.Create | Creates a new instance of TRecall.
TRecall.Destroy | Copies the stored properties to the reference object and destroys the TRecall instance.
TRecall.Forget | Clear the reference property.
TRecall.Store | Assigns the reference instance to the storage instance.
TPersistent.Assign | Assign the contents of one class to another.


TRecall

ro

Reference

TObject


TRecall
 | Create
 | Destroy
 | Store
 | Forget
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Create (TObject)

Create (TRecall)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Destroy (TRecall)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

FieldAddress (TObject)

Forget (TRecall)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

SafeCallException (TObject)

Store (TRecall)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)


TRecall

TObject


TRecall.Create

Creates a new instance of TRecall.

Declaration

Source position: classesh.inc line 471

public constructor TRecall.Create(

  AStorage: TPersistent;

  AReference: TPersistent

);

Description

Create creates a new instance of TRecall and initializes the Reference and Storage instances. It calls Store to assign the reference object properties to the storage instance.

See also

TRecall.Store | Assigns the reference instance to the storage instance.
TRecall.Destroy | Copies the stored properties to the reference object and destroys the TRecall instance.


TRecall.Destroy

Copies the stored properties to the reference object and destroys the TRecall instance.

Declaration

Source position: classesh.inc line 472

public destructor TRecall.Destroy; override;

Description

Destroy assigns the storage instance to the reference instance, if the latter is still valid. After this, it frees the storage and calls the inherited destroy.

Errors

Destroy does not check whether the reference instance is still valid. If the reference pointer was invalidated, call TRecall.Forget to clear the reference instance.

See also

TRecall.Store | Assigns the reference instance to the storage instance.
TRecall.Forget | Clear the reference property.


TRecall.Forget

Clear the reference property.

Declaration

Source position: classesh.inc line 474

public procedure TRecall.Forget;

Description

Forget sets the Reference property to Nil. When the TRecall instance is destroyed, the reference instance will not be restored.

Note that after a call to Forget, a call to Store has no effect.

Errors

None.

See also

TRecall.Reference | The reference object.
TRecall.Store | Assigns the reference instance to the storage instance.
TRecall.Destroy | Copies the stored properties to the reference object and destroys the TRecall instance.


TRecall.Reference

The reference object.

Declaration

Source position: classesh.inc line 475

public property TRecall.Reference : TPersistent
  read FReference;

Description

Reference is the instance of the reference object. Do not free the reference directly. Call Forget to clear the reference and then free the reference object.

See also

TRecall.Forget

Clear the reference property.


TRecall.Store

Assigns the reference instance to the storage instance.

Declaration

Source position: classesh.inc line 473

public procedure TRecall.Store;

Description

Store assigns the reference instance to the storage instance. This will only work if the two classes can be assigned to each other.

This method can be used to refresh the storage.

Errors

Store does not check whether the reference instance is still valid. If the reference pointer was invalidated, call TRecall.Forget to clear the reference instance.


TResourceStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Stream that reads its data from a resource object.

Declaration

Source position: classesh.inc line 1039

type TResourceStream = class(TCustomMemoryStream)
public
constructor Create(); | Creates a new instance of a resource stream.
constructor CreateFromID(); | Creates a new instance of a resource stream with a resource
destructor Destroy; override; | Destroys the instance of the resource stream.
end;

Inheritance

TResourceStream | Stream that reads its data from a resource object.
|
TCustomMemoryStream | Abstract stream that stores its data in memory.
|
TStream | Base class for streams.
|
TObject | Base class of all classes.


TResourceStream
TCustomMemoryStream
 | ro | Memory
TStream
 |  | Position
 |  | Size
TObject


TResourceStream
 | Create
 | CreateFromID
 | Destroy
TCustomMemoryStream
 | Read
 | Seek
 | SaveToStream
 | SaveToFile
TStream
 | Read
 | Write
 | Seek
 | ReadBuffer
 | WriteBuffer
 | CopyFrom
 | ReadComponent
 | ReadComponentRes
 | WriteComponent
 | WriteComponentRes
 | WriteDescendent
 | WriteDescendentRes
 | WriteResourceHeader
 | FixupResourceHeader
 | ReadResHeader
 | ReadByte
 | ReadWord
 | ReadDWord
 | ReadQWord
 | ReadAnsiString
 | WriteByte
 | WriteWord
 | WriteDWord
 | WriteQWord
 | WriteAnsiString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

CopyFrom (TStream)

Create (TObject)

Create (TResourceStream)

CreateFromID (TResourceStream)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Destroy (TResourceStream)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

FieldAddress (TObject)

FixupResourceHeader (TStream)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

Read (TStream)

Read (TCustomMemoryStream)

ReadAnsiString (TStream)

ReadBuffer (TStream)

ReadByte (TStream)

ReadComponent (TStream)

ReadComponentRes (TStream)

ReadDWord (TStream)

ReadQWord (TStream)

ReadResHeader (TStream)

ReadWord (TStream)

SafeCallException (TObject)

SaveToFile (TCustomMemoryStream)

SaveToStream (TCustomMemoryStream)

Seek (TStream)

Seek (TCustomMemoryStream)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)

Write (TStream)

WriteAnsiString (TStream)

WriteBuffer (TStream)

WriteByte (TStream)

WriteComponent (TStream)

WriteComponentRes (TStream)

WriteDescendent (TStream)

WriteDescendentRes (TStream)

WriteDWord (TStream)

WriteQWord (TStream)

WriteResourceHeader (TStream)

WriteWord (TStream)


TResourceStream

TCustomMemoryStream

TStream

TObject


TResourceStream.Create

Creates a new instance of a resource stream.

Declaration

Source position: classesh.inc line 1045

public constructor TResourceStream.Create(

  Instance: TFPResourceHMODULE;

  const ResName: string;

  ResType: PChar

);


TResourceStream.CreateFromID

Creates a new instance of a resource stream with a resource

Declaration

Source position: classesh.inc line 1046

public constructor TResourceStream.CreateFromID(

  Instance: TFPResourceHMODULE;

  ResID: Integer;

  ResType: PChar

);

Description

The resource is loaded from the loaded module (identified by the handle Instance), identifier ResID and type ResType.


TResourceStream.Destroy

Destroys the instance of the resource stream.

Declaration

Source position: classesh.inc line 1047

public destructor TResourceStream.Destroy; override;


TStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Base class for streams.

Declaration

Source position: classesh.inc line 852

type TStream = class(TObject)
public
function Read(); virtual; | Reads data from the stream to a buffer and returns the number of bytes read.
function Write(); virtual; | Writes data from a buffer to the stream and returns the number of bytes written.
function Seek(); | Sets the current position in the stream
procedure ReadBuffer(); | Reads data from the stream to a buffer
procedure WriteBuffer(); | Writes data from a buffer to the stream
function CopyFrom(); | Copy data from one stream to another
function ReadComponent(); | Reads component data from a stream
function ReadComponentRes(); | Reads component data and resource header from a stream
procedure WriteComponent(); | Write component data to the stream
procedure WriteComponentRes(); | Write resource header and component data to a stream
procedure WriteDescendent(); | Write descendent of a component
procedure WriteDescendentRes(); | Write descendent of a component as resource
procedure WriteResourceHeader(); | Write resource header to the stream
procedure FixupResourceHeader(); | Not implemented in FPC
procedure ReadResHeader; | Read a resource header from the stream.
function ReadByte; | Read a byte from the stream and return its value.
function ReadWord; | Read a word from the stream and return its value.
function ReadDWord; | Read a DWord from the stream and return its value.
function ReadQWord; | Read a QWord value from the stream and return its value
function ReadAnsiString; | Read an ansistring from the stream and return its value.
procedure WriteByte(); | Write a byte to the stream.
procedure WriteWord(); | Write a word to the stream.
procedure WriteDWord(); | Write a DWord to the stream.
procedure WriteQWord(); | Write a QWord value to the stream
procedure WriteAnsiString(); | Write an ansistring to the stream.
property Position: Int64; [rw] | The current position in the stream.
property Size: Int64; [rw] | The current size of the stream.
end;

Inheritance

TStream | Base class for streams.
|
TObject | Base class of all classes.

Description

TStream is the base class for all streaming classes. It defines methods for reading, writing from and to streams, as well as functions to determine the size of the stream as well as the current position of the stream.

Descendant classes such as TMemoryStream or TFileStream then override these methods to write streams to memory or file.

See also

TMemoryStream | Standard implementation of a stream that stores its data in memory
TFileStream | Stream that stores its data in a named file on disk.
TStringStream | Stream that stores its data in a string.


TStream
 | Position
 | Size
TObject


TStream
 | Read
 | Write
 | Seek
 | ReadBuffer
 | WriteBuffer
 | CopyFrom
 | ReadComponent
 | ReadComponentRes
 | WriteComponent
 | WriteComponentRes
 | WriteDescendent
 | WriteDescendentRes
 | WriteResourceHeader
 | FixupResourceHeader
 | ReadResHeader
 | ReadByte
 | ReadWord
 | ReadDWord
 | ReadQWord
 | ReadAnsiString
 | WriteByte
 | WriteWord
 | WriteDWord
 | WriteQWord
 | WriteAnsiString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

CopyFrom (TStream)

Create (TObject)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

FieldAddress (TObject)

FixupResourceHeader (TStream)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

Read (TStream)

ReadAnsiString (TStream)

ReadBuffer (TStream)

ReadByte (TStream)

ReadComponent (TStream)

ReadComponentRes (TStream)

ReadDWord (TStream)

ReadQWord (TStream)

ReadResHeader (TStream)

ReadWord (TStream)

SafeCallException (TObject)

Seek (TStream)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)

Write (TStream)

WriteAnsiString (TStream)

WriteBuffer (TStream)

WriteByte (TStream)

WriteComponent (TStream)

WriteComponentRes (TStream)

WriteDescendent (TStream)

WriteDescendentRes (TStream)

WriteDWord (TStream)

WriteQWord (TStream)

WriteResourceHeader (TStream)

WriteWord (TStream)


TStream

TObject


TStream.CopyFrom

Copy data from one stream to another

Declaration

Source position: classesh.inc line 874

public function TStream.CopyFrom(

  Source: TStream;

  Count: Int64

):Int64;

Description

CopyFrom reads Count bytes from Source and writes them to the current stream. This updates the current position in the stream. After the action is completed, the number of bytes copied is returned. If Count is zero, then the whole contents of the Source stream is copied. It is positioned on the first byte of data, and Size bytes are copied. Note that this cannot be used with streams that do not allow seeking or do not allow determining the size of the stream.

This can be used to quickly copy data from one stream to another or to copy the whole contents of the stream.

See also

TStream.Read | Reads data from the stream to a buffer and returns the number of bytes read.
TStream.Write | Writes data from a buffer to the stream and returns the number of bytes written.


TStream.FixupResourceHeader

Not implemented in FPC

Declaration

Source position: classesh.inc line 882

public procedure TStream.FixupResourceHeader(

  FixupInfo: LongInt

);

Description

FixupResourceHeader is used to write the size of the resource after a component was written to stream. The size is determined from the current position, and it is written at position FixupInfo. After that the current position is restored.

FixupResourceHeader should never be called directly; it is handled by the streaming system.

See also

TStream.WriteResourceHeader | Write resource header to the stream
TStream.WriteComponentRes | Write resource header and component data to a stream
TStream.WriteDescendantRes | Write resource header and component data to a stream, relative to an ancestor


TStream.Position

The current position in the stream.

Declaration

Source position: classesh.inc line 894

public property TStream.Position : Int64
  read GetPosition
  write SetPosition;

Description

Position can be read to determine the current position in the stream. It can be written to set the (absolute) position in the stream. The position is zero-based, so to set the position at the beginning of the stream, the position must be set to zero.

Remark: Not all TStream descendants support setting the position in the stream, so this should be used with care.

Errors

Some descendants may raise an EStreamError exception if they do not support setting the stream position.

See also

TStream.Size | The current size of the stream.
TStream.Seek | Sets the current position in the stream


TStream.Read

Reads data from the stream to a buffer and returns the number of bytes read.

Declaration

Source position: classesh.inc line 868

public function TStream.Read(

  var Buffer;

  Count: LongInt

):LongInt; virtual;

Description

Read attempts to read Count from the stream to Buffer and returns the number of bytes actually read.

This method should be used when the number of bytes is not determined. If a specific number of bytes is expected, use TSTream.ReadBuffer instead.

As implemented in TStream, Read does nothing but raises an EStreamError exception to indicate that reading is not supported. Descendant classes that allow reading must override this method to do the actual reading.

Descendant classes should (if they don't explicitly raise an exception) return a positive value (>=0), where zero indicates an error.

Errors

In case a descendant class does not allow reading from the stream, an exception is raised.

See also

TStream.Write | Writes data from a buffer to the stream and returns the number of bytes written.
TStream.ReadBuffer | Reads data from the stream to a buffer


TStream.ReadAnsiString

Read an ansistring from the stream and return its value.

Declaration

Source position: classesh.inc line 888

public function TStream.ReadAnsiString: string;

Description

ReadAnsiString reads an ansistring from the stream and returns its value. This is a utility function which simply calls the read function several times. The Ansistring should be stored as 4 bytes (a DWord) representing the length of the string, and then the string value itself. The WriteAnsiString function writes an ansistring in such a format.

Errors

If the AnsiString cannot be read, a EStreamError exception will be raised.

See also

TStream.Read | Reads data from the stream to a buffer and returns the number of bytes read.
TStream.WriteAnsiString | Write an ansistring to the stream.
TStream.ReadByte | Read a byte from the stream and return its value.
TStream.ReadWord | Read a word from the stream and return its value.
TStream.ReadDWord | Read a DWord from the stream and return its value.


TStream.ReadBuffer

Reads data from the stream to a buffer

Declaration

Source position: classesh.inc line 872

public procedure TStream.ReadBuffer(

  var Buffer;

  Count: LongInt

);

Description

ReadBuffer reads Count bytes of the stream into Buffer. If the stream does not contain Count bytes, then an exception is raised.

ReadBuffer should be used to read in a fixed number of bytes, such as when reading structures or the content of variables. If the number of bytes is not determined, use TStream.Read instead. ReadBuffer uses Read internally to do the actual reading.

Errors

If the stream does not allow to read Count bytes, then an exception is raised.

See also

TStream.Read | Reads data from the stream to a buffer and returns the number of bytes read.
TStream.WriteBuffer | Writes data from a buffer to the stream


TStream.ReadByte

Read a byte from the stream and return its value.

Declaration

Source position: classesh.inc line 884

public function TStream.ReadByte: Byte;

Description

ReadByte reads one byte from the stream and returns its value.

Errors

If the byte cannot be read, a EStreamError exception will be raised. This is a utility function which symply calls the Read function.

See also

TStream.Read | Reads data from the stream to a buffer and returns the number of bytes read.
TStream.WriteByte | Write a byte to the stream.
TStream.ReadWord | Read a word from the stream and return its value.
TStream.ReadDWord | Read a DWord from the stream and return its value.
TStream.ReadAnsiString | Read an ansistring from the stream and return its value.


TStream.ReadComponent

Reads component data from a stream

Declaration

Source position: classesh.inc line 875

public function TStream.ReadComponent(

  Instance: TComponent

):TComponent;

Description

ReadComponent reads a component state from the stream and transfers this state to Instance. If Instance is nil, then it is created first based on the type stored in the stream. ReadComponent returns the component as it is read from the stream.

ReadComponent simply creates a TReader object and calls its ReadRootComponent method.

Errors

If an error occurs during the reading of the component, an EFilerError exception is raised.

See also

TStream.WriteComponent | Write component data to the stream
TStream.ReadComponentRes | Reads component data and resource header from a stream
TReader.ReadRootComponent | Starts reading a root component.


TStream.ReadComponentRes

Reads component data and resource header from a stream

Declaration

Source position: classesh.inc line 876

public function TStream.ReadComponentRes(

  Instance: TComponent

):TComponent;

Description

ReadComponentRes reads a resource header from the stream, and then calls ReadComponent to read the component state from the stream into Instance.

This method is usually called by the global streaming method when instantiating forms and datamodules as created by an IDE. It should be used mainly on Windows, to store components in Windows resources.

Errors

If an error occurs during the reading of the component, an EFilerError exception is raised.

See also

TStream.ReadComponent | Reads component data from a stream
TStream.WriteComponentRes | Write resource header and component data to a stream


TStream.ReadDWord

Read a DWord from the stream and return its value.

Declaration

Source position: classesh.inc line 886

public function TStream.ReadDWord: Cardinal;

Description

ReadDWord reads one DWord (i.e. 4 bytes) from the stream and returns its value. This is a utility function which simply calls the Read function.

Errors

If the DWord cannot be read, a EStreamError exception will be raised.

See also

TStream.Read | Reads data from the stream to a buffer and returns the number of bytes read.
TStream.WriteDWord | Write a DWord to the stream.
TStream.ReadByte | Read a byte from the stream and return its value.
TStream.ReadWord | Read a word from the stream and return its value.
TStream.ReadAnsiString | Read an ansistring from the stream and return its value.


TStream.ReadQWord

Read a QWord value from the stream and return its value

Declaration

Source position: classesh.inc line 887

public function TStream.ReadQWord: QWord;

Description

ReadQWord reads a QWord value (8 bytes) from the stream and returns it's value.

Errors

If not enough bytes are available on the stream, an EStreamError exception will be raised.

See also

TStream.Read | Reads data from the stream to a buffer and returns the number of bytes read.
TStream.WriteByte | Write a byte to the stream.
TStream.ReadWord | Read a word from the stream and return its value.
TStream.ReadDWord | Read a DWord from the stream and return its value.
TStream.ReadAnsiString | Read an ansistring from the stream and return its value.


TStream.ReadResHeader

Read a resource header from the stream.

Declaration

Source position: classesh.inc line 883

public procedure TStream.ReadResHeader;

Description

ReadResourceHeader reads a reasource file header from the stream. It positions the stream just beyond the header.

ReadResourceHeader should not be called directly, it is called by the streaming system when needed.

Errors

If the resource header is invalid an EInvalidImage exception is raised.

See also

TStream.ReadComponentRes | Reads component data and resource header from a stream
EInvalidImage | Exception raised when the resource header needed for streaming of a component is invalid.


TStream.ReadWord

Read a word from the stream and return its value.

Declaration

Source position: classesh.inc line 885

public function TStream.ReadWord: Word;

Description

ReadWord reads one Word (i.e. 2 bytes) from the stream and returns its value. This is a utility function which symply calls the Read function.

Errors

If the word cannot be read, a EStreamError exception will be raised.

See also

TStream.Read | Reads data from the stream to a buffer and returns the number of bytes read.
TStream.WriteWord | Write a word to the stream.
TStream.ReadByte | Read a byte from the stream and return its value.
TStream.ReadDWord | Read a DWord from the stream and return its value.
TStream.ReadAnsiString | Read an ansistring from the stream and return its value.


TStream.Seek

Sets the current position in the stream

Declaration

Source position: classesh.inc line 870

public function TStream.Seek(

  Offset: LongInt;

  Origin: Word

):LongInt; virtual; overload;

function TStream.Seek(

  const Offset: Int64;

  Origin: TSeekOrigin

):Int64; virtual; overload;

Description

Seek sets the position of the stream to Offset bytes from Origin. There is a 32-bit variant of this function and a 64-bit variant. The difference can be made by choosing the correct Offset parameter: the integer-typed parameter selects the 32-bit variant, the parameter of type TSeekOrigin selects the 64-bit variant of the function.

The Origin parameter for the 32-bit version can have one of the following values:

Constant | Meaning
soFromBeginning | Set the position relative to the start of the stream.
soFromCurrent | Set the position relative to the current position in the stream.
soFromEnd | Set the position relative to the end of the stream.

These values are defined in the SysUtils unit.

The Origin parameter for the 64-bit version has one of the following values:

Value | Meaning
soBeginning | Offset is interpreted relative to the start of the stream.
soCurrent | Offset is interpreted relative to the current position in the stream.
soEnd | Offset is interpreted relative to the end of the stream.

Offset should be negative when the origin is SoFromEnd (soEnd). It should be positive for soFromBeginning and can have both signs for soFromCurrent

This is an abstract method, which must be overridden by descendant classes. They may choose not to implement this method for all values of Origin and Offset.

Remark: Internally, all calls are re-routed to the 64-bit version of the call. When creating a descendant of TStream, the 64-bit version of the call should be overridden.

Errors

An exception may be raised if this method is called with an invalid pair of Offset,Origin values. e.g. a negative offset for soFromBeginning (or soBeginning).

See also

TStream.Position

The current position in the stream.


TStream.Size

The current size of the stream.

Declaration

Source position: classesh.inc line 895

public property TStream.Size : Int64
  read GetSize
  write SetSize64;

Description

Size can be read to determine the stream size or to set the stream size.

Remark: Not all descendants of TStream support getting or setting the stream size; they may raise an exception if the Size property is read or set.

See also

TStream.Position | The current position in the stream.
TStream.Seek | Sets the current position in the stream


TStream.Write

Writes data from a buffer to the stream and returns the number of bytes written.

Declaration

Source position: classesh.inc line 869

public function TStream.Write(

  const Buffer;

  Count: LongInt

):LongInt; virtual;

Description

Write attempts to write Count bytes from Buffer to the stream. It returns the actual number of bytes written to the stream.

This method should be used when the number of bytes that should be written is not determined. If a specific number of bytes should be written, use TSTream.WriteBuffer instead.

As implemented in TStream, Write does nothing but raises EStreamError exception to indicate that writing is not supported. Descendant classes that allow writing must override this method to do the actual writing.

Descendant classes should (if they don't explicitly raise an exception) return a positive value (>=0), where zero indicates an error.

Errors

In case a descendant class does not allow writing to the stream, an exception is raised.

See also

TStream.Read | Reads data from the stream to a buffer and returns the number of bytes read.
TStream.WriteBuffer | Writes data from a buffer to the stream


TStream.WriteAnsiString

Write an ansistring to the stream.

Declaration

Source position: classesh.inc line 893

public procedure TStream.WriteAnsiString(

  const S: string

);

Description

WriteAnsiString writes the AnsiString S (i.e. 4 bytes) to the stream. This is a utility function which simply calls the Write function. The ansistring is written as a 4 byte length specifier, followed by the ansistring's content. The ansistring can be read from the stream using the ReadAnsiString function.

Errors

If an error occurs when attempting to write, an EStreamError exception will be raised.

See also

TStream.Write | Writes data from a buffer to the stream and returns the number of bytes written.
TStream.ReadAnsiString | Read an ansistring from the stream and return its value.
TStream.WriteByte | Write a byte to the stream.
TStream.WriteWord | Write a word to the stream.
TStream.WriteDWord | Write a DWord to the stream.


TStream.WriteBuffer

Writes data from a buffer to the stream

Declaration

Source position: classesh.inc line 873

public procedure TStream.WriteBuffer(

  const Buffer;

  Count: LongInt

);

Description

WriteBuffer writes Count bytes to the stream from Buffer. If the stream does not allow Count bytes to be written, then an exception is raised.

WriteBuffer should be used to write a fixed number of bytes, such as when writing structures or the content of variables. If the number of bytes is not determined, use TStream.Write instead. WriteBuffer uses Write internally to do the actual writing.

Errors

If the stream does not allow to write Count bytes, then an exception is raised.

See also

TStream.Write | Writes data from a buffer to the stream and returns the number of bytes written.
TStream.ReadBuffer | Reads data from the stream to a buffer


TStream.WriteByte

Write a byte to the stream.

Declaration

Source position: classesh.inc line 889

public procedure TStream.WriteByte(

  b: Byte

);

Description

WriteByte writes the byte B to the stream. This is a utility function which simply calls the Write function. The byte can be read from the stream using the ReadByte function.

Errors

If an error occurs when attempting to write, an EStreamError exception will be raised.

See also

TStream.Write | Writes data from a buffer to the stream and returns the number of bytes written.
TStream.ReadByte | Read a byte from the stream and return its value.
TStream.WriteWord | Write a word to the stream.
TStream.WriteDWord | Write a DWord to the stream.
TStream.WriteAnsiString | Write an ansistring to the stream.


TStream.WriteComponent

Write component data to the stream

Declaration

Source position: classesh.inc line 877

public procedure TStream.WriteComponent(

  Instance: TComponent

);

Description

WriteComponent writes the published properties of Instance to the stream, so they can later be read with TStream.ReadComponent. This method is intended to be used by an IDE, to preserve the state of a form or datamodule as designed in the IDE.

WriteComponent simply calls WriteDescendant with Nil ancestor.

See also

TStream.ReadComponent | Reads component data from a stream
TStream.WriteComponentRes | Write resource header and component data to a stream


TStream.WriteComponentRes

Write resource header and component data to a stream

Declaration

Source position: classesh.inc line 878

public procedure TStream.WriteComponentRes(

  const ResName: string;

  Instance: TComponent

);

Description

WriteComponentRes writes a ResName resource header to the stream and then calls WriteComponent to write the published properties of Instance to the stream.

This method is intened for use by an IDE that can use it to store forms or datamodules as designed in a Windows resource stream.

See also

TStream.WriteComponent | Write component data to the stream
TStream.ReadComponentRes | Reads component data and resource header from a stream


TStream.WriteDescendent

Write descendent of a component

Declaration

Source position: classesh.inc line 879

public procedure TStream.WriteDescendent(

  Instance: TComponent;

  Ancestor: TComponent

);

Description

WriteDescendent will create a TWriter writer class and write Instance as a descendent of Ancestor using the writer. This is used to create diff streams: only the properties where Instance differs from Ancestor are written to the stream.

See also

TWriter.WriteDescendent

Write descendent to stream


TStream.WriteDescendentRes

Write descendent of a component as resource

Declaration

Source position: classesh.inc line 880

public procedure TStream.WriteDescendentRes(

  const ResName: string;

  Instance: TComponent;

  Ancestor: TComponent

);

Description

WriteDescendentRes calls WriteDescendent as a resource stream.

See also

TWriter.WriteDescendent

Write descendent to stream


TStream.WriteDWord

Write a DWord to the stream.

Declaration

Source position: classesh.inc line 891

public procedure TStream.WriteDWord(

  d: Cardinal

);

Description

WriteDWord writes the DWord D (i.e. 4 bytes) to the stream. This is a utility function which simply calls the Write function. The DWord can be read from the stream using the ReadDWord function.

Errors

If an error occurs when attempting to write, an EStreamError exception will be raised.

See also

TStream.Write | Writes data from a buffer to the stream and returns the number of bytes written.
TStream.ReadDWord | Read a DWord from the stream and return its value.
TStream.WriteByte | Write a byte to the stream.
TStream.WriteWord | Write a word to the stream.
TStream.WriteAnsiString | Write an ansistring to the stream.


TStream.WriteQWord

Write a QWord value to the stream

Declaration

Source position: classesh.inc line 892

public procedure TStream.WriteQWord(

  q: QWord

);

Description

WriteQWord writes the word W (i.e. 8 bytes) to the stream. This is a utility function which simply calls the Write function. The word can be read from the stream using the ReadQWord function.

Errors

If an error occurs when attempting to write, an EStreamError exception will be raised.

See also

TStream.Write | Writes data from a buffer to the stream and returns the number of bytes written.
TStream.ReadByte | Read a byte from the stream and return its value.
TStream.WriteWord | Write a word to the stream.
TStream.WriteDWord | Write a DWord to the stream.
TStream.WriteAnsiString | Write an ansistring to the stream.


TStream.WriteResourceHeader

Write resource header to the stream

Declaration

Source position: classesh.inc line 881

public procedure TStream.WriteResourceHeader(

  const ResName: string;

  var FixupInfo: LongInt

);

Description

WriteResourceHeader writes a resource-file header for a resource called ResName. It returns in FixupInfo the argument that should be passed on to TStream.FixupResourceHeader.

WriteResourceHeader should not be used directly. It is called by the TStream.WriteComponentRes and TStream.WriteDescendantRes methods.

See also

TStream.FixupResourceHeader | Not implemented in FPC
TStream.WriteComponentRes | Write resource header and component data to a stream
TStream.WriteDescendantRes | Write resource header and component data to a stream, relative to an ancestor


TStream.WriteWord

Write a word to the stream.

Declaration

Source position: classesh.inc line 890

public procedure TStream.WriteWord(

  w: Word

);

Description

WriteWord writes the word W (i.e. 2 bytes) to the stream. This is a utility function which simply calls the Write function. The word can be read from the stream using the ReadWord function.

Errors

If an error occurs when attempting to write, an EStreamError exception will be raised.

See also

TStream.Write | Writes data from a buffer to the stream and returns the number of bytes written.
TStream.ReadWord | Read a word from the stream and return its value.
TStream.WriteByte | Write a byte to the stream.
TStream.WriteDWord | Write a DWord to the stream.
TStream.WriteAnsiString | Write an ansistring to the stream.


TStreamAdapter

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Implements IStream for TStream descendants

Declaration

Source position: classesh.inc line 1056

type TStreamAdapter = class(TInterfacedObject, IStream)
public
constructor Create(); | Create a new instance of TStreamAdapter
destructor Destroy; override; | Free the TStreamAdapter instance
function Read(); virtual; | Read from the stream.
function Write(); virtual; | Write to the stream
function Seek(); virtual; | Set the stream position
function SetSize(); virtual; | Set the stream size
function CopyTo(); virtual; | Copy data to destination stream
function Commit(); virtual; | Commit data to the stream
function Revert; virtual; | Revert operations on the stream
function LockRegion(); virtual; | Lock a region of the stream
function UnlockRegion(); virtual; | Unlock a region of the stream
function Stat(); virtual; | Return statistical data about the stream
function Clone(); virtual; | Clone the stream
property Stream: TStream; [r] | Stream on which adaptor works
property StreamOwnership: TStreamOwnership; [rw] | Determines what happens with the stream when the adaptor is freed
end;

Inheritance

TStreamAdapter,IStream | Implements IStream for TStream descendants
|
TInterfacedObject,IUnknown | TObject descendent implementing the IUnknown interface
|
TObject | Base class of all classes.


TStreamAdapter
 | ro | Stream
 |  | StreamOwnership
TInterfacedObject
 | ro | RefCount
TObject


ro | RefCount (TInterfacedObject)
ro |


TStreamAdapter
 | Create
 | Destroy
 | Read
 | Write
 | Seek
 | SetSize
 | CopyTo
 | Commit
 | Revert
 | LockRegion
 | UnlockRegion
 | Stat
 | Clone
TInterfacedObject
 | AfterConstruction
 | BeforeDestruction
 | NewInstance
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

AfterConstruction (TInterfacedObject)

BeforeDestruction (TObject)

BeforeDestruction (TInterfacedObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Clone (TStreamAdapter)

Commit (TStreamAdapter)

CopyTo (TStreamAdapter)

Create (TObject)

Create (TStreamAdapter)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Destroy (TStreamAdapter)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

FieldAddress (TObject)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

LockRegion (TStreamAdapter)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

NewInstance (TInterfacedObject)

Read (TStreamAdapter)

Revert (TStreamAdapter)

SafeCallException (TObject)

Seek (TStreamAdapter)

SetSize (TStreamAdapter)

Stat (TStreamAdapter)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)

UnlockRegion (TStreamAdapter)

Write (TStreamAdapter)


TStreamAdapter

TInterfacedObject

TObject


TStreamAdapter.Clone

Clone the stream

Declaration

Source position: classesh.inc line 1074

public function TStreamAdapter.Clone(

  out stm: IStream

):HRESULT; virtual;

Description

Clone implements #rtl.types.IStream.Clone.

Errors

This function must be overridden and will raise a runerror 217 when called directly.

See also

#rtl.types.IStream.Clone

Clone the stream instance


TStreamAdapter.Commit

Commit data to the stream

Declaration

Source position: classesh.inc line 1069

public function TStreamAdapter.Commit(

  grfCommitFlags: LongInt

):HRESULT; virtual;

Description

Commit implements #rtl.types.IStream.Commit.

Errors

This function must be overridden and will raise a runerror 217 when called directly.

See also

#rtl.types.IStream.Commit

Commit data to the stream


TStreamAdapter.CopyTo

Copy data to destination stream

Declaration

Source position: classesh.inc line 1068

public function TStreamAdapter.CopyTo(

  stm: IStream;

  cb: LargeUint;

  out cbRead: LargeUint;

  out cbWritten: LargeUint

):HRESULT; virtual;

Description

CopyTo implements #rtl.types.IStream.CopyTo.

Errors

This function must be overridden and will raise a runerror 217 when called directly.


TStreamAdapter.Create

Create a new instance of TStreamAdapter

Declaration

Source position: classesh.inc line 1062

public constructor TStreamAdapter.Create(

  Stream: TStream;

  Ownership: TStreamOwnership = soReference

);

Description

Create creates a new instance of TStreamAdaptor. It initializes TStreamAdapter.Stream with Stream and initializes StreamOwnerShip with Ownership.

TStreamAdapter is an abstract class: descendants must be created that implement the actual functionality.

See also

StreamOwnerShip | Determines what happens with the stream when the adaptor is freed
TStreamAdapter.Stream | Stream on which adaptor works


TStreamAdapter.Destroy

Free the TStreamAdapter instance

Declaration

Source position: classesh.inc line 1063

public destructor TStreamAdapter.Destroy; override;

Description

Explicitly free the TStreamAdapter instance. Normally, this is done automatically if a reference to the IStream interface is freed.


TStreamAdapter.LockRegion

Lock a region of the stream

Declaration

Source position: classesh.inc line 1071

public function TStreamAdapter.LockRegion(

  libOffset: LargeUint;

  cb: LargeUint;

  dwLockType: LongInt

):HRESULT; virtual;

Description

LockRegion implements #rtl.types.IStream.LockRegion.

Errors

This function must be overridden and will raise a runerror 217 when called directly.

See also

#rtl.types.IStream.LockRegion

Lock a region of bytes in the stream


TStreamAdapter.Read

Read from the stream.

Declaration

Source position: classesh.inc line 1064

public function TStreamAdapter.Read(

  pv: Pointer;

  cb: DWORD;

  pcbRead: PDWord

):HRESULT; virtual;

Description

Read implements #rtl.types.ISequentialStream.Read by reading from the stream specified at creation.

Errors

This function must be overridden and will raise a runerror 217 when called directly.

See also

#rtl.types.ISequentialStream.Read

Read data from the stream


TStreamAdapter.Revert

Revert operations on the stream

Declaration

Source position: classesh.inc line 1070

public function TStreamAdapter.Revert: HRESULT; virtual;

Description

Revert implements #rtl.types.IStream.Revert.

Errors

This function must be overridden and will raise a runerror 217 when called directly.

See also

#rtl.types.IStream.Revert

Revert changes


TStreamAdapter.Seek

Set the stream position

Declaration

Source position: classesh.inc line 1066

public function TStreamAdapter.Seek(

  dlibMove: LargeUint;

  dwOrigin: LongInt;

  out libNewPosition: LargeUint

):HRESULT; virtual;

Description

Seek implements #rtl.types.IStream.Seek by setting the position of the stream specified at creation.

Errors

This function must be overridden and will raise a runerror 217 when called directly.

See also

#rtl.types.IStream.Seek

Set the stream position


TStreamAdapter.SetSize

Set the stream size

Declaration

Source position: classesh.inc line 1067

public function TStreamAdapter.SetSize(

  libNewSize: LargeUint

):HRESULT; virtual;

Description

SetSize implements #rtl.types.IStream.Setsize by setting the size of the stream specified at creation.

Errors

This function must be overridden and will raise a runerror 217 when called directly.

See also

#rtl.types.IStream.Setsize

Set the stream size


TStreamAdapter.Stat

Return statistical data about the stream

Declaration

Source position: classesh.inc line 1073

public function TStreamAdapter.Stat(

  out statstg: TStatStg;

  grfStatFlag: LongInt

):HRESULT; virtual;

Description

Stat implements #rtl.types.IStream.Stat.

Errors

This function must be overridden and will raise a runerror 217 when called directly.

See also

#rtl.types.IStream.Stat

return information about the stream.


TStreamAdapter.Stream

Stream on which adaptor works

Declaration

Source position: classesh.inc line 1075

public property TStreamAdapter.Stream : TStream
  read FStream;

Description

This is the stream on which the adaptor works. It was specified at rreation.


TStreamAdapter.StreamOwnership

Determines what happens with the stream when the adaptor is freed

Declaration

Source position: classesh.inc line 1076

public property TStreamAdapter.StreamOwnership : TStreamOwnership
  read FOwnership
  write FOwnership;

Description

StreamOwnership determines what happens when the adaptor


TStreamAdapter.UnlockRegion

Unlock a region of the stream

Declaration

Source position: classesh.inc line 1072

public function TStreamAdapter.UnlockRegion(

  libOffset: LargeUint;

  cb: LargeUint;

  dwLockType: LongInt

):HRESULT; virtual;

Description

UnLockRegion implements #rtl.types.IStream.UnLockRegion.

Errors

This function must be overridden and will raise a runerror 217 when called directly.

See also

#rtl.types.IStream.UnLockRegion

Unlocks a previously locked region of bytes in the stream


TStreamAdapter.Write

Write to the stream

Declaration

Source position: classesh.inc line 1065

public function TStreamAdapter.Write(

  pv: Pointer;

  cb: DWORD;

  pcbWritten: PDWord

):HRESULT; virtual;

Description

Write implements #rtl.types.ISequentialStream.Write by writing to the stream specified at creation.

Errors

This function must be overridden and will raise a runerror 217 when called directly.

See also

#rtl.types.ISequentialStream.Write

Write data to the stream


TStringList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Standard implementation of the TStrings class.

Declaration

Source position: classesh.inc line 735

type TStringList = class(TStrings)
public
destructor Destroy; override; | Destroys the stringlist.
function Add(); override; | Implements the TStrings.Add function.
procedure Clear; override; | Implements the TStrings.Clear function.
procedure Delete(); override; | Implements the TStrings.Delete function.
procedure Exchange(); override; | Implements the TStrings.Exchange function.
function Find(); virtual; | Locates the index for a given string in sorted lists.
function IndexOf(); override; | Overrides the TStrings.IndexOf property.
procedure Insert(); override; | Overrides the TStrings.Insert method.
procedure Sort; virtual; | Sorts the strings in the list.
procedure CustomSort(); virtual; | Sort the stringlist using a custom sort algorithm
property Duplicates: TDuplicates; [rw] | Describes the behaviour of a sorted list with respect to duplicate strings.
property Sorted: Boolean; [rw] | Determines whether the list is sorted or not.
property CaseSensitive: Boolean; [rw] | Indicates whether comparing strings happens in a case sensitive manner.
property OnChange: TNotifyEvent; [rw] | Event triggered after the list was modified.
property OnChanging: TNotifyEvent; [rw] | Event triggered when the list is about to be modified.
property OwnsObjects: Boolean; [rw] | Determines whether the stringlist owns it's objects or not.
property SortStyle: TStringsSortStyle; [rw] | Sort style for strings
end;

Inheritance

TStringList | Standard implementation of the TStrings class.
|
TStrings | Class to manage arrays or collections of strings
|
TPersistent,IFPObserved | Base class for streaming system and persistent properties.
|
TObject | Base class of all classes.

Description

TStringList is a descendant class of TStrings that implements all of the abstract methods introduced there. It also introduces some additional methods:

  • Sort the list, or keep the list sorted at all times
  • Special handling of duplicates in sorted lists
  • Notification of changes in the list

See also

TStrings | Class to manage arrays or collections of strings
TStringList.Duplicates | Describes the behaviour of a sorted list with respect to duplicate strings.
TStringList.Sorted | Determines whether the list is sorted or not.


TStringList
 |  | Duplicates
 |  | Sorted
 |  | CaseSensitive
 |  | OwnsObjects
 |  | SortStyle
TStrings
 |  | TextLineBreakStyle
 |  | Delimiter
 |  | DelimitedText
 |  | LineBreak
 |  | StrictDelimiter
 |  | QuoteChar
 |  | NameValueSeparator
 |  | ValueFromIndex
 |  | Capacity
 |  | CommaText
 | ro | Count
 | ro | Names
 |  | Objects
 |  | Values
 |  | Strings
 |  | Text
 |  | StringsAdapter
 |  | SkipLastLineBreak
TPersistent
TObject


ro | Count (TStrings)
 | DelimitedText (TStrings)
 | Delimiter (TStrings)
 | Duplicates (TStringList)
 | LineBreak (TStrings)
ro | Names (TStrings)
 | NameValueSeparator (TStrings)
 | Objects (TStrings)
 | OwnsObjects (TStringList)
 | QuoteChar (TStrings)
 | SkipLastLineBreak (TStrings)
 | Sorted (TStringList)
 | SortStyle (TStringList)
 | StrictDelimiter (TStrings)
 | Strings (TStrings)
 | StringsAdapter (TStrings)
 | Text (TStrings)
 | TextLineBreakStyle (TStrings)
 | ValueFromIndex (TStrings)
 | Values (TStrings)


TStringList
 | Destroy
 | Add
 | Clear
 | Delete
 | Exchange
 | Find
 | IndexOf
 | Insert
 | Sort
 | CustomSort
TStrings
 | Destroy
 | Add
 | AddObject
 | Append
 | AddStrings
 | AddText
 | Assign
 | BeginUpdate
 | Clear
 | Delete
 | EndUpdate
 | Equals
 | Exchange
 | GetEnumerator
 | GetText
 | IndexOf
 | IndexOfName
 | IndexOfObject
 | Insert
 | InsertObject
 | LoadFromFile
 | LoadFromStream
 | Move
 | SaveToFile
 | SaveToStream
 | SetText
 | GetNameValue
 | ExtractName
TPersistent
 | Destroy
 | Assign
 | FPOAttachObserver
 | FPODetachObserver
 | FPONotifyObservers
 | GetNamePath
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


Add (TStrings)

Add (TStringList)

AddObject (TStrings)

AddStrings (TStrings)

AddText (TStrings)

AfterConstruction (TObject)

Append (TStrings)

Assign (TPersistent)

Assign (TStrings)

BeforeDestruction (TObject)

BeginUpdate (TStrings)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Clear (TStrings)

Clear (TStringList)

Create (TObject)

CustomSort (TStringList)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Delete (TStrings)

Delete (TStringList)

Destroy (TObject)

Destroy (TPersistent)

Destroy (TStrings)

Destroy (TStringList)

Dispatch (TObject)

DispatchStr (TObject)

EndUpdate (TStrings)

Equals (TObject)

Equals (TStrings)

Exchange (TStrings)

Exchange (TStringList)

ExtractName (TStrings)

FieldAddress (TObject)

Find (TStringList)

FPOAttachObserver (TPersistent)

FPODetachObserver (TPersistent)

FPONotifyObservers (TPersistent)

Free (TObject)

FreeInstance (TObject)

GetEnumerator (TStrings)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

GetNamePath (TPersistent)

GetNameValue (TStrings)

GetText (TStrings)

IndexOf (TStrings)

IndexOf (TStringList)

IndexOfName (TStrings)

IndexOfObject (TStrings)

InheritsFrom (TObject)

InitInstance (TObject)

Insert (TStrings)

Insert (TStringList)

InsertObject (TStrings)

InstanceSize (TObject)

LoadFromFile (TStrings)

LoadFromStream (TStrings)

MethodAddress (TObject)

MethodName (TObject)

Move (TStrings)

newinstance (TObject)

SafeCallException (TObject)

SaveToFile (TStrings)

SaveToStream (TStrings)

SetText (TStrings)

Sort (TStringList)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)


TStringList
 | OnChange
 | OnChanging
TStrings
TPersistent
TObject


OnChange (TStringList)

OnChanging (TStringList)


TStringList.Add

Implements the TStrings.Add function.

Declaration

Source position: classesh.inc line 774

public function TStringList.Add(

  const S: string

):Integer; override;

Description

Add will add S to the list. If the list is sorted and the string S is already present in the list and TStringList.Duplicates is dupError then an EStringListError exception is raised. If Duplicates is set to dupIgnore then the return value is the index of the previous entry.

If the list is sorted, new strings will not necessarily be added to the end of the list, rather they will be inserted at their alphabetical position.

Errors

If the list is sorted and the string S is already present in the list and TStringList.Duplicates is dupError then an EStringListError exception is raised.

See also

TStringList.Insert | Overrides the TStrings.Insert method.
TStringList.Duplicates | Describes the behaviour of a sorted list with respect to duplicate strings.


TStringList.CaseSensitive

Indicates whether comparing strings happens in a case sensitive manner.

Declaration

Source position: classesh.inc line 785

public property TStringList.CaseSensitive : Boolean
  read FCaseSensitive
  write SetCaseSensitive;

Description

CaseSensitive indicates how string values are compared: When True this happens case sensitively, and when False, case must match.

This property influences IndexOf, Find, IndexOfName and Sort.

See also

IndexOf | Find a string in the list and return its position.
Find | Locates the index for a given string in sorted lists.
IndexOfName | Finds the index of a name in the name-value pairs.
Sort | Sorts the strings in the list.


TStringList.Clear

Implements the TStrings.Clear function.

Declaration

Source position: classesh.inc line 775

public procedure TStringList.Clear; override;


TStringList.CustomSort

Sort the stringlist using a custom sort algorithm

Declaration

Source position: classesh.inc line 782

public procedure TStringList.CustomSort(

  CompareFn: TStringListSortCompare

); virtual;

Description

CustomSort sorts the stringlist with a custom comparison function. The function should compare 2 elements in the list, and return a negative number if the first item is before the second. It should return 0 if the elements are equal, and a positive result indicates that the second elements should be before the first.

See also

TStringList.Sorted | Determines whether the list is sorted or not.
TStringList.Sort | Sorts the strings in the list.


TStringList.Delete

Implements the TStrings.Delete function.

Declaration

Source position: classesh.inc line 776

public procedure TStringList.Delete(

  Index: Integer

); override;


TStringList.Destroy

Destroys the stringlist.

Declaration

Source position: classesh.inc line 773

public destructor TStringList.Destroy; override;

Description

Destroy clears the stringlist, release all memory allocated for the storage of the strings, and then calls the inherited destroy method.

Remark: Any objects associated to strings in the list will not be destroyed; it is the responsability of the caller to destroy all objects associated with strings in the list.


TStringList.Duplicates

Describes the behaviour of a sorted list with respect to duplicate strings.

Declaration

Source position: classesh.inc line 783

public property TStringList.Duplicates : TDuplicates
  read FDuplicates
  write FDuplicates;

Description

Duplicates describes what to do in case a duplicate value is added to the list:

dupIgnore | Duplicate values will not be added to the list, but no error will be triggered.
dupError | If an attempt is made to add a duplicate value to the list, an EStringListError exception is raised.
dupAccept | Duplicate values can be added to the list.

If the stringlist is not sorted, the Duplicates setting is ignored.


TStringList.Exchange

Implements the TStrings.Exchange function.

Declaration

Source position: classesh.inc line 777

public procedure TStringList.Exchange(

  Index1: Integer;

  Index2: Integer

); override;

Description

Exchange will exchange two items in the list as described in TStrings.Exchange.

Remark: Exchange will not check whether the list os sorted or not; if Exchange is called on a sorted list and the strings are not identical, the sort order of the list will be destroyed.

See also

TStringList.Sorted | Determines whether the list is sorted or not.
TStrings.Exchange | Exchanges two strings in the list.


TStringList.Find

Locates the index for a given string in sorted lists.

Declaration

Source position: classesh.inc line 778

public function TStringList.Find(

  const S: string;

  out Index: Integer

):Boolean; virtual;

Description

Find returns True if the string S is present in the list. Upon exit, the Index parameter will contain the position of the string in the list. If the string is not found, the function will return False and Index will contain the position where the string will be inserted if it is added to the list.

Remark:
  1. Use this method only on sorted lists. For unsorted lists, use TStringList.IndexOf instead.
  2. Find uses a binary search method to locate the string


TStringList.IndexOf

Overrides the TStrings.IndexOf property.

Declaration

Source position: classesh.inc line 779

public function TStringList.IndexOf(

  const S: string

):Integer; override;

Description

IndexOf overrides the ancestor method TStrings.indexOf. It tries to optimize the search by executing a binary search if the list is sorted. The function returns the position of S if it is found in the list, or -1 if the string is not found in the list.

See also

TStrings.IndexOf | Find a string in the list and return its position.
TStringList.Find | Locates the index for a given string in sorted lists.


TStringList.Insert

Overrides the TStrings.Insert method.

Declaration

Source position: classesh.inc line 780

public procedure TStringList.Insert(

  Index: Integer;

  const S: string

); override;

Description

Insert will insert the string S at position Index in the list. If the list is sorted, an EStringListError exception will be raised instead. Index is a zero-based position.

Errors

If Index contains an invalid value (less than zero or larger than Count, or the list is sorted, an EStringListError exception will be raised.

See also

TStringList.Add | Implements the TStrings.Add function.
TStrings.Insert | Insert a string in the list.
TStrings.InsertObject | Insert a string and associated object in the list.


TStringList.OnChange

Event triggered after the list was modified.

Declaration

Source position: classesh.inc line 786

public property TStringList.OnChange : TNotifyEvent
  read FOnChange
  write FOnChange;

Description

OnChange can be assigned to respond to changes that have occurred in the list. The handler is called whenever strings are added, moved, modified or deleted from the list.

The Onchange event is triggered after the modification took place. When the modification is about to happen, an TstringList.OnChanging event occurs.

See also

TStringList.OnChanging

Event triggered when the list is about to be modified.


TStringList.OnChanging

Event triggered when the list is about to be modified.

Declaration

Source position: classesh.inc line 787

public property TStringList.OnChanging : TNotifyEvent
  read FOnChanging
  write FOnChanging;

Description

OnChanging can be assigned to respond to changes that will occurred in the list. The handler is called whenever strings will be added, moved, modified or deleted from the list.

The Onchanging event is triggered before the modification will take place. When the modification has happened, an TstringList.OnChange event occurs.

See also

TStringList.OnChange

Event triggered after the list was modified.


TStringList.OwnsObjects

Determines whether the stringlist owns it's objects or not.

Declaration

Source position: classesh.inc line 788

public property TStringList.OwnsObjects : Boolean
  read FOwnsObjects
  write FOwnsObjects;

Description

OwnsObjects can be set to true to let the stringlist instance own the objects in the list: if an element is removed from the list, the associated object (if there is any) will be freed as well. The same is true if the list is cleared or destroyed.

See also

TStrings.Objects

Indexed access to the objects associated with the strings in the list.


TStringList.Sort

Sorts the strings in the list.

Declaration

Source position: classesh.inc line 781

public procedure TStringList.Sort; virtual;

Description

Sort will sort the strings in the list using the quicksort algorithm. If the list has its TStringList.Sorted property set to True then nothing will be done.

See also

TStringList.Sorted

Determines whether the list is sorted or not.


TStringList.Sorted

Determines whether the list is sorted or not.

Declaration

Source position: classesh.inc line 784

public property TStringList.Sorted : Boolean
  read GetSorted
  write SetSorted;

Description

Sorted can be set to True in order to cause the list of strings to be sorted. Further additions to the list will be inserted at the correct position so the list remains sorted at all times. Setting the property to False has no immediate effect, but will allow strings to be inserted at any position.

Remark:
  1. When Sorted is True, TStringList.Insert cannot be used. For sorted lists, TStringList.Add should be used instead.
  2. If Sorted is True, the TStringList.Duplicates setting has effect. This setting is ignored when Sorted is False.

See also

TStringList.Sort | Sorts the strings in the list.
TStringList.Duplicates | Describes the behaviour of a sorted list with respect to duplicate strings.
TStringList.Add | Implements the TStrings.Add function.
TstringList.Insert | Overrides the TStrings.Insert method.


TStringList.SortStyle

Sort style for strings

Declaration

Source position: classesh.inc line 789

public property TStringList.SortStyle : TStringsSortStyle
  read FSortStyle
  write SetSortStyle;

Description

SortStyle sets the sort style for the TStringList instance. Setting it to sslAuto will keep the list sorted automatically at all times.

Find (and hence IndexOf) will use a binary search if SortStyle differs from sslNone. if SortStyle is sslNone, then it will raise an exception.

See also

TStringsSortStyle

Determines how the strings are sorted

TStrings.Sorted


TStringListSortCompare

Callback type used in stringlist compares.

Declaration

Source position: classesh.inc line 719

type TStringListSortCompare = function(

  List: TStringList;

  Index1: Integer;

  Index2: Integer

):Integer;


TStrings

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Class to manage arrays or collections of strings

Declaration

Source position: classesh.inc line 603

type TStrings = class(TPersistent)
public
destructor Destroy; override; | Frees all strings and objects, and removes the list from memory.
function Add(); | Add a string to the list
function AddObject(); | Add a string and associated object to the list.
procedure Append(); | Add a string to the list.
procedure AddStrings(); | Add contents of another stringlist to this list.
procedure AddText(); virtual; | Add text to the string list.
procedure Assign(); override; | Assign the contents of another stringlist to this one.
procedure BeginUpdate; | Mark the beginning of an update batch.
procedure Clear; virtual; abstract; | Removes all strings and associated objects from the list.
procedure Delete(); virtual; abstract; | Delete a string from the list.
procedure EndUpdate; | Mark the end of an update batch.
function Equals(); | Compares the contents of two stringlists.
procedure Exchange(); virtual; | Exchanges two strings in the list.
function GetEnumerator; | Create an IEnumerator instance
function GetText; virtual; | Returns the contents as a PChar
function IndexOf(); virtual; | Find a string in the list and return its position.
function IndexOfName(); virtual; | Finds the index of a name in the name-value pairs.
function IndexOfObject(); virtual; | Finds an object in the list and returns its index.
procedure Insert(); virtual; abstract; | Insert a string in the list.
procedure InsertObject(); | Insert a string and associated object in the list.
procedure LoadFromFile(); virtual; | Load the contents of a file as a series of strings.
procedure LoadFromStream(); virtual; | Load the contents of a stream as a series of strings.
procedure Move(); virtual; | Move a string from one place in the list to another.
procedure SaveToFile(); virtual; | Save the contents of the list to a file.
procedure SaveToStream(); virtual; | Save the contents of the string to a stream.
procedure SetText(); virtual; | Set the contents of the list from a PChar.
procedure GetNameValue(); | Return both name and value of a name,value pair based on it's index.
function ExtractName(); | Extract the name part of a string
property TextLineBreakStyle: TTextLineBreakStyle; [rw] | Determines which line breaks to use in the Text property
property Delimiter: Char; [rw] | Delimiter character used in DelimitedText.
property DelimitedText: string; [rw] | Get or set all strings in the list in a delimited form.
property LineBreak: string; [rw] | LineBreak character to use
property StrictDelimiter: Boolean; [rw] | Should only the delimiter character be considered a delimiter
property QuoteChar: Char; [rw] | Quote character used in DelimitedText.
property NameValueSeparator: Char; [rw] | Value of the character used to separate name,value pairs
property ValueFromIndex []: string; [rw] | Return the value part of a string based on it's index.
property Capacity: Integer; [rw] | Capacity of the list, i.e. number of strings that the list can currently hold before it tries to expand.
property CommaText: string; [rw] | Contents of the list as a comma-separated string.
property Count: Integer; [r] | Number of strings in the list.
property Names []: string; [r] | Name parts of the name-value pairs in the list.
property Objects []: TObject; [rw] | Indexed access to the objects associated with the strings in the list.
property Values []: string; [rw] | Value parts of the name-value pairs in the list.
property Strings []: string; default; [rw] | Indexed access to the strings in the list.
property Text: string; [rw] | Contents of the list as one big string.
property StringsAdapter: IStringsAdapter; [rw] | Not implemented in Free Pascal.
property SkipLastLineBreak: Boolean; [rw] | Do not add a linebreak to the last item
end;

Inheritance

TStrings | Class to manage arrays or collections of strings
|
TPersistent,IFPObserved | Base class for streaming system and persistent properties.
|
TObject | Base class of all classes.

Description

TStrings implements an abstract class to manage an array of strings. It introduces methods to set and retrieve strings in the array, searching for a particular string, concatenating the strings and so on. It also allows an arbitrary object to be associated with each string.

It also introduces methods to manage a series of name=value settings, as found in many configuration files.

An instance of TStrings is never created directly, instead a descendant class such as TStringList should be created. This is because TStrings is an abstract class which does not implement all methods; TStrings also doesn't store any strings, this is the functionality introduced in descendants such as TStringList.

TStrings implements the IFPObserved interface: when the stringlist is changed, a ooChanged notification is sent to all observers.

See also

TStringList | Standard implementation of the TStrings class.
IFPObserved | Interface implemented by an object that can be observed.


TStrings
 |  | TextLineBreakStyle
 |  | Delimiter
 |  | DelimitedText
 |  | LineBreak
 |  | StrictDelimiter
 |  | QuoteChar
 |  | NameValueSeparator
 |  | ValueFromIndex
 |  | Capacity
 |  | CommaText
 | ro | Count
 | ro | Names
 |  | Objects
 |  | Values
 |  | Strings
 |  | Text
 |  | StringsAdapter
 |  | SkipLastLineBreak
TPersistent
TObject


ro | Count (TStrings)
 | DelimitedText (TStrings)
 | Delimiter (TStrings)
 | LineBreak (TStrings)
ro | Names (TStrings)
 | NameValueSeparator (TStrings)
 | Objects (TStrings)
 | QuoteChar (TStrings)
 | SkipLastLineBreak (TStrings)
 | StrictDelimiter (TStrings)
 | Strings (TStrings)
 | StringsAdapter (TStrings)
 | Text (TStrings)
 | TextLineBreakStyle (TStrings)
 | ValueFromIndex (TStrings)
 | Values (TStrings)


TStrings
 | Destroy
 | Add
 | AddObject
 | Append
 | AddStrings
 | AddText
 | Assign
 | BeginUpdate
 | Clear
 | Delete
 | EndUpdate
 | Equals
 | Exchange
 | GetEnumerator
 | GetText
 | IndexOf
 | IndexOfName
 | IndexOfObject
 | Insert
 | InsertObject
 | LoadFromFile
 | LoadFromStream
 | Move
 | SaveToFile
 | SaveToStream
 | SetText
 | GetNameValue
 | ExtractName
TPersistent
 | Destroy
 | Assign
 | FPOAttachObserver
 | FPODetachObserver
 | FPONotifyObservers
 | GetNamePath
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


Add (TStrings)

AddObject (TStrings)

AddStrings (TStrings)

AddText (TStrings)

AfterConstruction (TObject)

Append (TStrings)

Assign (TPersistent)

Assign (TStrings)

BeforeDestruction (TObject)

BeginUpdate (TStrings)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Clear (TStrings)

Create (TObject)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Delete (TStrings)

Destroy (TObject)

Destroy (TPersistent)

Destroy (TStrings)

Dispatch (TObject)

DispatchStr (TObject)

EndUpdate (TStrings)

Equals (TObject)

Equals (TStrings)

Exchange (TStrings)

ExtractName (TStrings)

FieldAddress (TObject)

FPOAttachObserver (TPersistent)

FPODetachObserver (TPersistent)

FPONotifyObservers (TPersistent)

Free (TObject)

FreeInstance (TObject)

GetEnumerator (TStrings)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

GetNamePath (TPersistent)

GetNameValue (TStrings)

GetText (TStrings)

IndexOf (TStrings)

IndexOfName (TStrings)

IndexOfObject (TStrings)

InheritsFrom (TObject)

InitInstance (TObject)

Insert (TStrings)

InsertObject (TStrings)

InstanceSize (TObject)

LoadFromFile (TStrings)

LoadFromStream (TStrings)

MethodAddress (TObject)

MethodName (TObject)

Move (TStrings)

newinstance (TObject)

SafeCallException (TObject)

SaveToFile (TStrings)

SaveToStream (TStrings)

SetText (TStrings)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)


TStrings

TPersistent

TObject


TStrings.Add

Add a string to the list

Declaration

Source position: classesh.inc line 661

public function TStrings.Add(

  const S: string

):Integer; virtual; overload;

function TStrings.Add(

  const Fmt: string;

  const Args: array of Const

):Integer; overload;

Description

Add adds S at the end of the list and returns the index of S in the list (which should equal Tstrings.Count

See also

TStrings.Objects | Indexed access to the objects associated with the strings in the list.
TStrings.AddObject | Add a string and associated object to the list.
TStrings.Insert | Insert a string in the list.
TStrings.Delete | Delete a string from the list.
TStrings.Strings | Indexed access to the strings in the list.
TStrings.Count | Number of strings in the list.


TStrings.AddObject

Add a string and associated object to the list.

Declaration

Source position: classesh.inc line 662

public function TStrings.AddObject(

  const S: string;

  AObject: TObject

):Integer; virtual; overload;

function TStrings.AddObject(

  const Fmt: string;

  Args: array of Const;

  AObject: TObject

):Integer; overload;

Description

AddObject adds S to the list of strings, and associates AObject with it. It returns the index of S.

Remark: An object added to the list is not automatically destroyed by the list of the list is destroyed or the string it is associated with is deleted. It is the responsibility of the application to destroy any objects associated with strings.

See also

TStrings.Add | Add a string to the list
TStrings.Strings | Indexed access to the strings in the list.
TStrings.Objects | Indexed access to the objects associated with the strings in the list.
TStrings.InsertObject | Insert a string and associated object in the list.


TStrings.AddStrings

Add contents of another stringlist to this list.

Declaration

Source position: classesh.inc line 666

public procedure TStrings.AddStrings(

  TheStrings: TStrings

); virtual; overload;

procedure TStrings.AddStrings(

  TheStrings: TStrings;

  ClearFirst: Boolean

); overload;

procedure TStrings.AddStrings(

  const TheStrings: array of string

); virtual; overload;

procedure TStrings.AddStrings(

  const TheStrings: array of string;

  ClearFirst: Boolean

); overload;

Description

AddStrings adds the contents of TheStrings to the stringlist. Any associated objects are added as well.

See also

TStrings.Add | Add a string to the list
TStrings.Assign | Assign the contents of another stringlist to this one.


TStrings.AddText

Add text to the string list.

Declaration

Source position: classesh.inc line 670

public procedure TStrings.AddText(

  const S: string

); virtual;

Description

AddText adds S to the strings. It is identical in function to setting Text but does not clear the list of strings first: S is split into lines, and each line is added to the list.

See also

TString.Text


TStrings.Append

Add a string to the list.

Declaration

Source position: classesh.inc line 665

public procedure TStrings.Append(

  const S: string

);

Description

Append does the same as TStrings.Add, only it does not return the index of the inserted string.

See also

TStrings.Add

Add a string to the list


TStrings.Assign

Assign the contents of another stringlist to this one.

Declaration

Source position: classesh.inc line 671

public procedure TStrings.Assign(

  Source: TPersistent

); override;

Description

Assign replaces the contents of the stringlist with the contents of Source if Source is also of type TStrings. Any associated objects are copied as well.

See also

TStrings.Add | Add a string to the list
TStrings.AddStrings | Add contents of another stringlist to this list.
TPersistent.Assign | Assign the contents of one class to another.


TStrings.BeginUpdate

Mark the beginning of an update batch.

Declaration

Source position: classesh.inc line 672

public procedure TStrings.BeginUpdate;

Description

BeginUpdate increases the update count by one. It is advisable to call BeginUpdate before lengthy operations on the stringlist. At the end of these operation, TStrings.EndUpdate should be called to mark the end of the operation. Descendant classes may use this information to perform optimizations. e.g. updating the screen only once after many strings were added to the list.

All TStrings methods that modify the string list call BeginUpdate before the actual operation, and call endUpdate when the operation is finished. Descendant classes should also call these methods when modifying the string list.

Remark:

Always put the corresponding call to TStrings.EndUpdate in the context of a Finally block, to ensure that the update count is always descreased at the end of the operation, even if an exception occurred:

With MyStrings do
    try
      BeginUpdate;
      // Some lengthy operation.
    Finally
      EndUpdate
    end;

See also

TStrings.EndUpdate

Mark the end of an update batch.


TStrings.Capacity

Capacity of the list, i.e. number of strings that the list can currently hold before it tries to expand.

Declaration

Source position: classesh.inc line 703

public property TStrings.Capacity : Integer
  read GetCapacity
  write SetCapacity;

Description

Capacity is the number of strings that the list can hold before it tries to allocate more memory.

TStrings returns TStrings.Count when read. Trying to set the capacity has no effect. Descendant classes such as TStringlist can override this property such that it actually sets the new capacity.

See also

TStringList | Standard implementation of the TStrings class.
TStrings.Count | Number of strings in the list.


TStrings.Clear

Removes all strings and associated objects from the list.

Declaration

Source position: classesh.inc line 673

public procedure TStrings.Clear; virtual; abstract;

Description

Clear will remove all strings and their associated objects from the list. After a call to clear, TStrings.Count is zero.

Since it is an abstract method, TStrings itself does not implement Clear. Descendant classes such as TStringList implement this method.

See also

TStrings.Objects | Indexed access to the objects associated with the strings in the list.
TStrings.Strings | Indexed access to the strings in the list.
TStrings.Delete | Delete a string from the list.
TStrings.Count | Number of strings in the list.


TStrings.CommaText

Contents of the list as a comma-separated string.

Declaration

Source position: classesh.inc line 704

public property TStrings.CommaText : string
  read GetCommaText
  write SetCommaText;

Description

CommaText represents the stringlist as a single string, consisting of a comma-separated concatenation of the strings in the list. If one of the strings contains spaces, comma's or quotes it will be enclosed by double quotes. Any double quotes in a string will be doubled. For instance the following strings:

Comma,string
Quote"string
Space string
NormalSttring

is converted to

"Comma,string","Quote""String","Space string",NormalString

Conversely, when setting the CommaText property, the text will be parsed according to the rules outlined above, and the strings will be set accordingly. Note that spaces will in this context be regarded as string separators, unless the string as a whole is contained in double quotes. Spaces that occur next to a delimiter will be ignored. The following string:

"Comma,string" , "Quote""String",Space string,, NormalString

Will be converted to

Comma,String
Quote"String
Space
String

NormalString

This is a special case of the TStrings.DelimitedText property where the quote character is always the double quote, and the delimiter is always the colon.

See also

TStrings.Text | Contents of the list as one big string.
TStrings.SetText | Set the contents of the list from a PChar.


TStrings.Count

Number of strings in the list.

Declaration

Source position: classesh.inc line 705

public property TStrings.Count : Integer
  read GetCount;

Description

Count is the current number of strings in the list. TStrings does not implement this property; descendant classes should override the property read handler to return the correct value.

Strings in the list are always uniquely identified by their Index; the index of a string is zero-based, i.e. it's supported range is 0 to Count-1. trying to access a string with an index larger than or equal to Count will result in an error. Code that iterates over the list in a stringlist should always take into account the zero-based character of the list index.

See also

TStrings.Strings | Indexed access to the strings in the list.
TStrings.Objects | Indexed access to the objects associated with the strings in the list.
TStrings.Capacity | Capacity of the list, i.e. number of strings that the list can currently hold before it tries to expand.


TStrings.Delete

Delete a string from the list.

Declaration

Source position: classesh.inc line 674

public procedure TStrings.Delete(

  Index: Integer

); virtual; abstract;

Description

Delete deletes the string at position Index from the list. The associated object is also removed from the list, but not destroyed. Index is zero-based, and should be in the range 0 to Count-1.

Since it is an abstract method, TStrings itself does not implement Delete. Descendant classes such as TStringList implement this method.

Errors

If Index is not in the allowed range, an EStringListError is raised.

See also

TStrings.Insert | Insert a string in the list.
TStrings.Objects | Indexed access to the objects associated with the strings in the list.
TStrings.Strings | Indexed access to the strings in the list.
TStrings.Clear | Removes all strings and associated objects from the list.


TStrings.DelimitedText

Get or set all strings in the list in a delimited form.

Declaration

Source position: classesh.inc line 697

public property TStrings.DelimitedText : string
  read GetDelimitedText
  write SetDelimitedText;

Description

DelimitedText returns all strings, properly quoted with QuoteChar and separated by the Delimiter character.

Strings are quoted if they contain a space or any character with ASCII value less than 32.

The CommaText property is a special case of delimited text where the delimiter character is a comma and the quote character is a double quote.

If StrictDelimiter is set to True, then no quoting is done (The QuoteChar property is disregarded completely): the returned text will contain the items in the stringlist, separated by the Delimiter character. When writing the DelimitedText property, the text will be split at all occurrences of the Delimiter character; however, when reading, the QuoteChar property will be taken into account.

See also

TStrings.Delimiter | Delimiter character used in DelimitedText.
TStrings.Text | Contents of the list as one big string.
TStrings.QuoteChar | Quote character used in DelimitedText.
TStrings.CommaText | Contents of the list as a comma-separated string.


TStrings.Delimiter

Delimiter character used in DelimitedText.

Declaration

Source position: classesh.inc line 696

public property TStrings.Delimiter : Char
  read GetDelimiter
  write SetDelimiter;

Description

Delimiter is the delimiter character used to separate the different strings in the stringlist when they are read or set through the DelimitedText property.

See also

TStrings.DelimitedText

Get or set all strings in the list in a delimited form.


TStrings.Destroy

Frees all strings and objects, and removes the list from memory.

Declaration

Source position: classesh.inc line 660

public destructor TStrings.Destroy; override;

Description

Destroy is the destructor of TStrings it does nothing except calling the inherited destructor.


TStrings.EndUpdate

Mark the end of an update batch.

Declaration

Source position: classesh.inc line 675

public procedure TStrings.EndUpdate;

Description

EndUpdate should be called at the end of a lengthy operation on the stringlist, but only if there was a call to BeginUpdate before the operation was started. It is best to put the call to EndUpdate in the context of a Finally block, so it will be called even if an exception occurs.

For more information, see TStrings.BeginUpdate.

TStrings implements the IFPObserved interface: when EndUpdate is called, a ooChanged notification is sent to all observers.

See also

TStrings.BeginUpdate | Mark the beginning of an update batch.
IFPObserved | Interface implemented by an object that can be observed.


TStrings.Equals

Compares the contents of two stringlists.

Declaration

Source position: classesh.inc line 676

public function TStrings.Equals(

  Obj: TObject

):Boolean; override; overload;

function TStrings.Equals(

  TheStrings: TStrings

):Boolean; overload;

Description

Equals compares the contents of the stringlist with the contents of TheStrings. If the contents match, i.e. the stringlist contain an equal amount of strings, and all strings match, then True is returned. If the number of strings in the lists is unequal, or they contain one or more different strings, False is returned.

Remark:
  1. The strings are compared case-insensitively.
  2. The associated objects are not compared

See also

TStrings.Objects | Indexed access to the objects associated with the strings in the list.
TStrings.Strings | Indexed access to the strings in the list.
TStrings.Count | Number of strings in the list.
TStrings.Assign | Assign the contents of another stringlist to this one.


TStrings.Exchange

Exchanges two strings in the list.

Declaration

Source position: classesh.inc line 678

public procedure TStrings.Exchange(

  Index1: Integer;

  Index2: Integer

); virtual;

Description

Exchange exchanges the strings at positions Index1 and Index2. The associated objects are also exchanged.

Both indexes must be in the range of valid indexes, i.e. must have a value between 0 and Count-1.

Errors

If either Index1 or Index2 is not in the range of valid indexes, an EStringListError exception is raised.

See also

TStrings.Move | Move a string from one place in the list to another.
TStrings.Strings | Indexed access to the strings in the list.
TStrings.Count | Number of strings in the list.


TStrings.ExtractName

Extract the name part of a string

Declaration

Source position: classesh.inc line 694

public function TStrings.ExtractName(

  const S: string

):string;

Description

ExtractName returns the name part (the part before the NameValueSeparator character) of the string. If the character is not present, an empty string is returned. The resulting string is not trimmed, it can end or start with spaces.

See also

NameValueSeparator

Value of the character used to separate name,value pairs


TStrings.GetEnumerator

Create an IEnumerator instance

Declaration

Source position: classesh.inc line 679

public function TStrings.GetEnumerator: TStringsEnumerator;

Description

GetEnumerator is the implementation of the IEnumerable interface for TStrings. It creates a TStringsEnumerator instance and returns it's IEnumerator interface.

See also

TStringsEnumerator | Implements IEnumerator for the TStrings class.
IEnumerator | Enumerator support interface
IEnumerable | Interface to retrieve an enumerator from a class.


TStrings.GetNameValue

Return both name and value of a name,value pair based on it's index.

Declaration

Source position: classesh.inc line 693

public procedure TStrings.GetNameValue(

  Index: Integer;

  out AName: string;

  out AValue: string

);


TStrings.GetText

Returns the contents as a PChar

Declaration

Source position: classesh.inc line 680

public function TStrings.GetText: PChar; virtual;

Description

GetText allocates a memory buffer and compies the contents of the stringlist to this buffer as a series of strings, separated by an end-of-line marker. The buffer is zero terminated.

Remark: The caller is responsible for freeing the returned memory buffer.


TStrings.IndexOf

Find a string in the list and return its position.

Declaration

Source position: classesh.inc line 681

public function TStrings.IndexOf(

  const S: string

):Integer; virtual;

Description

IndexOf searches the list for S. The search is case-insensitive. If a matching entry is found, its position is returned. if no matching string is found, -1 is returned.

Remark:
  1. Only the first occurrence of the string is returned.
  2. The returned position is zero-based, i.e. 0 indicates the first string in the list.

See also

TStrings.IndexOfObject | Finds an object in the list and returns its index.
TStrings.IndexOfName | Finds the index of a name in the name-value pairs.
TStrings.Strings | Indexed access to the strings in the list.


TStrings.IndexOfName

Finds the index of a name in the name-value pairs.

Declaration

Source position: classesh.inc line 682

public function TStrings.IndexOfName(

  const Name: string

):Integer; virtual;

Description

IndexOfName searches in the list of strings for a name-value pair with name part Name. If such a pair is found, it returns the index of the pair in the stringlist. If no such pair is found, the function returns -1. The search is done case-insensitive.

Remark:
  1. Only the first occurrence of a matching name-value pair is returned.
  2. The returned position is zero-based, i.e. 0 indicates the first string in the list.

See also

TStrings.IndexOf | Find a string in the list and return its position.
TStrings.IndexOfObject | Finds an object in the list and returns its index.
TStrings.Strings | Indexed access to the strings in the list.


TStrings.IndexOfObject

Finds an object in the list and returns its index.

Declaration

Source position: classesh.inc line 683

public function TStrings.IndexOfObject(

  AObject: TObject

):Integer; virtual;

Description

IndexOfObject searchs through the list of strings till it find a string associated with AObject, and returns the index of this string. If no such string is found, -1 is returned.

Remark:
  1. Only the first occurrence of a string with associated object AObject is returned; if more strings in the list can be associated with AObject, they will not be found by this routine.
  2. The returned position is zero-based, i.e. 0 indicates the first string in the list.


TStrings.Insert

Insert a string in the list.

Declaration

Source position: classesh.inc line 684

public procedure TStrings.Insert(

  Index: Integer;

  const S: string

); virtual; abstract;

Description

Insert inserts the string S at position Index in the list. Index is a zero-based position, and can have values from 0 to Count. If Index equals Count then the string is appended to the list.

Remark:
  1. All methods that add strings to the list use Insert to add a string to the list.
  2. If the string has an associated object, use TStrings.InsertObject instead.

Errors

If Index is less than zero or larger than Count then an EStringListError exception is raised.

See also

TStrings.Add | Add a string to the list
TStrings.InsertObject | Insert a string and associated object in the list.
TStrings.Append | Add a string to the list.
TStrings.Delete | Delete a string from the list.


TStrings.InsertObject

Insert a string and associated object in the list.

Declaration

Source position: classesh.inc line 685

public procedure TStrings.InsertObject(

  Index: Integer;

  const S: string;

  AObject: TObject

);

Description

InsertObject inserts the string S and its associated objectAObject at position Index in the list. Index is a zero-based position, and can have values from 0 to Count. If Index equals Count then the string is appended to the list.

Errors

If Index is less than zero or larger than Count then an EStringListError exception is raised.

See also

TStrings.Insert | Insert a string in the list.
TStrings.AddObject | Add a string and associated object to the list.
TStrings.Append | Add a string to the list.
TStrings.Delete | Delete a string from the list.


TStrings.LineBreak

LineBreak character to use

Declaration

Source position: classesh.inc line 698

public property TStrings.LineBreak : string
  read GetLineBreak
  write SetLineBreak;

Description

LineBreak is the character used to separate lines when reading or writing TStrings.Text, and it is also used when reading from file.

See also

TStrings.Text

Contents of the list as one big string.


TStrings.LoadFromFile

Load the contents of a file as a series of strings.

Declaration

Source position: classesh.inc line 687

public procedure TStrings.LoadFromFile(

  const FileName: string

); virtual;

Description

LoadFromFile loads the contents of a file into the stringlist. Each line in the file (as marked by the end-of-line marker of the particular OS the application runs on) becomes one string in the stringlist. This action replaces the contents of the stringlist, it does not append the strings to the current content.

LoadFromFile simply creates a file stream with the given filename, and then executes TStrings.LoadfromStream; after that the file stream object is destroyed again.

See also

TStrings.LoadFromStream | Load the contents of a stream as a series of strings.
TStrings.SaveToFile | Save the contents of the list to a file.
Tstrings.SaveToStream | Save the contents of the string to a stream.


TStrings.LoadFromStream

Load the contents of a stream as a series of strings.

Declaration

Source position: classesh.inc line 688

public procedure TStrings.LoadFromStream(

  Stream: TStream

); virtual;

Description

LoadFromStream loads the contents of Stream into the stringlist. Each line in the stream (as marked by the end-of-line marker of the particular OS the application runs on) becomes one string in the stringlist. This action replaces the contents of the stringlist, it does not append the strings to the current content.

See also

TStrings.LoadFromFile | Load the contents of a file as a series of strings.
TStrings.SaveToFile | Save the contents of the list to a file.
Tstrings.SaveToStream | Save the contents of the string to a stream.


TStrings.Move

Move a string from one place in the list to another.

Declaration

Source position: classesh.inc line 689

public procedure TStrings.Move(

  CurIndex: Integer;

  NewIndex: Integer

); virtual;

Description

Move moves the string at position CurIndex so it has position NewIndex after the move operation. The object associated to the string is also moved. CurIndex and NewIndex should be in the range of 0 to Count-1.

Remark:

NewIndex is not the position in the stringlist before the move operation starts. The move operation

  1. removes the string from position CurIndex
  2. inserts the string at position NewIndex

This may not lead to the desired result if NewIndex is bigger than CurIndex. Consider the following example:

With MyStrings do
    begin
    Clear;
    Add('String 0');
    Add('String 1');
    Add('String 2');
    Add('String 3');
    Add('String 4');
    Move(1,3);
    end;

After the Move operation has completed, 'String 1' will be between 'String 3' and 'String 4'.

Errors

If either CurIndex or NewIndex is outside the allowed range, an EStringListError is raised.

See also

TStrings.Exchange

Exchanges two strings in the list.


TStrings.Names

Name parts of the name-value pairs in the list.

Declaration

Source position: classesh.inc line 706

public property TStrings.Names[Index: Integer] : string
  read GetName;

Description

Names provides indexed access to the names of the name-value pairs in the list. It returns the name part of the Index-th string in the list.

Remark: The index is not an index based on the number of name-value pairs in the list. It is the name part of the name-value pair a string Index in the list. If the string at position Index is not a name-value pair (i.e. does not contain the equal sign (=)), then an empty name is returned.

See also

TStrings.Values | Value parts of the name-value pairs in the list.
TStrings.IndexOfName | Finds the index of a name in the name-value pairs.


TStrings.NameValueSeparator

Value of the character used to separate name,value pairs

Declaration

Source position: classesh.inc line 701

public property TStrings.NameValueSeparator : Char
  read GetNameValueSeparator
  write SetNameValueSeparator;

Description

NameValueSeparator is the character used to separate name,value pair. By default, this is the equal sign (=), resulting in Name=Value pairs.

It can be set to a colon for Name : Value pairs.


TStrings.Objects

Indexed access to the objects associated with the strings in the list.

Declaration

Source position: classesh.inc line 707

public property TStrings.Objects[Index: Integer] : TObject
  read GetObject
  write PutObject;

Description

Objects provides indexed access to the objects associated to the strings in the list. Index is a zero-based index and must be in the range of 0 to Count-1.

Setting the objects property will not free the previously associated object, if there was one. The caller is repsonsible for freeing the object that was previously associated to the string.

TStrings does not implement any storage for objects. Reading the Objects property will always return Nil, Setting the property will have no effect. It is the responsability of the descendant classes to provide storage for the associated objects.

Errors

If an Index outside the valid range is specified, an EStringListError exception will be raised.

See also

TStrings.Strings | Indexed access to the strings in the list.
TStrings.IndexOfObject | Finds an object in the list and returns its index.
TStrings.Names | Name parts of the name-value pairs in the list.
TStrings.Values | Value parts of the name-value pairs in the list.


TStrings.QuoteChar

Quote character used in DelimitedText.

Declaration

Source position: classesh.inc line 700

public property TStrings.QuoteChar : Char
  read GetQuoteChar
  write SetQuoteChar;

Description

QuoteChar is the character used by the DelimitedText property to quote strings that have a space or non-printing character in it.


TStrings.SaveToFile

Save the contents of the list to a file.

Declaration

Source position: classesh.inc line 690

public procedure TStrings.SaveToFile(

  const FileName: string

); virtual;

Description

SaveToFile saves the contents of the stringlist to the file with name FileName. It writes the strings to the file, separated by end-of-line markers, so each line in the file will contain 1 string from the stringlist.

SaveToFile creates a file stream with name FileName, calls TStrings.SaveToStream and then destroys the file stream object.

Errors

An EStreamError exception can be raised if the file FileName cannot be opened, or if it cannot be written to.

See also

TStrings.SaveToStream | Save the contents of the string to a stream.
Tstrings.LoadFromStream | Load the contents of a stream as a series of strings.
TStrings.LoadFromFile | Load the contents of a file as a series of strings.


TStrings.SaveToStream

Save the contents of the string to a stream.

Declaration

Source position: classesh.inc line 691

public procedure TStrings.SaveToStream(

  Stream: TStream

); virtual;

Description

SaveToStream saves the contents of the stringlist to Stream. It writes the strings to the stream, separated by end-of-line markers, so each 'line' in the stream will contain 1 string from the stringlist.

Errors

An EStreamError exception can be raised if the stream cannot be written to.

See also

TStrings.SaveToFile | Save the contents of the list to a file.
Tstrings.LoadFromStream | Load the contents of a stream as a series of strings.
TStrings.LoadFromFile | Load the contents of a file as a series of strings.


TStrings.SetText

Set the contents of the list from a PChar.

Declaration

Source position: classesh.inc line 692

public procedure TStrings.SetText(

  TheText: PChar

); virtual;

Description

SetText parses the contents of TheText and fills the stringlist based on the contents. It regards TheText as a series of strings, separated by end-of-line markers. Each of these strings is added to the stringlist.

See also

TStrings.Text

Contents of the list as one big string.


TStrings.SkipLastLineBreak

Do not add a linebreak to the last item

Declaration

Source position: classesh.inc line 712

public property TStrings.SkipLastLineBreak : Boolean
  read GetSkipLastLineBreak
  write SetSkipLastLineBreak;

Description

SkipLastLineBreak can be set to True to omit a linebreak character after the last string in the TStrings.Text. This also means when writing to file, that the file will not have a terminating linebreak character.

See also

TStrings.LineBreak | LineBreak character to use
TStrings.Text | Contents of the list as one big string.


TStrings.StrictDelimiter

Should only the delimiter character be considered a delimiter

Declaration

Source position: classesh.inc line 699

public property TStrings.StrictDelimiter : Boolean
  read FStrictDelimiter
  write FStrictDelimiter;

Description

StrictDelimiter can be used to indicate that only the delimiter character should be considered a delimiter when setting DelimitedText: under normal circumstances, quotes and spaces are considered specially (see the TStrings.CommaText property for more information).

When StrictDelimiter is set to True then only the Delimiter character is considered when splitting the text in items: no quoting whatsoever is performed when writing the DelimitedText property. However, when reading the DelimitedText property, quoted strings are taken into account (so a quoted string can contain a delimiter that is treated as text instead of a delimiter).

See also

DelimitedText | Get or set all strings in the list in a delimited form.
CommaText | Contents of the list as a comma-separated string.
Delimiter | Delimiter character used in DelimitedText.


TStrings.Strings

Indexed access to the strings in the list.

Declaration

Source position: classesh.inc line 709

public property TStrings.Strings[Index: Integer] : string
  read Get
  write Put;
  default;

Description

Strings is the default property of TStrings. It provides indexed read-write access to the list of strings. Reading it will return the string at position Index in the list. Writing it will set the string at position Index.

Index is the position of the string in the list. It is zero-based, i.e. valued values range from 0 (the first string in the list) till Count-1 (the last string in the list). When browsing through the strings in the list, this fact must be taken into account.

To access the objects associated with the strings in the list, use the TStrings.Objects property. The name parts of name-value pairs can be accessed with the TStrings.Names property, and the values can be set or read through the TStrings.Values property.

Searching through the list can be done using the TStrings.IndexOf method.

Errors

If Index is outside the allowed range, an EStringListError exception is raised.

See also

TStrings.Count | Number of strings in the list.
TStrings.Objects | Indexed access to the objects associated with the strings in the list.
TStrings.Names | Name parts of the name-value pairs in the list.
TStrings.Values | Value parts of the name-value pairs in the list.
TStrings.IndexOf | Find a string in the list and return its position.


TStrings.StringsAdapter

Not implemented in Free Pascal.

Declaration

Source position: classesh.inc line 711

public property TStrings.StringsAdapter : IStringsAdapter
  read FAdapter
  write SetStringsAdapter;


TStrings.Text

Contents of the list as one big string.

Declaration

Source position: classesh.inc line 710

public property TStrings.Text : string
  read GetTextStr
  write SetTextStr;

Description

Text returns, when read, the contents of the stringlist as one big string consisting of all strings in the list, separated by an end-of-line marker. When this property is set, the string will be cut into smaller strings, based on the positions of end-of-line markers in the string. Any previous content of the stringlist will be lost.

Remark: If any of the strings in the list contains an end-of-line marker, then the resulting string will appear to contain more strings than actually present in the list. To avoid this ambiguity, use the TStrings.CommaText property instead.

See also

TStrings.Strings | Indexed access to the strings in the list.
TStrings.Count | Number of strings in the list.
TStrings.CommaText | Contents of the list as a comma-separated string.


TStrings.TextLineBreakStyle

Determines which line breaks to use in the Text property

Declaration

Source position: classesh.inc line 695

public property TStrings.TextLineBreakStyle : TTextLineBreakStyle
  read GetLBS
  write SetLBS;

Description

TextLineBreakStyle determines which linebreak style is used when constructing the Text property: the same rules are used as in the writing to text files:

tlbsLF
Lines are separated with a linefeed character #10.
tlbsCRLF
Lines are separated with a carriage-return/linefeed character pair: #13#10.
tlbsCR
Lines are separated with a carriage-return character #13.

It has no effect when setting the text property.

See also

Text

Contents of the list as one big string.


TStrings.ValueFromIndex

Return the value part of a string based on it's index.

Declaration

Source position: classesh.inc line 702

public property TStrings.ValueFromIndex[Index: Integer] : string
  read GetValueFromIndex
  write SetValueFromIndex;

Description

ValueFromIndex returns the value part of a string based on the string index. The value part are all characters in the string after the NameValueSeparator character, or all characters if the NameValueSeparator character is not present.


TStrings.Values

Value parts of the name-value pairs in the list.

Declaration

Source position: classesh.inc line 708

public property TStrings.Values[Name: string] : string
  read GetValue
  write SetValue;

Description

Values represents the value parts of the name-value pairs in the list.

When reading this property, if there is a name-value pair in the list of strings that has name part Name, then the corresponding value is returned. If there is no such pair, an empty string is returned.

When writing this value, first it is checked whether there exists a name-value pair in the list with name Name. If such a pair is found, it's value part is overwritten with the specified value. If no such pair is found, a new name-value pair is added with the specified Name and value.

Remark:
  1. Names are compared case-insensitively.
  2. Any character, including whitespace, up till the first equal (=) sign in a string is considered part of the name.

See also

TStrings.Names | Name parts of the name-value pairs in the list.
TStrings.Strings | Indexed access to the strings in the list.
TStrings.Objects | Indexed access to the objects associated with the strings in the list.


TStringsEnumerator

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Implements IEnumerator for the TStrings class.

Declaration

Source position: classesh.inc line 590

type TStringsEnumerator = class
public
constructor Create(); | Initialize a new instance of TStringsEnumerator
function GetCurrent; | Return the current pointer in the list
function MoveNext; | Move the position of the enumerator to the next position in the list.
property Current: string; [r] | Current pointer in the list
end;

Inheritance

TStringsEnumerator

Implements IEnumerator for the TStrings class.
|

TObject

Description

TStringsEnumerator implements the #rtl.system.IEnumerator interface for the TStrings class, so the TStrings class can be used in a for ... in loop. It is returned by the TStrings.GetEnumerator method of TStrings.

See also

TStrings | Class to manage arrays or collections of strings
TStrings.GetEnumerator | Create an IEnumerator instance
#rtl.system.IEnumerator | Enumerator support interface


TStringsEnumerator

ro

Current


TStringsEnumerator
 | Create
 | GetCurrent
 | MoveNext


Create (TStringsEnumerator)

GetCurrent (TStringsEnumerator)

MoveNext (TStringsEnumerator)


TStringsEnumerator


TStringsEnumerator.Create

Initialize a new instance of TStringsEnumerator

Declaration

Source position: classesh.inc line 595

public constructor TStringsEnumerator.Create(

  AStrings: TStrings

);

Description

Create initializes a new instance of TStringsEnumerator and keeps a reference to the stringlist AStrings that will be enumerated.

See also

TStrings

Class to manage arrays or collections of strings


TStringsEnumerator.Current

Current pointer in the list

Declaration

Source position: classesh.inc line 598

public property TStringsEnumerator.Current : string
  read GetCurrent;

Description

Current redefines GetCurrent as a property.

See also

GetCurrent

Return the current pointer in the list


TStringsEnumerator.GetCurrent

Return the current pointer in the list

Declaration

Source position: classesh.inc line 596

public function TStringsEnumerator.GetCurrent: string;

Description

GetCurrent returns the current string item in the enumerator.

Errors

No checking is done on the validity of the current position.

See also

MoveNext | Move the position of the enumerator to the next position in the list.
TStringItem | The TStringItem is used to store the string and object items in a TStringList string list instance. It should never be used directly.


TStringsEnumerator.MoveNext

Move the position of the enumerator to the next position in the list.

Declaration

Source position: classesh.inc line 597

public function TStringsEnumerator.MoveNext: Boolean;

Description

MoveNext puts the pointer on the next item in the stringlist, and returns True if this succeeded, or False if the pointer is past the last element in the list.

Errors

Note that if False is returned, calling GetCurrent will result in an exception.

See also

GetCurrent

Return the current pointer in the list


TStringStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Stream that stores its data in a string.

Declaration

Source position: classesh.inc line 1007

type TStringStream = class(TStream)
public
constructor Create(); | Creates a new stringstream and sets its initial content.
function Read(); override; | Reads from the stream.
function ReadString(); | Reads a string of length Count
function Seek(); override; | Sets the position in the stream.
function Write(); override; | Write overrides the TStream.Write method.
procedure WriteString(); | WriteString writes a string to the stream.
property DataString: string; [r] | Contains the contents of the stream in string form
end;

Inheritance

TStringStream | Stream that stores its data in a string.
|
TStream | Base class for streams.
|
TObject | Base class of all classes.

Description

TStringStream stores its data in an ansistring. The contents of this string is available as the DataString property. It also introduces some methods to read or write parts of the stringstream's data as a string.

The main purpose of a TStringSTream is to be able to treat a string as a stream from which can be read.

See also

TStream | Base class for streams.
TStringStream.DataString | Contains the contents of the stream in string form
TStringStream.ReadString | Reads a string of length Count
TStringStream.WriteString | WriteString writes a string to the stream.


TStringStream
 | ro | DataString
TStream
 |  | Position
 |  | Size
TObject


TStringStream
 | Create
 | Read
 | ReadString
 | Seek
 | Write
 | WriteString
TStream
 | Read
 | Write
 | Seek
 | ReadBuffer
 | WriteBuffer
 | CopyFrom
 | ReadComponent
 | ReadComponentRes
 | WriteComponent
 | WriteComponentRes
 | WriteDescendent
 | WriteDescendentRes
 | WriteResourceHeader
 | FixupResourceHeader
 | ReadResHeader
 | ReadByte
 | ReadWord
 | ReadDWord
 | ReadQWord
 | ReadAnsiString
 | WriteByte
 | WriteWord
 | WriteDWord
 | WriteQWord
 | WriteAnsiString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

CopyFrom (TStream)

Create (TObject)

Create (TStringStream)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

FieldAddress (TObject)

FixupResourceHeader (TStream)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

Read (TStream)

Read (TStringStream)

ReadAnsiString (TStream)

ReadBuffer (TStream)

ReadByte (TStream)

ReadComponent (TStream)

ReadComponentRes (TStream)

ReadDWord (TStream)

ReadQWord (TStream)

ReadResHeader (TStream)

ReadString (TStringStream)

ReadWord (TStream)

SafeCallException (TObject)

Seek (TStream)

Seek (TStringStream)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)

Write (TStream)

Write (TStringStream)

WriteAnsiString (TStream)

WriteBuffer (TStream)

WriteByte (TStream)

WriteComponent (TStream)

WriteComponentRes (TStream)

WriteDescendent (TStream)

WriteDescendentRes (TStream)

WriteDWord (TStream)

WriteQWord (TStream)

WriteResourceHeader (TStream)

WriteString (TStringStream)

WriteWord (TStream)


TStringStream

TStream

TObject


TStringStream.Create

Creates a new stringstream and sets its initial content.

Declaration

Source position: classesh.inc line 1016

public constructor TStringStream.Create(

  const AString: string

);

Description

Create creates a new TStringStream instance and sets its initial content to Astring. The position is still 0 but the size of the stream will equal the length of the string.

See also

TStringStream.DataString

Contains the contents of the stream in string form


TStringStream.DataString

Contains the contents of the stream in string form

Declaration

Source position: classesh.inc line 1022

public property TStringStream.DataString : string
  read FDataString;


TStringStream.Read

Reads from the stream.

Declaration

Source position: classesh.inc line 1017

public function TStringStream.Read(

  var Buffer;

  Count: LongInt

):LongInt; override;

Description

Read overrides the Read from TStream. It tries to read Count bytes into Buffer. It returns the number of bytes actually read. The position of the stream is advanced with the number of bytes actually read; When the reading has reached the end of the DataString, then the reading stops, i.e. it is not possible to read beyond the end of the datastring.

See also

TStream.Read | Reads data from the stream to a buffer and returns the number of bytes read.
TStringStream.Write | Write overrides the TStream.Write method.
TStringStream.DataString | Contains the contents of the stream in string form


TStringStream.ReadString

Reads a string of length Count

Declaration

Source position: classesh.inc line 1018

public function TStringStream.ReadString(

  Count: LongInt

):string;

Description

ReadString reads Count bytes from the stream and returns the read bytes as a string. If less than Count bytes were available, the string has as many characters as bytes could be read.

The ReadString method is a wrapper around the Read method. It does not do the same stringas the TStream.ReadAnsiString method, which first reads a length integer to determine the length of the string to be read.

See also

TStringStream.Read | Reads from the stream.
TStream.ReadAnsiString | Read an ansistring from the stream and return its value.


TStringStream.Seek

Sets the position in the stream.

Declaration

Source position: classesh.inc line 1019

public function TStringStream.Seek(

  Offset: LongInt;

  Origin: Word

):LongInt; override;

Description

Seek implements the abstract Seek method.


TStringStream.Write

Write overrides the TStream.Write method.

Declaration

Source position: classesh.inc line 1020

public function TStringStream.Write(

  const Buffer;

  Count: LongInt

):LongInt; override;


TStringStream.WriteString

WriteString writes a string to the stream.

Declaration

Source position: classesh.inc line 1021

public procedure TStringStream.WriteString(

  const AString: string

);


TTextObjectWriter

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Driver class which stores component data in text format.

Declaration

Source position: classesh.inc line 1422

type TTextObjectWriter = class(TAbstractObjectWriter) end;

Inheritance

TTextObjectWriter | Driver class which stores component data in text format.
|
TAbstractObjectWriter | Abstract driver class for writing component data.
|
TObject

Description

Not yet implemented.


TTextObjectWriter

TAbstractObjectWriter


TTextObjectWriter
TAbstractObjectWriter
 | BeginCollection
 | BeginComponent
 | WriteSignature
 | BeginList
 | EndList
 | BeginProperty
 | EndProperty
 | Write
 | WriteBinary
 | WriteBoolean
 | WriteFloat
 | WriteSingle
 | WriteDate
 | WriteCurrency
 | WriteIdent
 | WriteInteger
 | WriteUInt64
 | WriteVariant
 | WriteMethodName
 | WriteSet
 | WriteString
 | WriteWideString
 | WriteUnicodeString


TThread

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Abstract Thread class.

Declaration

Source position: classesh.inc line 1589

type TThread = class
public
Type
TSystemTimes = record | Record for returning processor usage
IdleTime: QWord; | Processor idle time
UserTime: QWord; | User code execution time
KernelTime: QWord; | Kernel (OS) code execution time
NiceTime: QWord; | Nice (reduced priority) code execution time
end;
protected
procedure Execute; virtual; abstract; | Execute method. Must be overridden in a descendant thread.
procedure Synchronize(); | Synchronizes the thread by executing the method in the main thread.
procedure Queue(); | Queue a method for execution in the main thread
public
constructor Create(); | Creates a new thread.
destructor Destroy; override; | Destroys the thread object.
class function CreateAnonymousThread(); | Execute code in an anonymous thread
class procedure NameThreadForDebugging(); | Set a thread name
class procedure SetReturnValue(); | Set return value of a thread
class function CheckTerminated; | Check if the current thread has finished executing.
class procedure RemoveQueuedEvents(); | Remove methods scheduled for execution from queue
class procedure SpinWait(); | Prevent thread execution in a spin-wait loop
class procedure Sleep(); | Prevent thread execution
class procedure Yield; | Yield execution to other threads
class procedure GetSystemTimes(); | Return CPU stats
class function GetTickCount; deprecated ; | Return tick count (32-bit)
class function GetTickCount64; | Return tick count (64-bit)
class function ExecuteInThread(); | Execute a method or static procedure in a thread
procedure AfterConstruction; override; | Code to be executed after construction but before execute.
procedure Start; | Starts a thread that was created in a suspended state.
procedure Resume; deprecated ; | Resumes the thread's execution. Deprecated, see TThread.Start
procedure Suspend; deprecated ; | Suspends the thread's execution.
procedure Terminate; | Signals the thread it should terminate.
function WaitFor; | Waits for the thread to terminate and returns the exit status.
property CurrentThread: TThread; [r] | Return current thread instance
property ProcessorCount: LongWord; [r] | Return the processor count for this system
property IsSingleProcessor: Boolean; [r] | Is the current system single processor or not
property FreeOnTerminate: Boolean; [rw] | Indicates whether the thread should free itself when it stops executing.
property Handle: TThreadID; [r] | Returns the thread handle.
property ExternalThread: Boolean; [r] | Is the thread instance an external thread ?
property Priority: TThreadPriority; [rw] | Returns the thread priority.
property Suspended: Boolean; [rw] | Indicates whether the thread is suspended.
property Finished: Boolean; [r] | Has the thread finished executing
property ThreadID: TThreadID; [r] | Returns the thread ID.
property OnTerminate: TNotifyEvent; [rw] | Event called when the thread terminates.
property FatalException: TObject; [r] | Exception that occurred during thread execution
end;

Inheritance

TThread

Abstract Thread class.
|

TObject

Description

The TThread class encapsulates the native thread support of the operating system. To create a thread, declare a descendant of the TThread object and override the Execute method. In this method, the tthread's code should be executed. To run a thread, create an instance of the tthread descendant, and call it's execute method.

It is also possible to simply execute a method or static procedure in a thread using the TThread.ExecuteInThread class method.

See also

EThread | Thread error exception.
TThread.Execute | Execute method. Must be overridden in a descendant thread.
TThread.ExecuteInThread | Execute a method or static procedure in a thread


TThread
 | ro | CurrentThread
 | ro | ProcessorCount
 | ro | IsSingleProcessor
 |  | FreeOnTerminate
 | ro | Handle
 | ro | ExternalThread
 |  | Priority
 |  | Suspended
 | ro | Finished
 | ro | ThreadID
 | ro | FatalException


ro | CurrentThread (TThread)
ro | ExternalThread (TThread)
ro | FatalException (TThread)
ro | Finished (TThread)
 | FreeOnTerminate (TThread)
ro | Handle (TThread)
ro | IsSingleProcessor (TThread)
 | Priority (TThread)
ro | ProcessorCount (TThread)
 | Suspended (TThread)
ro |


TThread
pt | Execute
pt | Synchronize
pt | Queue
 | Create
 | Destroy
 | CreateAnonymousThread
 | NameThreadForDebugging
 | SetReturnValue
 | CheckTerminated
 | RemoveQueuedEvents
 | SpinWait
 | Sleep
 | Yield
 | GetSystemTimes
 | GetTickCount
 | GetTickCount64
 | ExecuteInThread
 | AfterConstruction
 | Start
 | Resume
 | Suspend
 | Terminate
 | WaitFor


 | AfterConstruction (TThread)
 | CheckTerminated (TThread)
 | Create (TThread)
 | CreateAnonymousThread (TThread)
 | Destroy (TThread)
pt | Execute (TThread)
 | ExecuteInThread (TThread)
 | GetSystemTimes (TThread)
 | GetTickCount (TThread)
 | GetTickCount64 (TThread)
 | NameThreadForDebugging (TThread)
pt | Queue (TThread)
 | RemoveQueuedEvents (TThread)
 | Resume (TThread)
 | SetReturnValue (TThread)
 | Sleep (TThread)
 | SpinWait (TThread)
 | Start (TThread)
 | Suspend (TThread)
pt | Synchronize (TThread)
 | Terminate (TThread)
 | WaitFor (TThread)
 | Yield (TThread)


TThread

OnTerminate


OnTerminate (TThread)


TThread.AfterConstruction

Code to be executed after construction but before execute.

Declaration

Source position: classesh.inc line 1701

public procedure TThread.AfterConstruction; override;

Description

AfterConstruction is overridden in TThread, it starts the thread if it was created in a suspended state. When overriding this method, the inherited method must be called.


TThread.CheckTerminated

Check if the current thread has finished executing.

Declaration

Source position: classesh.inc line 1681

public class function TThread.CheckTerminated: Boolean;

Description

TThread.CheckTerminated can be used to check if the current thread has finished executing (i.e. Execute has finished. This can be called from methods in other classes where the current thread instance is not available.

Errors

If the thread was not created by the FPC program, an EThreadExternalException exception is raised.

See also

EThreadExternalException | Exception raised when an invalid operation is attempted on an external thread
TThread.SetReturnValue | Set return value of a thread


TThread.Create

Creates a new thread.

Declaration

Source position: classesh.inc line 1667

public constructor TThread.Create(

  CreateSuspended: Boolean;

  const StackSize: SizeUInt = DefaultStackSize

);


TThread.CreateAnonymousThread

Execute code in an anonymous thread

Declaration

Source position: classesh.inc line 1671

public class function TThread.CreateAnonymousThread(

  aProc: TProcedure

):TThread;

Description

CreateAnonymousThread will create an instance of a TThread descendant and calls aProc in this procedure. This can be used to quickly execute a method in another thread without having to expliticly declare a thread for such purposes. It returns the created TThread instance, which can be checked for termination etc.

Note that this method differs slightly from Delphi in that FPC does not yet support anonymous methods, so the signature of aProc differs slightly.

See also

TThread.CheckTerminated

Check if the current thread has finished executing.


TThread.CurrentThread

Return current thread instance

Declaration

Source position: classesh.inc line 1707

public property TThread.CurrentThread : TThread
  read GetCurrentThread;

Description

TThread.CurrentThread can be used to get the current thread instance. This is useful in code that is not inside a TThread implementation, but which needs access to the current thread.

For threads that were created outside of FPC code (DLLs or a calling program) this will return a dummy TThread instance.

See also

TThread.ExternalThread

Is the thread instance an external thread ?


TThread.Destroy

Destroys the thread object.

Declaration

Source position: classesh.inc line 1669

public destructor TThread.Destroy; override;


TThread.Execute

Execute method. Must be overridden in a descendant thread.

Declaration

Source position: classesh.inc line 1637

protected procedure TThread.Execute; virtual; abstract;

Description

Execute is a method that must be overridden in descendant classes of the thread. It must contain the code that must execute in the thread. The Execute method is responsible for checking Terminated at regular intervals: when it is set to True the execute method must exit.

See also

Terminated


TThread.ExecuteInThread

Execute a method or static procedure in a thread

Declaration

Source position: classesh.inc line 1696

public class function TThread.ExecuteInThread(

  AMethod: TThreadExecuteHandler;

  AOnTerminate: TNotifyEvent = Nil

):TThread; overload;

class function TThread.ExecuteInThread(

  AMethod: TThreadExecuteStatusHandler;

  AOnStatus: TThreadStatusNotifyEvent;

  AOnTerminate: TNotifyEvent = Nil

):TThread; overload;

class function TThread.ExecuteInThread(

  AMethod: TThreadExecuteCallBack;

  AData: Pointer = Nil;

  AOnTerminate: TNotifyCallBack = Nil

):TThread; overload;

class function TThread.ExecuteInThread(

  AMethod: TThreadExecuteStatusCallBack;

  AOnStatus: TThreadStatusNotifyCallBack;

  AData: Pointer = Nil;

  AOnTerminate: TNotifyCallBack = Nil

):TThread; overload;

Description

TThread.ExecuteInThread is a class method which allows to quickly execute a method or procedure in a thread. The method or procedure to be executed is passed in Method, this can be a method or a plain (static) procedure.

The caller can be notified of thread termination: In the optional argument AOnTerminate a callback (procedure or method, depending on the signature) can be specified that will be called when the thread terminated. This callback is executed in the main thread.

The signature of AMethod determines whether status reporting is enabled or not. If the method of type TThreadExecuteStatusHandler or TThreadExecuteStatusCallback, then an extra AOnStatus callback must be specified. This callback will be called in the main thread whenever the thread wishes to be report its status. The status callback should not do extensive work, because while the status callback is called, thread execution is suspended.

When using a plain procedure, extra data can be passed on to the procedure in AData. The AData pointer will be passed to the thread method, and also to the thread status callback and thread termination callback.

See also

TThreadExecuteHandler | Signature of method to execute in a thread, without status reporting
TThreadExecuteStatusHandler | Signature of method to execute in a thread, with status reporting
TThreadExecuteStatusCallback | Signature of procedure to execute in a thread, with status reporting
TThreadExecuteCallback | Signature of procedure to execute in a thread, without status reporting

Example

program tthrc;

uses cthreads, sysutils, classes;

Var
  D : Integer;

Procedure DoneThread(Sender : TObject; AData : Pointer);

begin
  Writeln('Thread ',TThread(Sender).ThreadID,' done. D is currently: ', PInteger(AData)^);
end;

Procedure DoThread(AData : Pointer);

Var
  I : integer;

begin
  for I:=1 to 10 do
    begin
    Sleep(10*Random(30));
    Writeln('Thread ',TThread.CurrentThread.ThreadID,' ping ',I);
    Inc(PInteger(AData)^,i);
    end;
end;

Var
  T1,T2 : TThread;

begin
  T1:=TThread.ExecuteInThread(@DoThread,@D,@DoneThread);
  T2:=TThread.ExecuteInThread(@DoThread,@D,@DoneThread);
  Writeln('Main thread done');
  T1.WaitFor;
  T2.WaitFor;
end.

Example

program tthre;

{$mode objfpc}
{$H+}

uses cthreads, sysutils, classes;

Type
  TTestThread = Class(TObject)
    D : Integer;
    Procedure DoneThread(Sender : TObject);
    Procedure DoThread;
    Procedure Run;
  end;

Procedure TTestThread.DoneThread(Sender : TObject);

begin
  Writeln('Thread ',TThread(Sender).ThreadID,' done. D is currently: ', D);
end;

Procedure TTestThread.DoThread;

Var
  I : integer;

begin
  for I:=1 to 10 do
    begin
    Sleep(10*Random(30));
    Writeln('Thread ',TThread.CurrentThread.ThreadID,' ping ',I);
    Inc(D,i);
    end;
end;

Procedure TTestThread.Run;

Var
  T1,T2 : TThread;

begin
  T1:=TThread.ExecuteInThread(@DoThread,@DoneThread);
  T2:=TThread.ExecuteInThread(@DoThread,@DoneThread);
  Writeln('Main thread done');
  T1.WaitFor;
  T2.WaitFor;
end;

begin
  With TTestThread.Create do
    try
      Run;
    finally
      Free;
    end;
end.

Example

program tthrcs;
{$h+}
uses cthreads, sysutils, classes;

Var
  D : Integer;
  DoneThreads : INteger;

Procedure DoneThread(Sender : TObject; Data : Pointer);

begin
  Inc(DoneThreads);
  Writeln('Thread ',TThread(Sender).ThreadID,' done. D is currently: ', PInteger(Data)^);
end;

Procedure ReportThreadStatus(Sender : TThread; AData : Pointer;Const status : String);

begin
   Writeln('Thread ',Sender.ThreadID,' Status report : ',Status);
end;

Procedure DoThread(AData : Pointer; Report : TThreadReportStatus);

Var
  I : integer;

begin
  for I:=1 to 10 do
    begin
    Sleep(10*Random(30));
    Report('Ping '+IntToStr(i));
    Inc(PInteger(AData)^,i);
    end;
end;

Var
  T1,T2 : TThread;

begin
  DoneThreads:=0;
  T1:=TThread.ExecuteInThread(@DoThread,@ReportThreadStatus,@D,@DoneThread);
  T2:=TThread.ExecuteInThread(@DoThread,@ReportThreadStatus,@D,@DoneThread);
  Writeln('Main thread loop');
  While DoneThreads<2 do
    begin
    Sleep(10);
    CheckSynchronize;
    end;
  T1.WaitFor;
  T2.WaitFor;
end.

Example

program tthrc;

{$mode objfpc}
{$H+}

uses cthreads, sysutils, classes;

Type
  TTestThread = Class(TObject)
    D : Integer;
    DoneThreads : integer;
    Procedure DoneThread(Sender : TObject);
    Procedure ReportThreadStatus(Sender : TThread; Const status : String);
    Procedure DoThread(Report: TThreadReportStatus);
    Procedure Run;
  end;

Procedure TTestThread.DoneThread(Sender : TObject);

begin
  Inc(DoneThreads);
  Writeln('Thread ',TThread(Sender).ThreadID,' done. D is currently: ', D);
end;

Procedure TTestThread.ReportThreadStatus(Sender : TThread; Const status : String);

begin
   Writeln('Thread ',Sender.ThreadID,' Status report : ',Status);
end;

Procedure TTestThread.DoThread(Report : TThreadReportStatus);

Var
  I : integer;

begin
  for I:=1 to 10 do
    begin
    Sleep(10*Random(30));
    Report('Ping '+IntToStr(i));
    Inc(D,i);
    end;
end;

Procedure TTestThread.Run;

Var
  T1,T2 : TThread;

begin
  DoneThreads:=0;
  T1:=TThread.ExecuteInThread(@DoThread,@ReportThreadStatus,@DoneThread);
  T2:=TThread.ExecuteInThread(@DoThread,@ReportThreadStatus,@DoneThread);
  Writeln('Main thread loop');
  While DoneThreads<2 do
    begin
    Sleep(10);
    CheckSynchronize;
    end;
  T1.WaitFor;
  T2.WaitFor;
end;

begin
  With TTestThread.Create do
    try
      Run;
    finally
      Free;
    end;
end.


TThread.ExternalThread

Is the thread instance an external thread ?

Declaration

Source position: classesh.inc line 1712

public property TThread.ExternalThread : Boolean
  read FExternalThread;

Description

ExternalThread returns True if the thread is an externally created thread. If the thread was created by the FPC program, this returns False. This is useful for examining instances returned by TThread.CurrentThread.

See also

TThread.CurrentThread

Return current thread instance


TThread.FatalException

Exception that occurred during thread execution

Declaration

Source position: classesh.inc line 1718

public property TThread.FatalException : TObject
  read FFatalException;

Description

FatalException contains the exception that occurred during the thread's execution.


TThread.Finished

Has the thread finished executing

Declaration

Source position: classesh.inc line 1715

public property TThread.Finished : Boolean
  read FFinished;

Description

Finished is True when TThread.Execue has finished executing, but the thread is still cleaning up (calling OnTerminate, etc).

See also

TThread.Execue

TThread.OnTerminate

Event called when the thread terminates.


TThread.FreeOnTerminate

Indicates whether the thread should free itself when it stops executing.

Declaration

Source position: classesh.inc line 1710

public property TThread.FreeOnTerminate : Boolean
  read FFreeOnTerminate
  write FFreeOnTerminate;


TThread.GetSystemTimes

Return CPU stats

Declaration

Source position: classesh.inc line 1692

public class procedure TThread.GetSystemTimes(

  out aSystemTimes: TSystemTimes

);

Description

GetSystemTimes is provided for Delphi compatibility only, it currently returns empty values only.

See also

TSystemTimes


TThread.GetTickCount

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Classes' (#rtl)

TThread.GetTickCount (deprecated)

Return tick count (32-bit)

Declaration

Source position: classesh.inc line 1693

public class function TThread.GetTickCount: LongWord;

Description

GetTickCount is deprecated and should not be used. Use TThread.GetTickCount64 instead.

See also

TThread.GetTickCount64

Return tick count (64-bit)


TThread.GetTickCount64

Return tick count (64-bit)

Declaration

Source position: classesh.inc line 1694

public class function TThread.GetTickCount64: QWord;

Description

GetTickCount64 simply calls SysUtils.GetTickCount64 and is implemented for Delphi compatibility only.

See also

SysUtils.GetTickCount64

Get tick count (64-bit)


TThread.Handle

Returns the thread handle.

Declaration

Source position: classesh.inc line 1711

public property TThread.Handle : TThreadID
  read FHandle;


TThread.IsSingleProcessor

Is the current system single processor or not

Declaration

Source position: classesh.inc line 1709

public property TThread.IsSingleProcessor : Boolean
  read GetIsSingleProcessor;

Description

Thread.IsSingleProcessor returns True if TThread.ProcessorCount is less than or equal to 1, False otherwise.

See also

TThread.ProcessorCount

Return the processor count for this system


TThread.NameThreadForDebugging

Set a thread name

Declaration

Source position: classesh.inc line 1678

public class procedure TThread.NameThreadForDebugging(

  aThreadName: UnicodeString;

  aThreadID: TThreadID = TThreadID(- 1)

);

class procedure TThread.NameThreadForDebugging(

  aThreadName: AnsiString;

  aThreadID: TThreadID = TThreadID(- 1)

);

Description

NameThreadForDebugging sets the name of thread aThreadID to aThreadName. The thread name can be unicode or ansistring. This is mainly useful for debugging purposes, as thread names are more easily recognizable than IDs.

Note that this requires OS support. Currently this is not implemented for any FPC platform and is supported for Delphi compatibility only.


TThread.OnTerminate

Event called when the thread terminates.

Declaration

Source position: classesh.inc line 1717

public property TThread.OnTerminate : TNotifyEvent
  read FOnTerminate
  write FOnTerminate;

Description

TThread.OnTerminate is called when the thread terminates. The event is always called in the context of the main thread, i.e. using TThread.Synchronize

See also

TThread.Synchronize | Synchronizes the thread by executing the method in the main thread.
TThread.FreeOnTerminate | Indicates whether the thread should free itself when it stops executing.


TThread.Priority

Returns the thread priority.

Declaration

Source position: classesh.inc line 1713

public property TThread.Priority : TThreadPriority
  read GetPriority
  write SetPriority;


TThread.ProcessorCount

Return the processor count for this system

Declaration

Source position: classesh.inc line 1708

public property TThread.ProcessorCount : LongWord
  read FProcessorCount;

Description

ProcessorCount returns the processor count for this system.

Whether this is the number of cores or the number of CPUs present in the hardware, is deliberately unspecified. The number of cores can also vary during the lifetime of the program, and the FPC implementation does not guarantee that this will always match, the value is set at program start.

As such, the number specified should only be used as an indication of how many threads can be executed at once by the system.

See also

TThread.IsSingleProcessor

Is the current system single processor or not


TThread.Queue

Queue a method for execution in the main thread

Declaration

Source position: classesh.inc line 1639

protected procedure TThread.Queue(

  aMethod: TThreadMethod

);

class procedure TThread.Queue(

  aThread: TThread;

  aMethod: TThreadMethod

);

Description

Queue schedules a method aMethod for execution in the main thread. In difference with TThread.Synchronize, Queue just posts the method for execution in a queue, and does not wait for it to be executed, so this call returns at once.

In the class procedure overloaded version of this call, the thread for which the method must be posted is the first argument. In the protected version of this call (used in the tthread instance), this argument is not there, and the thread instance is used.

When a thread finishes it's execution, all its queued calls are removed from the queue list.

See also

TThread.Synchronize | Synchronizes the thread by executing the method in the main thread.
TThread.RemoveQueuedEvents | Remove methods scheduled for execution from queue


TThread.RemoveQueuedEvents

Remove methods scheduled for execution from queue

Declaration

Source position: classesh.inc line 1684

public class procedure TThread.RemoveQueuedEvents(

  aThread: TThread;

  aMethod: TThreadMethod

);

class procedure TThread.RemoveQueuedEvents(

  aMethod: TThreadMethod

);

class procedure TThread.RemoveQueuedEvents(

  aThread: TThread

);

Description

RemoveQueuedEvents removes methods from the list of methods waiting for execution in the main thread. If only aThread is specified, all methods scheduled for execution by that thread are removed. If only aMethod is specified, then all calls to that method are removed, regardless of the thread. If both arguments are specified, then all calls to the given method by the given thread are removed.

See also

TThread.Synchronize | Synchronizes the thread by executing the method in the main thread.
TThread.Queue | Queue a method for execution in the main thread


TThread.Resume

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Classes' (#rtl)

TThread.Resume (deprecated)

Resumes the thread's execution. Deprecated, see TThread.Start

Declaration

Source position: classesh.inc line 1703

public procedure TThread.Resume;

See also

TThread.Start | Starts a thread that was created in a suspended state.
TThread.Suspend | Suspends the thread's execution.


TThread.SetReturnValue

Set return value of a thread

Declaration

Source position: classesh.inc line 1680

public class procedure TThread.SetReturnValue(

  aValue: Integer

);

Description

TThread.SetReturnValue sets the return value of an internally created thread.

Errors

If the thread was not created by the FPC program, an EThreadExternalException exception is raised.

See also

EThreadExternalException | Exception raised when an invalid operation is attempted on an external thread
TThread.CheckTerminated | Check if the current thread has finished executing.


TThread.Sleep

Prevent thread execution

Declaration

Source position: classesh.inc line 1688

public class procedure TThread.Sleep(

  aMilliseconds: Cardinal

);

Description

Sleep blocks the execution of the thread for aMilliseconds. This function simply calls sysutils.sleep

In difference with TThread.SpinWait, a thread switch may occur during the sleep.

See also

SysUtils.Sleep | Suspend execution of a program for a certain time.
TThread.SpinWait | Prevent thread execution in a spin-wait loop


TThread.SpinWait

Prevent thread execution in a spin-wait loop

Declaration

Source position: classesh.inc line 1687

public class procedure TThread.SpinWait(

  aIterations: LongWord

);

Description

SpinWait blocks the execution of the thread in a spin-wait loop: it simply executes some simple instructions.

This can be used to create short time delays without an immediate thread switch (e.g. SysUtils.Sleep can cause a thread switch). The input parameter (aIterations) specifies the number of spin loops.

See also

SysUtils.Sleep | Suspend execution of a program for a certain time.
TThread.Sleep | Prevent thread execution


TThread.Start

Starts a thread that was created in a suspended state.

Declaration

Source position: classesh.inc line 1702

public procedure TThread.Start;

Description

The effect of this method is currently the same as calling TThread.Resume after creating a thread in a suspended state. This method was added for Delphi-compatibility, where it was introduced after TThread.Suspend and TThread.Resume were deprecated.

See also

TThread.Create

Creates a new thread.


TThread.Suspend

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Classes' (#rtl)

TThread.Suspend (deprecated)

Suspends the thread's execution.

Declaration

Source position: classesh.inc line 1704

public procedure TThread.Suspend;

Description

On non-Windows platforms, a thread can only suspend itself. Other threads can wake up a suspended thread by calling TThread.Start.

See also

TThread.Resume | Resumes the thread's execution. Deprecated, see TThread.Start
TThread.Start | Starts a thread that was created in a suspended state.


TThread.Suspended

Indicates whether the thread is suspended.

Declaration

Source position: classesh.inc line 1714

public property TThread.Suspended : Boolean
  read GetSuspended
  write SetSuspended;


TThread.Synchronize

Synchronizes the thread by executing the method in the main thread.

Declaration

Source position: classesh.inc line 1638

protected procedure TThread.Synchronize(

  AMethod: TThreadMethod

);

class procedure TThread.Synchronize(

  AThread: TThread;

  AMethod: TThreadMethod

);


TThread.Terminate

Signals the thread it should terminate.

Declaration

Source position: classesh.inc line 1705

public procedure TThread.Terminate;


TThread.ThreadID

Returns the thread ID.

Declaration

Source position: classesh.inc line 1716

public property TThread.ThreadID : TThreadID
  read FThreadID;


TThread.TSystemTimes

Record for returning processor usage

Declaration

Source position: classesh.inc line 1602

public type TThread.TSystemTimes = record
IdleTime: QWord; | Processor idle time
UserTime: QWord; | User code execution time
KernelTime: QWord; | Kernel (OS) code execution time
NiceTime: QWord; | Nice (reduced priority) code execution time
end;

Description

TThread.TSystemTimes is used in TThread.GetSystemTimes to report processor usage. The fields are in microseconds.

See also

TThread.GetSystemTimes

Return CPU stats


TThread.WaitFor

Waits for the thread to terminate and returns the exit status.

Declaration

Source position: classesh.inc line 1706

public function TThread.WaitFor: Integer;


TThread.Yield

Yield execution to other threads

Declaration

Source position: classesh.inc line 1689

public class procedure TThread.Yield;

Description

TThread.Yield yields the processor to other threads. It can be called from methods outside the thread class itself.


TThreadExecuteCallBack

Signature of procedure to execute in a thread, without status reporting

Declaration

Source position: classesh.inc line 1583

type TThreadExecuteCallBack = procedure(

  AData: Pointer

);

Description

TThreadExecuteCallBack is the signature of the static procedure to be used when executing something in a thread using TThread.ExecuteInThread when no status reporting is required.

See also

TThread.ExecuteInThread | Execute a method or static procedure in a thread
TThreadReportStatus | Thread status report callback prototype
TThreadStatusNotifyEvent | Signature of thread status report event handler
TThreadExecuteStatusCallBack | Signature of procedure to execute in a thread, with status reporting


TThreadExecuteHandler

Signature of method to execute in a thread, without status reporting

Declaration

Source position: classesh.inc line 1578

type TThreadExecuteHandler = TThreadMethod;

Description

TThreadExecuteHandler is the signature of the method to be used when executing something in a thread using TThread.ExecuteInThread when no status reporting is required.

See also

TThread.ExecuteInThread | Execute a method or static procedure in a thread
TThreadReportStatus | Thread status report callback prototype
TThreadStatusNotifyEvent | Signature of thread status report event handler


TThreadExecuteStatusCallBack

Signature of procedure to execute in a thread, with status reporting

Declaration

Source position: classesh.inc line 1584

type TThreadExecuteStatusCallBack = procedure(

  AData: Pointer;

  ReportStatus: TThreadReportStatus

);

Description

TThreadExecuteStatusCallBack is the signature of a procedure to be used when executing something in a thread using TThread.ExecuteInThread when status reporting is required.

On entry in the method, AData is the AData parameter passed to TThread.ExecuteInThread. ReportStatus is passed to the method, and the threaded procedure can call ReportStatus at various stages to report about the status of the method: The status will be reported to the main thread using TThread.synchronize, so calls to ReportStatus will be blocked as long as the status was not reported.

See also

TThread.ExecuteInThread | Execute a method or static procedure in a thread
TThreadReportStatus | Thread status report callback prototype
TThreadStatusNotifyCallback | Signature of thread status report callback


TThreadExecuteStatusHandler

Signature of method to execute in a thread, with status reporting

Declaration

Source position: classesh.inc line 1579

type TThreadExecuteStatusHandler = procedure(

  ReportStatus: TThreadReportStatus

) of object;

Description

TThreadExecuteStatusHandler is the signature of the method to be used when executing something in a thread using TThread.ExecuteInThread when status reporting is required.

On entry in the method, ReportStatus is passed to the method, and the method can call ReportStatus at various stages to report about the status of the method: The status will be reported to the main thread using TThread.synchronize, and calls ReportStatus will be blocked as long as the status was not reported.

See also

TThread.ExecuteInThread | Execute a method or static procedure in a thread
TThreadReportStatus | Thread status report callback prototype
TThreadStatusNotifyEvent | Signature of thread status report event handler


TThreadList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Thread-safe list object

Declaration

Source position: classesh.inc line 352

type TThreadList = class
public
constructor Create; | Creates a new thread-safe list.
destructor Destroy; override; | Destroys the list instance.
procedure Add(); | Adds an element to the list.
procedure Clear; | Removes all emements from the list.
function LockList; | Locks the list for exclusive access.
procedure Remove(); | Removes an item from the list.
procedure UnlockList; | Unlocks the list after it was locked.
property Duplicates: TDuplicates; [rw] | Describes what to do with duplicates
end;

Inheritance

TThreadList

Thread-safe list object
|

TObject

Description

TThreadList is a thread-safe Tlist implementation. Unlike TList, it can be accessed read-write by multiple threads: the list implementation will take care of locking the list when adding or removing items from the list.

See also

TList

Class to manage collections of pointers.


TThreadList

Duplicates


Duplicates (TThreadList)


TThreadList
 | Create
 | Destroy
 | Add
 | Clear
 | LockList
 | Remove
 | UnlockList


Add (TThreadList)

Clear (TThreadList)

Create (TThreadList)

Destroy (TThreadList)

LockList (TThreadList)

Remove (TThreadList)

UnlockList (TThreadList)


TThreadList


TThreadList.Add

Adds an element to the list.

Declaration

Source position: classesh.inc line 360

public procedure TThreadList.Add(

  Item: Pointer

);

Description

Add attempts to lock the list and adds the pointer Item to the list. After the pointer was added, the list is unlocked again.

See also

LockList | Locks the list for exclusive access.
Clear | Removes all emements from the list.
Remove | Removes an item from the list.
UnlockList | Unlocks the list after it was locked.


TThreadList.Clear

Removes all emements from the list.

Declaration

Source position: classesh.inc line 361

public procedure TThreadList.Clear;

Description

Clear attempts to lock the list and then clears the list; all items are removed from the list. After the list is cleared, it is again unlocked.

See also

LockList | Locks the list for exclusive access.
Add | Adds an element to the list.
Remove | Removes an item from the list.
UnlockList | Unlocks the list after it was locked.


TThreadList.Create

Creates a new thread-safe list.

Declaration

Source position: classesh.inc line 358

public constructor TThreadList.Create;

Description

Create instantiates a new TThreadList instance. It initializes a critical section and an internal list object.

See also

TThreadList.Destroy

Destroys the list instance.


TThreadList.Destroy

Destroys the list instance.

Declaration

Source position: classesh.inc line 359

public destructor TThreadList.Destroy; override;

Description

Destroy finalizes the critical section, clears the internal list object and calls the inherited destructor.

See also

TThreadList.Create

Creates a new thread-safe list.


TThreadList.Duplicates

Describes what to do with duplicates

Declaration

Source position: classesh.inc line 365

public property TThreadList.Duplicates : TDuplicates
  read FDuplicates
  write FDuplicates;

Description

Duplicates describes what the threadlist should do when a duplicate pointer is added to the list. It is identical in behaviour to the Duplicates property of TStringList.

See also

TDuplicates

Type to describe what to do with duplicate values in a TStringlist.


TThreadList.LockList

Locks the list for exclusive access.

Declaration

Source position: classesh.inc line 362

public function TThreadList.LockList: TList;

Description

LockList locks the list for exclusive access. Locklist uses an internal critical section, so all rules for multiple locking of critical sections apply to locklist/unlocklist as well.

See also

Clear | Removes all emements from the list.
Add | Adds an element to the list.
Remove | Removes an item from the list.
UnlockList | Unlocks the list after it was locked.


TThreadList.Remove

Removes an item from the list.

Declaration

Source position: classesh.inc line 363

public procedure TThreadList.Remove(

  Item: Pointer

);

Description

Remove attempts to lock the list and then removes Item from the list. After the item is removed, the list is again unlocked.

See also

LockList | Locks the list for exclusive access.
Add | Adds an element to the list.
Clear | Removes all emements from the list.
UnlockList | Unlocks the list after it was locked.


TThreadList.UnlockList

Unlocks the list after it was locked.

Declaration

Source position: classesh.inc line 364

public procedure TThreadList.UnlockList;

Description

UnLockList unlocks the list when it was locked for exclusive access. UnLocklist and LockList use an internal critical section, so all rules for multiple locking/unlocking of critical sections apply.

See also

Clear | Removes all emements from the list.
Add | Adds an element to the list.
Remove | Removes an item from the list.
lockList | Locks the list for exclusive access.


TWriter

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Object to write component data to an arbitrary format.

Declaration

Source position: classesh.inc line 1433

type TWriter = class(TFiler)
public
constructor Create(); | Creates a new Writer with a stream and bufsize.
destructor Destroy; override; | Destroys the writer instance.
procedure DefineProperty(); override; | Callback used when defining and streaming custom properties.
procedure DefineBinaryProperty(); override; | Callback used when defining and streaming custom properties.
procedure Write(); virtual; | Write raw data to stream
procedure WriteBoolean(); | Write boolean value to the stream.
procedure WriteCollection(); | Write a collection to the stream.
procedure WriteComponent(); | Stream a component to the stream.
procedure WriteChar(); | Write a character to the stream.
procedure WriteWideChar(); | Write widechar to stream
procedure WriteDescendent(); | Write descendent to stream
procedure WriteFloat(); | Write a float to the stream.
procedure WriteSingle(); | Write a single-type real to the stream.
procedure WriteDate(); | Write a date to the stream.
procedure WriteCurrency(); | Write a currency value to the stream
procedure WriteIdent(); | Write an identifier to the stream.
procedure WriteInteger(); | Write an integer to the stream.
procedure WriteSet(); | Write a set value to the stream
procedure WriteListBegin; | Write a start-of-list marker to the stream.
procedure WriteListEnd; | Write an end-of-list marker to the stream.
procedure WriteSignature; | Write a signature to the stream
procedure WriteRootComponent(); | Write a root component to the stream.
procedure WriteString(); | Write a string to the stream.
procedure WriteWideString(); | Write a widestring value to the stream
procedure WriteUnicodeString(); | Write a unicode string to the stream.
procedure WriteVariant(); | Write a variant to the stream
property RootAncestor: TComponent; [rw] | Ancestor of root component.
property OnFindAncestor: TFindAncestorEvent; [rw] | Event occurring when an ancestor component must be found.
property OnWriteMethodProperty: TWriteMethodPropertyEvent; [rw] | Handler from writing method properties.
property OnWriteStringProperty: TReadWriteStringPropertyEvent; [rw] | Event handler for translating strings written to stream.
property Driver: TAbstractObjectWriter; [r] | Driver used when writing to the stream.
property PropertyPath: string; [r] | Path to the property that is currently being written
end;

Inheritance

TWriter | Object to write component data to an arbitrary format.
|
TFiler | Class responsible for streaming of components.
|
TObject | Base class of all classes.

Description

The TWriter class is a writer class that implements generic component streaming capabilities, independent of the format of the data in the stream. It uses a driver class TAbstractObjectWriter to do the actual reading of data. The interface of the TWriter class should be identical to the interface in Delphi.

Note that the TWriter design is such that it will write a single component to a stream. It will write all children of this component, but it is not designed to write multiple components in succession to one stream.

It should never be necessary to create an instance of this class directly. Instead, the TStream.WriteComponent call should be used.

See also

TFiler | Class responsible for streaming of components.
TWriter | Object to write component data to an arbitrary format.
TAbstractObjectReader | Abstract driver class to read stored component data.


TWriter
 |  | RootAncestor
 | ro | Driver
 | ro | PropertyPath
TFiler
 |  | Root
 | ro | LookupRoot
 |  | Ancestor
 |  | IgnoreChildren
TObject


ro | Driver (TWriter)
 | IgnoreChildren (TFiler)
ro | LookupRoot (TFiler)
ro |


TWriter
 | Create
 | Destroy
 | DefineProperty
 | DefineBinaryProperty
 | Write
 | WriteBoolean
 | WriteCollection
 | WriteComponent
 | WriteChar
 | WriteWideChar
 | WriteDescendent
 | WriteFloat
 | WriteSingle
 | WriteDate
 | WriteCurrency
 | WriteIdent
 | WriteInteger
 | WriteSet
 | WriteListBegin
 | WriteListEnd
 | WriteSignature
 | WriteRootComponent
 | WriteString
 | WriteWideString
 | WriteUnicodeString
 | WriteVariant
TFiler
 | DefineProperty
 | DefineBinaryProperty
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Create (TObject)

Create (TWriter)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

DefineBinaryProperty (TFiler)

DefineBinaryProperty (TWriter)

DefineProperty (TFiler)

DefineProperty (TWriter)

Destroy (TObject)

Destroy (TWriter)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

FieldAddress (TObject)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

SafeCallException (TObject)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)

Write (TWriter)

WriteBoolean (TWriter)

WriteChar (TWriter)

WriteCollection (TWriter)

WriteComponent (TWriter)

WriteCurrency (TWriter)

WriteDate (TWriter)

WriteDescendent (TWriter)

WriteFloat (TWriter)

WriteIdent (TWriter)

WriteInteger (TWriter)

WriteListBegin (TWriter)

WriteListEnd (TWriter)

WriteRootComponent (TWriter)

WriteSet (TWriter)

WriteSignature (TWriter)

WriteSingle (TWriter)

WriteString (TWriter)

WriteUnicodeString (TWriter)

WriteVariant (TWriter)

WriteWideChar (TWriter)

WriteWideString (TWriter)


TWriter
 | OnFindAncestor
 | OnWriteMethodProperty
 | OnWriteStringProperty
TFiler
TObject


OnFindAncestor (TWriter)

OnWriteMethodProperty (TWriter)

OnWriteStringProperty (TWriter)


TWriter.Create

Creates a new Writer with a stream and bufsize.

Declaration

Source position: classesh.inc line 1457

public constructor TWriter.Create(

  ADriver: TAbstractObjectWriter

);

constructor TWriter.Create(

  Stream: TStream;

  BufSize: Integer

);


TWriter.DefineBinaryProperty

Callback used when defining and streaming custom properties.

Declaration

Source position: classesh.inc line 1463

public procedure TWriter.DefineBinaryProperty(

  const Name: string;

  ReadData: TStreamProc;

  AWriteData: TStreamProc;

  HasData: Boolean

); override;


TWriter.DefineProperty

Callback used when defining and streaming custom properties.

Declaration

Source position: classesh.inc line 1460

public procedure TWriter.DefineProperty(

  const Name: string;

  ReadData: TReaderProc;

  AWriteData: TWriterProc;

  HasData: Boolean

); override;


TWriter.Destroy

Destroys the writer instance.

Declaration

Source position: classesh.inc line 1459

public destructor TWriter.Destroy; override;


TWriter.Driver

Driver used when writing to the stream.

Declaration

Source position: classesh.inc line 1498

public property TWriter.Driver : TAbstractObjectWriter
  read FDriver;


TWriter.OnFindAncestor

Event occurring when an ancestor component must be found.

Declaration

Source position: classesh.inc line 1494

public property TWriter.OnFindAncestor : TFindAncestorEvent
  read FOnFindAncestor
  write FOnFindAncestor;


TWriter.OnWriteMethodProperty

Handler from writing method properties.

Declaration

Source position: classesh.inc line 1495

public property TWriter.OnWriteMethodProperty : TWriteMethodPropertyEvent
  read FOnWriteMethodProperty
  write FOnWriteMethodProperty;

Description

OnWriteMethodProperty can be set by an IDE or some streaming mechanism which handles dummy values for method properties; It can be used to write a real value to the stream which will be interpreted correctly when the stream is read. See TWriteMethodPropertyEvent for a description of the arguments.

See also

TWriteMethodPropertyEvent | Callback for the TWriter.OnWriteMethodProperty event.
TReader.OnSetMethodProperty | Handler for setting method properties.


TWriter.OnWriteStringProperty

Event handler for translating strings written to stream.

Declaration

Source position: classesh.inc line 1496

public property TWriter.OnWriteStringProperty : TReadWriteStringPropertyEvent
  read FOnWriteStringProperty
  write FOnWriteStringProperty;

Description

OnWriteStringProperty is called whenever a string property is written to the stream. It can be used e.g. by a translation mechanism to translate the strings on the fly, when a form is written. See TReadWriteStringPropertyEvent for a description of the various parameters.

See also

TReader.OnPropertyNotFound | Handler for treating missing properties.
TReader.OnSetMethodProperty | Handler for setting method properties.
TReadWriteStringPropertyEvent | Callback for the TReader.OnReadStringProperty event handler


TWriter.PropertyPath

Path to the property that is currently being written

Declaration

Source position: classesh.inc line 1499

public property TWriter.PropertyPath : string
  read FPropPath;

Description

PropertyPath is set to the property name of the class currently being written to stream. This is only done when TPersistent descendant class properties are written.


TWriter.RootAncestor

Ancestor of root component.

Declaration

Source position: classesh.inc line 1493

public property TWriter.RootAncestor : TComponent
  read FRootAncestor
  write FRootAncestor;


TWriter.Write

Write raw data to stream

Declaration

Source position: classesh.inc line 1468

public procedure TWriter.Write(

  const Buffer;

  Count: LongInt

); virtual;

Description

Write is introduced for Delphi compatibility to write raw data to the component stream. This should not be used in new production code as it will totally mess up the streaming.

See also

TBinaryObjectWriter.Write | Write raw data to stream
TAbstractObjectWriter.Write | Write raw data to stream


TWriter.WriteBoolean

Write boolean value to the stream.

Declaration

Source position: classesh.inc line 1469

public procedure TWriter.WriteBoolean(

  Value: Boolean

);


TWriter.WriteChar

Write a character to the stream.

Declaration

Source position: classesh.inc line 1472

public procedure TWriter.WriteChar(

  Value: Char

);


TWriter.WriteCollection

Write a collection to the stream.

Declaration

Source position: classesh.inc line 1470

public procedure TWriter.WriteCollection(

  Value: TCollection

);


TWriter.WriteComponent

Stream a component to the stream.

Declaration

Source position: classesh.inc line 1471

public procedure TWriter.WriteComponent(

  Component: TComponent

);


TWriter.WriteCurrency

Write a currency value to the stream

Declaration

Source position: classesh.inc line 1480

public procedure TWriter.WriteCurrency(

  const Value: Currency

);

Description

WriteCurrency writes a currency typed value to the stream. This method does nothing except call the driver method of the driver being used.

See also

TReader.ReadCurrency

Read a currency value from the stream.


TWriter.WriteDate

Write a date to the stream.

Declaration

Source position: classesh.inc line 1478

public procedure TWriter.WriteDate(

  const Value: TDateTime

);


TWriter.WriteDescendent

Write descendent to stream

Declaration

Source position: classesh.inc line 1474

public procedure TWriter.WriteDescendent(

  ARoot: TComponent;

  AAncestor: TComponent

);

Description

WriteDescendent writes ARoot as a descendent of AAncestor This is used to create diff streams: only the properties where ARoot differs from AAncestor are written to the stream.

See also

TStream.WriteDescendent

Write descendent of a component


TWriter.WriteFloat

Write a float to the stream.

Declaration

Source position: classesh.inc line 1476

public procedure TWriter.WriteFloat(

  const Value: Extended

);


TWriter.WriteIdent

Write an identifier to the stream.

Declaration

Source position: classesh.inc line 1481

public procedure TWriter.WriteIdent(

  const Ident: string

);


TWriter.WriteInteger

Write an integer to the stream.

Declaration

Source position: classesh.inc line 1482

public procedure TWriter.WriteInteger(

  Value: LongInt

); overload;

procedure TWriter.WriteInteger(

  Value: Int64

); overload;


TWriter.WriteListBegin

Write a start-of-list marker to the stream.

Declaration

Source position: classesh.inc line 1485

public procedure TWriter.WriteListBegin;


TWriter.WriteListEnd

Write an end-of-list marker to the stream.

Declaration

Source position: classesh.inc line 1486

public procedure TWriter.WriteListEnd;


TWriter.WriteRootComponent

Write a root component to the stream.

Declaration

Source position: classesh.inc line 1488

public procedure TWriter.WriteRootComponent(

  ARoot: TComponent

);


TWriter.WriteSet

Write a set value to the stream

Declaration

Source position: classesh.inc line 1484

public procedure TWriter.WriteSet(

  Value: LongInt;

  SetType: Pointer

);

Description

WriteSet writes a set Value consisting of elements with type EnumType. The set must be encoded as an integer where each element is encoded in a bit of the integer. Thus, at most an enumerated type with 32 elements can be written with this method.

Errors

No checking is performed on the validity of EnumType. It is assumed to be a valid PTypeInfo pointer.

See also

TReader.ReadSet

Read a set value from the stream


TWriter.WriteSignature

Write a signature to the stream

Declaration

Source position: classesh.inc line 1487

public procedure TWriter.WriteSignature;

Description

WriteSignature writes the streaming signature (if any) to a stream. It is called once, at the start of writing the root component to a stream.

See also

TAbstractObjectWriter.WriteSignature | Write stream signature to the stream
TBinaryObjectWriter.WriteSignature | Write stream signature to the stream


TWriter.WriteSingle

Write a single-type real to the stream.

Declaration

Source position: classesh.inc line 1477

public procedure TWriter.WriteSingle(

  const Value: Single

);


TWriter.WriteString

Write a string to the stream.

Declaration

Source position: classesh.inc line 1489

public procedure TWriter.WriteString(

  const Value: string

);


TWriter.WriteUnicodeString

Write a unicode string to the stream.

Declaration

Source position: classesh.inc line 1491

public procedure TWriter.WriteUnicodeString(

  const Value: UnicodeString

);

Description

WriteUnicodeString writes Value, a UnicodeString string to the stream. It simply passes the string on to the WriteUnicodeString method of the writer driver class.

See also

TBinaryObjectWriter.WriteUnicodeString | Write a unicode string to the stream.
TReader.ReadUnicodeString | Read a UnicodeString value from the stream


TWriter.WriteVariant

Write a variant to the stream

Declaration

Source position: classesh.inc line 1492

public procedure TWriter.WriteVariant(

  const VarValue: Variant

);

Description

WriteVariant writes Value, a simple variant, o the stream. It simply passes the string on to the WriteVariant method of the writer driver class.

See also

TBinaryObjectWriter.WriteVariant | Write a variant to the stream
TReader.ReadVariant | Read a variant from the stream


TWriter.WriteWideChar

Write widechar to stream

Declaration

Source position: classesh.inc line 1473

public procedure TWriter.WriteWideChar(

  Value: WideChar

);

Description

WriteWideChar writes a widechar to the stream. This actually writes a widestring of length 1.

See also

TReader.ReadWideChar | Read widechar from the stream
TWriter.WriteWideString | Write a widestring value to the stream


TWriter.WriteWideString

Write a widestring value to the stream

Declaration

Source position: classesh.inc line 1490

public procedure TWriter.WriteWideString(

  const Value: WideString

);

Description

WriteWidestring writes a currency typed value to the stream. This method does nothing except call the driver method of the driver being used.

See also

TReader.ReadWideString

Read a WideString value from the stream.


TWriterProc

Writer procedure used by DefineProperties

Declaration

Source position: classesh.inc line 1090

type TWriterProc = procedure(

  Writer: TWriter

) of object;

Description

The TWriterProc writer procedure is a callback procedure which will be used by a TPersistent descendant to write user properties from a stream during the streaming process. The Writer argument is the writer object which can be used write properties to the stream.


EListError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception thrown when a list-related error occurs

Declaration

Source position: fgl.pp line 39

type EListError = class(Exception)

Inheritance

EListError | Exception thrown when a list-related error occurs
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EListError is the exception used in the TFPSList class to indicate errors such as a list index out of bounds, wrong capacity etc.

See also

TFPSList.Capacity | Current capacity of the list
TFPSList.Exchange | Exchange two items in the list
TFPSList.Items | Items in the list


TFPGInterfacedObjectList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Generic interfaced object list

Declaration

Source position: fgl.pp line 193

type generic TFPGInterfacedObjectList <T>= class(TFPSList)
public
constructor Create; | Instantiate a new interfaced object list.
function Add(); | Add new object of class T to the list.
function Extract(); | Extract an item from the list
property First: T; [rw] | First non-nil object
function GetEnumerator; | Return a list enumerator for T
function IndexOf(); | Index of object
procedure Insert(); | Insert a new object in the list
property Last: T; [rw] | Last non-Nil object
procedure Assign(); | Copy objects from Source list
function Remove(); | Remove an object from the list.
procedure Sort(); | Sort the objects in the list
property Items []: T; default; [rw] | Indexed access to objects in the list.
property List: PTypeList; [r] | Internal list pointer
end;

Inheritance

TFPGInterfacedObjectList | Generic interfaced object list
TFPSList | Basic list of memory blocks
TObject | Base class of all classes.

Description

TFPGList can be used to specialize a list for any class type T that requires reference counting (all objects that implement IInterface or IUnknown)). It will specialize to a list with the same methods as TFPSList or classes.TFPList or TFPObjectList

Classes that implement IInterface or IUnknown require special care to maintain the reference count. The TFPGInterfacedObjectList list provides the necessary functionality to deal with this.

See also

TFPSList | Basic list of memory blocks
classes.TFPList | Class to manage collections of pointers.


TFPGInterfacedObjectList
 |  | First
 |  | Last
 |  | Items
 | ro | List
TFPSList
 |  | Capacity
 |  | Count
 |  | Items
 | ro | ItemSize
 | ro | List
 |  | First
 |  | Last
TObject


 | Capacity (TFPSList)
 | Count (TFPSList)
 | First (TFPSList)
 | First (TFPGInterfacedObjectList)
 | Items (TFPSList)
 | Items (TFPGInterfacedObjectList)
ro | ItemSize (TFPSList)
 | Last (TFPSList)
 | Last (TFPGInterfacedObjectList)
ro | List (TFPSList)
ro |


TFPGInterfacedObjectList
 | Create
 | Add
 | Extract
 | GetEnumerator
 | IndexOf
 | Insert
 | Assign
 | Remove
 | Sort
TFPSList
 | Create
 | Destroy
 | Add
 | Clear
 | Delete
 | Error
 | Exchange
 | Expand
 | Extract
 | IndexOf
 | Insert
 | Move
 | Assign
 | Remove
 | Pack
 | Sort
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


Add (TFPSList)

Add (TFPGInterfacedObjectList)

AfterConstruction (TObject)

Assign (TFPSList)

Assign (TFPGInterfacedObjectList)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Clear (TFPSList)

Create (TObject)

Create (TFPSList)

Create (TFPGInterfacedObjectList)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Delete (TFPSList)

Destroy (TObject)

Destroy (TFPSList)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

Error (TFPSList)

Exchange (TFPSList)

Expand (TFPSList)

Extract (TFPSList)

Extract (TFPGInterfacedObjectList)

FieldAddress (TObject)

Free (TObject)

FreeInstance (TObject)

GetEnumerator (TFPGInterfacedObjectList)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

IndexOf (TFPSList)

IndexOf (TFPGInterfacedObjectList)

InheritsFrom (TObject)

InitInstance (TObject)

Insert (TFPSList)

Insert (TFPGInterfacedObjectList)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

Move (TFPSList)

newinstance (TObject)

Pack (TFPSList)

Remove (TFPSList)

Remove (TFPGInterfacedObjectList)

SafeCallException (TObject)

Sort (TFPSList)

Sort (TFPGInterfacedObjectList)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)


TFPGInterfacedObjectList

TFPSList

TObject


TFPGInterfacedObjectList.Add

Add new object of class T to the list.

Declaration

Source position: fgl.pp line 215

public function TFPGInterfacedObjectList.Add(

  const Item: T

):Integer;

Arguments

Item

Interfaced object to add to the list.

Function result

Index at which the object was added.

Description

Add adds a new item Item of class type T to the list and returns the position at which the item was added. Add will increase the reference count of the object.

Errors

If the item could not be added, an EListError exception is raised.

See also

TFPGInterfacedObjectList.Extract | Extract an item from the list
TFPGInterfacedObjectList.Items | Indexed access to objects in the list.
TFPGInterfacedObjectList.IndexOf | Index of object


TFPGInterfacedObjectList.Assign

Copy objects from Source list

Declaration

Source position: fgl.pp line 223

public procedure TFPGInterfacedObjectList.Assign(

  Source: TFPGInterfacedObjectList

);

Arguments

Source

Source list to copy items from.

Description

Assign clears the list and copies all items in Source to the list. The source list must be of the same type as the destination list.

See also

TFPSList.Clear | Clear the list
TFPGObjectList.Add | Add new object of class T to the list.


TFPGInterfacedObjectList.Create

Instantiate a new interfaced object list.

Declaration

Source position: fgl.pp line 214

public constructor TFPGInterfacedObjectList.Create;

Description

Create instantiates a new object list. It will simply call the inherited constructor with the correct item size.

See also

TFPSList.Destroy

Destroy the list instance.


TFPGInterfacedObjectList.Extract

Extract an item from the list

Declaration

Source position: fgl.pp line 216

public function TFPGInterfacedObjectList.Extract(

  const Item: T

):T;

Arguments

Item

The extracted object

Function result

The actually removed object, or Nil

Description

Extract removes Item from the list and returns the removed item, or Nil if it was not found.

The extracted object will not be destroyed.

Errors

None.

See also

TFPSList.Delete

Delete an item from the list


TFPGInterfacedObjectList.First

First non-nil object

Declaration

Source position: fgl.pp line 217

public property TFPGInterfacedObjectList.First : T
  read GetFirst
  write SetFirst;

Description

First returns the first non-nil object. If no such element is present, Nil is returned.

See also

TFPSList.First | Pointer to first non-empty item in the list
TFPGInterfacedObjectList.Last | Last non-Nil object
TFPSList.Pack | Remove empty items from the list


TFPGInterfacedObjectList.GetEnumerator

Return a list enumerator for T

Declaration

Source position: fgl.pp line 218

public function TFPGInterfacedObjectList.GetEnumerator: TFPGListEnumeratorSpec;

Function result

A new enumerator

Description

GetEnumerator returns an enumerator for the elements in the list. It is a specialized version of TFPGListEnumerator.

See also

TFPGListEnumerator

Generic list enumerator


TFPGInterfacedObjectList.IndexOf

Index of object

Declaration

Source position: fgl.pp line 219

public function TFPGInterfacedObjectList.IndexOf(

  const Item: T

):Integer;

Arguments

Item

Item to search in the list.

Function result

Index of Item in the list or -1 if it is not in the list.

Description

IndexOf returns the index of Item in the list, or -1 if the object does not appear in the list.

Errors

None.

See also

TFPGInterfacedObjectList.Items | Indexed access to objects in the list.
TFPGInterfacedObjectList.Insert | Insert a new object in the list
TFPGInterfacedObjectList.Add | Add new object of class T to the list.


TFPGInterfacedObjectList.Insert

Insert a new object in the list

Declaration

Source position: fgl.pp line 220

public procedure TFPGInterfacedObjectList.Insert(

  Index: Integer;

  const Item: T

);

Arguments

Index | Position to insert Item at
Item | Interfaced Object to insert in the list

Description

Insert inserts a new object (Item) in the list at position Index. The index is zero based and must be less than Count.

Errors

If an invalid index is specified, an EListError exception is raised.

See also

TFPGInterfacedObjectList.Items | Indexed access to objects in the list.
TFPGInterfacedObjectList.Add | Add new object of class T to the list.


TFPGInterfacedObjectList.Items

Indexed access to objects in the list.

Declaration

Source position: fgl.pp line 227

public property TFPGInterfacedObjectList.Items[Index: Integer] : T
  read Get
  write Put;
  default;

Description

Items provides indexed access to the objects in the list. The objects can be get or set.

The index Index is zero based, and has a maximum value of Count-1.

The previous object at position Index may be freed when setting the property, depending on its reference count.

Errors

If an invalid index is used, an EListError exception is raised.

See also

TFPSList.Count

Current element count


TFPGInterfacedObjectList.Last

Last non-Nil object

Declaration

Source position: fgl.pp line 221

public property TFPGInterfacedObjectList.Last : T
  read GetLast
  write SetLast;

Description

Last returns the last non-Nil object. If no such element is present, Nil is returned.

See also

TFPGInterfacedObjectList.First | First non-nil object
TFPSList.Last | Pointer to last non-empty item in the list


TFPGInterfacedObjectList.List

Internal list pointer

Declaration

Source position: fgl.pp line 228

public property TFPGInterfacedObjectList.List : PTypeList
  read GetList;

Description

List is the internal list of objects. It should not be used directly.

See also

TFPGInterfacedObjectList.Items

Indexed access to objects in the list.


TFPGInterfacedObjectList.Remove

Remove an object from the list.

Declaration

Source position: fgl.pp line 225

public function TFPGInterfacedObjectList.Remove(

  const Item: T

):Integer;

Arguments

Item

Object to remove from the list

Function result

Index of removed object, prior to removal.

Description

Remove removes the object Item from the list, and returns the index of the removed item. If no item was removed, -1 is returned. Only the first object is removed.

Removing an object from the list may cause the object to be freed.

Errors

None.

See also

TFPGInterfacedObjectList.IndexOf | Index of object
TFPSList.Delete | Delete an item from the list
TFPGInterfacedObjectList.FreeObjects


TFPGInterfacedObjectList.Sort

Sort the objects in the list

Declaration

Source position: fgl.pp line 226

public procedure TFPGInterfacedObjectList.Sort(

  Compare: TCompareFunc

);

Arguments

Compare

Compare function for 2 objects

Description

Sort sorts the elements in the list using the provided Compare function. The list passes 2 items to the compare function. The result of this function determines how the items will be sorted:

  • If the result of this function is negative, the first object (Item1) is assumed to be 'less' than the second object (Item2) and will be moved before the second in the list.
  • If the function result is positive, the first object (Item1) is assumed to be 'greater than' the second object (Item2)and will be moved after the second in the list.
  • if the function result is zero, the objects are assumed to be 'equal' and no moving will take place.

Errors

None.

See also

TFPSList.Sorted


TFPGList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Generic list

Declaration

Source position: fgl.pp line 114

type generic TFPGList <T>= class(TFPSList)
public
Type
TFPGListEnumeratorSpec = TFPGListEnumeratorSpec;
constructor Create; | Instantiate a new list
function Add(); | Add new item of type T to the list.
function Extract(); | Extract an item from the list
property First: T; [rw] | First non-empty item
function GetEnumerator; | Return a list enumerator for T.
function IndexOf(); | Index of item
procedure Insert(); | Insert a new item in the list
property Last: T; [rw] | Last non-empty item
procedure Assign(); | Copy elements from Source list
function Remove(); | Remove an item from the list.
procedure Sort(); | Sort the list
property Items []: T; default; [rw] | Indexed access to items in the list
property List: PTypeList; [r] | Internal list object
end;

Inheritance

TFPGList | Generic list
TFPSList | Basic list of memory blocks
TObject | Base class of all classes.

Description

TFPGList can be used to specialize a list for any type T that does not require reference counting (such as interfaced objects). It will specialize to a list with the same methods as TFPSList or classes.TFPList

See also

TFPSList | Basic list of memory blocks
classes.TFPList | Class to manage collections of pointers.


TFPGList
 |  | First
 |  | Last
 |  | Items
 | ro | List
TFPSList
 |  | Capacity
 |  | Count
 |  | Items
 | ro | ItemSize
 | ro | List
 |  | First
 |  | Last
TObject


 | Capacity (TFPSList)
 | Count (TFPSList)
 | First (TFPSList)
 | First (TFPGList)
 | Items (TFPSList)
 | Items (TFPGList)
ro | ItemSize (TFPSList)
 | Last (TFPSList)
 | Last (TFPGList)
ro | List (TFPSList)
ro |


TFPGList
 | Create
 | Add
 | Extract
 | GetEnumerator
 | IndexOf
 | Insert
 | Assign
 | Remove
 | Sort
TFPSList
 | Create
 | Destroy
 | Add
 | Clear
 | Delete
 | Error
 | Exchange
 | Expand
 | Extract
 | IndexOf
 | Insert
 | Move
 | Assign
 | Remove
 | Pack
 | Sort
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


Add (TFPSList)

Add (TFPGList)

AfterConstruction (TObject)

Assign (TFPSList)

Assign (TFPGList)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Clear (TFPSList)

Create (TObject)

Create (TFPSList)

Create (TFPGList)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Delete (TFPSList)

Destroy (TObject)

Destroy (TFPSList)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

Error (TFPSList)

Exchange (TFPSList)

Expand (TFPSList)

Extract (TFPSList)

Extract (TFPGList)

FieldAddress (TObject)

Free (TObject)

FreeInstance (TObject)

GetEnumerator (TFPGList)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

IndexOf (TFPSList)

IndexOf (TFPGList)

InheritsFrom (TObject)

InitInstance (TObject)

Insert (TFPSList)

Insert (TFPGList)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

Move (TFPSList)

newinstance (TObject)

Pack (TFPSList)

Remove (TFPSList)

Remove (TFPGList)

SafeCallException (TObject)

Sort (TFPSList)

Sort (TFPGList)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)


TFPGList

TFPSList

TObject


TFPGList.Add

Add new item of type T to the list.

Declaration

Source position: fgl.pp line 137

public function TFPGList.Add(

  const Item: T

):Integer;

Arguments

Item

Item to add to the list.

Function result

Index at which item was added.

Description

Add adds a new item Item of generic type T to the list and returns the position at which the item was added.

Errors

If the item could not be added, an EListError exception is raised.

See also

TFPGList.Extract | Extract an item from the list
TFPGList.Items | Indexed access to items in the list
TFPGList.IndexOf | Index of item


TFPGList.Assign

Copy elements from Source list

Declaration

Source position: fgl.pp line 145

public procedure TFPGList.Assign(

  Source: TFPGList

);

Arguments

Source

Source list to copy items from.

Description

Assign clears the list and copies all items in Source to the list. The source list must be of the same type as the destination list.

See also

TFPSList.Clear | Clear the list
TFPGList.Add | Add new item of type T to the list.


TFPGList.Create

Instantiate a new list

Declaration

Source position: fgl.pp line 136

public constructor TFPGList.Create;

Description

Create instantiates a new list. It will simply call the inherited constructor with the correct item size: sizeof(T).


TFPGList.Extract

Extract an item from the list

Declaration

Source position: fgl.pp line 138

public function TFPGList.Extract(

  const Item: T

):T;

Arguments

Item

Item to extract

Function result

The extracted item

Description

Extract removes Item from the list and returns the removed item, or an expression equivalent to T(0) if it was not found.

Errors

None.

See also

TFPSList.Delete

Delete an item from the list


TFPGList.First

First non-empty item

Declaration

Source position: fgl.pp line 139

public property TFPGList.First : T
  read GetFirst
  write SetFirst;

Description

First returns the first non-empty item, which means the first item not equal to T(0). If no such element is present, T(0). is returned.

See also

TFPSList.First | Pointer to first non-empty item in the list
TFPGList.Last | Last non-empty item


TFPGList.GetEnumerator

Return a list enumerator for T.

Declaration

Source position: fgl.pp line 140

public function TFPGList.GetEnumerator: TFPGListEnumeratorSpec;

Function result

A new enumerator

Description

GetEnumerator returns an enumerator for the elements in the list. It is a specialized version of TFPGListEnumerator.

See also

TFPGListEnumerator

Generic list enumerator


TFPGList.IndexOf

Index of item

Declaration

Source position: fgl.pp line 141

public function TFPGList.IndexOf(

  const Item: T

):Integer;

Arguments

Item

Item to search in the list.

Function result

Index of Item in the list or -1 if it is not in the list.

Description

IndexOf returns the index of Item in the list, or -1 if the item does not appear in the list.

Errors

None.

See also

TFPGList.Items | Indexed access to items in the list
TFPGList.Insert | Insert a new item in the list
TFPSList.Add | Add a new item to the list


TFPGList.Insert

Insert a new item in the list

Declaration

Source position: fgl.pp line 142

public procedure TFPGList.Insert(

  Index: Integer;

  const Item: T

);

Arguments

Index | Position to insert item at
Item | Item to insert in the list

Description

Insert inserts a new item in the list at position Index. The index is zero based and must be less than Count.

Errors

If an invalid index is specified, an EListError exception is raised.

See also

TFPGList.Items | Indexed access to items in the list
TFPGList.Insert | Insert a new item in the list
TFPSList.Add | Add a new item to the list


TFPGList.Items

Indexed access to items in the list

Declaration

Source position: fgl.pp line 149

public property TFPGList.Items[Index: Integer] : T
  read Get
  write Put;
  default;

Description

Items provides indexed access to the items in the list. The items can be get or set.

The index Index is zero based, and has a maximum value of Count-1.

Errors

If an invalid index is used, an EListError exception is raised.

See also

TFPSList.Count

Current element count


TFPGList.Last

Last non-empty item

Declaration

Source position: fgl.pp line 143

public property TFPGList.Last : T
  read GetLast
  write SetLast;

Description

Last returns the last non-empty item, which means the last item not equal to T(0). If no such element is present, T(0). is returned.

See also

TFPGList.First | First non-empty item
TFPSList.Last | Pointer to last non-empty item in the list


TFPGList.List

Internal list object

Declaration

Source position: fgl.pp line 150

public property TFPGList.List : PTypeList
  read GetList;

Description

List is the internal list of items. It should not be used directly.

See also

TFPGList.Items

Indexed access to items in the list


TFPGList.Remove

Remove an item from the list.

Declaration

Source position: fgl.pp line 147

public function TFPGList.Remove(

  const Item: T

):Integer;

Arguments

Item

Item to remove from the list.

Function result

Index of the removed item.

Description

Remove removes the item Item from the list, and returns the index of the removed item. If no item was removed, -1 is returned. Only the first item is removed.

Errors

None.

See also

TFPGList.IndexOf

Index of item


TFPGList.Sort

Sort the list

Declaration

Source position: fgl.pp line 148

public procedure TFPGList.Sort(

  Compare: TCompareFunc

);

Arguments

Compare

Compare function for 2 items

Description

Sort sorts the elements in the list using the provided Compare function. The list passes 2 items to the compare function. The result of this function determines how the items will be sorted:

  • If the result of this function is negative, the first item (Item1) is assumed to be 'less' than the second item (Item2) and will be moved before the second in the list.
  • If the function result is positive, the first item (Item1) is assumed to be 'greater than' the second item (Item2)and will be moved after the second in the list.
  • if the function result is zero, the items are assumed to be 'equal' and no moving will take place.


TFPGList.TFPGListEnumeratorSpec

Declaration

Source position: fgl.pp line 135

public type TFPGList.TFPGListEnumeratorSpec = TFPGListEnumeratorSpec;


TFPGListEnumerator

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Generic list enumerator

Declaration

Source position: fgl.pp line 103

type generic TFPGListEnumerator <T>= class(TObject)
public
constructor Create(); | Create a new list enumerator
function MoveNext; | Move to next element in the list
property Current: T; [r] | Current enumerated element
end;

Inheritance

TFPGListEnumerator | Generic list enumerator
TObject | Base class of all classes.

Description

TFPGListEnumerator is a generic list enumerator. It is used in the TFPGList class to implement the enumerator for the list.

Normally there should be no need to instantiate or use this class directly.

See also

TFPGList

Generic list


TFPGListEnumerator

ro

Current

TObject


TFPGListEnumerator
 | Create
 | MoveNext
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Create (TObject)

Create (TFPGListEnumerator)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

FieldAddress (TObject)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

MoveNext (TFPGListEnumerator)

newinstance (TObject)

SafeCallException (TObject)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)


TFPGListEnumerator

TObject


TFPGListEnumerator.Create

Create a new list enumerator

Declaration

Source position: fgl.pp line 109

public constructor TFPGListEnumerator.Create(

  AList: TFPSList

);

Arguments

AList

List to be enumerated

Description

Create is called by the list AList to initialize a new enumerator. There should be no need to call this directly.

See also

TFPGList

Generic list


TFPGListEnumerator.Current

Current enumerated element

Declaration

Source position: fgl.pp line 111

public property TFPGListEnumerator.Current : T
  read GetCurrent;

Description

Current returns the currently enumerated element. It is only valid after TFPGListEnumerator.MoveNext was called and returned True.

See also

TFPGListEnumerator.MoveNext

Move to next element in the list


TFPGListEnumerator.MoveNext

Move to next element in the list

Declaration

Source position: fgl.pp line 110

public function TFPGListEnumerator.MoveNext: Boolean;

Function result

True if the enumerator successfully selected the next element

Description

MoveNext moves to the next element in the list.

See also

TFPGListEnumerator.Current

Current enumerated element


TFPGMap

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Generic map

Declaration

Source position: fgl.pp line 281

type generic TFPGMap <TKey,TData>= class(TFPSMap)
public
constructor Create; | Create a new instance of the map
function Add(); | Add a key and value to the map
function Find(); | Find item based on key
function TryGetData(); | Find data or return default
procedure AddOrSetData(); | Add data with given or set value if the key already exists.
function IndexOf(); | Find index of a key in the list.
function IndexOfData(); | Find index of data value in the list.
procedure InsertKey(); | Insert a new key in the list
procedure InsertKeyData(); | Insert a new key with associated data in the list
function Remove(); | Remove a key from the list
property Keys []: TKey; [rw] | Indexed access to the keys in the list.
property Data []: TData; [rw] | Indexed access to the data in the list
property KeyData []: TData; default; [rw] | Access to data based on key
property OnCompare: TKeyCompareFunc; [rw] | Alias for OnKeyCompare
property OnKeyCompare: TKeyCompareFunc; [rw] | Compare function for key values.
property OnDataCompare: TDataCompareFunc; [rw] | Compare function for data values.
end;

Inheritance

TFPGMap | Generic map
TFPSMap | Basic map object, used in generic maps
TFPSList | Basic list of memory blocks
TObject | Base class of all classes.

Description

TFPGMap is a generic map class. It can be used to specialize a map for any key type and data type that do not require manual reference counting: For reference counted interface objects, TFPGMapInterfacedObjectData must be used.

See also

TFPGMapInterfacedObjectData

Generic map for reference counted objects


TFPGMap
 |  | Keys
 |  | Data
 |  | KeyData
TFPSMap
 |  | Duplicates
 | ro | KeySize
 | ro | DataSize
 |  | Keys
 |  | Data
 |  | KeyData
 |  | Sorted
TFPSList
 |  | Capacity
 |  | Count
 |  | Items
 | ro | ItemSize
 | ro | List
 |  | First
 |  | Last
TObject


 | Capacity (TFPSList)
 | Count (TFPSList)
 | Data (TFPSMap)
 | Data (TFPGMap)
ro | DataSize (TFPSMap)
 | Duplicates (TFPSMap)
 | First (TFPSList)
 | Items (TFPSList)
ro | ItemSize (TFPSList)
 | KeyData (TFPSMap)
 | KeyData (TFPGMap)
 | Keys (TFPSMap)
 | Keys (TFPGMap)
ro | KeySize (TFPSMap)
 | Last (TFPSList)
ro |


TFPGMap
 | Create
 | Add
 | Find
 | TryGetData
 | AddOrSetData
 | IndexOf
 | IndexOfData
 | InsertKey
 | InsertKeyData
 | Remove
TFPSMap
 | Create
 | Add
 | Find
 | IndexOf
 | IndexOfData
 | Insert
 | InsertKey
 | InsertKeyData
 | Remove
 | Sort
TFPSList
 | Create
 | Destroy
 | Add
 | Clear
 | Delete
 | Error
 | Exchange
 | Expand
 | Extract
 | IndexOf
 | Insert
 | Move
 | Assign
 | Remove
 | Pack
 | Sort
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


Add (TFPSList)

Add (TFPSMap)

Add (TFPGMap)

AddOrSetData (TFPGMap)

AfterConstruction (TObject)

Assign (TFPSList)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Clear (TFPSList)

Create (TObject)

Create (TFPSList)

Create (TFPSMap)

Create (TFPGMap)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Delete (TFPSList)

Destroy (TObject)

Destroy (TFPSList)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

Error (TFPSList)

Exchange (TFPSList)

Expand (TFPSList)

Extract (TFPSList)

FieldAddress (TObject)

Find (TFPSMap)

Find (TFPGMap)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

IndexOf (TFPSList)

IndexOf (TFPSMap)

IndexOf (TFPGMap)

IndexOfData (TFPSMap)

IndexOfData (TFPGMap)

InheritsFrom (TObject)

InitInstance (TObject)

Insert (TFPSList)

Insert (TFPSMap)

InsertKey (TFPSMap)

InsertKey (TFPGMap)

InsertKeyData (TFPSMap)

InsertKeyData (TFPGMap)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

Move (TFPSList)

newinstance (TObject)

Pack (TFPSList)

Remove (TFPSList)

Remove (TFPSMap)

Remove (TFPGMap)

SafeCallException (TObject)

Sort (TFPSList)

Sort (TFPSMap)

StringMessageTable (TObject)

ToString (TObject)

TryGetData (TFPGMap)

UnitName (TObject)


TFPGMap
 | OnCompare
 | OnKeyCompare
 | OnDataCompare
TFPSMap
 | OnPtrCompare
 | OnKeyPtrCompare
 | OnDataPtrCompare
TFPSList
TObject


OnCompare (TFPGMap)

OnDataCompare (TFPGMap)

OnDataPtrCompare (TFPSMap)

OnKeyCompare (TFPGMap)

OnKeyPtrCompare (TFPSMap)

OnPtrCompare (TFPSMap)


TFPGMap.Add

Add a key and value to the map

Declaration

Source position: fgl.pp line 310

public function TFPGMap.Add(

  const AKey: TKey;

  const AData: TData

):Integer;

function TFPGMap.Add(

  const AKey: TKey

):Integer;

Arguments

AKey | Key value
AData | Data item

Function result

Index of the new key

Arguments

AKey

Key value

Description

Add adds a new key AKey of generic type TKey with data value AData to the list and returns the position at which the key was added.

Errors

If the item could not be added, an EListError exception is raised. If Duplicates is set to dupError and a duplicate key is added, an EListError exception is raised.

See also

TFPGMap.Keys | Indexed access to the keys in the list.
TFPGMap.IndexOf | Find index of a key in the list.
TFPGMap.KeyData | Access to data based on key
TFPGMap.Data | Indexed access to the data in the list
TFPSMap.Duplicates | What to do with duplicate key values


TFPGMap.AddOrSetData

Add data with given or set value if the key already exists.

Declaration

Source position: fgl.pp line 314

public procedure TFPGMap.AddOrSetData(

  const AKey: TKey;

  const AData: TData

);

Description

AddOrSetData will check if key AKey already exists. if yes, the value associated with it will be replaced with AData. If the key does not yet exist, it will be added with value AData.

Errors

None.

See also

TFPGMap.TryGetData | Find data or return default
TFPGMap.Add | Add a key and value to the map
TFPGMap.Find | Find item based on key


TFPGMap.Create

Create a new instance of the map

Declaration

Source position: fgl.pp line 309

public constructor TFPGMap.Create;

Description

Create instantiates a new map. It mainly initializes the TFPSMap parent with the sized of the key and data.

See also

TFPSMap.Create

Create a new map with given key and data size.


TFPGMap.Data

Indexed access to the data in the list

Declaration

Source position: fgl.pp line 321

public property TFPGMap.Data[Index: Integer] : TData
  read GetData
  write PutData;

Description

Data provides indexed access to the data values in the list. Valid values for Index are in the range [0..Count-1]. Data can always be read or written.

Errors

If the index AIndex is out of range [0..Count-1], an EListError exception will be raised.

See also

TFPSList.Count | Current element count
TFPGMap.Keys | Indexed access to the keys in the list.
TFPGMap.KeyData | Access to data based on key


TFPGMap.Find

Find item based on key

Declaration

Source position: fgl.pp line 312

public function TFPGMap.Find(

  const AKey: TKey;

  out Index: Integer

):Boolean;

Arguments

AKey | Key to search for.
Index | Index of found key

Function result

True if an exact match for AKey was found.

Description

Find will search the key equal to AKey and return its index in AIndex. The return value of the function is True if an exact match for AKey is found, False otherwise.

The behaviour of Find is undefined if the map is not sorted. For unsorted maps, use IndexOf instead.

See also

TFPGMap.IndexOf | Find index of a key in the list.
TFPGMap.IndexOfData | Find index of data value in the list.


TFPGMap.IndexOf

Find index of a key in the list.

Declaration

Source position: fgl.pp line 315

public function TFPGMap.IndexOf(

  const AKey: TKey

):Integer;

Arguments

AKey

Key value to search.

Function result

Index of AKey in the list, -1 if not present.

Description

IndexOf returns the index of AKey in the list, or -1 if the key was not found in the list.

Errors

None.

See also

TFPGMap.Find | Find item based on key
TFPGMap.IndexOfData | Find index of data value in the list.


TFPGMap.IndexOfData

Find index of data value in the list.

Declaration

Source position: fgl.pp line 316

public function TFPGMap.IndexOfData(

  const AData: TData

):Integer;

Arguments

AData

Data value to search

Function result

Index of AData in the list, -1 if not present.

Description

IndexOfData returns the index of AData in the list, or -1 if the data was not found in the list.

Errors

None.

See also

TFPGMap.Find | Find item based on key
TFPGMap.IndexOf | Find index of a key in the list.


TFPGMap.InsertKey

Insert a new key in the list

Declaration

Source position: fgl.pp line 317

public procedure TFPGMap.InsertKey(

  Index: Integer;

  const AKey: TKey

);

Arguments

Index | Index at which to insert AKey
AKey | Key to insert in the list.

Description

InsertKey inserts key AKey at position Index in the list. It is not allowed to insert a key in a sorted list.

Errors

If the index AIndex is out of range [0..Count-1], or the list is sorted, an EListError exception will be raised.

See also

TFPGMap.InsertKeyData | Insert a new key with associated data in the list
TFPGMap.Add | Add a key and value to the map
TFPSMap.Delete
TFPSMap.Remove | Remove a key/value pair from the map.


TFPGMap.InsertKeyData

Insert a new key with associated data in the list

Declaration

Source position: fgl.pp line 318

public procedure TFPGMap.InsertKeyData(

  Index: Integer;

  const AKey: TKey;

  const AData: TData

);

Arguments

Index | Index at which to insert AKey and AData
AKey | Key to insert in the list.
AData | Data to associate with AKey

Description

InsertKey inserts key AKey with associated data AData at position Index in the list. It is not allowed to insert a key in a sorted list.

Errors

If the index AIndex is out of range [0..Count-1], or the list is sorted, an EListError exception will be raised.

See also

TFPGMap.InsertKey | Insert a new key in the list
TFPGMap.Add | Add a key and value to the map
TFPSMap.Delete
TFPGMap.Remove | Remove a key from the list


TFPGMap.KeyData

Access to data based on key

Declaration

Source position: fgl.pp line 322

public property TFPGMap.KeyData[AKey: TKey] : TData
  read GetKeyData
  write PutKeyData;
  default;

Description

KeyData allows access to the data based on the key value AKey. The data can be read and written. When writing, writing using an existing key will overwrite the current data. If it does not exist yet, it will be created. When reading, if the key is not present, an EListError will be raised.

Errors

If the key does not exist, an EListError exception will be raised.

See also

TFPSList.Count | Current element count
TFPGMap.Keys | Indexed access to the keys in the list.
TFPGMap.Data | Indexed access to the data in the list


TFPGMap.Keys

Indexed access to the keys in the list.

Declaration

Source position: fgl.pp line 320

public property TFPGMap.Keys[Index: Integer] : TKey
  read GetKey
  write PutKey;

Description

Keys provides indexed access to the key values in the list. Valid values for Index are in the range [0..Count-1]. Key values can always be read, but can only be written if the list is unsorted.

Errors

If the index AIndex is out of range [0..Count-1], an EListError exception will be raised. The same exception is raised if a key is written and the list is sorted.

See also

TFPSList.Count | Current element count
TFPGMap.Data | Indexed access to the data in the list
TFPGMap.KeyData | Access to data based on key


TFPGMap.OnCompare

Alias for OnKeyCompare

Declaration

Source position: fgl.pp line 323

public property TFPGMap.OnCompare : TKeyCompareFunc
  read FOnKeyCompare
  write SetOnKeyCompare;

Description

OnCompare is a deprecated property, use TFPGMap.OnKeyCompare instead.

See also

TFPGMap.OnKeyCompare

Compare function for key values.


TFPGMap.OnDataCompare

Compare function for data values.

Declaration

Source position: fgl.pp line 325

public property TFPGMap.OnDataCompare : TDataCompareFunc
  read FOnDataCompare
  write SetOnDataCompare;

Description

OnDataCompare can be set to a function that compares data values. The default value for this event is a function that compares data based on a byte-by-byte comparison of the memory block. The function must have the following semantics:

  • If the result of this function is negative, the first data item (Data1) is assumed to be 'less' than the second data item (Data2) and will be moved before the second in the list.
  • If the function result is positive, the first data item (Data1) pointer is assumed to be 'greater than' the second data item (Data2)and will be moved after the second in the list.
  • if the function result is zero, the data items are assumed to be 'equal' and no moving will take place.

See also

TFPGMap.OnKeyCompare

Compare function for key values.


TFPGMap.OnKeyCompare

Compare function for key values.

Declaration

Source position: fgl.pp line 324

public property TFPGMap.OnKeyCompare : TKeyCompareFunc
  read FOnKeyCompare
  write SetOnKeyCompare;

Description

OnKeyCompare can be set to a function that compares key values. The default value for this event is a function that compares keys based on a byte-by-byte comparison of the memory block. The function must have the following semantics:

  • If the result of this function is negative, the first key (key1) is assumed to be 'less' than the second key (key2) and will be moved before the second in the list.
  • If the function result is positive, the first key (key1) pointer is assumed to be 'greater than' the second key (key2)and will be moved after the second in the list.
  • if the function result is zero, the keys are assumed to be 'equal' and no moving will take place.

See also

TFPGMap.OnDataCompare

Compare function for data values.


TFPGMap.Remove

Remove a key from the list

Declaration

Source position: fgl.pp line 319

public function TFPGMap.Remove(

  const AKey: TKey

):Integer;

Arguments

AKey

Key to remove from the list.

Function result

Index of AKey prior to removal.

Description

Remove removes the key AKey from the list, together with its associated data. The function returns the index of AKey prior to removal from the list, or -1 if AKey was not present in the list.

Errors

None.

See also

TFPGMap.InsertKey | Insert a new key in the list
TFPGMap.InsertKeyData | Insert a new key with associated data in the list
TFPGMap.Add | Add a key and value to the map
TFPSMap.Delete


TFPGMap.TryGetData

Find data or return default

Declaration

Source position: fgl.pp line 313

public function TFPGMap.TryGetData(

  const AKey: TKey;

  out AData: TData

):Boolean;

Description

TryGetData will search the map for AKey and return True or False depending on whether the value with the given key was found. If the key was found, the associated value is returned in AData, if it is not found a default value (using Default) is returned.

Errors

None.

See also

TFPGMap.Find

Find item based on key


TFPGMapInterfacedObjectData

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Generic map for reference counted objects

Declaration

Source position: fgl.pp line 377

type generic TFPGMapInterfacedObjectData <TKey,TData>= class(TFPSMap)
public
constructor Create; | Create a new instance of the map
function Add(); | Add a key and value to the map
function Find(); | Find item based on key
function TryGetData(); | Find data or return default
procedure AddOrSetData(); | Add data with given or set value if the key already exists.
function IndexOf(); | Find index of a key in the list.
function IndexOfData(); | Find index of data value in the list.
procedure InsertKey(); | Insert a new key in the list
procedure InsertKeyData(); | Insert a new key with associated data in the list
function Remove(); | Remove a key from the list
property Keys []: TKey; [rw] | Indexed access to the keys in the list.
property Data []: TData; [rw] | Indexed access to the data in the list
property KeyData []: TData; default; [rw] | Access to data based on key
property OnCompare: TKeyCompareFunc; [rw] | Alias for OnKeyCompare
property OnKeyCompare: TKeyCompareFunc; [rw] | Compare function for key values.
property OnDataCompare: TDataCompareFunc; [rw] | Compare function for data values.
end;

Inheritance

TFPGMapInterfacedObjectData | Generic map for reference counted objects
TFPSMap | Basic map object, used in generic maps
TFPSList | Basic list of memory blocks
TObject | Base class of all classes.

Description

TFPGInterfacedObjectMap is a generic map class. It can be used to specialize a map for any key type, with associated data type that requires manual reference counting: any type which implements IInterface. For non-reference counted objects, TFPGMap should be used.

This map class is entirely equivalend to TFPGMap, but operates on data items that require additional reference counting code on the data.

See also

TFPGMap

Generic map


TFPGMapInterfacedObjectData
 |  | Keys
 |  | Data
 |  | KeyData
TFPSMap
 |  | Duplicates
 | ro | KeySize
 | ro | DataSize
 |  | Keys
 |  | Data
 |  | KeyData
 |  | Sorted
TFPSList
 |  | Capacity
 |  | Count
 |  | Items
 | ro | ItemSize
 | ro | List
 |  | First
 |  | Last
TObject


 | Capacity (TFPSList)
 | Count (TFPSList)
 | Data (TFPSMap)
 | Data (TFPGMapInterfacedObjectData)
ro | DataSize (TFPSMap)
 | Duplicates (TFPSMap)
 | First (TFPSList)
 | Items (TFPSList)
ro | ItemSize (TFPSList)
 | KeyData (TFPSMap)
 | KeyData (TFPGMapInterfacedObjectData)
 | Keys (TFPSMap)
 | Keys (TFPGMapInterfacedObjectData)
ro | KeySize (TFPSMap)
 | Last (TFPSList)
ro |


TFPGMapInterfacedObjectData
 | Create
 | Add
 | Find
 | TryGetData
 | AddOrSetData
 | IndexOf
 | IndexOfData
 | InsertKey
 | InsertKeyData
 | Remove
TFPSMap
 | Create
 | Add
 | Find
 | IndexOf
 | IndexOfData
 | Insert
 | InsertKey
 | InsertKeyData
 | Remove
 | Sort
TFPSList
 | Create
 | Destroy
 | Add
 | Clear
 | Delete
 | Error
 | Exchange
 | Expand
 | Extract
 | IndexOf
 | Insert
 | Move
 | Assign
 | Remove
 | Pack
 | Sort
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


Add (TFPSList)

Add (TFPSMap)

Add (TFPGMapInterfacedObjectData)

AddOrSetData (TFPGMapInterfacedObjectData)

AfterConstruction (TObject)

Assign (TFPSList)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Clear (TFPSList)

Create (TObject)

Create (TFPSList)

Create (TFPSMap)

Create (TFPGMapInterfacedObjectData)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Delete (TFPSList)

Destroy (TObject)

Destroy (TFPSList)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

Error (TFPSList)

Exchange (TFPSList)

Expand (TFPSList)

Extract (TFPSList)

FieldAddress (TObject)

Find (TFPSMap)

Find (TFPGMapInterfacedObjectData)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

IndexOf (TFPSList)

IndexOf (TFPSMap)

IndexOf (TFPGMapInterfacedObjectData)

IndexOfData (TFPSMap)

IndexOfData (TFPGMapInterfacedObjectData)

InheritsFrom (TObject)

InitInstance (TObject)

Insert (TFPSList)

Insert (TFPSMap)

InsertKey (TFPSMap)

InsertKey (TFPGMapInterfacedObjectData)

InsertKeyData (TFPSMap)

InsertKeyData (TFPGMapInterfacedObjectData)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

Move (TFPSList)

newinstance (TObject)

Pack (TFPSList)

Remove (TFPSList)

Remove (TFPSMap)

Remove (TFPGMapInterfacedObjectData)

SafeCallException (TObject)

Sort (TFPSList)

Sort (TFPSMap)

StringMessageTable (TObject)

ToString (TObject)

TryGetData (TFPGMapInterfacedObjectData)

UnitName (TObject)


TFPGMapInterfacedObjectData
 | OnCompare
 | OnKeyCompare
 | OnDataCompare
TFPSMap
 | OnPtrCompare
 | OnKeyPtrCompare
 | OnDataPtrCompare
TFPSList
TObject


OnCompare (TFPGMapInterfacedObjectData)

OnDataCompare (TFPGMapInterfacedObjectData)

OnDataPtrCompare (TFPSMap)

OnKeyCompare (TFPGMapInterfacedObjectData)

OnKeyPtrCompare (TFPSMap)

OnPtrCompare (TFPSMap)


TFPGMapInterfacedObjectData.Add

Add a key and value to the map

Declaration

Source position: fgl.pp line 406

public function TFPGMapInterfacedObjectData.Add(

  const AKey: TKey;

  const AData: TData

):Integer;

function TFPGMapInterfacedObjectData.Add(

  const AKey: TKey

):Integer;

Arguments

AKey | Key value
AData | Data item

Function result

Index of the new ke

Arguments

AKey

Key value

Description

Add adds a new key AKey of generic type TKey with data value AData to the list and returns the position at which the key was added.

Errors

If the item could not be added, an EListError exception is raised. If Duplicates is set to dupError and a duplicate key is added, an EListError exception is raised.

See also

TFPGMapInterfacedObjectData.Keys | Indexed access to the keys in the list.
TFPGMapInterfacedObjectData.IndexOf | Find index of a key in the list.
TFPGMapInterfacedObjectData.KeyData | Access to data based on key
TFPGMapInterfacedObjectData.Data | Indexed access to the data in the list
TFPS.Duplicates


TFPGMapInterfacedObjectData.AddOrSetData

Add data with given or set value if the key already exists.

Declaration

Source position: fgl.pp line 410

public procedure TFPGMapInterfacedObjectData.AddOrSetData(

  const AKey: TKey;

  const AData: TData

);

Description

AddOrSetData will check if key AKey already exists. if yes, the value associated with it will be replaced with AData. If the key does not yet exist, it will be added with value AData.

Errors

None.

See also

TFPGMapInterfacedObjectData.TryGetData | Find data or return default
TFPGMapInterfacedObjectData.Add | Add a key and value to the map
TFPGMapInterfacedObjectData.Find | Find item based on key


TFPGMapInterfacedObjectData.Create

Create a new instance of the map

Declaration

Source position: fgl.pp line 405

public constructor TFPGMapInterfacedObjectData.Create;

Description

Create instantiates a new map. It mainly initializes the TFPSMap parent with the sized of the key and data.

See also

TFPSMap.Create

Create a new map with given key and data size.


TFPGMapInterfacedObjectData.Data

Indexed access to the data in the list

Declaration

Source position: fgl.pp line 417

public property TFPGMapInterfacedObjectData.Data[Index: Integer] : TData
  read GetData
  write PutData;

Description

Data provides indexed access to the data values in the list. Valid values for Index are in the range [0..Count-1]. Data can always be read or written.

Errors

If the index AIndex is out of range [0..Count-1], an EListError exception will be raised.

See also

TFPSList.Count | Current element count
TFPGMapInterfacedObjectData.Keys | Indexed access to the keys in the list.
TFPGMapInterfacedObjectData.KeyData | Access to data based on key


TFPGMapInterfacedObjectData.Find

Find item based on key

Declaration

Source position: fgl.pp line 408

public function TFPGMapInterfacedObjectData.Find(

  const AKey: TKey;

  out Index: Integer

):Boolean;

Arguments

AKey | Key to search for
Index | Index of found key

Function result

True if an exact match for AKey was found.

Description

Find will search the first key smaller than or equal to AKey and return its index in AIndex. If the key was not found then -1 is returned. The return value of the function is True if an exact match for AKey is found, False otherwise.

See also

TFPGMapInterfacedObjectData.IndexOf | Find index of a key in the list.
TFPGMapInterfacedObjectData.IndexOfData | Find index of data value in the list.


TFPGMapInterfacedObjectData.IndexOf

Find index of a key in the list.

Declaration

Source position: fgl.pp line 411

public function TFPGMapInterfacedObjectData.IndexOf(

  const AKey: TKey

):Integer;

Arguments

AKey

Key value to search.

Function result

Index of AKey in the list, -1 if not present.

Description

IndexOf returns the index of AKey in the list, or -1 if the key was not found in the list.

Errors

None.

See also

TFPGMapInterfacedObjectData.Find | Find item based on key
TFPGMapInterfacedObjectData.IndexOfData | Find index of data value in the list.


TFPGMapInterfacedObjectData.IndexOfData

Find index of data value in the list.

Declaration

Source position: fgl.pp line 412

public function TFPGMapInterfacedObjectData.IndexOfData(

  const AData: TData

):Integer;

Arguments

AData

Data value to search

Function result

Index of AData in the list, -1 if not present.

Description

IndexOfData returns the index of AData in the list, or -1 if the data was not found in the list.

Errors

None.

See also

TFPGMapInterfacedObjectData.Find | Find item based on key
TFPGMapInterfacedObjectData.IndexOf | Find index of a key in the list.


TFPGMapInterfacedObjectData.InsertKey

Insert a new key in the list

Declaration

Source position: fgl.pp line 413

public procedure TFPGMapInterfacedObjectData.InsertKey(

  Index: Integer;

  const AKey: TKey

);

Arguments

Index | Index at which to insert AKey
AKey | Key to insert in the list.

Description

InsertKey inserts key AKey at position Index in the list. It is not allowed to insert a key in a sorted list.

Errors

If the index AIndex is out of range [0..Count-1], or the list is sorted, an EListError exception will be raised.

See also

TFPGMapInterfacedObjectData.InsertKeyData | Insert a new key with associated data in the list
TFPGMapInterfacedObjectData.Add | Add a key and value to the map
TFPSMapInterfacedObjectData.Delete
TFPSMapInterfacedObjectData.Remove


TFPGMapInterfacedObjectData.InsertKeyData

Insert a new key with associated data in the list

Declaration

Source position: fgl.pp line 414

public procedure TFPGMapInterfacedObjectData.InsertKeyData(

  Index: Integer;

  const AKey: TKey;

  const AData: TData

);

Arguments

Index | Index at which to insert AKey and AData
AKey | Key to insert in the list
AData | Data to associate with AKey

Description

InsertKey inserts key AKey with associated data AData at position Index in the list. It is not allowed to insert a key in a sorted list.

Errors

If the index AIndex is out of range [0..Count-1], or the list is sorted, an EListError exception will be raised.

See also

TFPGMapInterfacedObjectData.InsertKey | Insert a new key in the list
TFPGMapInterfacedObjectData.Add | Add a key and value to the map
TFPSMapInterfacedObjectData.Delete
TFPGMapInterfacedObjectData.Remove | Remove a key from the list


TFPGMapInterfacedObjectData.KeyData

Access to data based on key

Declaration

Source position: fgl.pp line 418

public property TFPGMapInterfacedObjectData.KeyData[AKey: TKey] : TData
  read GetKeyData
  write PutKeyData;
  default;

Description

KeyData allows access to the data based on the key value AKey. The data can be read and written. When writing, writing using an existing key will overwrite the current data. If it does not exist yet, it will be created. When reading, if the key is not present, an EListError will be raised.

Errors

If the key does not exist, an EListError exception will be raised.

See also

TFPSList.Count | Current element count
TFPGMapInterfacedObjectData.Keys | Indexed access to the keys in the list.
TFPGMapInterfacedObjectData.Data | Indexed access to the data in the list


TFPGMapInterfacedObjectData.Keys

Indexed access to the keys in the list.

Declaration

Source position: fgl.pp line 416

public property TFPGMapInterfacedObjectData.Keys[Index: Integer] : TKey
  read GetKey
  write PutKey;

Description

Keys provides indexed access to the key values in the list. Valid values for Index are in the range [0..Count-1]. Key values can always be read, but can only be written if the list is unsorted.

Errors

If the index AIndex is out of range [0..Count-1], an EListError exception will be raised. The same exception is raised if a key is written and the list is sorted.

See also

TFPSList.Count | Current element count
TFPGMapInterfacedObjectData.Data | Indexed access to the data in the list
TFPGMapInterfacedObjectData.KeyData | Access to data based on key


TFPGMapInterfacedObjectData.OnCompare

Alias for OnKeyCompare

Declaration

Source position: fgl.pp line 419

public property TFPGMapInterfacedObjectData.OnCompare : TKeyCompareFunc
  read FOnKeyCompare
  write SetOnKeyCompare;

Description

OnCompare is a deprecated property, use TFPGMapInterfacedObjectData.OnKeyCompare instead.

See also

TFPGMapInterfacedObjectData.OnKeyCompare

Compare function for key values.


TFPGMapInterfacedObjectData.OnDataCompare

Compare function for data values.

Declaration

Source position: fgl.pp line 421

public property TFPGMapInterfacedObjectData.OnDataCompare : TDataCompareFunc
  read FOnDataCompare
  write SetOnDataCompare;

Description

OnDataCompare can be set to a function that compares data values. The default value for this event is a function that compares data based on a byte-by-byte comparison of the memory block. The function must have the following semantics:

  • If the result of this function is negative, the first data item (Data1) is assumed to be 'less' than the second data item (Data2) and will be moved before the second in the list.
  • If the function result is positive, the first data item (Data1) pointer is assumed to be 'greater than' the second data item (Data2)and will be moved after the second in the list.
  • if the function result is zero, the data items are assumed to be 'equal' and no moving will take place.

See also

TFPGMapInterfacedObjectData.OnKeyCompare

Compare function for key values.


TFPGMapInterfacedObjectData.OnKeyCompare

Compare function for key values.

Declaration

Source position: fgl.pp line 420

public property TFPGMapInterfacedObjectData.OnKeyCompare : TKeyCompareFunc
  read FOnKeyCompare
  write SetOnKeyCompare;

Description

OnKeyCompare can be set to a function that compares key values. The default value for this event is a function that compares keys based on a byte-by-byte comparison of the memory block. The function must have the following semantics:

  • If the result of this function is negative, the first key (key1) is assumed to be 'less' than the second key (key2) and will be moved before the second in the list.
  • If the function result is positive, the first key (key1) pointer is assumed to be 'greater than' the second key (key2)and will be moved after the second in the list.
  • if the function result is zero, the keys are assumed to be 'equal' and no moving will take place.

See also

TFPGMapInterfacedObjectData.OnDataCompare

Compare function for data values.


TFPGMapInterfacedObjectData.Remove

Remove a key from the list

Declaration

Source position: fgl.pp line 415

public function TFPGMapInterfacedObjectData.Remove(

  const AKey: TKey

):Integer;

Arguments

AKey

Key to remove from the list

Function result

Index of AKey prior to removal

Description

Remove removes the key AKey from the list, together with its associated data. The function returns the index of AKey prior to removal from the list, or -1 if AKey was not present in the list.

Errors

None.

See also

TFPGMap.InsertKey | Insert a new key in the list
TFPGMap.InsertKeyData | Insert a new key with associated data in the list
TFPGMap.Add | Add a key and value to the map
TFPGMapInterfacedObjectData.Delete


TFPGMapInterfacedObjectData.TryGetData

Find data or return default

Declaration

Source position: fgl.pp line 409

public function TFPGMapInterfacedObjectData.TryGetData(

  const AKey: TKey;

  out AData: TData

):Boolean;

Description

TryGetData will search the map for AKey and return True or False depending on whether the value with the given key was found. If the key was found, the associated value is returned in AData, if it is not found a default value (using Default) is returned.

Errors

None.

See also

TFPGMapInterfacedObjectData.Find

Find item based on key


TFPGMapObject

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Generic map

Declaration

Source position: fgl.pp line 328

type generic TFPGMapObject <TKey,TData>= class(TFPSMap)
public
constructor Create(); | Create a new instance of the map
function Add(); | Add a key and value to the map
function Find(); | Find item based on key
function TryGetData(); | Find data or return default
procedure AddOrSetData(); | Add data with given or set value if the key already exists.
function IndexOf(); | Find index of a key in the list.
function IndexOfData(); | Find index of data value in the list.
procedure InsertKey(); | Insert a new key in the list
procedure InsertKeyData(); | Insert a new key with associated data in the list
function Remove(); | Remove a key from the list
property Keys []: TKey; [rw] | Indexed access to the keys in the list.
property Data []: TData; [rw] | Indexed access to the data in the list
property KeyData []: TData; default; [rw] | Access to data based on key
property OnCompare: TKeyCompareFunc; [rw] | Alias for OnKeyCompare
property OnKeyCompare: TKeyCompareFunc; [rw] | Compare function for key values.
property OnDataCompare: TDataCompareFunc; [rw] | Compare function for data values.
end;

Inheritance

TFPGMapObject | Generic map
TFPSMap | Basic map object, used in generic maps
TFPSList | Basic list of memory blocks
TObject | Base class of all classes.

Description

TFPGMapObject is a generic map class. It can be used to specialize a map for object types, but not objects with automated reference counting: For reference counted interface objects, TFPGMapInterfacedObjectData must be used.

See also

TFPGMapInterfacedObjectData

Generic map for reference counted objects


TFPGMapObject
 |  | Keys
 |  | Data
 |  | KeyData
TFPSMap
 |  | Duplicates
 | ro | KeySize
 | ro | DataSize
 |  | Keys
 |  | Data
 |  | KeyData
 |  | Sorted
TFPSList
 |  | Capacity
 |  | Count
 |  | Items
 | ro | ItemSize
 | ro | List
 |  | First
 |  | Last
TObject


 | Capacity (TFPSList)
 | Count (TFPSList)
 | Data (TFPSMap)
 | Data (TFPGMapObject)
ro | DataSize (TFPSMap)
 | Duplicates (TFPSMap)
 | First (TFPSList)
 | Items (TFPSList)
ro | ItemSize (TFPSList)
 | KeyData (TFPSMap)
 | KeyData (TFPGMapObject)
 | Keys (TFPSMap)
 | Keys (TFPGMapObject)
ro | KeySize (TFPSMap)
 | Last (TFPSList)
ro |


TFPGMapObject
 | Create
 | Add
 | Find
 | TryGetData
 | AddOrSetData
 | IndexOf
 | IndexOfData
 | InsertKey
 | InsertKeyData
 | Remove
TFPSMap
 | Create
 | Add
 | Find
 | IndexOf
 | IndexOfData
 | Insert
 | InsertKey
 | InsertKeyData
 | Remove
 | Sort
TFPSList
 | Create
 | Destroy
 | Add
 | Clear
 | Delete
 | Error
 | Exchange
 | Expand
 | Extract
 | IndexOf
 | Insert
 | Move
 | Assign
 | Remove
 | Pack
 | Sort
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


Add (TFPSList)

Add (TFPSMap)

Add (TFPGMapObject)

AddOrSetData (TFPGMapObject)

AfterConstruction (TObject)

Assign (TFPSList)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Clear (TFPSList)

Create (TObject)

Create (TFPSList)

Create (TFPSMap)

Create (TFPGMapObject)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Delete (TFPSList)

Destroy (TObject)

Destroy (TFPSList)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

Error (TFPSList)

Exchange (TFPSList)

Expand (TFPSList)

Extract (TFPSList)

FieldAddress (TObject)

Find (TFPSMap)

Find (TFPGMapObject)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

IndexOf (TFPSList)

IndexOf (TFPSMap)

IndexOf (TFPGMapObject)

IndexOfData (TFPSMap)

IndexOfData (TFPGMapObject)

InheritsFrom (TObject)

InitInstance (TObject)

Insert (TFPSList)

Insert (TFPSMap)

InsertKey (TFPSMap)

InsertKey (TFPGMapObject)

InsertKeyData (TFPSMap)

InsertKeyData (TFPGMapObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

Move (TFPSList)

newinstance (TObject)

Pack (TFPSList)

Remove (TFPSList)

Remove (TFPSMap)

Remove (TFPGMapObject)

SafeCallException (TObject)

Sort (TFPSList)

Sort (TFPSMap)

StringMessageTable (TObject)

ToString (TObject)

TryGetData (TFPGMapObject)

UnitName (TObject)


TFPGMapObject
 | OnCompare
 | OnKeyCompare
 | OnDataCompare
TFPSMap
 | OnPtrCompare
 | OnKeyPtrCompare
 | OnDataPtrCompare
TFPSList
TObject


OnCompare (TFPGMapObject)

OnDataCompare (TFPGMapObject)

OnDataPtrCompare (TFPSMap)

OnKeyCompare (TFPGMapObject)

OnKeyPtrCompare (TFPSMap)

OnPtrCompare (TFPSMap)


TFPGMapObject.Add

Add a key and value to the map

Declaration

Source position: fgl.pp line 359

public function TFPGMapObject.Add(

  const AKey: TKey;

  const AData: TData

):Integer;

function TFPGMapObject.Add(

  const AKey: TKey

):Integer;

Arguments

AKey | Key value
AData | Data item

Function result

Index of the new key

Arguments

AKey

Key value

Description

Add adds a new key AKey of generic type TKey with data object AData to the list and returns the position at which the key was added.

Errors

If the item could not be added, an EListError exception is raised. If Duplicates is set to dupError and a duplicate key is added, an EListError exception is raised.

See also

TFPGMapObject.Keys | Indexed access to the keys in the list.
TFPGMapObject.IndexOf | Find index of a key in the list.
TFPGMapObject.KeyData | Access to data based on key
TFPGMapObject.Data | Indexed access to the data in the list
TFPSMap.Duplicates | What to do with duplicate key values


TFPGMapObject.AddOrSetData

Add data with given or set value if the key already exists.

Declaration

Source position: fgl.pp line 363

public procedure TFPGMapObject.AddOrSetData(

  const AKey: TKey;

  const AData: TData

);

Description

AddOrSetData will check if key AKey already exists. if yes, the value associated with it will be replaced with AData. If the key does not yet exist, it will be added with value AData.

Errors

None.

See also

TFPGMapObject.TryGetData | Find data or return default
TFPGMapObject.Add | Add a key and value to the map
TFPGMapObject.Find | Find item based on key


TFPGMapObject.Create

Create a new instance of the map

Declaration

Source position: fgl.pp line 357

public constructor TFPGMapObject.Create(

  AFreeObjects: Boolean

);

constructor TFPGMapObject.Create;

Description

Create instantiates a new map. It mainly initializes the TFPSMap parent with the sized of the key and data.

See also

TFPSMap.Create

Create a new map with given key and data size.


TFPGMapObject.Data

Indexed access to the data in the list

Declaration

Source position: fgl.pp line 370

public property TFPGMapObject.Data[Index: Integer] : TData
  read GetData
  write PutData;

Description

Data provides indexed access to the data values in the list. Valid values for Index are in the range [0..Count-1]. Data can always be read or written.

Errors

If the index AIndex is out of range [0..Count-1], an EListError exception will be raised.

See also

TFPSList.Count | Current element count
TFPGMapObject.Keys | Indexed access to the keys in the list.
TFPGMapObject.KeyData | Access to data based on key


TFPGMapObject.Find

Find item based on key

Declaration

Source position: fgl.pp line 361

public function TFPGMapObject.Find(

  const AKey: TKey;

  out Index: Integer

):Boolean;

Arguments

AKey | Key to search for.
Index | Index of found key

Function result

True if an exact match for AKey was found.

Description

Find will search the first key smaller than or equal to AKey and return its index in AIndex. If the key was not found then -1 is returned. The return value of the function is True if an exact match for AKey is found, False otherwise.

See also

TFPGMapObject.IndexOf | Find index of a key in the list.
TFPGMapObject.IndexOfData | Find index of data value in the list.


TFPGMapObject.IndexOf

Find index of a key in the list.

Declaration

Source position: fgl.pp line 364

public function TFPGMapObject.IndexOf(

  const AKey: TKey

):Integer;

Arguments

AKey

Key value to search.

Function result

Index of AKey in the list, -1 if not present.

Description

IndexOf returns the index of AKey in the list, or -1 if the key was not found in the list.

Errors

None.

See also

TFPGMapObject.Find | Find item based on key
TFPGMapObject.IndexOfData | Find index of data value in the list.


TFPGMapObject.IndexOfData

Find index of data value in the list.

Declaration

Source position: fgl.pp line 365

public function TFPGMapObject.IndexOfData(

  const AData: TData

):Integer;

Arguments

AData

Data value to search

Function result

Index of AData in the list, -1 if not present.

Description

IndexOfData returns the index of object AData in the list, or -1 if the data was not found in the list.

Errors

None.

See also

TFPGMapObject.Find | Find item based on key
TFPGMapObject.IndexOf | Find index of a key in the list.


TFPGMapObject.InsertKey

Insert a new key in the list

Declaration

Source position: fgl.pp line 366

public procedure TFPGMapObject.InsertKey(

  Index: Integer;

  const AKey: TKey

);

Arguments

Index | Index at which to insert AKey
AKey | Key to insert in the list.

Description

InsertKey inserts key AKey at position Index in the list. It is not allowed to insert a key in a sorted list.

Errors

If the index AIndex is out of range [0..Count-1], or the list is sorted, an EListError exception will be raised.

See also

TFPGMapObject.InsertKeyData | Insert a new key with associated data in the list
TFPGMapObject.Add | Add a key and value to the map
TFPSMap.Delete
TFPSMap.Remove | Remove a key/value pair from the map.


TFPGMapObject.InsertKeyData

Insert a new key with associated data in the list

Declaration

Source position: fgl.pp line 367

public procedure TFPGMapObject.InsertKeyData(

  Index: Integer;

  const AKey: TKey;

  const AData: TData

);

Arguments

Index | Index at which to insert AKey and AData
AKey | Key to insert in the list.
AData | Data to associate with AKey

Description

InsertKey inserts key AKey with associated data AData at position Index in the list. It is not allowed to insert a key in a sorted list.

Errors

If the index AIndex is out of range [0..Count-1], or the list is sorted, an EListError exception will be raised.

See also

TFPGMapObject.InsertKey | Insert a new key in the list
TFPGMapObject.Add | Add a key and value to the map
TFPSMap.Delete
TFPGMapObject.Remove | Remove a key from the list


TFPGMapObject.KeyData

Access to data based on key

Declaration

Source position: fgl.pp line 371

public property TFPGMapObject.KeyData[AKey: TKey] : TData
  read GetKeyData
  write PutKeyData;
  default;

Description

KeyData allows access to the data based on the key value AKey. The data can be read and written. When writing, writing using an existing key will overwrite the current data. If it does not exist yet, it will be created. When reading, if the key is not present, an EListError will be raised.

Errors

If the key does not exist, an EListError exception will be raised.

See also

TFPSList.Count | Current element count
TFPGMapObject.Keys | Indexed access to the keys in the list.
TFPGMapObject.Data | Indexed access to the data in the list


TFPGMapObject.Keys

Indexed access to the keys in the list.

Declaration

Source position: fgl.pp line 369

public property TFPGMapObject.Keys[Index: Integer] : TKey
  read GetKey
  write PutKey;

Description

Keys provides indexed access to the key values in the list. Valid values for Index are in the range [0..Count-1]. Key values can always be read, but can only be written if the list is unsorted.

Errors

If the index AIndex is out of range [0..Count-1], an EListError exception will be raised. The same exception is raised if a key is written and the list is sorted.

See also

TFPSList.Count | Current element count
TFPGMapObject.Data | Indexed access to the data in the list
TFPGMapObject.KeyData | Access to data based on key


TFPGMapObject.OnCompare

Alias for OnKeyCompare

Declaration

Source position: fgl.pp line 372

public property TFPGMapObject.OnCompare : TKeyCompareFunc
  read FOnKeyCompare
  write SetOnKeyCompare;

Description

OnCompare is a deprecated property, use TFPGMapObject.OnKeyCompare instead.

See also

TFPGMapObject.OnKeyCompare

Compare function for key values.


TFPGMapObject.OnDataCompare

Compare function for data values.

Declaration

Source position: fgl.pp line 374

public property TFPGMapObject.OnDataCompare : TDataCompareFunc
  read FOnDataCompare
  write SetOnDataCompare;

Description

OnDataCompare can be set to a function that compares data values. The default value for this event is a function that compares data based on a byte-by-byte comparison of the memory block. The function must have the following semantics:

  • If the result of this function is negative, the first data item (Data1) is assumed to be 'less' than the second data item (Data2) and will be moved before the second in the list.
  • If the function result is positive, the first data item (Data1) pointer is assumed to be 'greater than' the second data item (Data2)and will be moved after the second in the list.
  • if the function result is zero, the data items are assumed to be 'equal' and no moving will take place.

See also

TFPGMapObject.OnKeyCompare

Compare function for key values.


TFPGMapObject.OnKeyCompare

Compare function for key values.

Declaration

Source position: fgl.pp line 373

public property TFPGMapObject.OnKeyCompare : TKeyCompareFunc
  read FOnKeyCompare
  write SetOnKeyCompare;

Description

OnKeyCompare can be set to a function that compares key values. The default value for this event is a function that compares keys based on a byte-by-byte comparison of the memory block. The function must have the following semantics:

  • If the result of this function is negative, the first key (key1) is assumed to be 'less' than the second key (key2) and will be moved before the second in the list.
  • If the function result is positive, the first key (key1) pointer is assumed to be 'greater than' the second key (key2)and will be moved after the second in the list.
  • if the function result is zero, the keys are assumed to be 'equal' and no moving will take place.

See also

TFPGMapObject.OnDataCompare

Compare function for data values.


TFPGMapObject.Remove

Remove a key from the list

Declaration

Source position: fgl.pp line 368

public function TFPGMapObject.Remove(

  const AKey: TKey

):Integer;

Arguments

AKey

Key to remove from the list.

Function result

Index of AKey prior to removal.

Description

Remove removes the key AKey from the list, together with its associated data. The function returns the index of AKey prior to removal from the list, or -1 if AKey was not present in the list.

Errors

None.

See also

TFPGMapObject.InsertKey | Insert a new key in the list
TFPGMapObject.InsertKeyData | Insert a new key with associated data in the list
TFPGMapObject.Add | Add a key and value to the map
TFPSMap.Delete


TFPGMapObject.TryGetData

Find data or return default

Declaration

Source position: fgl.pp line 362

public function TFPGMapObject.TryGetData(

  const AKey: TKey;

  out AData: TData

):Boolean;

Description

TryGetData will search the map for AKey and return True or False depending on whether the value with the given key was found. If the key was found, the associated value is returned in AData, if it is not found a default value (using Default) is returned.

Errors

None.

See also

TFPGMapObject.Find

Find item based on key


TFPGObjectList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Generic object list

Declaration

Source position: fgl.pp line 153

type generic TFPGObjectList <T>= class(TFPSList)
public
constructor Create(); | Instantiate a new object list.
function Add(); | Add new object of class T to the list.
function Extract(); | Extract an item from the list
property First: T; [rw] | First non-nil item
function GetEnumerator; | Return a list enumerator for T.
function IndexOf(); | Index of item
procedure Insert(); | Insert a new object in the list
property Last: T; [rw] | Last non-Nil object
procedure Assign(); | Copy objects from Source list
function Remove(); | Remove an object from the list.
procedure Sort(); | Sort the objects in the list
property Items []: T; default; [rw] | Indexed access to objects in the list.
property List: PTypeList; [r] | Internal list pointer
property FreeObjects: Boolean; [rw] | Does the list own the objects or not?
end;

Inheritance

TFPGObjectList | Generic object list
TFPSList | Basic list of memory blocks
TObject | Base class of all classes.

Description

TFPGList can be used to specialize a list for any class type T that does not require reference counting (such as interfaced objects). It will specialize to a list with the same methods as TFPSList or classes.TFPList or TFPObjectList

See also

TFPSList | Basic list of memory blocks
classes.TFPList | Class to manage collections of pointers.


TFPGObjectList
 |  | First
 |  | Last
 |  | Items
 | ro | List
 |  | FreeObjects
TFPSList
 |  | Capacity
 |  | Count
 |  | Items
 | ro | ItemSize
 | ro | List
 |  | First
 |  | Last
TObject


 | Capacity (TFPSList)
 | Count (TFPSList)
 | First (TFPSList)
 | First (TFPGObjectList)
 | FreeObjects (TFPGObjectList)
 | Items (TFPSList)
 | Items (TFPGObjectList)
ro | ItemSize (TFPSList)
 | Last (TFPSList)
 | Last (TFPGObjectList)
ro | List (TFPSList)
ro |


TFPGObjectList
 | Create
 | Add
 | Extract
 | GetEnumerator
 | IndexOf
 | Insert
 | Assign
 | Remove
 | Sort
TFPSList
 | Create
 | Destroy
 | Add
 | Clear
 | Delete
 | Error
 | Exchange
 | Expand
 | Extract
 | IndexOf
 | Insert
 | Move
 | Assign
 | Remove
 | Pack
 | Sort
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


Add (TFPSList)

Add (TFPGObjectList)

AfterConstruction (TObject)

Assign (TFPSList)

Assign (TFPGObjectList)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Clear (TFPSList)

Create (TObject)

Create (TFPSList)

Create (TFPGObjectList)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Delete (TFPSList)

Destroy (TObject)

Destroy (TFPSList)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

Error (TFPSList)

Exchange (TFPSList)

Expand (TFPSList)

Extract (TFPSList)

Extract (TFPGObjectList)

FieldAddress (TObject)

Free (TObject)

FreeInstance (TObject)

GetEnumerator (TFPGObjectList)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

IndexOf (TFPSList)

IndexOf (TFPGObjectList)

InheritsFrom (TObject)

InitInstance (TObject)

Insert (TFPSList)

Insert (TFPGObjectList)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

Move (TFPSList)

newinstance (TObject)

Pack (TFPSList)

Remove (TFPSList)

Remove (TFPGObjectList)

SafeCallException (TObject)

Sort (TFPSList)

Sort (TFPGObjectList)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)


TFPGObjectList

TFPSList

TObject


TFPGObjectList.Add

Add new object of class T to the list.

Declaration

Source position: fgl.pp line 176

public function TFPGObjectList.Add(

  const Item: T

):Integer;

Arguments

Item

Item to add to the list.

Function result

Index at which item was added.

Description

Add adds a new item Item of class type T to the list and returns the position at which the item was added.

Errors

If the item could not be added, an EListError exception is raised.

See also

TFPGObjectList.Extract | Extract an item from the list
TFPGObjectList.Items | Indexed access to objects in the list.
TFPGObjectList.IndexOf | Index of item


TFPGObjectList.Assign

Copy objects from Source list

Declaration

Source position: fgl.pp line 184

public procedure TFPGObjectList.Assign(

  Source: TFPGObjectList

);

Arguments

Source

Source list to copy items from.

Description

Assign clears the list and copies all items in Source to the list. The source list must be of the same type as the destination list.

Take care if both the list owns the objects (i.e. have TFPGObjectList.FreeObjects set to True), this may result to access violations.

See also

TFPSList.Clear | Clear the list
TFPGObjectList.Add | Add new object of class T to the list.


TFPGObjectList.Create

Instantiate a new object list.

Declaration

Source position: fgl.pp line 175

public constructor TFPGObjectList.Create(

  FreeObjects: Boolean = True

);

Arguments

FreeObjects

When True the list owns the objects.

Description

Create instantiates a new object list. It will simply call the inherited constructor with the correct item size and will initialize TFPGObjectList.FreeObjects with FreeObjects.

If FreeObjects is true, then the list owns the objects. Freeing or clearing the list will remove all objects from memory by calling the destructor. Deleting or removing an item from the list will also dispose of the element.

See also

TFPGObjectList.FreeObjects

Does the list own the objects or not?


TFPGObjectList.Extract

Extract an item from the list

Declaration

Source position: fgl.pp line 177

public function TFPGObjectList.Extract(

  const Item: T

):T;

Arguments

Item

The extracted item

Function result

The actually removed item, or Nil

Description

Extract removes Item from the list and returns the removed item, or Nil if it was not found.

The extracted object will not be destroyed even if the list owns the objects.

Errors

None.

See also

TFPSList.Delete

Delete an item from the list


TFPGObjectList.First

First non-nil item

Declaration

Source position: fgl.pp line 178

public property TFPGObjectList.First : T
  read GetFirst
  write SetFirst;

Description

First returns the first non-nil item. If no such element is present, Nil is returned.

See also

TFPSList.First | Pointer to first non-empty item in the list
TFPGList.Last | Last non-empty item
TFPSList.Pack | Remove empty items from the list


TFPGObjectList.FreeObjects

Does the list own the objects or not?

Declaration

Source position: fgl.pp line 190

public property TFPGObjectList.FreeObjects : Boolean
  read FFreeObjects
  write FFreeObjects;

Description

FreeObjects indicates whether the list owns the objects or not. If set to True, freeing or clearing the list will remove all objects from memory by calling the destructor. Deleting or removing an item from the list will also dispose of the element.

The initial value for this property is set in the constructor and is True by default.

See also

TFPGObjectList.FreeObjects

Does the list own the objects or not?


TFPGObjectList.GetEnumerator

Return a list enumerator for T.

Declaration

Source position: fgl.pp line 179

public function TFPGObjectList.GetEnumerator: TFPGListEnumeratorSpec;

Function result

A new enumerator

Description

GetEnumerator returns an enumerator for the elements in the list. It is a specialized version of TFPGListEnumerator.

See also

TFPGListEnumerator

Generic list enumerator


TFPGObjectList.IndexOf

Index of item

Declaration

Source position: fgl.pp line 180

public function TFPGObjectList.IndexOf(

  const Item: T

):Integer;

Arguments

Item

Item to search in the list.

Function result

Index of Item in the list or -1 if it is not in the list.

Description

IndexOf returns the index of Item in the list, or -1 if the item does not appear in the list.

Errors

None.

See also

TFPGObjectList.Items | Indexed access to objects in the list.
TFPGObjectList.Insert | Insert a new object in the list
TFPGObjectList.Add | Add new object of class T to the list.


TFPGObjectList.Insert

Insert a new object in the list

Declaration

Source position: fgl.pp line 181

public procedure TFPGObjectList.Insert(

  Index: Integer;

  const Item: T

);

Arguments

Index | Position to insert Item at
Item | Object to insert in the list

Description

Insert inserts a new object (Item) in the list at position Index. The index is zero based and must be less than Count.

Errors

If an invalid index is specified, an EListError exception is raised.

See also

TFPGList.Items | Indexed access to items in the list
TFPGList.Insert | Insert a new item in the list
TFPSList.Add | Add a new item to the list


TFPGObjectList.Items

Indexed access to objects in the list.

Declaration

Source position: fgl.pp line 188

public property TFPGObjectList.Items[Index: Integer] : T
  read Get
  write Put;
  default;

Description

Items provides indexed access to the objects in the list. The objects can be get or set.

The index Index is zero based, and has a maximum value of Count-1.

If the list owns the objects, (TFPGObjectList.FreeObjects is set to True) then the previous object at position Index is freed when setting the property.

Errors

If an invalid index is used, an EListError exception is raised.

See also

TFPSList.Count | Current element count
TFPGObjectList.FreeObjects | Does the list own the objects or not?


TFPGObjectList.Last

Last non-Nil object

Declaration

Source position: fgl.pp line 182

public property TFPGObjectList.Last : T
  read GetLast
  write SetLast;

Description

Last returns the last non-Nil object. If no such element is present, Nil. is returned.

See also

TFPGObjectList.First | First non-nil item
TFPSList.Last | Pointer to last non-empty item in the list


TFPGObjectList.List

Internal list pointer

Declaration

Source position: fgl.pp line 189

public property TFPGObjectList.List : PTypeList
  read GetList;

Description

List is the internal list of objects. It should not be used directly.

See also

TFPGObjectList.Items

Indexed access to objects in the list.


TFPGObjectList.Remove

Remove an object from the list.

Declaration

Source position: fgl.pp line 186

public function TFPGObjectList.Remove(

  const Item: T

):Integer;

Arguments

Item

Object to remove from the list.

Function result

Index of removed object, prior to removal.

Description

Remove removes the object Item from the list, and returns the index of the removed item. If no item was removed, -1 is returned. Only the first object is removed.

If the list owns the objects, (TFPGObjectList.FreeObjects is set to True) then the object is freed.

Errors

None.

See also

TFPGObjectList.IndexOf | Index of item
TFPSList.Delete | Delete an item from the list
TFPGObjectList.FreeObjects | Does the list own the objects or not?


TFPGObjectList.Sort

Sort the objects in the list

Declaration

Source position: fgl.pp line 187

public procedure TFPGObjectList.Sort(

  Compare: TCompareFunc

);

Arguments

Compare

Compare function for 2 objects

Description

Sort sorts the elements in the list using the provided Compare function. The list passes 2 items to the compare function. The result of this function determines how the items will be sorted:

  • If the result of this function is negative, the first object (Item1) is assumed to be 'less' than the second object (Item2) and will be moved before the second in the list.
  • If the function result is positive, the first object (Item1) is assumed to be 'greater than' the second object (Item2)and will be moved after the second in the list.
  • if the function result is zero, the objects are assumed to be 'equal' and no moving will take place.

Errors

None.


TFPSList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Basic list of memory blocks

Declaration

Source position: fgl.pp line 44

type TFPSList = class(TObject)
public
constructor Create(); | Create a new instance of TFPSList
destructor Destroy; override; | Destroy the list instance.
function Add(); | Add a new item to the list
procedure Clear; | Clear the list
procedure Delete(); | Delete an item from the list
class procedure Error(); | Raise an EListError exception.
procedure Exchange(); | Exchange two items in the list
function Expand; | Expand the capacity of the list
procedure Extract(); | delete an element from the list
function IndexOf(); | Search an item in the list
procedure Insert(); | Insert a new item in the list.
procedure Move(); | Moves an item from one position in the list to another.
procedure Assign(); | Copy one list to another
function Remove(); | Remove the item from the list
procedure Pack; | Remove empty items from the list
procedure Sort(); | Sort the list
property Capacity: Integer; [rw] | Current capacity of the list
property Count: Integer; [rw] | Current element count
property Items []: Pointer; default; [rw] | Items in the list
property ItemSize: Integer; [r] | Size of the items in the list
property List: PByte; [r] | Internal list pointer
property First: Pointer; [rw] | Pointer to first non-empty item in the list
property Last: Pointer; [rw] | Pointer to last non-empty item in the list
end;

Inheritance

TFPSList | Basic list of memory blocks
|
TObject | Base class of all classes.

Description

TFPSList can be seen as the generalized equivalent of the classes unit TFPList list. It is used as a base class for the TFPGList, TFPGMap, TFPGObjectList, TFPGInterfacedObjectList and TFPGMapInterfacedObjectData generic classes.

This list is not meant to be used directly, it is an auxiliary class for the actual generic list classes.

See also

classes.TFPList | Class to manage collections of pointers.
TFPGMap | Generic map
TFPGObjectList | Generic object list
TFPGInterfacedObjectList | Generic interfaced object list
TFPGMapInterfacedObjectData | Generic map for reference counted objects


TFPSList
 |  | Capacity
 |  | Count
 |  | Items
 | ro | ItemSize
 | ro | List
 |  | First
 |  | Last
TObject


 | Capacity (TFPSList)
 | Count (TFPSList)
 | First (TFPSList)
 | Items (TFPSList)
ro | ItemSize (TFPSList)
 | Last (TFPSList)
ro |


TFPSList
 | Create
 | Destroy
 | Add
 | Clear
 | Delete
 | Error
 | Exchange
 | Expand
 | Extract
 | IndexOf
 | Insert
 | Move
 | Assign
 | Remove
 | Pack
 | Sort
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


Add (TFPSList)

AfterConstruction (TObject)

Assign (TFPSList)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Clear (TFPSList)

Create (TObject)

Create (TFPSList)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Delete (TFPSList)

Destroy (TObject)

Destroy (TFPSList)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

Error (TFPSList)

Exchange (TFPSList)

Expand (TFPSList)

Extract (TFPSList)

FieldAddress (TObject)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

IndexOf (TFPSList)

InheritsFrom (TObject)

InitInstance (TObject)

Insert (TFPSList)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

Move (TFPSList)

newinstance (TObject)

Pack (TFPSList)

Remove (TFPSList)

SafeCallException (TObject)

Sort (TFPSList)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)


TFPSList

TObject


TFPSList.Add

Add a new item to the list

Declaration

Source position: fgl.pp line 71

public function TFPSList.Add(

  Item: Pointer

):Integer;

Arguments

Item

Pointer to the item to be added.

Function result

The index at which the item was added.

Description

Add adds the item pointed to by Item to the list. It is not the pointer Item itself which is added to the list, but rather the TFPSList.ItemSize bytes of memory to which Item is pointing.

The function returns the index of the newly added item.

Errors

If the maximum list size is reached, an EListError is raised.

See also

TFPSList.Delete | Delete an item from the list
TFPSList.Items | Items in the list
TFPSList.Clear | Clear the list


TFPSList.Assign

Copy one list to another

Declaration

Source position: fgl.pp line 82

public procedure TFPSList.Assign(

  Obj: TFPSList

);

Arguments

Obj

Source list from which to copy items.

Description

Assign clears the list and will add all items from Obj to the list. The items are copied one by one.

Errors

If the TFPSList.ItemSize differs for the two lists, an EListError exception is raised.

See also

TFPSList.Add

Add a new item to the list


TFPSList.Capacity

Current capacity of the list

Declaration

Source position: fgl.pp line 86

public property TFPSList.Capacity : Integer
  read FCapacity
  write SetCapacity;

Description

Capacity is the current capacity (maximum amount of elements) of the list. The list capacity will expand automatically if an item is added and the capacity is reached (i.e. TFPSList.Count equals capacity. Expanding the list is an expensive operation involving reallocation of memory and moving of list data in memort, so capacity can be set to a large amount to avoid frequent reallocations.

See also

TFPSList.Count | Current element count
TFPSList.Expand | Expand the capacity of the list
TFPSList.Items | Items in the list


TFPSList.Clear

Clear the list

Declaration

Source position: fgl.pp line 72

public procedure TFPSList.Clear;

Description

Clear removes all the items in the list. Depending on the descendent, the list items themselves may be cleared as well.

See also

TFPSList.Delete | Delete an item from the list
TFPSList.Items | Items in the list
TFPSList.Add | Add a new item to the list


TFPSList.Count

Current element count

Declaration

Source position: fgl.pp line 87

public property TFPSList.Count : Integer
  read FCount
  write SetCount;

Description

Count is the current amount of elements in the list. It is initially zero. A valid item index is always a value between zero and Count-1.

See also

TFPSList.Items | Items in the list
TFPSList.Capacity | Current capacity of the list


TFPSList.Create

Create a new instance of TFPSList

Declaration

Source position: fgl.pp line 69

public constructor TFPSList.Create(

  AItemSize: Integer = sizeof(Pointer)

);

Arguments

AItemSize

Size of items in the list

Description

Create creates a new instance of TFPSList, and initializes the item size to ItemSize, which defaults to the size of a pointer.

See also

TFPSList.ItemSize | Size of the items in the list
TFPSList.Destroy | Destroy the list instance.


TFPSList.Delete

Delete an item from the list

Declaration

Source position: fgl.pp line 73

public procedure TFPSList.Delete(

  Index: Integer

);

Arguments

Index

Item to delete from the list/

Description

Delete deletes the item at position Index from the list. Depending on the descendent, the list items itself may be cleared as well.

Errors

If Index is out of bounds, an EListError exception is raised.

See also

TFPSList.Clear | Clear the list
TFPSList.Items | Items in the list
TFPSList.Add | Add a new item to the list


TFPSList.Destroy

Destroy the list instance.

Declaration

Source position: fgl.pp line 70

public destructor TFPSList.Destroy; override;

Description

Destroy clears and cleans up the list instance. Depending on the descendant, this may also remove the items in the list from memory.

See also

TFPSList.Clear

Clear the list


TFPSList.Error

Raise an EListError exception.

Declaration

Source position: fgl.pp line 74

public class procedure TFPSList.Error(

  const Msg: string;

  Data: PtrInt

);

Arguments

Msg | Message (will be formatted with Data)
Data | Integer index

Description

Error is an auxiliary routine which raises an EListError exception formatted from Msg and Data.

See also

EListError

Exception thrown when a list-related error occurs


TFPSList.Exchange

Exchange two items in the list

Declaration

Source position: fgl.pp line 75

public procedure TFPSList.Exchange(

  Index1: Integer;

  Index2: Integer

);

Arguments

Index1 | First item
Index2 | Second item

Description

Exchange will exchange 2 items at positions Index1 and Index2 in the list.

Errors

If Index1 or Index2 are out of bounds, an EListError exception is raised.


TFPSList.Expand

Expand the capacity of the list

Declaration

Source position: fgl.pp line 76

public function TFPSList.Expand: TFPSList;

Function result

Self

Description

Expand will expand the capacity of the list, and returns itself.

Errors

If the size will become larger than MaxListSize an EListError exception will be raised.

See also

MaxListSize | Maximum amount of elements in a list
TFPSList.Capacity | Current capacity of the list


TFPSList.Extract

delete an element from the list

Declaration

Source position: fgl.pp line 77

public procedure TFPSList.Extract(

  Item: Pointer;

  ResultPtr: Pointer

);

Arguments

Item | Pointer to item to extract
ResultPtr | The actually removed item.

Description

Extract removes the item pointed to by Item from the list. It returns a pointer to the actually removed item from the list. The item is searched using TFPSList.IndexOf. If the item is not found, nil is returned.

Some descendents own the items in the list. Extract will not dispose of the item, as TFPSList.Delete does.

Errors

None.

See also

TFPSList.Delete | Delete an item from the list
TFPSList.Add | Add a new item to the list
TFPSList.IndexOf | Search an item in the list


TFPSList.First

Pointer to first non-empty item in the list

Declaration

Source position: fgl.pp line 91

public property TFPSList.First : Pointer
  read GetFirst
  write SetFirst;

Description

First returns the value of the first non-empty item in the list. An item is considered empty if consists of TFPSList.ItemSize zero bytes.

If there are no non-empty items in the list, then Nil is returned.

See also

TFPSList.Last | Pointer to last non-empty item in the list
TFPSList.Pack | Remove empty items from the list


TFPSList.IndexOf

Search an item in the list

Declaration

Source position: fgl.pp line 78

public function TFPSList.IndexOf(

  Item: Pointer

):Integer;

Arguments

Item

Pointer to item to search for.

Function result

Position in the list (0-based)

Description

IndexOf searches in the list for the item pointed to by Item, and returns the position (0-based index) of the item in the list, or -1 if it was not found. The items are compared using system.CompareMem, so an exact memory layout match.

See also

TFPSList.Extract

delete an element from the list


TFPSList.Insert

Insert a new item in the list.

Declaration

Source position: fgl.pp line 79

public procedure TFPSList.Insert(

  Index: Integer;

  Item: Pointer

);

function TFPSList.Insert(

  Index: Integer

):Pointer;

Arguments

Index | Index at which to insert the new item in the list
Item | Item to insert in the list

Arguments

Index

Index at which to insert the new item in the list

Function result

Newly allocated slot in the list

Description

Insert comes in 2 overloaded version. The version without Item creates a slot for a new item at position Index in the list, and returns a pointer to the new slot. The slot will be of size TFPSList.ItemSize.

The version with Item argument will allocate a slot in the list at position Index and will copy the item pointed to by Item to the slot in the list.

In both cases, Index must be 0-based.

Errors

If Index is invalid, an EListError exception will be raised.

See also

TFPSList.Add | Add a new item to the list
TFPSList.Delete | Delete an item from the list
TFPSList.Extract | delete an element from the list


TFPSList.Items

Items in the list

Declaration

Source position: fgl.pp line 88

public property TFPSList.Items[Index: Integer] : Pointer
  read Get
  write Put;
  default;

Description

Items provides indexed access to the items in the list, the returned pointers are not the actual list items, but pointers to the elements in the list. The items can be get or set.

When assigning to the Items property, the memory area pointed to by the assigned pointer is copied to the list. Exactly TFPSList.ItemSize bytes are copied.

The index Index is zero based, and has a maximum value of Count-1.

Errors

If an invalid index is used, an EListError exception is raised.

See also

TFPSList.ItemSize | Size of the items in the list
TFPSList.Count | Current element count


TFPSList.ItemSize

Size of the items in the list

Declaration

Source position: fgl.pp line 89

public property TFPSList.ItemSize : Integer
  read FItemSize;

Description

ItemSize is the memory size of the items in the list. It is specified in the constructor and cannot be changed during the lifetime of the list.

See also

TFPSList.Create

Create a new instance of TFPSList


TFPSList.Last

Pointer to last non-empty item in the list

Declaration

Source position: fgl.pp line 92

public property TFPSList.Last : Pointer
  read GetLast
  write SetLast;

Description

Last returns the value of the last non-empty item in the list. An item is considered empty if consists of TFPSList.ItemSize zero bytes.

If there are no non-empty items in the list, then Nil is returned.

See also

TFPSList.Last | Pointer to last non-empty item in the list
TFPSList.Pack | Remove empty items from the list


TFPSList.List

Internal list pointer

Declaration

Source position: fgl.pp line 90

public property TFPSList.List : PByte
  read FList;

Description

List is a pointer to the memory area used for the items in the list. It should not be manipulated.


TFPSList.Move

Moves an item from one position in the list to another.

Declaration

Source position: fgl.pp line 81

public procedure TFPSList.Move(

  CurIndex: Integer;

  NewIndex: Integer

);

Arguments

CurIndex | Item's current position in the list.
NewIndex | Items new position in the list.

Description

Move moves the item at position CurIndex to position NewIndex. This is done by storing the value at position CurIndex, deleting the pointer at position CurIndex, and reinserting the value at position NewIndex

Errors

If CurIndex or Newindex are not inside the valid range of indices, an EListError exception is raised.

See also

Exchange

Exchange two items in the list


TFPSList.Pack

Remove empty items from the list

Declaration

Source position: fgl.pp line 84

public procedure TFPSList.Pack;

Description

Pack will remove all empty items from the list. An item is considered to be empty if the memory location where the item is stored contains only zero bytes.

See also

TFPSList.Clear | Clear the list
TFPSList.Sort | Sort the list


TFPSList.Remove

Remove the item from the list

Declaration

Source position: fgl.pp line 83

public function TFPSList.Remove(

  Item: Pointer

):Integer;

Arguments

Item

Removed item

Function result

Index of removed item

Description

Remove searches Item in the list, and deletes it from the list. It returns the index of the item that was removed, or -1 if it was not found. Only the first match is removed.

If a descendent of TFPSList owns the object of the list, the item is removed from memory. If this is not desired, then TFPSList.Extract must be used instead.

See also

TFPSList.Extract | delete an element from the list
TFPSList.IndexOf | Search an item in the list


TFPSList.Sort

Sort the list

Declaration

Source position: fgl.pp line 85

public procedure TFPSList.Sort(

  Compare: TFPSListCompareFunc

);

Arguments

Compare

Function to compare 2 items in the list

Description

Sort> sorts the items in the list. Two pointers are compared by passing them to the Compare function. The result of this function determines how the pointers will be sorted:

  • If the result of this function is negative, the first item is assumed to be 'less' than the second and will be moved before the second item in the list.
  • If the function result is positive, the first item is assumed to be 'greater than' the second and will be moved after the second item in the list.
  • if the function result is zero, the pointers are assumed to be 'equal' and no moving will take place.

The sort is done using a quicksort algorithm.

See also

TFPSListCompareFunc

Compare list items callback signature


TFPSListCompareFunc

Compare list items callback signature

Declaration

Source position: fgl.pp line 42

type TFPSListCompareFunc = function(

  Key1: Pointer;

  Key2: Pointer

):Integer of object;

Arguments

Key1 | First key value
Key2 | Second key value

Function result

Is key1 less than key2

Description

TFPSListCompareFunc is used in the TFPSList.Sort method to compare 2 elements. The list passes 2 pointers to the actual items to the compare function. The result of this function determines how the pointers will be sorted:

  • If the result of this function is negative, the first key (key1) is assumed to be 'less' than the second key (key2) and will be moved before the second in the list.
  • If the function result is positive, the first key (key1) pointer is assumed to be 'greater than' the second key (key2)and will be moved after the second in the list.
  • if the function result is zero, the keys are assumed to be 'equal' and no moving will take place.

See also

TFPSList.Sort

Sort the list


TFPSMap

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Basic map object, used in generic maps

Declaration

Source position: fgl.pp line 231

type TFPSMap = class(TFPSList)
public
constructor Create(); | Create a new map with given key and data size.
function Add(); | Add a key, value pair to the map.
function Find(); | Find data using the associated key
function IndexOf(); | Index of key pointed to by AKey
function IndexOfData(); | Index of data item AData
function Insert(); | Insert a new slot for key and associated data item in the list
procedure InsertKey(); | Insert a key in the list
procedure InsertKeyData(); | Insert a key and associated in the list
function Remove(); | Remove a key/value pair from the map.
procedure Sort; | Sort the list according to key
property Duplicates: TDuplicates; [rw] | What to do with duplicate key values
property KeySize: Integer; [r] | Size (in bytes) for the key
property DataSize: Integer; [r] | Size (in bytes) for the data associated with keys
property Keys []: Pointer; [rw] | Indexed access to the locations of all keys
property Data []: Pointer; [rw] | Indexed access to the locations of all data items
property KeyData []: Pointer; default; [rw] | Access to data locations using key
property Sorted: Boolean; [rw] | Is the map permanently sorted on key ?
property OnPtrCompare: TFPSListCompareFunc; [rw] | Alias for OnKeyPtrCompare
property OnKeyPtrCompare: TFPSListCompareFunc; [rw] | Callback to compare 2 keys
property OnDataPtrCompare: TFPSListCompareFunc; [rw] | Callback to compare 2 data items
end;

Inheritance

TFPSMap | Basic map object, used in generic maps
|
TFPSList | Basic list of memory blocks
|
TObject | Base class of all classes.

Description

TFPSMap can be used to create a map for any type T that does not require reference counting (such as interfaced objects). It will specialize to a map which is a generalized list with an arbitrary type as the list index (called the key).

This class should normally not be used directly, instead use one of the generic map objects such as TFPGMap.

See also

TFPGMap

Generic map


TFPSMap
 |  | Duplicates
 | ro | KeySize
 | ro | DataSize
 |  | Keys
 |  | Data
 |  | KeyData
 |  | Sorted
TFPSList
 |  | Capacity
 |  | Count
 |  | Items
 | ro | ItemSize
 | ro | List
 |  | First
 |  | Last
TObject


ro | DataSize (TFPSMap)
 | Duplicates (TFPSMap)
 | First (TFPSList)
 | Items (TFPSList)
ro | ItemSize (TFPSList)
 | KeyData (TFPSMap)
 | Keys (TFPSMap)
ro | KeySize (TFPSMap)
 | Last (TFPSList)
ro |


TFPSMap
 | Create
 | Add
 | Find
 | IndexOf
 | IndexOfData
 | Insert
 | InsertKey
 | InsertKeyData
 | Remove
 | Sort
TFPSList
 | Create
 | Destroy
 | Add
 | Clear
 | Delete
 | Error
 | Exchange
 | Expand
 | Extract
 | IndexOf
 | Insert
 | Move
 | Assign
 | Remove
 | Pack
 | Sort
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


Add (TFPSList)

Add (TFPSMap)

AfterConstruction (TObject)

Assign (TFPSList)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Clear (TFPSList)

Create (TObject)

Create (TFPSList)

Create (TFPSMap)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Delete (TFPSList)

Destroy (TObject)

Destroy (TFPSList)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

Error (TFPSList)

Exchange (TFPSList)

Expand (TFPSList)

Extract (TFPSList)

FieldAddress (TObject)

Find (TFPSMap)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

IndexOf (TFPSList)

IndexOf (TFPSMap)

IndexOfData (TFPSMap)

InheritsFrom (TObject)

InitInstance (TObject)

Insert (TFPSList)

Insert (TFPSMap)

InsertKey (TFPSMap)

InsertKeyData (TFPSMap)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

Move (TFPSList)

newinstance (TObject)

Pack (TFPSList)

Remove (TFPSList)

Remove (TFPSMap)

SafeCallException (TObject)

Sort (TFPSList)

Sort (TFPSMap)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)


TFPSMap
 | OnPtrCompare
 | OnKeyPtrCompare
 | OnDataPtrCompare
TFPSList
TObject


OnDataPtrCompare (TFPSMap)

OnKeyPtrCompare (TFPSMap)

OnPtrCompare (TFPSMap)


TFPSMap.Add

Add a key, value pair to the map.

Declaration

Source position: fgl.pp line 258

public function TFPSMap.Add(

  AKey: Pointer;

  AData: Pointer

):Integer;

function TFPSMap.Add(

  AKey: Pointer

):Integer;

Arguments

AKey | Pointer to key to add to list
AData | Pointer to data to add to list

Function result

Slot in the list for the key and data.

Arguments

AKey

Pointer to key to add to list

Description

Add adds the memory pointed to by AData to the map using the memory pointed to by AKey as the key. If no data is specified, it allocates a slot fot AKey and returns a pointer to that slot.

Errors

If the maximum amount of values is reached, Add will raise an EListError exception.

See also

TFPSMap.Insert | Insert a new slot for key and associated data item in the list
TFPSMap.IndexOf | Index of key pointed to by AKey


TFPSMap.Create

Create a new map with given key and data size.

Declaration

Source position: fgl.pp line 256

public constructor TFPSMap.Create(

  AKeySize: Integer = sizeof(Pointer);

  ADataSize: Integer = sizeof(Pointer)

);

Arguments

AKeySize | Size for map keys
ADataSize | Size for map data

Description

Create instantiates a new TFPSMap instance and initializes TFPSMap.KeySize and TFPSMap.DataSize with AKeySize and ADataSize, respectively. It also initializes the TFPSMap.OnDataPtrCompare and TFPSMap.OnKeyPtrCompare properties to functions that compare memory blocks.

Errors

None.

See also

TFPSMap.Destroy
TFPSMap.KeySize | Size (in bytes) for the key
TFPSMap.DataSize | Size (in bytes) for the data associated with keys
TFPSMap.OnDataPtrCompare | Callback to compare 2 data items
TFPSMap.OnKeyPtrCompare | Callback to compare 2 keys


TFPSMap.Data

Indexed access to the locations of all data items

Declaration

Source position: fgl.pp line 273

public property TFPSMap.Data[Index: Integer] : Pointer
  read GetData
  write PutData;

Description

Data provides indexed access to all data. It does not return the actual data, but returns a pointer to the data. When setting the Data property, a pointer to the data value must be set, and the data value is copied from the pointer.

See also

TFPSMap.DataSize | Size (in bytes) for the data associated with keys
TFPSMap.KeyData | Access to data locations using key
TFPSMap.Keys | Indexed access to the locations of all keys


TFPSMap.DataSize

Size (in bytes) for the data associated with keys

Declaration

Source position: fgl.pp line 271

public property TFPSMap.DataSize : Integer
  read FDataSize;

Description

DataSize is the size (in bytes) for the data in the map. This size is initialized during list construction and defaults to the size of a pointer.

See also

TFPSMap.Create | Create a new map with given key and data size.
TFPSMap.KeySize | Size (in bytes) for the key
TFPSMap.Keys | Indexed access to the locations of all keys
TFPSMap.KeyData | Access to data locations using key
TFPSMap.Data | Indexed access to the locations of all data items


TFPSMap.Duplicates

What to do with duplicate key values

Declaration

Source position: fgl.pp line 269

public property TFPSMap.Duplicates : TDuplicates
  read FDuplicates
  write FDuplicates;

Description

Duplicates can be set to determine what to do with duplicate key values in the map:

dupIgnore
Ignore the new item, do not add it to the list.
dupAccept
Accept duplicates, adding them to the list.
dupError
Raise an error when an attempt is made to add a duplicate.

The value is ignored if Sorted is False.

See also

TFPSMap.Sorted | Is the map permanently sorted on key ?
types.TDuplicates | Enumeration type, indicating what to do with duplicates in a list.


TFPSMap.Find

Find data using the associated key

Declaration

Source position: fgl.pp line 260

public function TFPSMap.Find(

  AKey: Pointer;

  out Index: Integer

):Boolean;

Arguments

AKey | Key to search for
Index | Index of first key smaller than Akey

Function result

True if an exact match was found

Description

Find searches for the first key less than or equal to AKey and returns its index in the list in Index. It returns True if an exact match for the key was found. It returns False if the key was not found, and Index is then set to -1

This function performs a binary search using the key comparing function specified in OnKeyPtrCompare.

Errors

if OnKeyPtrCompare is not set, an access violation will occur.

See also

TFPSMap.OnKeyPtrCompare

Callback to compare 2 keys


TFPSMap.IndexOf

Index of key pointed to by AKey

Declaration

Source position: fgl.pp line 261

public function TFPSMap.IndexOf(

  AKey: Pointer

):Integer;

Arguments

AKey

key to search for

Function result

Index of AKey or -1 if AKey was not found.

Description

IndexOf returns the index of the element with a key pointed to by AKey. It returns -1 if the key was not found.

If the list is sorted, then a binary search is performed, otherwise a linear search is used to find the key.

Errors

None.

See also

TFPSMap.Find | Find data using the associated key
TFPSMap.IndexOfData | Index of data item AData
TFPSMap.Keys | Indexed access to the locations of all keys
TFPSMap.Data | Indexed access to the locations of all data items


TFPSMap.IndexOfData

Index of data item AData

Declaration

Source position: fgl.pp line 262

public function TFPSMap.IndexOfData(

  AData: Pointer

):Integer;

Arguments

AData

Data item to search for.

Function result

Index of AData in the Data

Description

IndexOfData returns the index of the element with data pointed to by AData. It returns -1 if the data item was not found. The search is always performed using a linear search.

See also

TFPSMap.Find | Find data using the associated key
TFPSMap.IndexOf | Index of key pointed to by AKey
TFPSMap.Keys | Indexed access to the locations of all keys
TFPSMap.Data | Indexed access to the locations of all data items


TFPSMap.Insert

Insert a new slot for key and associated data item in the list

Declaration

Source position: fgl.pp line 263

public function TFPSMap.Insert(

  Index: Integer

):Pointer;

procedure TFPSMap.Insert(

  Index: Integer;

  out AKey: Pointer;

  out AData: Pointer

);

Arguments

Index

Index to insert new key, value pair

Function result

Slot to add data to

Arguments

Index | Index to insert new key, value pair
AKey | Pointer to location for key value
AData | Pointer to location for data value

Description

Insert will allocate a new slot in the list. It returns a pointer to the new slot. If Akey and AData are given, then they will point to the positions in the slot for the key and data items.

Errors

If the maximum amount of values is reached or an invalid index is specified, Insert will raise an EListError exception.

See also

TFPSMap.Add | Add a key, value pair to the map.
TFPSMap.InsertKey | Insert a key in the list
TFPSMap.InsertKeyData | Insert a key and associated in the list


TFPSMap.InsertKey

Insert a key in the list

Declaration

Source position: fgl.pp line 265

public procedure TFPSMap.InsertKey(

  Index: Integer;

  AKey: Pointer

);

Arguments

Index | Index at which position key must be inserted
AKey | Pointer to Key value to insert

Description

InsertKey will allocate a new slot in the list for a key value as pointed to by AKey, and copy the key pointed to by AKey to the slot.

Errors

If the maximum amount of values is reached or an invalid index is specified, InsertKey will raise an EListError exception.

See also

TFPSMap.Add | Add a key, value pair to the map.
TFPSMap.Insert | Insert a new slot for key and associated data item in the list
TFPSMap.InsertKeyData | Insert a key and associated in the list


TFPSMap.InsertKeyData

Insert a key and associated in the list

Declaration

Source position: fgl.pp line 266

public procedure TFPSMap.InsertKeyData(

  Index: Integer;

  AKey: Pointer;

  AData: Pointer

);

Arguments

Index | Index at which to insert key and value
AKey | Pointer to key value
AData | Pointer to data value

Description

InsertKeyData will allocate a new slot in the list for a key value as pointed to by AKey, and copy the key pointed to by AKey as well as the data pointed to by AData to the newly allocated slot.

Errors

If the maximum amount of values is reached or an invalid index is specified, InsertKeyData will raise an EListError exception.

See also

TFPSMap.Add | Add a key, value pair to the map.
TFPSMap.Insert | Insert a new slot for key and associated data item in the list
TFPSMap.InsertKey | Insert a key in the list


TFPSMap.KeyData

Access to data locations using key

Declaration

Source position: fgl.pp line 274

public property TFPSMap.KeyData[Key: Pointer] : Pointer
  read GetKeyData
  write PutKeyData;
  default;

Description

KeyData provides access to the data items, using their key value (as pointed to by AKey) as an index. When reading a non-existent key value, Nil is returned. If the key is found, a pointer to the associated data's location is returned. When writing, the key pointed to by Key is added if it was not present, and the data data is copied from the written pointer.

See also

TFPSMap.DataSize | Size (in bytes) for the data associated with keys
TFPSMap.KeyData | Access to data locations using key
TFPSMap.Data | Indexed access to the locations of all data items
TFPSMap.Keys | Indexed access to the locations of all keys
TFPSMap.KeySize | Size (in bytes) for the key


TFPSMap.Keys

Indexed access to the locations of all keys

Declaration

Source position: fgl.pp line 272

public property TFPSMap.Keys[Index: Integer] : Pointer
  read GetKey
  write PutKey;

Description

Keys provides indexed access to all keys. It does not return the key, but returns a pointer to the key value. When setting the Keys property, a pointer to the key value must be set, and the key value is copied from the pointer.

See also

TFPSMap.KeySize | Size (in bytes) for the key
TFPSMap.KeyData | Access to data locations using key
TFPSMap.Data | Indexed access to the locations of all data items


TFPSMap.KeySize

Size (in bytes) for the key

Declaration

Source position: fgl.pp line 270

public property TFPSMap.KeySize : Integer
  read FKeySize;

Description

KeySize is the size (in bytes) for the keys in the map. This size is initialized during list construction and defaults to the size of a pointer.

See also

TFPSMap.Create | Create a new map with given key and data size.
TFPSMap.DataSize | Size (in bytes) for the data associated with keys
TFPSMap.Keys | Indexed access to the locations of all keys
TFPSMap.KeyData | Access to data locations using key


TFPSMap.OnDataPtrCompare

Callback to compare 2 data items

Declaration

Source position: fgl.pp line 278

public property TFPSMap.OnDataPtrCompare : TFPSListCompareFunc
  read FOnDataPtrCompare
  write SetOnDataPtrCompare;

Description

OnKeyPtrCompare is used to compare the values of 2 keys. By default it simply compares the byte values of the key memory block. It can be set to any function that performs another comparison. (e.g. a function that treats the memory blocks as a string pointer and compare the actual strings).

This function is used to find a data item (IndexOf).

See also

TFPSListCompareFunc | Compare list items callback signature
TFPSMap.OnKeyPtrCompare | Callback to compare 2 keys
TFPSMap.IndexOfData | Index of data item AData


TFPSMap.OnKeyPtrCompare

Callback to compare 2 keys

Declaration

Source position: fgl.pp line 277

public property TFPSMap.OnKeyPtrCompare : TFPSListCompareFunc
  read FOnKeyPtrCompare
  write SetOnKeyPtrCompare;

Description

OnKeyPtrCompare is used to compare the values of 2 keys. By default it simply compares the byte values of the key memory block. It can be set to any function that performs another comparison. (e.g. a function that treats the memory blocks as a string pointer and compare the actual strings).

This function is used to sort the list or find a key.

See also

TFPSListCompareFunc | Compare list items callback signature
TFPSMap.OnDataPtrCompare | Callback to compare 2 data items
TFPSMap.Sort | Sort the list according to key
TFPSMap.Find | Find data using the associated key
TFPSMap.IndexOf | Index of key pointed to by AKey


TFPSMap.OnPtrCompare

Alias for OnKeyPtrCompare

Declaration

Source position: fgl.pp line 276

public property TFPSMap.OnPtrCompare : TFPSListCompareFunc
  read FOnKeyPtrCompare
  write SetOnKeyPtrCompare;

Description

OnPtrCompare is a deprecated alias for OnKeyPtrCompare.

See also

TFPSMap.OnKeyPtrCompare | Callback to compare 2 keys
TFPSMap.OnDataPtrCompare | Callback to compare 2 data items


TFPSMap.Remove

Remove a key/value pair from the map.

Declaration

Source position: fgl.pp line 267

public function TFPSMap.Remove(

  AKey: Pointer

):Integer;

Arguments

AKey

Key to remove from the map.

Function result

Index of AKey prior to removal, or -1 if not found.

Description

Remove removes the key/value pair pointing to by AKey from the map. It returns the index of Akey prior to removal from the list. If AKey was not found, -1 is returned.

Errors

None.

See also

TFPSList.Delete | Delete an item from the list
TFPSMap.IndexOf | Index of key pointed to by AKey


TFPSMap.Sort

Sort the list according to key

Declaration

Source position: fgl.pp line 268

public procedure TFPSMap.Sort;

Description

Sort sorts the list according to the key value, using the compare function provided in TFPSMap.OnKeyPtrCompare

Errors

None.

See also

TFPSMap.OnKeyPtrCompare | Callback to compare 2 keys
TFPSMap.OnDataPtrCompare | Callback to compare 2 data items


TFPSMap.Sorted

Is the map permanently sorted on key ?

Declaration

Source position: fgl.pp line 275

public property TFPSMap.Sorted : Boolean
  read FSorted
  write SetSorted;

Description

Sorted can be set to true to keep the map permanently sorted on key value. The sorting happens using TFPSMap.OnKeyPtrCompare.

See also

TFPSMap.OnKeyPtrCompare | Callback to compare 2 keys
TFPSMap.Sort | Sort the list according to key
TFPSMap.Duplicates | What to do with duplicate key values


Tmatrix2_double

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Double precision matrix of two scalars

Declaration

Source position: matrix.pp line 157

type Tmatrix2_double = object
data: Tmatrix2_double_data; | Internal data of Tmatrix2.double
constructor init_zero; | Initializes the matrix and sets its elements to zero
constructor init_identity; | Initializes the matrix and sets its elements to the identity matrix.
constructor init(); | Initializes the matrix, setting its elements to the values passed to the constructor.
function get_column(); | Returns the c-th column of the matrix as vector.
function get_row(); | Returns the r-th row of the matrix as vector.
procedure set_column(); | Sets c-th column of the matrix with a vector.
procedure set_row(); | Sets r-th row of the matrix with a vector.
function determinant; | Calculates the determinant of the matrix.
function inverse(); | Calculates the inverse of the matrix.
function transpose; | Returns the transposition of the matrix.
end;

Inheritance

Tmatrix2_double

Double precision matrix of two scalars

Description

The Tmatrix2_double object provides a matrix of 2*2 double precision scalars.


Tmatrix2_double


Tmatrix2_double
 | init_zero
 | init_identity
 | init
 | get_column
 | get_row
 | set_column
 | set_row
 | determinant
 | inverse
 | transpose


determinant (Tmatrix2_double)

get_column (Tmatrix2_double)

get_row (Tmatrix2_double)

init (Tmatrix2_double)

init_identity (Tmatrix2_double)

init_zero (Tmatrix2_double)

inverse (Tmatrix2_double)

set_column (Tmatrix2_double)

set_row (Tmatrix2_double)

transpose (Tmatrix2_double)


Tmatrix2_double.data

Internal data of Tmatrix2.double

Declaration

Source position: matrix.pp line 158

Tmatrix2_double.data : Tmatrix2_double_data;

Description

See Tmatrix2_double_data.


Tmatrix2_double.determinant

Calculates the determinant of the matrix.

Declaration

Source position: matrix.pp line 166

function Tmatrix2_double.determinant: Double;

Description

Returns the determinant of the matrix.


Tmatrix2_double.get_column

Returns the c-th column of the matrix as vector.

Declaration

Source position: matrix.pp line 162

function Tmatrix2_double.get_column(

  c: Byte

):Tvector2_double;

Description

Returns the c-th column of the matrix as vector. The column numbering starts at 0.


Tmatrix2_double.get_row

Returns the r-th row of the matrix as vector.

Declaration

Source position: matrix.pp line 163

function Tmatrix2_double.get_row(

  r: Byte

):Tvector2_double;

Description

Returns the r-th row of the matrix as vector. The row numbering starts at 0.


Tmatrix2_double.init

Initializes the matrix, setting its elements to the values passed to the constructor.

Declaration

Source position: matrix.pp line 161

constructor Tmatrix2_double.init(

  aa: Double;

  ab: Double;

  ba: Double;

  bb: Double

);

Description

Initializes the matrix, setting its elements to the values passed to the constructor. The order of the values is left to right, then top to bottom.


Tmatrix2_double.init_identity

Initializes the matrix and sets its elements to the identity matrix.

Declaration

Source position: matrix.pp line 160

constructor Tmatrix2_double.init_identity;

Description

Initializes the matrix and sets its elements to the identity matrix, that is, elements to 1 on the left-upper to right-lower diagonal, the rest zero.


Tmatrix2_double.init_zero

Initializes the matrix and sets its elements to zero

Declaration

Source position: matrix.pp line 159

constructor Tmatrix2_double.init_zero;


Tmatrix2_double.inverse

Calculates the inverse of the matrix.

Declaration

Source position: matrix.pp line 167

function Tmatrix2_double.inverse(

  Adeterminant: Double

):Tmatrix2_double;

Description

Tmatrix2_double.inverse returns a new matrix that is the inverse of the matrix. You must pass the determinant of the matrix as parameter.


Tmatrix2_double.set_column

Sets c-th column of the matrix with a vector.

Declaration

Source position: matrix.pp line 164

procedure Tmatrix2_double.set_column(

  c: Byte;

  const v: Tvector2_double

);

Description

Replaces the c-th column of the matrix with vector v. The column numbering starts at 0.


Tmatrix2_double.set_row

Sets r-th row of the matrix with a vector.

Declaration

Source position: matrix.pp line 165

procedure Tmatrix2_double.set_row(

  r: Byte;

  const v: Tvector2_double

);

Description

Replaces the r-th row of the matrix with vector v. The row numbering starts at 0.


Tmatrix2_double.transpose

Returns the transposition of the matrix.

Declaration

Source position: matrix.pp line 168

function Tmatrix2_double.transpose: Tmatrix2_double;

Description

Tmatrix2_double.transpose returns a new matrix that is the transposition of the matrix, that is, the matrix with the x and y coordinates of the values swapped.


Tmatrix2_double_data

Internal data of Tmatrix2_double

Declaration

Source position: matrix.pp line 51

type Tmatrix2_double_data = array [0..1,0..1] of Double;

Description

This is the matrix internal data for a matrix. It uses a simple array structure so data from other libraries that define their own matrix type as a simple array structure can simply be moved to and from this data, or typecasted into it. As this is the only field in the object, the object itself can be used just as fine for typecasting purposes etc.


Tmatrix2_extended

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Extended precision matrix of two scalars

Declaration

Source position: matrix.pp line 171

type Tmatrix2_extended = object
data: Tmatrix2_extended_data; | Internal data of Tmatrix2.extended
constructor init_zero; | Initializes the matrix and sets its elements to zero
constructor init_identity; | Initializes the matrix and sets its elements to the identity matrix.
constructor init(); | Initializes the matrix, setting its elements to the values passed to the constructor.
function get_column(); | Returns the c-th column of the matrix as vector.
function get_row(); | Returns the r-th row of the matrix as vector.
procedure set_column(); | Sets c-th column of the matrix with a vector.
procedure set_row(); | Sets r-th row of the matrix with a vector.
function determinant; | Calculates the determinant of the matrix.
function inverse(); | Calculates the inverse of the matrix.
function transpose; | Returns the transposition of the matrix.
end;

Inheritance

Tmatrix2_extended

Extended precision matrix of two scalars

Description

The Tmatrix2_extended object provides a matrix of 2*2 extended precision scalars.


Tmatrix2_extended


Tmatrix2_extended
 | init_zero
 | init_identity
 | init
 | get_column
 | get_row
 | set_column
 | set_row
 | determinant
 | inverse
 | transpose


determinant (Tmatrix2_extended)

get_column (Tmatrix2_extended)

get_row (Tmatrix2_extended)

init (Tmatrix2_extended)

init_identity (Tmatrix2_extended)

init_zero (Tmatrix2_extended)

inverse (Tmatrix2_extended)

set_column (Tmatrix2_extended)

set_row (Tmatrix2_extended)

transpose (Tmatrix2_extended)


Tmatrix2_extended.data

Internal data of Tmatrix2.extended

Declaration

Source position: matrix.pp line 172

Tmatrix2_extended.data : Tmatrix2_extended_data;

Description

See Tmatrix2_extended_data.


Tmatrix2_extended.determinant

Calculates the determinant of the matrix.

Declaration

Source position: matrix.pp line 180

function Tmatrix2_extended.determinant: extended;

Description

Returns the determinant of the matrix.


Tmatrix2_extended.get_column

Returns the c-th column of the matrix as vector.

Declaration

Source position: matrix.pp line 176

function Tmatrix2_extended.get_column(

  c: Byte

):Tvector2_extended;

Description

Returns the c-th column of the matrix as vector. The column numbering starts at 0.


Tmatrix2_extended.get_row

Returns the r-th row of the matrix as vector.

Declaration

Source position: matrix.pp line 177

function Tmatrix2_extended.get_row(

  r: Byte

):Tvector2_extended;

Description

Returns the r-th row of the matrix as vector. The row numbering starts at 0.


Tmatrix2_extended.init

Initializes the matrix, setting its elements to the values passed to the constructor.

Declaration

Source position: matrix.pp line 175

constructor Tmatrix2_extended.init(

  aa: extended;

  ab: extended;

  ba: extended;

  bb: extended

);

Description

Initializes the matrix, setting its elements to the values passed to the constructor. The order of the values is left to right, then top to bottom.


Tmatrix2_extended.init_identity

Initializes the matrix and sets its elements to the identity matrix.

Declaration

Source position: matrix.pp line 174

constructor Tmatrix2_extended.init_identity;

Description

Initializes the matrix and sets its elements to the identity matrix, that is, elements to 1 on the left-upper to right-lower diagonal, the rest zero.


Tmatrix2_extended.init_zero

Initializes the matrix and sets its elements to zero

Declaration

Source position: matrix.pp line 173

constructor Tmatrix2_extended.init_zero;


Tmatrix2_extended.inverse

Calculates the inverse of the matrix.

Declaration

Source position: matrix.pp line 181

function Tmatrix2_extended.inverse(

  Adeterminant: extended

):Tmatrix2_extended;

Description

Tmatrix2_extended.inverse returns a new matrix that is the inverse of the matrix. You must pass the determinant of the matrix as parameter.


Tmatrix2_extended.set_column

Sets c-th column of the matrix with a vector.

Declaration

Source position: matrix.pp line 178

procedure Tmatrix2_extended.set_column(

  c: Byte;

  const v: Tvector2_extended

);

Description

Replaces the c-th column of the matrix with vector v. The column numbering starts at 0.


Tmatrix2_extended.set_row

Sets r-th row of the matrix with a vector.

Declaration

Source position: matrix.pp line 179

procedure Tmatrix2_extended.set_row(

  r: Byte;

  const v: Tvector2_extended

);

Description

Replaces the r-th row of the matrix with vector v. The row numbering starts at 0.


Tmatrix2_extended.transpose

Returns the transposition of the matrix.

Declaration

Source position: matrix.pp line 182

function Tmatrix2_extended.transpose: Tmatrix2_extended;

Description

Tmatrix2_extended.transpose returns a new matrix that is the transposition of the matrix, that is, the matrix with the x and y coordinates of the values swapped.


Tmatrix2_extended_data

Internal data of Tmatrix2_extended

Declaration

Source position: matrix.pp line 52

type Tmatrix2_extended_data = array [0..1,0..1] of extended;

Description

This is the matrix internal data for a matrix. It uses a simple array structure so data from other libraries that define their own matrix type as a simple array structure can simply be moved to and from this data, or typecasted into it. As this is the only field in the object, the object itself can be used just as fine for typecasting purposes etc.


Tmatrix2_single

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Single precision matrix of two scalars

Declaration

Source position: matrix.pp line 143

type Tmatrix2_single = object
data: Tmatrix2_single_data; | Internal data of Tmatrix2.single
constructor init_zero; | Initializes the matrix and sets its elements to zero
constructor init_identity; | Initializes the matrix and sets its elements to the identity matrix.
constructor init(); | Initializes the matrix, setting its elements to the values passed to the constructor.
function get_column(); | Returns the c-th column of the matrix as vector.
function get_row(); | Returns the r-th row of the matrix as vector.
procedure set_column(); | Sets c-th column of the matrix with a vector.
procedure set_row(); | Sets r-th row of the matrix with a vector.
function determinant; | Calculates the determinant of the matrix.
function inverse(); | Calculates the inverse of the matrix.
function transpose; | Returns the transposition of the matrix.
end;

Inheritance

Tmatrix2_single

Single precision matrix of two scalars

Description

The Tmatrix2_single object provides a matrix of 2*2 single precision scalars.


Tmatrix2_single


Tmatrix2_single
 | init_zero
 | init_identity
 | init
 | get_column
 | get_row
 | set_column
 | set_row
 | determinant
 | inverse
 | transpose


determinant (Tmatrix2_single)

get_column (Tmatrix2_single)

get_row (Tmatrix2_single)

init (Tmatrix2_single)

init_identity (Tmatrix2_single)

init_zero (Tmatrix2_single)

inverse (Tmatrix2_single)

set_column (Tmatrix2_single)

set_row (Tmatrix2_single)

transpose (Tmatrix2_single)


Tmatrix2_single.data

Internal data of Tmatrix2.single

Declaration

Source position: matrix.pp line 144

Tmatrix2_single.data : Tmatrix2_single_data;

Description

See Tmatrix2_single_data.


Tmatrix2_single.determinant

Calculates the determinant of the matrix.

Declaration

Source position: matrix.pp line 152

function Tmatrix2_single.determinant: single;

Description

Returns the determinant of the matrix.


Tmatrix2_single.get_column

Returns the c-th column of the matrix as vector.

Declaration

Source position: matrix.pp line 148

function Tmatrix2_single.get_column(

  c: Byte

):Tvector2_single;

Description

Returns the c-th column of the matrix as vector. The column numbering starts at 0.


Tmatrix2_single.get_row

Returns the r-th row of the matrix as vector.

Declaration

Source position: matrix.pp line 149

function Tmatrix2_single.get_row(

  r: Byte

):Tvector2_single;

Description

Returns the r-th row of the matrix as vector. The row numbering starts at 0.


Tmatrix2_single.init

Initializes the matrix, setting its elements to the values passed to the constructor.

Declaration

Source position: matrix.pp line 147

constructor Tmatrix2_single.init(

  aa: single;

  ab: single;

  ba: single;

  bb: single

);

Description

Initializes the matrix, setting its elements to the values passed to the constructor. The order of the values is left to right, then top to bottom.


Tmatrix2_single.init_identity

Initializes the matrix and sets its elements to the identity matrix.

Declaration

Source position: matrix.pp line 146

constructor Tmatrix2_single.init_identity;

Description

Initializes the matrix and sets its elements to the identity matrix, that is, elements to 1 on the left-upper to right-lower diagonal, the rest zero.


Tmatrix2_single.init_zero

Initializes the matrix and sets its elements to zero

Declaration

Source position: matrix.pp line 145

constructor Tmatrix2_single.init_zero;


Tmatrix2_single.inverse

Calculates the inverse of the matrix.

Declaration

Source position: matrix.pp line 153

function Tmatrix2_single.inverse(

  Adeterminant: single

):Tmatrix2_single;

Description

Tmatrix2_single.inverse returns a new matrix that is the inverse of the matrix. You must pass the determinant of the matrix as parameter.


Tmatrix2_single.set_column

Sets c-th column of the matrix with a vector.

Declaration

Source position: matrix.pp line 150

procedure Tmatrix2_single.set_column(

  c: Byte;

  const v: Tvector2_single

);

Description

Replaces the c-th column of the matrix with vector v. The column numbering starts at 0.


Tmatrix2_single.set_row

Sets r-th row of the matrix with a vector.

Declaration

Source position: matrix.pp line 151

procedure Tmatrix2_single.set_row(

  r: Byte;

  const v: Tvector2_single

);

Description

Replaces the r-th row of the matrix with vector v. The row numbering starts at 0.


Tmatrix2_single.transpose

Returns the transposition of the matrix.

Declaration

Source position: matrix.pp line 154

function Tmatrix2_single.transpose: Tmatrix2_single;

Description

Tmatrix2_single.transpose returns a new matrix that is the transposition of the matrix, that is, the matrix with the x and y coordinates of the values swapped.


Tmatrix2_single_data

Internal data of Tmatrix2_single

Declaration

Source position: matrix.pp line 50

type Tmatrix2_single_data = array [0..1,0..1] of single;

Description

This is the matrix internal data for a matrix. It uses a simple array structure so data from other libraries that define their own matrix type as a simple array structure can simply be moved to and from this data, or typecasted into it. As this is the only field in the object, the object itself can be used just as fine for typecasting purposes etc.


Tmatrix3_double

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Double precision matrix of three scalars

Declaration

Source position: matrix.pp line 199

type Tmatrix3_double = object
data: Tmatrix3_double_data; | Internal data of Tmatrix3.double
constructor init_zero; | Initializes the matrix and sets its elements to zero
constructor init_identity; | Initializes the matrix and sets its elements to the identity matrix.
constructor init(); | Initializes the matrix, setting its elements to the values passed to the constructor.
function get_column(); | Returns the c-th column of the matrix as vector.
function get_row(); | Returns the r-th row of the matrix as vector.
procedure set_column(); | Sets c-th column of the matrix with a vector.
procedure set_row(); | Sets r-th row of the matrix with a vector.
function determinant; | Calculates the determinant of the matrix.
function inverse(); | Calculates the inverse of the matrix.
function transpose; | Returns the transposition of the matrix.
end;

Inheritance

Tmatrix3_double

Double precision matrix of three scalars

Description

The Tmatrix3_double object provides a matrix of 3*3 double precision scalars.


Tmatrix3_double


Tmatrix3_double
 | init_zero
 | init_identity
 | init
 | get_column
 | get_row
 | set_column
 | set_row
 | determinant
 | inverse
 | transpose


determinant (Tmatrix3_double)

get_column (Tmatrix3_double)

get_row (Tmatrix3_double)

init (Tmatrix3_double)

init_identity (Tmatrix3_double)

init_zero (Tmatrix3_double)

inverse (Tmatrix3_double)

set_column (Tmatrix3_double)

set_row (Tmatrix3_double)

transpose (Tmatrix3_double)


Tmatrix3_double.data

Internal data of Tmatrix3.double

Declaration

Source position: matrix.pp line 200

Tmatrix3_double.data : Tmatrix3_double_data;

Description

See Tmatrix3_double_data.


Tmatrix3_double.determinant

Calculates the determinant of the matrix.

Declaration

Source position: matrix.pp line 208

function Tmatrix3_double.determinant: Double;

Description

Returns the determinant of the matrix.


Tmatrix3_double.get_column

Returns the c-th column of the matrix as vector.

Declaration

Source position: matrix.pp line 204

function Tmatrix3_double.get_column(

  c: Byte

):Tvector3_double;

Description

Returns the c-th column of the matrix as vector. The column numbering starts at 0.


Tmatrix3_double.get_row

Returns the r-th row of the matrix as vector.

Declaration

Source position: matrix.pp line 205

function Tmatrix3_double.get_row(

  r: Byte

):Tvector3_double;

Description

Returns the r-th row of the matrix as vector. The row numbering starts at 0.


Tmatrix3_double.init

Initializes the matrix, setting its elements to the values passed to the constructor.

Declaration

Source position: matrix.pp line 203

constructor Tmatrix3_double.init(

  aa: Double;

  ab: Double;

  ac: Double;

  ba: Double;

  bb: Double;

  bc: Double;

  ca: Double;

  cb: Double;

  cc: Double

);

Description

Initializes the matrix, setting its elements to the values passed to the constructor. The order of the values is left to right, then top to bottom.


Tmatrix3_double.init_identity

Initializes the matrix and sets its elements to the identity matrix.

Declaration

Source position: matrix.pp line 202

constructor Tmatrix3_double.init_identity;

Description

Initializes the matrix and sets its elements to the identity matrix, that is, elements to 1 on the left-upper to right-lower diagonal, the rest zero.


Tmatrix3_double.init_zero

Initializes the matrix and sets its elements to zero

Declaration

Source position: matrix.pp line 201

constructor Tmatrix3_double.init_zero;


Tmatrix3_double.inverse

Calculates the inverse of the matrix.

Declaration

Source position: matrix.pp line 209

function Tmatrix3_double.inverse(

  Adeterminant: Double

):Tmatrix3_double;

Description

Tmatrix3_double.inverse returns a new matrix that is the inverse of the matrix. You must pass the determinant of the matrix as parameter.


Tmatrix3_double.set_column

Sets c-th column of the matrix with a vector.

Declaration

Source position: matrix.pp line 206

procedure Tmatrix3_double.set_column(

  c: Byte;

  const v: Tvector3_double

);

Description

Replaces the c-th column of the matrix with vector v. The column numbering starts at 0.


Tmatrix3_double.set_row

Sets r-th row of the matrix with a vector.

Declaration

Source position: matrix.pp line 207

procedure Tmatrix3_double.set_row(

  r: Byte;

  const v: Tvector3_double

);

Description

Replaces the r-th row of the matrix with vector v. The row numbering starts at 0.


Tmatrix3_double.transpose

Returns the transposition of the matrix.

Declaration

Source position: matrix.pp line 210

function Tmatrix3_double.transpose: Tmatrix3_double;

Description

Tmatrix2_double.transpose returns a new matrix that is the transposition of the matrix, that is, the matrix with the x and y coordinates of the values swapped.


Tmatrix3_double_data

Internal data of Tmatrix3_double

Declaration

Source position: matrix.pp line 55

type Tmatrix3_double_data = array [0..2,0..2] of Double;

Description

This is the matrix internal data for a matrix. It uses a simple array structure so data from other libraries that define their own matrix type as a simple array structure can simply be moved to and from this data, or typecasted into it. As this is the only field in the object, the object itself can be used just as fine for typecasting purposes etc.


Tmatrix3_extended

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Extended precision matrix of three scalars

Declaration

Source position: matrix.pp line 213

type Tmatrix3_extended = object
data: Tmatrix3_extended_data; | Internal data of Tmatrix3.extended
constructor init_zero; | Initializes the matrix and sets its elements to zero
constructor init_identity; | Initializes the matrix and sets its elements to the identity matrix.
constructor init(); | Initializes the matrix, setting its elements to the values passed to the constructor.
function get_column(); | Returns the c-th column of the matrix as vector.
function get_row(); | Returns the r-th row of the matrix as vector.
procedure set_column(); | Sets r-th column of the matrix with a vector.
procedure set_row(); | Sets r-th row of the matrix with a vector.
function determinant; | Calculates the determinant of the matrix.
function inverse(); | Calculates the inverse of the matrix.
function transpose; | Returns the transposition of the matrix.
end;

Inheritance

Tmatrix3_extended

Extended precision matrix of three scalars

Description

The Tmatrix3_extended object provides a matrix of 3*3 extended precision scalars.


Tmatrix3_extended


Tmatrix3_extended
 | init_zero
 | init_identity
 | init
 | get_column
 | get_row
 | set_column
 | set_row
 | determinant
 | inverse
 | transpose


determinant (Tmatrix3_extended)

get_column (Tmatrix3_extended)

get_row (Tmatrix3_extended)

init (Tmatrix3_extended)

init_identity (Tmatrix3_extended)

init_zero (Tmatrix3_extended)

inverse (Tmatrix3_extended)

set_column (Tmatrix3_extended)

set_row (Tmatrix3_extended)

transpose (Tmatrix3_extended)


Tmatrix3_extended.data

Internal data of Tmatrix3.extended

Declaration

Source position: matrix.pp line 214

Tmatrix3_extended.data : Tmatrix3_extended_data;

Description

See Tmatrix3_extended_data.


Tmatrix3_extended.determinant

Calculates the determinant of the matrix.

Declaration

Source position: matrix.pp line 222

function Tmatrix3_extended.determinant: extended;

Description

Returns the determinant of the matrix.


Tmatrix3_extended.get_column

Returns the c-th column of the matrix as vector.

Declaration

Source position: matrix.pp line 218

function Tmatrix3_extended.get_column(

  c: Byte

):Tvector3_extended;

Description

Returns the c-th column of the matrix as vector. The column numbering starts at 0.


Tmatrix3_extended.get_row

Returns the r-th row of the matrix as vector.

Declaration

Source position: matrix.pp line 219

function Tmatrix3_extended.get_row(

  r: Byte

):Tvector3_extended;

Description

Returns the r-th row of the matrix as vector. The row numbering starts at 0.


Tmatrix3_extended.init

Initializes the matrix, setting its elements to the values passed to the constructor.

Declaration

Source position: matrix.pp line 217

constructor Tmatrix3_extended.init(

  aa: extended;

  ab: extended;

  ac: extended;

  ba: extended;

  bb: extended;

  bc: extended;

  ca: extended;

  cb: extended;

  cc: extended

);

Description

Initializes the matrix, setting its elements to the values passed to the constructor. The order of the values is left to right, then top to bottom.


Tmatrix3_extended.init_identity

Initializes the matrix and sets its elements to the identity matrix.

Declaration

Source position: matrix.pp line 216

constructor Tmatrix3_extended.init_identity;

Description

Initializes the matrix and sets its elements to the identity matrix, that is, elements to 1 on the left-upper to right-lower diagonal, the rest zero.


Tmatrix3_extended.init_zero

Initializes the matrix and sets its elements to zero

Declaration

Source position: matrix.pp line 215

constructor Tmatrix3_extended.init_zero;


Tmatrix3_extended.inverse

Calculates the inverse of the matrix.

Declaration

Source position: matrix.pp line 223

function Tmatrix3_extended.inverse(

  Adeterminant: extended

):Tmatrix3_extended;

Description

Tmatrix3_extended.inverse returns a new matrix that is the inverse of the matrix. You must pass the determinant of the matrix as parameter.


Tmatrix3_extended.set_column

Sets r-th column of the matrix with a vector.

Declaration

Source position: matrix.pp line 220

procedure Tmatrix3_extended.set_column(

  c: Byte;

  const v: Tvector3_extended

);

Description

Replaces the c-th column of the matrix with vector v. The column numbering starts at 0.


Tmatrix3_extended.set_row

Sets r-th row of the matrix with a vector.

Declaration

Source position: matrix.pp line 221

procedure Tmatrix3_extended.set_row(

  r: Byte;

  const v: Tvector3_extended

);

Description

Replaces the r-th row of the matrix with vector v. The row numbering starts at 0.


Tmatrix3_extended.transpose

Returns the transposition of the matrix.

Declaration

Source position: matrix.pp line 224

function Tmatrix3_extended.transpose: Tmatrix3_extended;

Description

Tmatrix2_extended.transpose returns a new matrix that is the transposition of the matrix, that is, the matrix with the x and y coordinates of the values swapped.


Tmatrix3_extended_data

Internal data of Tmatrix3_extended

Declaration

Source position: matrix.pp line 56

type Tmatrix3_extended_data = array [0..2,0..2] of extended;

Description

This is the matrix internal data for a matrix. It uses a simple array structure so data from other libraries that define their own matrix type as a simple array structure can simply be moved to and from this data, or typecasted into it. As this is the only field in the object, the object itself can be used just as fine for typecasting purposes etc.


Tmatrix3_single

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Single precision matrix of three scalars

Declaration

Source position: matrix.pp line 185

type Tmatrix3_single = object
data: Tmatrix3_single_data; | Internal data of Tmatrix3.single
constructor init_zero; | Initializes the matrix and sets its elements to zero
constructor init_identity; | Initializes the matrix and sets its elements to the identity matrix.
constructor init(); | Initializes the matrix, setting its elements to the values passed to the constructor.
function get_column(); | Returns the c-th column of the matrix as vector.
function get_row(); | Returns the r-th row of the matrix as vector.
procedure set_column(); | Sets c-th column of the matrix with a vector.
procedure set_row(); | Sets r-th row of the matrix with a vector.
function determinant; | Calculates the determinant of the matrix.
function inverse(); | Calculates the inverse of the matrix.
function transpose; | Returns the transposition of the matrix.
end;

Inheritance

Tmatrix3_single

Single precision matrix of three scalars

Description

The Tmatrix3_single object provides a matrix of 3*3 single precision scalars.


Tmatrix3_single


Tmatrix3_single
 | init_zero
 | init_identity
 | init
 | get_column
 | get_row
 | set_column
 | set_row
 | determinant
 | inverse
 | transpose


determinant (Tmatrix3_single)

get_column (Tmatrix3_single)

get_row (Tmatrix3_single)

init (Tmatrix3_single)

init_identity (Tmatrix3_single)

init_zero (Tmatrix3_single)

inverse (Tmatrix3_single)

set_column (Tmatrix3_single)

set_row (Tmatrix3_single)

transpose (Tmatrix3_single)


Tmatrix3_single.data

Internal data of Tmatrix3.single

Declaration

Source position: matrix.pp line 186

Tmatrix3_single.data : Tmatrix3_single_data;

Description

See Tmatrix3_single_data.


Tmatrix3_single.determinant

Calculates the determinant of the matrix.

Declaration

Source position: matrix.pp line 194

function Tmatrix3_single.determinant: single;

Description

Returns the determinant of the matrix.


Tmatrix3_single.get_column

Returns the c-th column of the matrix as vector.

Declaration

Source position: matrix.pp line 190

function Tmatrix3_single.get_column(

  c: Byte

):Tvector3_single;

Description

Returns the c-th column of the matrix as vector. The column numbering starts at 0.


Tmatrix3_single.get_row

Returns the r-th row of the matrix as vector.

Declaration

Source position: matrix.pp line 191

function Tmatrix3_single.get_row(

  r: Byte

):Tvector3_single;

Description

Returns the r-th row of the matrix as vector. The row numbering starts at 0.


Tmatrix3_single.init

Initializes the matrix, setting its elements to the values passed to the constructor.

Declaration

Source position: matrix.pp line 189

constructor Tmatrix3_single.init(

  aa: single;

  ab: single;

  ac: single;

  ba: single;

  bb: single;

  bc: single;

  ca: single;

  cb: single;

  cc: single

);

Description

Initializes the matrix, setting its elements to the values passed to the constructor. The order of the values is left to right, then top to bottom.


Tmatrix3_single.init_identity

Initializes the matrix and sets its elements to the identity matrix.

Declaration

Source position: matrix.pp line 188

constructor Tmatrix3_single.init_identity;

Description

Initializes the matrix and sets its elements to the identity matrix, that is, elements to 1 on the left-upper to right-lower diagonal, the rest zero.


Tmatrix3_single.init_zero

Initializes the matrix and sets its elements to zero

Declaration

Source position: matrix.pp line 187

constructor Tmatrix3_single.init_zero;


Tmatrix3_single.inverse

Calculates the inverse of the matrix.

Declaration

Source position: matrix.pp line 195

function Tmatrix3_single.inverse(

  Adeterminant: single

):Tmatrix3_single;

Description

Tmatrix3_single.inverse returns a new matrix that is the inverse of the matrix. You must pass the determinant of the matrix as parameter.


Tmatrix3_single.set_column

Sets c-th column of the matrix with a vector.

Declaration

Source position: matrix.pp line 192

procedure Tmatrix3_single.set_column(

  c: Byte;

  const v: Tvector3_single

);

Description

Replaces the c-th column of the matrix with vector v. The column numbering starts at 0.


Tmatrix3_single.set_row

Sets r-th row of the matrix with a vector.

Declaration

Source position: matrix.pp line 193

procedure Tmatrix3_single.set_row(

  r: Byte;

  const v: Tvector3_single

);

Description

Replaces the r-th row of the matrix with vector v. The row numbering starts at 0.


Tmatrix3_single.transpose

Returns the transposition of the matrix.

Declaration

Source position: matrix.pp line 196

function Tmatrix3_single.transpose: Tmatrix3_single;

Description

Tmatrix2_single.transpose returns a new matrix that is the transposition of the matrix, that is, the matrix with the x and y coordinates of the values swapped.


Tmatrix3_single_data

Internal data of Tmatrix3_single

Declaration

Source position: matrix.pp line 54

type Tmatrix3_single_data = array [0..2,0..2] of single;

Description

This is the matrix internal data for a matrix. It uses a simple array structure so data from other libraries that define their own matrix type as a simple array structure can simply be moved to and from this data, or typecasted into it. As this is the only field in the object, the object itself can be used just as fine for typecasting purposes etc.


Tmatrix4_double

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Double precision matrix of four scalars

Declaration

Source position: matrix.pp line 241

type Tmatrix4_double = object
data: Tmatrix4_double_data; | Internal data of Tmatrix4.double
constructor init_zero; | Initializes the matrix and sets its elements to zero
constructor init_identity; | Initializes the matrix and sets its elements to the identity matrix.
constructor init(); | Initializes the matrix, setting its elements to the values passed to the constructor.
function get_column(); | Returns the c-th column of the matrix as vector.
function get_row(); | Returns the r-th row of the matrix as vector.
procedure set_column(); | Sets c-th column of the matrix with a vector.
procedure set_row(); | Sets r-th row of the matrix with a vector.
function determinant; | Calculates the determinant of the matrix.
function inverse(); | Calculates the inverse of the matrix.
function transpose; | Returns the transposition of the matrix.
end;

Inheritance

Tmatrix4_double

Double precision matrix of four scalars

Description

The Tmatrix4_double object provides a matrix of 4*4 double precision scalars.


Tmatrix4_double


Tmatrix4_double
 | init_zero
 | init_identity
 | init
 | get_column
 | get_row
 | set_column
 | set_row
 | determinant
 | inverse
 | transpose


determinant (Tmatrix4_double)

get_column (Tmatrix4_double)

get_row (Tmatrix4_double)

init (Tmatrix4_double)

init_identity (Tmatrix4_double)

init_zero (Tmatrix4_double)

inverse (Tmatrix4_double)

set_column (Tmatrix4_double)

set_row (Tmatrix4_double)

transpose (Tmatrix4_double)


Tmatrix4_double.data

Internal data of Tmatrix4.double

Declaration

Source position: matrix.pp line 242

Tmatrix4_double.data : Tmatrix4_double_data;

Description

See Tmatrix4_double_data.


Tmatrix4_double.determinant

Calculates the determinant of the matrix.

Declaration

Source position: matrix.pp line 250

function Tmatrix4_double.determinant: Double;

Description

Returns the determinant of the matrix. Note: Calculating the determinant of a 4*4 matrix requires quite a few operations.


Tmatrix4_double.get_column

Returns the c-th column of the matrix as vector.

Declaration

Source position: matrix.pp line 246

function Tmatrix4_double.get_column(

  c: Byte

):Tvector4_double;

Description

Returns the c-th column of the matrix as vector. The column numbering starts at 0.


Tmatrix4_double.get_row

Returns the r-th row of the matrix as vector.

Declaration

Source position: matrix.pp line 247

function Tmatrix4_double.get_row(

  r: Byte

):Tvector4_double;

Description

Returns the r-th row of the matrix as vector. The row numbering starts at 0.


Tmatrix4_double.init

Initializes the matrix, setting its elements to the values passed to the constructor.

Declaration

Source position: matrix.pp line 245

constructor Tmatrix4_double.init(

  aa: Double;

  ab: Double;

  ac: Double;

  ad: Double;

  ba: Double;

  bb: Double;

  bc: Double;

  bd: Double;

  ca: Double;

  cb: Double;

  cc: Double;

  cd: Double;

  da: Double;

  db: Double;

  dc: Double;

  dd: Double

);

Description

Initializes the matrix, setting its elements to the values passed to the constructor. The order of the values is left to right, then top to bottom.


Tmatrix4_double.init_identity

Initializes the matrix and sets its elements to the identity matrix.

Declaration

Source position: matrix.pp line 244

constructor Tmatrix4_double.init_identity;

Description

Initializes the matrix and sets its elements to the identity matrix, that is, elements to 1 on the left-upper to right-lower diagonal, the rest zero.


Tmatrix4_double.init_zero

Initializes the matrix and sets its elements to zero

Declaration

Source position: matrix.pp line 243

constructor Tmatrix4_double.init_zero;


Tmatrix4_double.inverse

Calculates the inverse of the matrix.

Declaration

Source position: matrix.pp line 251

function Tmatrix4_double.inverse(

  Adeterminant: Double

):Tmatrix4_double;

Description

Tmatrix4_double.inverse returns a new matrix that is the inverse of the matrix. You must pass the determinant of the matrix as parameter. Note: Calculating the inverse of a 4*4 matrix requires quite a few operations.


Tmatrix4_double.set_column

Sets c-th column of the matrix with a vector.

Declaration

Source position: matrix.pp line 248

procedure Tmatrix4_double.set_column(

  c: Byte;

  const v: Tvector4_double

);

Description

Replaces the c-th column of the matrix with vector v. The column numbering starts at 0.


Tmatrix4_double.set_row

Sets r-th row of the matrix with a vector.

Declaration

Source position: matrix.pp line 249

procedure Tmatrix4_double.set_row(

  r: Byte;

  const v: Tvector4_double

);

Description

Replaces the r-th row of the matrix with vector v. The row numbering starts at 0.


Tmatrix4_double.transpose

Returns the transposition of the matrix.

Declaration

Source position: matrix.pp line 252

function Tmatrix4_double.transpose: Tmatrix4_double;

Description

Tmatrix2_double.transpose returns a new matrix that is the transposition of the matrix, that is, the matrix with the x and y coordinates of the values swapped.


Tmatrix4_double_data

Internal data of Tmatrix4_double

Declaration

Source position: matrix.pp line 59

type Tmatrix4_double_data = array [0..3,0..3] of Double;

Description

This is the matrix internal data for a matrix. It uses a simple array structure so data from other libraries that define their own matrix type as a simple array structure can simply be moved to and from this data, or typecasted into it. As this is the only field in the object, the object itself can be used just as fine for typecasting purposes etc.


Tmatrix4_extended

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Extended precision matrix of extended scalars

Declaration

Source position: matrix.pp line 255

type Tmatrix4_extended = object
data: Tmatrix4_extended_data; | Internal data of Tmatrix4.extended
constructor init_zero; | Initializes the matrix and sets its elements to zero
constructor init_identity; | Initializes the matrix and sets its elements to the identity matrix.
constructor init(); | Initializes the matrix, setting its elements to the values passed to the constructor.
function get_column(); | Returns the c-th column of the matrix as vector.
function get_row(); | Returns the r-th row of the matrix as vector.
procedure set_column(); | Sets c-th column of the matrix with a vector.
procedure set_row(); | Sets r-th row of the matrix with a vector.
function determinant; | Calculates the determinant of the matrix.
function inverse(); | Calculates the inverse of the matrix.
function transpose; | Returns the transposition of the matrix.
end;

Inheritance

Tmatrix4_extended

Extended precision matrix of extended scalars

Description

The Tmatrix4_extended object provides a matrix of 4*4 extended precision scalars.


Tmatrix4_extended


Tmatrix4_extended
 | init_zero
 | init_identity
 | init
 | get_column
 | get_row
 | set_column
 | set_row
 | determinant
 | inverse
 | transpose


determinant (Tmatrix4_extended)

get_column (Tmatrix4_extended)

get_row (Tmatrix4_extended)

init (Tmatrix4_extended)

init_identity (Tmatrix4_extended)

init_zero (Tmatrix4_extended)

inverse (Tmatrix4_extended)

set_column (Tmatrix4_extended)

set_row (Tmatrix4_extended)

transpose (Tmatrix4_extended)


Tmatrix4_extended.data

Internal data of Tmatrix4.extended

Declaration

Source position: matrix.pp line 256

Tmatrix4_extended.data : Tmatrix4_extended_data;

Description

See Tmatrix4_extended_data.


Tmatrix4_extended.determinant

Calculates the determinant of the matrix.

Declaration

Source position: matrix.pp line 264

function Tmatrix4_extended.determinant: extended;

Description

Returns the determinant of the matrix. Note: Calculating the determinant of a 4*4 matrix requires quite a few operations.


Tmatrix4_extended.get_column

Returns the c-th column of the matrix as vector.

Declaration

Source position: matrix.pp line 260

function Tmatrix4_extended.get_column(

  c: Byte

):Tvector4_extended;

Description

Returns the c-th column of the matrix as vector. The column numbering starts at 0.


Tmatrix4_extended.get_row

Returns the r-th row of the matrix as vector.

Declaration

Source position: matrix.pp line 261

function Tmatrix4_extended.get_row(

  r: Byte

):Tvector4_extended;

Description

Returns the r-th row of the matrix as vector. The row numbering starts at 0.


Tmatrix4_extended.init

Initializes the matrix, setting its elements to the values passed to the constructor.

Declaration

Source position: matrix.pp line 259

constructor Tmatrix4_extended.init(

  aa: extended;

  ab: extended;

  ac: extended;

  ad: extended;

  ba: extended;

  bb: extended;

  bc: extended;

  bd: extended;

  ca: extended;

  cb: extended;

  cc: extended;

  cd: extended;

  da: extended;

  db: extended;

  dc: extended;

  dd: extended

);

Description

Initializes the matrix, setting its elements to the values passed to the constructor. The order of the values is left to right, then top to bottom.


Tmatrix4_extended.init_identity

Initializes the matrix and sets its elements to the identity matrix.

Declaration

Source position: matrix.pp line 258

constructor Tmatrix4_extended.init_identity;

Description

Initializes the matrix and sets its elements to the identity matrix, that is, elements to 1 on the left-upper to right-lower diagonal, the rest zero.


Tmatrix4_extended.init_zero

Initializes the matrix and sets its elements to zero

Declaration

Source position: matrix.pp line 257

constructor Tmatrix4_extended.init_zero;


Tmatrix4_extended.inverse

Calculates the inverse of the matrix.

Declaration

Source position: matrix.pp line 265

function Tmatrix4_extended.inverse(

  Adeterminant: extended

):Tmatrix4_extended;

Description

Tmatrix4_extended.inverse returns a new matrix that is the inverse of the matrix. You must pass the determinant of the matrix as parameter. Note: Calculating the inverse of a 4*4 matrix requires quite a few operations.


Tmatrix4_extended.set_column

Sets c-th column of the matrix with a vector.

Declaration

Source position: matrix.pp line 262

procedure Tmatrix4_extended.set_column(

  c: Byte;

  const v: Tvector4_extended

);

Description

Replaces the c-th column of the matrix with vector v. The column numbering starts at 0.


Tmatrix4_extended.set_row

Sets r-th row of the matrix with a vector.

Declaration

Source position: matrix.pp line 263

procedure Tmatrix4_extended.set_row(

  r: Byte;

  const v: Tvector4_extended

);

Description

Replaces the r-th row of the matrix with vector v. The row numbering starts at 0.


Tmatrix4_extended.transpose

Returns the transposition of the matrix.

Declaration

Source position: matrix.pp line 266

function Tmatrix4_extended.transpose: Tmatrix4_extended;

Description

Tmatrix2_extended.transpose returns a new matrix that is the transposition of the matrix, that is, the matrix with the x and y coordinates of the values swapped.


Tmatrix4_extended_data

Internal data of Tmatrix4_extended

Declaration

Source position: matrix.pp line 60

type Tmatrix4_extended_data = array [0..3,0..3] of extended;

Description

This is the matrix internal data for a matrix. It uses a simple array structure so data from other libraries that define their own matrix type as a simple array structure can simply be moved to and from this data, or typecasted into it. As this is the only field in the object, the object itself can be used just as fine for typecasting purposes etc.


Tmatrix4_single

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Single precision matrix of four scalars

Declaration

Source position: matrix.pp line 227

type Tmatrix4_single = object
data: Tmatrix4_single_data; | Internal data of Tmatrix4.single
constructor init_zero; | Initializes the matrix and sets its elements to zero
constructor init_identity; | Initializes the matrix and sets its elements to the identity matrix.
constructor init(); | Initializes the matrix, setting its elements to the values passed to the constructor.
function get_column(); | Returns the c-th column of the matrix as vector.
function get_row(); | Returns the r-th row of the matrix as vector.
procedure set_column(); | Sets c-th column of the matrix with a vector.
procedure set_row(); | Sets r-th row of the matrix with a vector.
function determinant; | Calculates the determinant of the matrix.
function inverse(); | Calculates the inverse of the matrix.
function transpose; | Returns the transposition of the matrix.
end;

Inheritance

Tmatrix4_single

Single precision matrix of four scalars

Description

The Tmatrix4_single object provides a matrix of 4*4 single precision scalars.


Tmatrix4_single


Tmatrix4_single
 | init_zero
 | init_identity
 | init
 | get_column
 | get_row
 | set_column
 | set_row
 | determinant
 | inverse
 | transpose


determinant (Tmatrix4_single)

get_column (Tmatrix4_single)

get_row (Tmatrix4_single)

init (Tmatrix4_single)

init_identity (Tmatrix4_single)

init_zero (Tmatrix4_single)

inverse (Tmatrix4_single)

set_column (Tmatrix4_single)

set_row (Tmatrix4_single)

transpose (Tmatrix4_single)


Tmatrix4_single.data

Internal data of Tmatrix4.single

Declaration

Source position: matrix.pp line 228

Tmatrix4_single.data : Tmatrix4_single_data;

Description

See Tmatrix4_single_data.


Tmatrix4_single.determinant

Calculates the determinant of the matrix.

Declaration

Source position: matrix.pp line 236

function Tmatrix4_single.determinant: single;

Description

Returns the determinant of the matrix. Note: Calculating the determinant of a 4*4 matrix requires quite a few operations.


Tmatrix4_single.get_column

Returns the c-th column of the matrix as vector.

Declaration

Source position: matrix.pp line 232

function Tmatrix4_single.get_column(

  c: Byte

):Tvector4_single;

Description

Returns the c-th column of the matrix as vector. The column numbering starts at 0.


Tmatrix4_single.get_row

Returns the r-th row of the matrix as vector.

Declaration

Source position: matrix.pp line 233

function Tmatrix4_single.get_row(

  r: Byte

):Tvector4_single;

Description

Returns the r-th row of the matrix as vector. The row numbering starts at 0.


Tmatrix4_single.init

Initializes the matrix, setting its elements to the values passed to the constructor.

Declaration

Source position: matrix.pp line 231

constructor Tmatrix4_single.init(

  aa: single;

  ab: single;

  ac: single;

  ad: single;

  ba: single;

  bb: single;

  bc: single;

  bd: single;

  ca: single;

  cb: single;

  cc: single;

  cd: single;

  da: single;

  db: single;

  dc: single;

  dd: single

);

Description

Initializes the matrix, setting its elements to the values passed to the constructor. The order of the values is left to right, then top to bottom.


Tmatrix4_single.init_identity

Initializes the matrix and sets its elements to the identity matrix.

Declaration

Source position: matrix.pp line 230

constructor Tmatrix4_single.init_identity;

Description

Initializes the matrix and sets its elements to the identity matrix, that is, elements to 1 on the left-upper to right-lower diagonal, the rest zero.


Tmatrix4_single.init_zero

Initializes the matrix and sets its elements to zero

Declaration

Source position: matrix.pp line 229

constructor Tmatrix4_single.init_zero;


Tmatrix4_single.inverse

Calculates the inverse of the matrix.

Declaration

Source position: matrix.pp line 237

function Tmatrix4_single.inverse(

  Adeterminant: single

):Tmatrix4_single;

Description

Tmatrix4_single.inverse returns a new matrix that is the inverse of the matrix. You must pass the determinant of the matrix as parameter. Note: Calculating the inverse of a 4*4 matrix requires quite a few operations.


Tmatrix4_single.set_column

Sets c-th column of the matrix with a vector.

Declaration

Source position: matrix.pp line 234

procedure Tmatrix4_single.set_column(

  c: Byte;

  const v: Tvector4_single

);

Description

Replaces the c-th column of the matrix with vector v. The column numbering starts at 0.


Tmatrix4_single.set_row

Sets r-th row of the matrix with a vector.

Declaration

Source position: matrix.pp line 235

procedure Tmatrix4_single.set_row(

  r: Byte;

  const v: Tvector4_single

);

Description

Replaces the r-th row of the matrix with vector v. The row numbering starts at 0.


Tmatrix4_single.transpose

Returns the transposition of the matrix.

Declaration

Source position: matrix.pp line 238

function Tmatrix4_single.transpose: Tmatrix4_single;

Description

Tmatrix2_single.transpose returns a new matrix that is the transposition of the matrix, that is, the matrix with the x and y coordinates of the values swapped.


Tmatrix4_single_data

Internal data of Tmatrix4_single

Declaration

Source position: matrix.pp line 58

type Tmatrix4_single_data = array [0..3,0..3] of single;

Description

This is the matrix internal data for a matrix. It uses a simple array structure so data from other libraries that define their own matrix type as a simple array structure can simply be moved to and from this data, or typecasted into it. As this is the only field in the object, the object itself can be used just as fine for typecasting purposes etc.


Tvector2_double

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Double precision vector of two scalars

Declaration

Source position: matrix.pp line 71

type Tvector2_double = object
data: Tvector2_double_data; | Internal data of Tvector2.double
constructor init_zero; | Initializes the vector and sets its elements to zero
constructor init_one; | Initializes the vector and sets its elements to one
constructor init(); | Initializes the vector, setting its elements to the values passed to the constructor.
function length; | Calculates the length of the vector.
function squared_length; | Calculates the squared length of the vector.
end;

Inheritance

Tvector2_double

Double precision vector of two scalars

Description

The Tvector2_double object provides a vector of two double precision scalars.


Tvector2_double


Tvector2_double
 | init_zero
 | init_one
 | init
 | length
 | squared_length


init (Tvector2_double)

init_one (Tvector2_double)

init_zero (Tvector2_double)

length (Tvector2_double)

squared_length (Tvector2_double)


Tvector2_double.data

Internal data of Tvector2.double

Declaration

Source position: matrix.pp line 72

Tvector2_double.data : Tvector2_double_data;

Description

See Tvector2_double_data.


Tvector2_double.init

Initializes the vector, setting its elements to the values passed to the constructor.

Declaration

Source position: matrix.pp line 75

constructor Tvector2_double.init(

  a: Double;

  b: Double

);


Tvector2_double.init_one

Initializes the vector and sets its elements to one

Declaration

Source position: matrix.pp line 74

constructor Tvector2_double.init_one;


Tvector2_double.init_zero

Initializes the vector and sets its elements to zero

Declaration

Source position: matrix.pp line 73

constructor Tvector2_double.init_zero;


Tvector2_double.length

Calculates the length of the vector.

Declaration

Source position: matrix.pp line 76

function Tvector2_double.length: Double;

Description

Calculate the length of the vector: length=sqrt(data[0]**2+data[1]**2). Try to use squared_length if you are able to, as it is faster.


Tvector2_double.squared_length

Calculates the squared length of the vector.

Declaration

Source position: matrix.pp line 77

function Tvector2_double.squared_length: Double;

Description

Calculate the squared length of the vector: squared_length=data[0]**2+data[1]**2.


Tvector2_double_data

Internal data of Tvector2_double

Declaration

Source position: matrix.pp line 39

type Tvector2_double_data = array [0..1] of Double;

Description

This is the vector internal data for a vector. It uses a simple array structure so data from other libraries that define their own vector type as a simple array structure can simply be moved to and from this data, or typecasted into it. As this is the only field in the object, the object itself can be used just as fine for typecasting purposes etc.


Tvector2_extended

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Extended precision vector of two scalars

Declaration

Source position: matrix.pp line 80

type Tvector2_extended = object
data: Tvector2_extended_data; | Internal data of Tvector2.extended
constructor init_zero; | Initializes the vector and sets its elements to zero
constructor init_one; | Initializes the vector and sets its elements to one
constructor init(); | Initializes the vector, setting its elements to the values passed to the constructor.
function length; | Calculates the length of the vector.
function squared_length; | Calculates the squared length of the vector.
end;

Inheritance

Tvector2_extended

Extended precision vector of two scalars

Description

The Tvector2_extended object provides a vector of two extended precision scalars.


Tvector2_extended


Tvector2_extended
 | init_zero
 | init_one
 | init
 | length
 | squared_length


init (Tvector2_extended)

init_one (Tvector2_extended)

init_zero (Tvector2_extended)

length (Tvector2_extended)

squared_length (Tvector2_extended)


Tvector2_extended.data

Internal data of Tvector2.extended

Declaration

Source position: matrix.pp line 81

Tvector2_extended.data : Tvector2_extended_data;

Description

See Tvector2_extended_data.


Tvector2_extended.init

Initializes the vector, setting its elements to the values passed to the constructor.

Declaration

Source position: matrix.pp line 84

constructor Tvector2_extended.init(

  a: extended;

  b: extended

);


Tvector2_extended.init_one

Initializes the vector and sets its elements to one

Declaration

Source position: matrix.pp line 83

constructor Tvector2_extended.init_one;


Tvector2_extended.init_zero

Initializes the vector and sets its elements to zero

Declaration

Source position: matrix.pp line 82

constructor Tvector2_extended.init_zero;


Tvector2_extended.length

Calculates the length of the vector.

Declaration

Source position: matrix.pp line 85

function Tvector2_extended.length: extended;

Description

Calculate the length of the vector: length=sqrt(data[0]**2+data[1]**2). Try to use squared_length if you are able to, as it is faster.


Tvector2_extended.squared_length

Calculates the squared length of the vector.

Declaration

Source position: matrix.pp line 86

function Tvector2_extended.squared_length: extended;

Description

Calculate the squared length of the vector: squared_length=data[0]**2+data[1]**2.


Tvector2_extended_data

Internal data of Tvector2_extended

Declaration

Source position: matrix.pp line 40

type Tvector2_extended_data = array [0..1] of extended;

Description

This is the vector internal data for a vector. It uses a simple array structure so data from other libraries that define their own vector type as a simple array structure can simply be moved to and from this data, or typecasted into it. As this is the only field in the object, the object itself can be used just as fine for typecasting purposes etc.


Tvector2_single

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Single precision vector of two scalars

Declaration

Source position: matrix.pp line 62

type Tvector2_single = object
data: Tvector2_single_data; | Internal data of Tvector2.single
constructor init_zero; | Initializes the vector and sets its elements to zero
constructor init_one; | Initializes the vector and sets its elements to one
constructor init(); | Initializes the vector, setting its elements to the values passed to the constructor.
function length; | Calculates the length of the vector.
function squared_length; | Calculates the squared length of the vector.
end;

Inheritance

Tvector2_single

Single precision vector of two scalars

Description

The Tvector2_single object provides a vector of two single precision scalars.


Tvector2_single


Tvector2_single
 | init_zero
 | init_one
 | init
 | length
 | squared_length


init (Tvector2_single)

init_one (Tvector2_single)

init_zero (Tvector2_single)

length (Tvector2_single)

squared_length (Tvector2_single)


Tvector2_single.data

Internal data of Tvector2.single

Declaration

Source position: matrix.pp line 63

Tvector2_single.data : Tvector2_single_data;

Description

See Tvector2_single_data.


Tvector2_single.init

Initializes the vector, setting its elements to the values passed to the constructor.

Declaration

Source position: matrix.pp line 66

constructor Tvector2_single.init(

  a: single;

  b: single

);


Tvector2_single.init_one

Initializes the vector and sets its elements to one

Declaration

Source position: matrix.pp line 65

constructor Tvector2_single.init_one;


Tvector2_single.init_zero

Initializes the vector and sets its elements to zero

Declaration

Source position: matrix.pp line 64

constructor Tvector2_single.init_zero;


Tvector2_single.length

Calculates the length of the vector.

Declaration

Source position: matrix.pp line 67

function Tvector2_single.length: single;

Description

Calculate the length of the vector: length=sqrt(data[0]**2+data[1]**2). Try to use squared_length if you are able to, as it is faster.


Tvector2_single.squared_length

Calculates the squared length of the vector.

Declaration

Source position: matrix.pp line 68

function Tvector2_single.squared_length: single;

Description

Calculate the squared length of the vector: squared_length=data[0]**2+data[1]**2.


Tvector2_single_data

Internal data of Tvector2_single

Declaration

Source position: matrix.pp line 38

type Tvector2_single_data = array [0..1] of single;

Description

This is the vector internal data for a vector. It uses a simple array structure so data from other libraries that define their own vector type as a simple array structure can simply be moved to and from this data, or typecasted into it. As this is the only field in the object, the object itself can be used just as fine for typecasting purposes etc.


Tvector3_double

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Double precision vector of three scalars

Declaration

Source position: matrix.pp line 98

type Tvector3_double = object
data: Tvector3_double_data; | Internal data of Tvector3.double
constructor init_zero; | Initializes the vector and sets its elements to zero
constructor init_one; | Initializes the vector and sets its elements to one
constructor init(); | Initializes the vector, setting its elements to the values passed to the constructor.
function length; | Calculates the length of the vector.
function squared_length; | Calculates the squared length of the vector.
end;

Inheritance

Tvector3_double

Double precision vector of three scalars

Description

The Tvector3_double object provides a vector of three double precision scalars.


Tvector3_double


Tvector3_double
 | init_zero
 | init_one
 | init
 | length
 | squared_length


init (Tvector3_double)

init_one (Tvector3_double)

init_zero (Tvector3_double)

length (Tvector3_double)

squared_length (Tvector3_double)


Tvector3_double.data

Internal data of Tvector3.double

Declaration

Source position: matrix.pp line 99

Tvector3_double.data : Tvector3_double_data;

Description

See Tvector3_double_data.


Tvector3_double.init

Initializes the vector, setting its elements to the values passed to the constructor.

Declaration

Source position: matrix.pp line 102

constructor Tvector3_double.init(

  a: Double;

  b: Double;

  c: Double

);


Tvector3_double.init_one

Initializes the vector and sets its elements to one

Declaration

Source position: matrix.pp line 101

constructor Tvector3_double.init_one;


Tvector3_double.init_zero

Initializes the vector and sets its elements to zero

Declaration

Source position: matrix.pp line 100

constructor Tvector3_double.init_zero;


Tvector3_double.length

Calculates the length of the vector.

Declaration

Source position: matrix.pp line 103

function Tvector3_double.length: Double;

Description

Calculate the length of the vector: length=sqrt(data[0]**2+data[1]**2+data[2]**2). Try to use squared_length if you are able to, as it is faster.


Tvector3_double.squared_length

Calculates the squared length of the vector.

Declaration

Source position: matrix.pp line 104

function Tvector3_double.squared_length: Double;

Description

Calculate the squared length of the vector: squared_length=data[0]**2+data[1]**2+data[2]**2.


Tvector3_double_data

Internal data of Tvector3_double

Declaration

Source position: matrix.pp line 43

type Tvector3_double_data = array [0..2] of Double;

Description

This is the vector internal data for a vector. It uses a simple array structure so data from other libraries that define their own vector type as a simple array structure can simply be moved to and from this data, or typecasted into it. As this is the only field in the object, the object itself can be used just as fine for typecasting purposes etc.


Tvector3_extended

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Extended precision vector of three scalars

Declaration

Source position: matrix.pp line 107

type Tvector3_extended = object
data: Tvector3_extended_data; | Internal data of Tvector3.extended
constructor init_zero; | Initializes the vector and sets its elements to zero
constructor init_one; | Initializes the vector and sets its elements to one
constructor init(); | Initializes the vector, setting its elements to the values passed to the constructor.
function length; | Calculates the length of the vector.
function squared_length; | Calculates the squared length of the vector.
end;

Inheritance

Tvector3_extended

Extended precision vector of three scalars

Description

The Tvector3_extended object provides a vector of three extended precision scalars.


Tvector3_extended


Tvector3_extended
 | init_zero
 | init_one
 | init
 | length
 | squared_length


init (Tvector3_extended)

init_one (Tvector3_extended)

init_zero (Tvector3_extended)

length (Tvector3_extended)

squared_length (Tvector3_extended)


Tvector3_extended.data

Internal data of Tvector3.extended

Declaration

Source position: matrix.pp line 108

Tvector3_extended.data : Tvector3_extended_data;

Description

See Tvector3_extended_data.


Tvector3_extended.init

Initializes the vector, setting its elements to the values passed to the constructor.

Declaration

Source position: matrix.pp line 111

constructor Tvector3_extended.init(

  a: extended;

  b: extended;

  c: extended

);


Tvector3_extended.init_one

Initializes the vector and sets its elements to one

Declaration

Source position: matrix.pp line 110

constructor Tvector3_extended.init_one;


Tvector3_extended.init_zero

Initializes the vector and sets its elements to zero

Declaration

Source position: matrix.pp line 109

constructor Tvector3_extended.init_zero;


Tvector3_extended.length

Calculates the length of the vector.

Declaration

Source position: matrix.pp line 112

function Tvector3_extended.length: extended;

Description

Calculate the length of the vector: length=sqrt(data[0]**2+data[1]**2+data[2]**2). Try to use squared_length if you are able to, as it is faster.


Tvector3_extended.squared_length

Calculates the squared length of the vector.

Declaration

Source position: matrix.pp line 113

function Tvector3_extended.squared_length: extended;

Description

Calculate the squared length of the vector: squared_length=data[0]**2+data[1]**2+data[2]**2.


Tvector3_extended_data

Internal data of Tvector3_extended

Declaration

Source position: matrix.pp line 44

type Tvector3_extended_data = array [0..2] of extended;

Description

This is the vector internal data for a vector. It uses a simple array structure so data from other libraries that define their own vector type as a simple array structure can simply be moved to and from this data, or typecasted into it. As this is the only field in the object, the object itself can be used just as fine for typecasting purposes etc.


Tvector3_single

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Single precision vector of three scalars

Declaration

Source position: matrix.pp line 89

type Tvector3_single = object
data: Tvector3_single_data; | Internal data of Tvector3.single
constructor init_zero; | Initializes the vector and sets its elements to zero
constructor init_one; | Initializes the vector and sets its elements to one
constructor init(); | Initializes the vector, setting its elements to the values passed to the constructor.
function length; | Calculates the length of the vector.
function squared_length; | Calculates the squared length of the vector.
end;

Inheritance

Tvector3_single

Single precision vector of three scalars

Description

The Tvector3_single object provides a vector of three single precision scalars.


Tvector3_single


Tvector3_single
 | init_zero
 | init_one
 | init
 | length
 | squared_length


init (Tvector3_single)

init_one (Tvector3_single)

init_zero (Tvector3_single)

length (Tvector3_single)

squared_length (Tvector3_single)


Tvector3_single.data

Internal data of Tvector3.single

Declaration

Source position: matrix.pp line 90

Tvector3_single.data : Tvector3_single_data;

Description

See Tvector3_single_data.


Tvector3_single.init

Initializes the vector, setting its elements to the values passed to the constructor.

Declaration

Source position: matrix.pp line 93

constructor Tvector3_single.init(

  a: single;

  b: single;

  c: single

);


Tvector3_single.init_one

Initializes the vector and sets its elements to one

Declaration

Source position: matrix.pp line 92

constructor Tvector3_single.init_one;


Tvector3_single.init_zero

Initializes the vector and sets its elements to zero

Declaration

Source position: matrix.pp line 91

constructor Tvector3_single.init_zero;


Tvector3_single.length

Calculates the length of the vector.

Declaration

Source position: matrix.pp line 94

function Tvector3_single.length: single;

Description

Calculate the length of the vector: length=sqrt(data[0]**2+data[1]**2+data[2]**2). Try to use squared_length if you are able to, as it is faster.


Tvector3_single.squared_length

Calculates the squared length of the vector.

Declaration

Source position: matrix.pp line 95

function Tvector3_single.squared_length: single;

Description

Calculate the squared length of the vector: squared_length=data[0]**2+data[1]**2+data[2]**2.


Tvector3_single_data

Internal data of Tvector3_single

Declaration

Source position: matrix.pp line 42

type Tvector3_single_data = array [0..2] of single;

Description

This is the vector internal data for a vector. It uses a simple array structure so data from other libraries that define their own vector type as a simple array structure can simply be moved to and from this data, or typecasted into it. As this is the only field in the object, the object itself can be used just as fine for typecasting purposes etc.


Tvector4_double

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Double precision vector of four scalars

Declaration

Source position: matrix.pp line 125

type Tvector4_double = object
data: Tvector4_double_data; | Internal data of Tvector4.double
constructor init_zero; | Initializes the vector and sets its elements to zero
constructor init_one; | Initializes the vector and sets its elements to one
constructor init(); | Initializes the vector, setting its elements to the values passed to the constructor.
function length; | Calculates the length of the vector.
function squared_length; | Calculates the squared length of the vector.
end;

Inheritance

Tvector4_double

Double precision vector of four scalars

Description

The Tvector4_double object provides a vector of four double precision scalars.


Tvector4_double


Tvector4_double
 | init_zero
 | init_one
 | init
 | length
 | squared_length


init (Tvector4_double)

init_one (Tvector4_double)

init_zero (Tvector4_double)

length (Tvector4_double)

squared_length (Tvector4_double)


Tvector4_double.data

Internal data of Tvector4.double

Declaration

Source position: matrix.pp line 126

Tvector4_double.data : Tvector4_double_data;

Description

See Tvector4_double_data.


Tvector4_double.init

Initializes the vector, setting its elements to the values passed to the constructor.

Declaration

Source position: matrix.pp line 129

constructor Tvector4_double.init(

  a: Double;

  b: Double;

  c: Double;

  d: Double

);


Tvector4_double.init_one

Initializes the vector and sets its elements to one

Declaration

Source position: matrix.pp line 128

constructor Tvector4_double.init_one;


Tvector4_double.init_zero

Initializes the vector and sets its elements to zero

Declaration

Source position: matrix.pp line 127

constructor Tvector4_double.init_zero;


Tvector4_double.length

Calculates the length of the vector.

Declaration

Source position: matrix.pp line 130

function Tvector4_double.length: Double;

Description

Calculate the length of the vector: length=sqrt(data[0]**2+data[1]**2+data[2]**2+data[3]**2). Try to use squared_length if you are able to, as it is faster.


Tvector4_double.squared_length

Calculates the squared length of the vector.

Declaration

Source position: matrix.pp line 131

function Tvector4_double.squared_length: Double;

Description

Calculate the squared length of the vector: squared_length=data[0]**2+data[1]**2+data[2]**2+data[3]**2.


Tvector4_double_data

Internal data of Tvector4_double

Declaration

Source position: matrix.pp line 47

type Tvector4_double_data = array [0..3] of Double;

Description

This is the vector internal data for a vector. It uses a simple array structure so data from other libraries that define their own vector type as a simple array structure can simply be moved to and from this data, or typecasted into it. As this is the only field in the object, the object itself can be used just as fine for typecasting purposes etc.


Tvector4_extended

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Extended precision vector of extended scalars

Declaration

Source position: matrix.pp line 134

type Tvector4_extended = object
data: Tvector4_extended_data; | Internal data of Tvector4.extended
constructor init_zero; | Initializes the vector and sets its elements to zero
constructor init_one; | Initializes the vector and sets its elements to one
constructor init(); | Initializes the vector, setting its elements to the values passed to the constructor.
function length; | Calculates the length of the vector.
function squared_length; | Calculates the squared length of the vector.
end;

Inheritance

Tvector4_extended

Extended precision vector of extended scalars

Description

The Tvector4_extended object provides a vector of four extended precision scalars.


Tvector4_extended


Tvector4_extended
 | init_zero
 | init_one
 | init
 | length
 | squared_length


init (Tvector4_extended)

init_one (Tvector4_extended)

init_zero (Tvector4_extended)

length (Tvector4_extended)

squared_length (Tvector4_extended)


Tvector4_extended.data

Internal data of Tvector4.extended

Declaration

Source position: matrix.pp line 135

Tvector4_extended.data : Tvector4_extended_data;

Description

See Tvector4_extended_data.


Tvector4_extended.init

Initializes the vector, setting its elements to the values passed to the constructor.

Declaration

Source position: matrix.pp line 138

constructor Tvector4_extended.init(

  a: extended;

  b: extended;

  c: extended;

  d: extended

);


Tvector4_extended.init_one

Initializes the vector and sets its elements to one

Declaration

Source position: matrix.pp line 137

constructor Tvector4_extended.init_one;


Tvector4_extended.init_zero

Initializes the vector and sets its elements to zero

Declaration

Source position: matrix.pp line 136

constructor Tvector4_extended.init_zero;


Tvector4_extended.length

Calculates the length of the vector.

Declaration

Source position: matrix.pp line 139

function Tvector4_extended.length: extended;

Description

Calculate the length of the vector: length=sqrt(data[0]**2+data[1]**2+data[2]**2+data[3]**2). Try to use squared_length if you are able to, as it is faster.


Tvector4_extended.squared_length

Calculates the squared length of the vector.

Declaration

Source position: matrix.pp line 140

function Tvector4_extended.squared_length: extended;

Description

Calculate the squared length of the vector: squared_length=data[0]**2+data[1]**2+data[2]**2+data[3]**2.


Tvector4_extended_data

Internal data of Tvector4_extended

Declaration

Source position: matrix.pp line 48

type Tvector4_extended_data = array [0..3] of extended;

Description

This is the vector internal data for a vector. It uses a simple array structure so data from other libraries that define their own vector type as a simple array structure can simply be moved to and from this data, or typecasted into it. As this is the only field in the object, the object itself can be used just as fine for typecasting purposes etc.


Tvector4_single

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Single precision vector of four scalars

Declaration

Source position: matrix.pp line 116

type Tvector4_single = object
data: Tvector4_single_data; | Internal data of Tvector4.single
constructor init_zero; | Initializes the vector and sets its elements to zero
constructor init_one; | Initializes the vector and sets its elements to one
constructor init(); | Initializes the vector, setting its elements to the values passed to the constructor.
function length; | Calculates the length of the vector.
function squared_length; | Calculates the squared length of the vector.
end;

Inheritance

Tvector4_single

Single precision vector of four scalars

Description

The Tvector4_single object provides a vector of four single precision scalars.


Tvector4_single


Tvector4_single
 | init_zero
 | init_one
 | init
 | length
 | squared_length


init (Tvector4_single)

init_one (Tvector4_single)

init_zero (Tvector4_single)

length (Tvector4_single)

squared_length (Tvector4_single)


Tvector4_single.data

Internal data of Tvector4.single

Declaration

Source position: matrix.pp line 117

Tvector4_single.data : Tvector4_single_data;

Description

See Tvector4_single_data.


Tvector4_single.init

Initializes the vector, setting its elements to the values passed to the constructor.

Declaration

Source position: matrix.pp line 120

constructor Tvector4_single.init(

  a: single;

  b: single;

  c: single;

  d: single

);


Tvector4_single.init_one

Initializes the vector and sets its elements to one

Declaration

Source position: matrix.pp line 119

constructor Tvector4_single.init_one;


Tvector4_single.init_zero

Initializes the vector and sets its elements to zero

Declaration

Source position: matrix.pp line 118

constructor Tvector4_single.init_zero;


Tvector4_single.length

Calculates the length of the vector.

Declaration

Source position: matrix.pp line 121

function Tvector4_single.length: single;

Description

Calculate the length of the vector: length=sqrt(data[0]**2+data[1]**2+data[2]**2+data[3]**2). Try to use squared_length if you are able to, as it is faster.


Tvector4_single.squared_length

Calculates the squared length of the vector.

Declaration

Source position: matrix.pp line 122

function Tvector4_single.squared_length: single;

Description

Calculate the squared length of the vector: squared_length=data[0]**2+data[1]**2+data[2]**2+data[3]**2.


Tvector4_single_data

Internal data of Tvector4_single

Declaration

Source position: matrix.pp line 46

type Tvector4_single_data = array [0..3] of single;

Description

This is the vector internal data for a vector. It uses a simple array structure so data from other libraries that define their own vector type as a simple array structure can simply be moved to and from this data, or typecasted into it. As this is the only field in the object, the object itself can be used just as fine for typecasting purposes etc.


TBufStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Buffered file stream

Declaration

Source position: objects.pp line 341

type TBufStream = object(TDosStream)
LastMode: Byte; | Last file open mode
BufSize: LongInt; | Size of buffer
BufPtr: LongInt; | Pointer to current position in buffer
BufEnd: LongInt; | End of data in buffer.
Buffer: PByteArray; | Actual buffer
constructor Init(); | Initialize an instance of TBufStream and open the file.
destructor Done; virtual; | Close the file and cleans up the instance.
procedure Close; virtual; | Flush data and Close the file.
procedure Flush; virtual; | FLush data from buffer, and write it to stream.
procedure Truncate; virtual; | Flush buffer, and truncate the file at current position.
procedure Seek(); virtual; | Set current position in file.
procedure Open(); virtual; | Open the file if it is closed.
procedure Read(); virtual; | Read data from the file to a buffer in memory.
procedure Write(); virtual; | Write data to the file from a buffer in memory.
end;

Inheritance

TBufStream | Buffered file stream
TDosStream | DOS file stream
TStream | Base stream class
TObject | Basis of all objects

Description

Bufstream implements a buffered file stream. That is, all data written to the stream is written to memory first. Only when the buffer is full, or on explicit request, the data is written to disk.

Also, when reading from the stream, first the buffer is checked if there is any unread data in it. If so, this is read first. If not the buffer is filled again, and then the data is read from the buffer.

The size of the buffer is fixed and is set when constructing the file.

This is useful if you need heavy throughput for your stream, because it speeds up operations.


TBufStream

TDosStream

TStream

TObject


TBufStream
 | Init
 | Done
 | Close
 | Flush
 | Truncate
 | Seek
 | Open
 | Read
 | Write
TDosStream
 | Init
 | Done
 | Close
 | Truncate
 | Seek
 | Open
 | Read
 | Write
TStream
 | Init
 | Get
 | StrRead
 | GetPos
 | GetSize
 | ReadStr
 | Open
 | Close
 | Reset
 | Flush
 | Truncate
 | Put
 | StrWrite
 | WriteStr
 | Seek
 | Error
 | Read
 | Write
 | CopyFrom
TObject
 | Init
 | Free
 | Is_Object
 | Done


Close (TStream)

Close (TDosStream)

Close (TBufStream)

CopyFrom (TStream)

Done (TObject)

Done (TDosStream)

Done (TBufStream)

Error (TStream)

Flush (TStream)

Flush (TBufStream)

Free (TObject)

Get (TStream)

GetPos (TStream)

GetSize (TStream)

Init (TObject)

Init (TStream)

Init (TDosStream)

Init (TBufStream)

Is_Object (TObject)

Open (TStream)

Open (TDosStream)

Open (TBufStream)

Put (TStream)

Read (TStream)

Read (TDosStream)

Read (TBufStream)

ReadStr (TStream)

Reset (TStream)

Seek (TStream)

Seek (TDosStream)

Seek (TBufStream)

StrRead (TStream)

StrWrite (TStream)

Truncate (TStream)

Truncate (TDosStream)

Truncate (TBufStream)

Write (TStream)

Write (TDosStream)

Write (TBufStream)

WriteStr (TStream)


TBufStream.BufEnd

End of data in buffer.

Declaration

Source position: objects.pp line 345

TBufStream.BufEnd : LongInt;


TBufStream.Buffer

Actual buffer

Declaration

Source position: objects.pp line 346

TBufStream.Buffer : PByteArray;


TBufStream.BufPtr

Pointer to current position in buffer

Declaration

Source position: objects.pp line 344

TBufStream.BufPtr : LongInt;


TBufStream.BufSize

Size of buffer

Declaration

Source position: objects.pp line 343

TBufStream.BufSize : LongInt;


TBufStream.Close

Flush data and Close the file.

Declaration

Source position: objects.pp line 349

procedure TBufStream.Close; virtual;

Description

Close flushes and closes the file if it was open, and sets Handle to -1. Contrary to Done it does not clean up the instance of TBufStream

For an example see TBufStream.Flush.

Errors

None.

See also

TStream.Close | Close the stream
TBufStream.Init | Initialize an instance of TBufStream and open the file.
TBufStream.Done | Close the file and cleans up the instance.


TBufStream.Done

Close the file and cleans up the instance.

Declaration

Source position: objects.pp line 348

destructor TBufStream.Done; virtual;

Description

Done flushes and closes the file if it was open and cleans up the instance of TBufStream.

For an example see TBufStream.Flush.

Errors

None.

See also

TDosStream.Done | Closes the file and cleans up the instance.
TBufStream.Init | Initialize an instance of TBufStream and open the file.
TBufStream.Close | Flush data and Close the file.


TBufStream.Flush

FLush data from buffer, and write it to stream.

Declaration

Source position: objects.pp line 350

procedure TBufStream.Flush; virtual;

Description

When the stream is in write mode, the contents of the buffer are written to disk, and the buffer position is set to zero. When the stream is in read mode, the buffer position is set to zero.

Errors

Write errors may occur if the file was in write mode. see Write for more info on the errors.

See also

TStream.Close | Close the stream
TBufStream.Init | Initialize an instance of TBufStream and open the file.
TBufStream.Done | Close the file and cleans up the instance.

Example

Program ex15;

{ Program to demonstrate the TStream.Flush method }

Uses Objects;

Var L : String;
    P : PString;
    S : PBufStream; { Only one with Flush implemented. }

begin
  L:='Some constant string';
  { Buffer size of 100 }
  S:=New(PBufStream,Init('test.dat',stcreate,100));
  Writeln ('Writing "',L,'" to stream with handle ',S^.Handle);
  S^.WriteStr(@L);
  { At this moment, there is no data on disk yet. }
  S^.Flush;
  { Now there is. }
  S^.WriteStr(@L);
  { Close calls flush first }
  S^.Close;
  Writeln ('Closed stream. File handle is ',S^.Handle);
  S^.Open (stOpenRead);
  P:=S^.ReadStr;
  L:=P^;
  DisposeStr(P);
  Writeln ('Read "',L,'" from stream with handle ',S^.Handle);
  S^.Close;
  Dispose (S,Done);
end.


TBufStream.Init

Initialize an instance of TBufStream and open the file.

Declaration

Source position: objects.pp line 347

constructor TBufStream.Init(

  FileName: FNameStr;

  Mode: Word;

  Size: Word

);

Description

Init instantiates an instance of TBufStream. The name of the file that contains (or will contain) the data of the stream is given in FileName. The Mode parameter determines whether a new file should be created and what access rights you have on the file. It can be one of the following constants:

stCreate
Creates a new file.
stOpenRead
Read access only.
stOpenWrite
Write access only.
stOpen
Read and write access.

The Size parameter determines the size of the buffer that will be created. It should be different from zero.

For an example see TBufStream.Flush.

Errors

On error, Status is set to stInitError, and ErrorInfo is set to the dos error code.

See also

TDosStream.Init | Instantiate a new instance of TDosStream.
TBufStream.Done | Close the file and cleans up the instance.


TBufStream.LastMode

Last file open mode

Declaration

Source position: objects.pp line 342

TBufStream.LastMode : Byte;


TBufStream.Open

Open the file if it is closed.

Declaration

Source position: objects.pp line 353

procedure TBufStream.Open(

  OpenMode: Word

); virtual;

Description

If the stream's status is stOK, and the stream is closed then Open re-opens the file stream with mode OpenMode. This call can be used after a Close call.

For an example, see TDosStream.Open.

Errors

If an error occurs when re-opening the file, then Status is set to stOpenError, and the OS error code is stored in ErrorInfo

See also

TStream.Open | Open the stream
TBufStream.Close | Flush data and Close the file.


TBufStream.Read

Read data from the file to a buffer in memory.

Declaration

Source position: objects.pp line 354

procedure TBufStream.Read(

  var Buf;

  Count: LongInt

); virtual;

Description

If the Stream is open and the stream status is stOK then Read will read Count bytes from the stream and place them in Buf.

Read will first try to read the data from the stream's internal buffer. If insufficient data is available, the buffer will be filled before contiunuing to read. This process is repeated until all needed data has been read.

For an example, see TStream.Read.

Errors

In case of an error, Status is set to StReadError, and ErrorInfo gets the OS specific error, or 0 when an attempt was made to read beyond the end of the stream.

See also

TStream.Read | Read data from stream to buffer.
TBufStream.Write | Write data to the file from a buffer in memory.


TBufStream.Seek

Set current position in file.

Declaration

Source position: objects.pp line 352

procedure TBufStream.Seek(

  Pos: LongInt

); virtual;

Description

If the stream's status is stOK, then Seek sets the file position to Pos. Pos is a zero-based offset, counted from the beginning of the file.

For an example, see TStream.Seek;

Errors

In case an error occurs, the stream's status is set to stSeekError, and the OS error code is stored in ErrorInfo.

See also

TStream.Seek | Set stream position.
TStream.GetPos | Return current position in the stream


TBufStream.Truncate

Flush buffer, and truncate the file at current position.

Declaration

Source position: objects.pp line 351

procedure TBufStream.Truncate; virtual;

Description

If the status of the stream is stOK, then Truncate tries to flush the buffer, and then truncates the stream size to the current file position.

For an example, see TDosStream.Truncate.

Errors

Errors can be those of Flush or TDosStream.Truncate.

See also

TStream.Truncate | Truncate the stream size on current position.
TDosStream.Truncate | Truncate the file on the current position.
TStream.GetSize | Return the size of the stream.


TBufStream.Write

Write data to the file from a buffer in memory.

Declaration

Source position: objects.pp line 355

procedure TBufStream.Write(

  var Buf;

  Count: LongInt

); virtual;

Description

If the Stream is open and the stream status is stOK then Write will write Count bytes from Buf and place them in the stream.

Write will first try to write the data to the stream's internal buffer. When the internal buffer is full, then the contents will be written to disk. This process is repeated until all data has been written.

For an example, see TStream.Read.

Errors

In case of an error, Status is set to StWriteError, and ErrorInfo gets the OS specific error.

See also

TStream.Write | Write a number of bytes to the stream.
TBufStream.Read | Read data from the file to a buffer in memory.


TCollection

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Manage a collection of pointers of objects

Declaration

Source position: objects.pp line 399

type TCollection = object(TObject)
Items: PItemList; | Pointer to list of items.
Count: Sw_Integer; | Current count of items
Limit: Sw_Integer; | Max number of items
Delta: Sw_Integer; | Number of pointers to allocate when adding items.
constructor Init(); | Instantiate a new collection.
constructor Load(); | Initialize a new collection and load collection from a stream.
destructor Done; virtual; | Clean up collection, release all memory.
function At(); | Return the item at a certain index.
function IndexOf(); virtual; | Find the position of a certain item.
function GetItem(); virtual; | Read one item off the stream.
function LastThat(); | Return last item which matches a test.
function FirstThat(); | Return first item which matches a test.
procedure Pack; | Remove all >Nil pointers from the collection.
procedure FreeAll; | Release all objects from the collection.
procedure DeleteAll; | Delete all elements from the collection. Objects are not destroyed.
procedure Free(); | Free item from collection, calling it's destructor.
procedure Insert(); virtual; | Insert a new item in the collection at the end.
procedure Delete(); | Delete an item from the collection, but does not destroy it.
procedure AtFree(); | Free an item at the indicates position, calling it's destructor.
procedure FreeItem(); virtual; | Destroy a non-nil item.
procedure AtDelete(); | Delete item at certain position.
procedure ForEach(); | Execute procedure for each item in the list.
procedure SetLimit(); virtual; | Set maximum number of elements in the collection.
procedure Error(); virtual; | Set error code.
procedure AtPut(); | Set collection item, overwriting an existing value.
procedure AtInsert(); | Insert an element at a certain position in the collection.
procedure Store(); | Write collection to a stream.
procedure PutItem(); virtual; | Put one item on the stream
end;

Inheritance

TCollection | Manage a collection of pointers of objects
TObject | Basis of all objects

Description

The TCollection object manages a collection of pointers or objects. It also provides a series of methods to manipulate these pointers or objects.

Whether or not objects are used depends on the kind of calls you use. All kinds come in 2 flavors, one for objects, one for pointers.


TCollection

TObject


TCollection
 | Init
 | Load
 | Done
 | At
 | IndexOf
 | GetItem
 | LastThat
 | FirstThat
 | Pack
 | FreeAll
 | DeleteAll
 | Free
 | Insert
 | Delete
 | AtFree
 | FreeItem
 | AtDelete
 | ForEach
 | SetLimit
 | Error
 | AtPut
 | AtInsert
 | Store
 | PutItem
TObject
 | Init
 | Free
 | Is_Object
 | Done


At (TCollection)

AtDelete (TCollection)

AtFree (TCollection)

AtInsert (TCollection)

AtPut (TCollection)

Delete (TCollection)

DeleteAll (TCollection)

Done (TObject)

Done (TCollection)

Error (TCollection)

FirstThat (TCollection)

ForEach (TCollection)

Free (TObject)

Free (TCollection)

FreeAll (TCollection)

FreeItem (TCollection)

GetItem (TCollection)

IndexOf (TCollection)

Init (TObject)

Init (TCollection)

Insert (TCollection)

Is_Object (TObject)

LastThat (TCollection)

Load (TCollection)

Pack (TCollection)

PutItem (TCollection)

SetLimit (TCollection)

Store (TCollection)


TCollection.At

Return the item at a certain index.

Declaration

Source position: objects.pp line 407

function TCollection.At(

  Index: Sw_Integer

):Pointer;

Description

At returns the item at position Index.

Errors

If Index is less than zero or larger than the number of items in the collection, seepl{Error}{TCollection.Error} is called with coIndexError and Index as arguments, resulting in a run-time error.

See also

TCollection.Insert

Insert a new item in the collection at the end.

Example

Program ex23;

{ Program to demonstrate the TCollection.At method }

Uses Objects,MyObject; { For TMyObject definition and registration }

Var C : PCollection;
    M : PMyObject;
    I : Longint;

begin
  C:=New(PCollection,Init(100,10));
  For I:=1 to 100 do
    begin
    M:=New(PMyObject,Init);
    M^.SetField(100-I);
    C^.Insert(M);
    end;
  For I:=0 to C^.Count-1 do
    begin
    M:=C^.At(I);
    Writeln ('Object ',i,' has field : ',M^.GetField);
    end;
  C^.FreeAll;
  Dispose(C,Done);
end.


TCollection.AtDelete

Delete item at certain position.

Declaration

Source position: objects.pp line 420

procedure TCollection.AtDelete(

  Index: Sw_Integer

);

Description

AtDelete deletes the pointer at position Index in the collection. It doesn't call the object's destructor.

Errors

If Index isn't valid then Error is called with CoIndexError.

See also

TCollection.Delete

Delete an item from the collection, but does not destroy it.

Example

Program ex33;

{ Program to demonstrate the TCollection.AtDelete method }

Uses Objects,MyObject; { For TMyObject definition and registration }

Var C : PCollection;
    M : PMyObject;
    I : Longint;

begin
  Randomize;
  C:=New(PCollection,Init(120,10));
  For I:=1 to 100 do
    begin
    M:=New(PMyObject,Init);
    M^.SetField(I-1);
    C^.Insert(M);
    end;
  Writeln ('Added 100 Items.');
  With C^ do
    While Count>0 do AtDelete(Count-1);
  Writeln ('Freed all objects.');
  Dispose(C,Done);
end.


TCollection.AtFree

Free an item at the indicates position, calling it's destructor.

Declaration

Source position: objects.pp line 418

procedure TCollection.AtFree(

  Index: Sw_Integer

);

Description

AtFree deletes the item at position Index in the collection, and calls the item's destructor if it is not Nil.

Errors

If Index isn't valid then Error is called with CoIndexError.

See also

TCollection.Free | Free item from collection, calling it's destructor.
TCollection.AtDelete | Delete item at certain position.

Example

Program ex32;

{ Program to demonstrate the TCollection.AtFree method }

Uses Objects,MyObject; { For TMyObject definition and registration }

Var C : PCollection;
    M : PMyObject;
    I : Longint;

begin
  Randomize;
  C:=New(PCollection,Init(120,10));
  For I:=1 to 100 do
    begin
    M:=New(PMyObject,Init);
    M^.SetField(I-1);
    C^.Insert(M);
    end;
  Writeln ('Added 100 Items');
  With C^ do
    While Count>0 do AtFree(Count-1);
  Writeln ('Freed all objects.');
  Dispose(C,Done);
end.


TCollection.AtInsert

Insert an element at a certain position in the collection.

Declaration

Source position: objects.pp line 425

procedure TCollection.AtInsert(

  Index: Sw_Integer;

  Item: Pointer

);

Description

AtInsert inserts Item in the collection at position Index, shifting all elements by one position. In case the current limit is reached, the collection will try to expand with a call to SetLimit

Errors

If Index isn't valid then Error is called with CoIndexError. If the collection fails to expand, then coOverFlow is passd to Error.

See also

TCollection.Insert

Insert a new item in the collection at the end.

Example

Program ex34;

{ Program to demonstrate the TCollection.AtInsert method }

Uses Objects,MyObject; { For TMyObject definition and registration }

Var C : PCollection;
    M : PMyObject;
    I : Longint;

Procedure PrintField (Dummy: Pointer;P : PMyObject);

begin
  Writeln ('Field : ',P^.GetField);
end;

begin
  Randomize;
  C:=New(PCollection,Init(120,10));
  Writeln ('Inserting 100 records at random places.');
  For I:=1 to 100 do
    begin
    M:=New(PMyObject,Init);
    M^.SetField(I-1);
    If I=1 then
      C^.Insert(M)
    else
      With C^ do
        AtInsert(Random(Count),M);
    end;
  Writeln ('Values : ');
  C^.Foreach(@PrintField);
  Dispose(C,Done);
end.


TCollection.AtPut

Set collection item, overwriting an existing value.

Declaration

Source position: objects.pp line 424

procedure TCollection.AtPut(

  Index: Sw_Integer;

  Item: Pointer

);

Description

AtPut sets the element at position Index in the collection to Item. Any previous value is overwritten.

For an example, see Pack.

Errors

If Index isn't valid then Error is called with CoIndexError.


TCollection.Count

Current count of items

Declaration

Source position: objects.pp line 401

TCollection.Count : Sw_Integer;


TCollection.Delete

Delete an item from the collection, but does not destroy it.

Declaration

Source position: objects.pp line 417

procedure TCollection.Delete(

  Item: Pointer

);

Description

Delete deletes Item from the collection. It doesn't call the item's destructor, though. For this the Free call is provided.

Errors

If the Item is not in the collection, Error will be called with coIndexError.

See also

TCollection.AtDelete | Delete item at certain position.
TCollection.Free | Free item from collection, calling it's destructor.

Example

Program ex31;

{ Program to demonstrate the TCollection.Delete method }

Uses Objects,MyObject; { For TMyObject definition and registration }

Var C : PCollection;
    M : PMyObject;
    I : Longint;

begin
  Randomize;
  C:=New(PCollection,Init(120,10));
  For I:=1 to 100 do
    begin
    M:=New(PMyObject,Init);
    M^.SetField(I-1);
    C^.Insert(M);
    end;
  Writeln ('Added 100 Items.');
  With C^ do
    While Count>0 do Delete(At(Count-1));
  Writeln ('Freed all objects');
  Dispose(C,Done);
end.


TCollection.DeleteAll

Delete all elements from the collection. Objects are not destroyed.

Declaration

Source position: objects.pp line 414

procedure TCollection.DeleteAll;

Description

DeleteAll deletes all elements from the collection. It just sets the Count variable to zero. Contrary to FreeAll, DeletAll doesn't call the destructor of the objects.

Errors

None.

See also

TCollection.FreeAll | Release all objects from the collection.
TCollection.Delete | Delete an item from the collection, but does not destroy it.

Example

Program ex29;

{
 Program to demonstrate the TCollection.DeleteAll method
 Compare with example 28, where FreeAll is used.
}

Uses Objects,MyObject; { For TMyObject definition and registration }

Var C : PCollection;
    M : PMyObject;
    I : Longint;

begin
  Randomize;
  C:=New(PCollection,Init(120,10));
  For I:=1 to 100 do
    begin
    M:=New(PMyObject,Init);
    M^.SetField(I-1);
    C^.Insert(M);
    end;
  Writeln ('Added 100 Items.');
  C^.DeleteAll;
  Writeln ('Deleted all objects.');
  Dispose(C,Done);
end.


TCollection.Delta

Number of pointers to allocate when adding items.

Declaration

Source position: objects.pp line 403

TCollection.Delta : Sw_Integer;


TCollection.Done

Clean up collection, release all memory.

Declaration

Source position: objects.pp line 406

destructor TCollection.Done; virtual;

Description

Done frees all objects in the collection, and then releases all memory occupied by the instance.

For an example, see TCollection.ForEach.

Errors

None.

See also

TCollection.Init | Instantiate a new collection.
TCollection.FreeAll | Release all objects from the collection.


TCollection.Error

Set error code.

Declaration

Source position: objects.pp line 423

procedure TCollection.Error(

  Code: Integer;

  Info: Integer

); virtual;

Description

Error is called by the various TCollection methods in case of an error condition. The default behaviour is to make a call to RunError with an error of 212-Code.

This method can be overridden by descendent objects to implement a different error-handling.

See also

Abstract

Abstract error handler.


TCollection.FirstThat

Return first item which matches a test.

Declaration

Source position: objects.pp line 411

function TCollection.FirstThat(

  Test: CodePointer

):Pointer;

Description

This function returns the first item in the collection for which Test returns a non-nil result. Test is a function that accepts 1 argument: a pointer to an object, and that returns a pointer as a result.

Errors

None.

See also

TCollection.LastThat

Return last item which matches a test.

Example

Program ex21;

{ Program to demonstrate the TCollection.FirstThat method }

Uses Objects,MyObject; { For TMyObject definition and registration }

Var C : PCollection;
    M : PMyObject;
    I : Longint;

Function CheckField (Dummy: Pointer;P : PMyObject) : Longint;

begin
  If P^.GetField>56 then
    Checkfield:=1
  else
    CheckField:=0;
end;

begin
  C:=New(PCollection,Init(100,10));
  For I:=1 to 100 do
    begin
    M:=New(PMyObject,Init);
    M^.SetField(I);
    C^.Insert(M);
    end;
  Writeln ('Inserted ',C^.Count,' objects');
  Writeln ('first one for which Field>56  has index (should be 56) : ',
            C^.IndexOf(C^.FirstThat(@CheckField)));
  C^.FreeAll;
  Dispose(C,Done);
end.


TCollection.ForEach

Execute procedure for each item in the list.

Declaration

Source position: objects.pp line 421

procedure TCollection.ForEach(

  Action: CodePointer

);

Description

ForEach calls Action for each element in the collection, and passes the element as an argument to Action.

Action is a procedural type variable that accepts a pointer as an argument.

Errors

None.

See also

TCollection.FirstThat | Return first item which matches a test.
TCollection.LastThat | Return last item which matches a test.

Example

Program ex21;

{ Program to demonstrate the TCollection.Foreach method }

Uses Objects,MyObject; { For TMyObject definition and registration }

Var C : PCollection;
    M : PMyObject;
    I : Longint;

Procedure PrintField (Dummy: Pointer;P : PMyObject);

begin
  Writeln ('Field : ',P^.GetField);
end;

begin
  C:=New(PCollection,Init(100,10));
  For I:=1 to 100 do
    begin
    M:=New(PMyObject,Init);
    M^.SetField(100-I);
    C^.Insert(M);
    end;
  Writeln ('Inserted ',C^.Count,' objects');
  C^.ForEach(@PrintField);
  C^.FreeAll;
  Dispose(C,Done);
end.


TCollection.Free

Free item from collection, calling it's destructor.

Declaration

Source position: objects.pp line 415

procedure TCollection.Free(

  Item: Pointer

);

Description

Free Deletes Item from the collection, and calls the destructor Done of the object.

Errors

If the Item is not in the collection, Error will be called with coIndexError.

See also

TCollection.FreeItem

Destroy a non-nil item.

Example

Program ex30;

{ Program to demonstrate the TCollection.Free method }

Uses Objects,MyObject; { For TMyObject definition and registration }

Var C : PCollection;
    M : PMyObject;
    I : Longint;

begin
  Randomize;
  C:=New(PCollection,Init(120,10));
  For I:=1 to 100 do
    begin
    M:=New(PMyObject,Init);
    M^.SetField(I-1);
    C^.Insert(M);
    end;
  Writeln ('Added 100 Items.');
  With C^ do
    While Count>0 do Free(At(Count-1));
  Writeln ('Freed all objects.');
  Dispose(C,Done);
end.


TCollection.FreeAll

Release all objects from the collection.

Declaration

Source position: objects.pp line 413

procedure TCollection.FreeAll;

Description

FreeAll calls the destructor of each object in the collection. It doesn't release any memory occumpied by the collection itself, but it does set Count to zero.

See also

TCollection.DeleteAll | Delete all elements from the collection. Objects are not destroyed.
TCollection.FreeItem | Destroy a non-nil item.

Example

Program ex28;

{ Program to demonstrate the TCollection.FreeAll method }

Uses Objects,MyObject; { For TMyObject definition and registration }

Var C : PCollection;
    M : PMyObject;
    I : Longint;

begin
  Randomize;
  C:=New(PCollection,Init(120,10));
  For I:=1 to 100 do
    begin
    M:=New(PMyObject,Init);
    M^.SetField(I-1);
    C^.Insert(M);
    end;
  Writeln ('Added 100 Items.');
  C^.FreeAll;
  Writeln ('Freed all objects.');
  Dispose(C,Done);
end.


TCollection.FreeItem

Destroy a non-nil item.

Declaration

Source position: objects.pp line 419

procedure TCollection.FreeItem(

  Item: Pointer

); virtual;

Description

FreeItem calls the destructor of Item if it is not nil.

Remark: This function is used internally by the TCollection object, and should not be called directly.

Errors

None.

See also

TCollection.Free | Free item from collection, calling it's destructor.
TCollection.AtFree | Free an item at the indicates position, calling it's destructor.


TCollection.GetItem

Read one item off the stream.

Declaration

Source position: objects.pp line 409

function TCollection.GetItem(

  var S: TStream

):Pointer; virtual;

Description

GetItem reads a single item off the stream S, and returns a pointer to this item. This method is used internally by the Load method, and should not be used directly.

Errors

Possible errors are the ones from TStream.Get.

See also

TStream.Get | Read an object definition from the stream.
TCollection.Store | Write collection to a stream.


TCollection.IndexOf

Find the position of a certain item.

Declaration

Source position: objects.pp line 408

function TCollection.IndexOf(

  Item: Pointer

):Sw_Integer; virtual;

Description

IndexOf returns the index of Item in the collection. If Item isn't present in the collection, -1 is returned.

Errors

If the item is not present, -1 is returned.

See also

TCollection.At | Return the item at a certain index.
TCollection.GetItem | Read one item off the stream.
TCollection.Insert | Insert a new item in the collection at the end.

Example

Program ex24;

{ Program to demonstrate the TCollection.IndexOf method }

Uses Objects,MyObject; { For TMyObject definition and registration }

Var C : PCollection;
    M,Keep : PMyObject;
    I : Longint;

begin
  Randomize;
  C:=New(PCollection,Init(100,10));
  Keep:=Nil;
  For I:=1 to 100 do
    begin
    M:=New(PMyObject,Init);
    M^.SetField(I-1);
    If Random<0.1 then
     Keep:=M;
    C^.Insert(M);
    end;
  If Keep=Nil then
    begin
    Writeln ('Please run again. No object selected');
    Halt(1);
    end;
  Writeln ('Selected object has field : ',Keep^.GetField);
  Write ('Selected object has index : ',C^.IndexOf(Keep));
  Writeln (' should match it''s field.');
  C^.FreeAll;
  Dispose(C,Done);
end.


TCollection.Init

Instantiate a new collection.

Declaration

Source position: objects.pp line 404

constructor TCollection.Init(

  ALimit: Sw_Integer;

  ADelta: Sw_Integer

);

Description

Init initializes a new instance of a collection. It sets the (initial) maximum number of items in the collection to ALimit. ADelta is the increase size : The number of memory places that will be allocated in case ALimit is reached, and another element is added to the collection.

For an example, see TCollection.ForEach.

Errors

None.

See also

TCollection.Load | Initialize a new collection and load collection from a stream.
TCollection.Done | Clean up collection, release all memory.


TCollection.Insert

Insert a new item in the collection at the end.

Declaration

Source position: objects.pp line 416

procedure TCollection.Insert(

  Item: Pointer

); virtual;

Description

Insert inserts Item in the collection. TCollection inserts this item at the end, but descendent objects may insert it at another place.

Errors

None.

See also

TCollection.AtInsert | Insert an element at a certain position in the collection.
TCollection.AtPut | Set collection item, overwriting an existing value.


TCollection.Items

Pointer to list of items.

Declaration

Source position: objects.pp line 400

TCollection.Items : PItemList;


TCollection.LastThat

Return last item which matches a test.

Declaration

Source position: objects.pp line 410

function TCollection.LastThat(

  Test: CodePointer

):Pointer;

Description

This function returns the last item in the collection for which Test returns a non-nil result. Test is a function that accepts 1 argument: a pointer to an object, and that returns a pointer as a result.

Errors

None.

See also

TCollection.FirstThat

Return first item which matches a test.

Example

Program ex21;

{ Program to demonstrate the TCollection.Foreach method }

Uses Objects,MyObject; { For TMyObject definition and registration }

Var C : PCollection;
    M : PMyObject;
    I : Longint;

Function CheckField (Dummy: Pointer;P : PMyObject) : Longint;

begin
  If P^.GetField<56 then
    Checkfield:=1
  else
    CheckField:=0;
end;

begin
  C:=New(PCollection,Init(100,10));
  For I:=1 to 100 do
    begin
    M:=New(PMyObject,Init);
    M^.SetField(I);
    C^.Insert(M);
    end;
  Writeln ('Inserted ',C^.Count,' objects');
  Writeln ('Last one for which Field<56  has index (should be 54) : ',
            C^.IndexOf(C^.LastThat(@CheckField)));
  C^.FreeAll;
  Dispose(C,Done);
end.


TCollection.Limit

Max number of items

Declaration

Source position: objects.pp line 402

TCollection.Limit : Sw_Integer;


TCollection.Load

Initialize a new collection and load collection from a stream.

Declaration

Source position: objects.pp line 405

constructor TCollection.Load(

  var S: TStream

);

Description

Load initializes a new instance of a collection. It reads from stream S the item count, the item limit count, and the increase size. After that, it reads the specified number of items from the stream.

Errors

Errors returned can be those of GetItem.

See also

TCollection.Init | Instantiate a new collection.
TCollection.GetItem | Read one item off the stream.
TCollection.Done | Clean up collection, release all memory.

Example

Program ex22;

{ Program to demonstrate the TCollection.Load method }

Uses Objects,MyObject; { For TMyObject definition and registration }

Var C : PCollection;
    M : PMyObject;
    I : Longint;
    S : PMemoryStream;

begin
  C:=New(PCollection,Init(100,10));
  For I:=1 to 100 do
    begin
    M:=New(PMyObject,Init);
    M^.SetField(100-I);
    C^.Insert(M);
    end;
  Writeln ('Inserted ',C^.Count,' objects');
  S:=New(PMemorySTream,Init(1000,10));
  C^.Store(S^);
  C^.FreeAll;
  // Dispose(C,Done);
  S^.Seek(0);
  C^.Load(S^);
  Writeln ('Read ',C^.Count,' objects from stream.');
  Dispose(S,Done);
  Dispose(C,Done);
end.


TCollection.Pack

Remove all >Nil pointers from the collection.

Declaration

Source position: objects.pp line 412

procedure TCollection.Pack;

Description

Pack removes all Nil pointers from the collection, and adjusts Count to reflect this change. No memory is freed as a result of this call. In order to free any memory, you can call SetLimit with an argument of Count after a call to Pack.

Errors

None.

See also

TCollection.SetLimit

Set maximum number of elements in the collection.

Example

Program ex21;

{ Program to demonstrate the TCollection.FirstThat method }

Uses Objects,MyObject; { For TMyObject definition and registration }

Var C : PCollection;
    M : PMyObject;
    I : Longint;

Function CheckField (Dummy: Pointer;P : PMyObject) : Longint;

begin
  If P^.GetField>56 then
    Checkfield:=1
  else
    CheckField:=0;
end;

begin
  C:=New(PCollection,Init(100,10));
  For I:=1 to 100 do
    begin
    M:=New(PMyObject,Init);
    M^.SetField(I);
    C^.Insert(M);
    end;
  Writeln ('Inserted ',C^.Count,' objects');
  Writeln ('first one for which Field>56  has index (should be 56) : ',
            C^.IndexOf(C^.FirstThat(@CheckField)));
  C^.FreeAll;
  Dispose(C,Done);
end.


TCollection.PutItem

Put one item on the stream

Declaration

Source position: objects.pp line 427

procedure TCollection.PutItem(

  var S: TStream;

  Item: Pointer

); virtual;

Description

PutItem writes Item to stream S. This method is used internaly by the TCollection object, and should not be called directly.

Errors

Errors are those returned by TStream.Put.

See also

Store | Write collection to a stream.
GetItem | Read one item off the stream.


TCollection.SetLimit

Set maximum number of elements in the collection.

Declaration

Source position: objects.pp line 422

procedure TCollection.SetLimit(

  ALimit: Sw_Integer

); virtual;

Description

SetLimit sets the maximum number of elements in the collection. ALimit must not be less than Count, and should not be larger than MaxCollectionSize

For an example, see Pack.

Errors

None.

See also

TCollection.Init

Instantiate a new collection.


TCollection.Store

Write collection to a stream.

Declaration

Source position: objects.pp line 426

procedure TCollection.Store(

  var S: TStream

);

Description

Store writes the collection to the stream S. It does this by writeing the current Count, Limit and Delta to the stream, and then writing each item to the stream.

The contents of the stream are then suitable for instantiating another collection with Load.

For an example, see TCollection.Load.

Errors

Errors returned are those by TStream.Put.

See also

TCollection.Load | Initialize a new collection and load collection from a stream.
TCollection.PutItem | Put one item on the stream


TDosStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

DOS file stream

Declaration

Source position: objects.pp line 314

type TDosStream = object(TStream)
Handle: THandle; | OS file handle for stream
FName: AsciiZ; | File name
constructor Init(); | Instantiate a new instance of TDosStream.
destructor Done; virtual; | Closes the file and cleans up the instance.
procedure Close; virtual; | Close the file.
procedure Truncate; virtual; | Truncate the file on the current position.
procedure Seek(); virtual; | Set file position.
procedure Open(); virtual; | Open the file stream
procedure Read(); virtual; | Read data from the stream to a buffer.
procedure Write(); virtual; | Write data from a buffer to the stream.
end;

Inheritance

TDosStream | DOS file stream
TStream | Base stream class
TObject | Basis of all objects

Description

TDosStream is a stream that stores it's contents in a file. it overrides a couple of methods of TStream for this.

In addition to the fields inherited from TStream (see TStream), there are some extra fields, that describe the file. (mainly the name and the OS file handle)

No buffering in memory is done when using TDosStream. All data are written directly to the file. For a stream that buffers in memory, see TBufStream.


TDosStream

TStream

TObject


TDosStream
 | Init
 | Done
 | Close
 | Truncate
 | Seek
 | Open
 | Read
 | Write
TStream
 | Init
 | Get
 | StrRead
 | GetPos
 | GetSize
 | ReadStr
 | Open
 | Close
 | Reset
 | Flush
 | Truncate
 | Put
 | StrWrite
 | WriteStr
 | Seek
 | Error
 | Read
 | Write
 | CopyFrom
TObject
 | Init
 | Free
 | Is_Object
 | Done


Close (TStream)

Close (TDosStream)

CopyFrom (TStream)

Done (TObject)

Done (TDosStream)

Error (TStream)

Flush (TStream)

Free (TObject)

Get (TStream)

GetPos (TStream)

GetSize (TStream)

Init (TObject)

Init (TStream)

Init (TDosStream)

Is_Object (TObject)

Open (TStream)

Open (TDosStream)

Put (TStream)

Read (TStream)

Read (TDosStream)

ReadStr (TStream)

Reset (TStream)

Seek (TStream)

Seek (TDosStream)

StrRead (TStream)

StrWrite (TStream)

Truncate (TStream)

Truncate (TDosStream)

Write (TStream)

Write (TDosStream)

WriteStr (TStream)


TDosStream.Close

Close the file.

Declaration

Source position: objects.pp line 319

procedure TDosStream.Close; virtual;

Description

Close closes the file if it was open, and sets Handle to -1. Contrary to Done it does not clean up the instance of TDosStream

For an example, see TDosStream.Open.

Errors

None.

See also

TStream.Close | Close the stream
TDosStream.Init | Instantiate a new instance of TDosStream.
TDosStream.Done | Closes the file and cleans up the instance.


TDosStream.Done

Closes the file and cleans up the instance.

Declaration

Source position: objects.pp line 318

destructor TDosStream.Done; virtual;

Description

Done closes the file if it was open and cleans up the instance of TDosStream.

for an example, see e.g. TDosStream.Truncate.

Errors

None.

See also

TDosStream.Init | Instantiate a new instance of TDosStream.
TDosStream.Close | Close the file.


TDosStream.FName

File name

Declaration

Source position: objects.pp line 316

TDosStream.FName : AsciiZ;


TDosStream.Handle

OS file handle for stream

Declaration

Source position: objects.pp line 315

TDosStream.Handle : THandle;


TDosStream.Init

Instantiate a new instance of TDosStream.

Declaration

Source position: objects.pp line 317

constructor TDosStream.Init(

  FileName: FNameStr;

  Mode: Word

);

Description

Init instantiates an instance of TDosStream. The name of the file that contains (or will contain) the data of the stream is given in FileName. The Mode parameter determines whether a new file should be created and what access rights you have on the file. It can be one of the following constants:

stCreate
Creates a new file.
stOpenRead
Read access only.
stOpenWrite
Write access only.
stOpen
Read and write access.

For an example, see TDosStream.Truncate.

Errors

On error, Status is set to stInitError, and ErrorInfo is set to the dos error code.

See also

TDosStream.Done

Closes the file and cleans up the instance.


TDosStream.Open

Open the file stream

Declaration

Source position: objects.pp line 322

procedure TDosStream.Open(

  OpenMode: Word

); virtual;

Description

If the stream's status is stOK, and the stream is closed then Open re-opens the file stream with mode OpenMode. This call can be used after a Close call.

Errors

If an error occurs when re-opening the file, then Status is set to stOpenError, and the OS error code is stored in ErrorInfo

See also

TStream.Open | Open the stream
TDosStream.Close | Close the file.

Example

Program ex14;

{ Program to demonstrate the TStream.Close method }

Uses Objects;

Var L : String;
    P : PString;
    S : PDosStream; { Only one with Close implemented. }

begin
  L:='Some constant string';
  S:=New(PDosStream,Init('test.dat',stcreate));
  Writeln ('Writing "',L,'" to stream with handle ',S^.Handle);
  S^.WriteStr(@L);
  S^.Close;
  Writeln ('Closed stream. File handle is ',S^.Handle);
  S^.Open (stOpenRead);
  P:=S^.ReadStr;
  L:=P^;
  DisposeStr(P);
  Writeln ('Read "',L,'" from stream with handle ',S^.Handle);
  S^.Close;
  Dispose (S,Done);
end.


TDosStream.Read

Read data from the stream to a buffer.

Declaration

Source position: objects.pp line 323

procedure TDosStream.Read(

  var Buf;

  Count: LongInt

); virtual;

Description

If the Stream is open and the stream status is stOK then Read will read Count bytes from the stream and place them in Buf.

For an example, see TStream.Read.

Errors

In case of an error, Status is set to StReadError, and ErrorInfo gets the OS specific error, or 0 when an attempt was made to read beyond the end of the stream.

See also

TStream.Read | Read data from stream to buffer.
TDosStream.Write | Write data from a buffer to the stream.


TDosStream.Seek

Set file position.

Declaration

Source position: objects.pp line 321

procedure TDosStream.Seek(

  Pos: LongInt

); virtual;

Description

If the stream's status is stOK, then Seek sets the file position to Pos. Pos is a zero-based offset, counted from the beginning of the file.

Errors

In case an error occurs, the stream's status is set to stSeekError, and the OS error code is stored in ErrorInfo.

See also

TStream.Seek | Set stream position.
TStream.GetPos | Return current position in the stream

Example

Program ex17;

{ Program to demonstrate the TStream.Seek method }

Uses Objects;

Var L : String;
    Marker : Word;
    P : PString;
    S : PDosStream;

begin
  L:='Some constant string';
  { Buffer size of 100 }
  S:=New(PDosStream,Init('test.dat',stcreate));
  Writeln ('Writing "',L,'" to stream.');
  S^.WriteStr(@L);
  Marker:=S^.GetPos;
  Writeln ('Set marker at ',Marker);
  L:='Some other constant String';
  Writeln ('Writing "',L,'" to stream.');
  S^.WriteStr(@L);
  S^.Close;
  S^.Open (stOpenRead);
  Writeln ('Size of stream is : ',S^.GetSize);
  Writeln ('Seeking to marker');
  S^.Seek(Marker);
  P:=S^.ReadStr;
  L:=P^;
  DisposeStr(P);
  Writeln ('Read "',L,'" from stream.');
  S^.Close;
  Dispose (S,Done);
end.


TDosStream.Truncate

Truncate the file on the current position.

Declaration

Source position: objects.pp line 320

procedure TDosStream.Truncate; virtual;

Description

If the status of the stream is stOK, then Truncate tries to truncate the stream size to the current file position.

Errors

If an error occurs, the stream's status is set to stError and ErrorInfo is set to the OS error code.

See also

TStream.Truncate | Truncate the stream size on current position.
TStream.GetSize | Return the size of the stream.

Example

Program ex16;

{ Program to demonstrate the TStream.Truncate method }

Uses Objects;

Var L : String;
    P : PString;
    S : PDosStream; { Only one with Truncate implemented. }

begin
  L:='Some constant string';
  { Buffer size of 100 }
  S:=New(PDosStream,Init('test.dat',stcreate));
  Writeln ('Writing "',L,'" to stream with handle ',S^.Handle);
  S^.WriteStr(@L);
  S^.WriteStr(@L);
  { Close calls flush first }
  S^.Close;
  S^.Open (stOpen);
  Writeln ('Size of stream is : ',S^.GetSize);
  P:=S^.ReadStr;
  L:=P^;
  DisposeStr(P);
  Writeln ('Read "',L,'" from stream with handle ',S^.Handle);
  S^.Truncate;
  Writeln ('Truncated stream. Size is : ',S^.GetSize);
  S^.Close;
  Dispose (S,Done);
end.


TDosStream.Write

Write data from a buffer to the stream.

Declaration

Source position: objects.pp line 324

procedure TDosStream.Write(

  var Buf;

  Count: LongInt

); virtual;

Description

If the Stream is open and the stream status is stOK then Write will write Count bytes from Buf and place them in the stream.

For an example, see TStream.Read.

Errors

In case of an error, Status is set to StWriteError, and ErrorInfo gets the OS specific error.

See also

TStream.Write | Write a number of bytes to the stream.
TDosStream.Read | Read data from the stream to a buffer.


TMemoryStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Stream which keeps data in memory.

Declaration

Source position: objects.pp line 370

type TMemoryStream = object(TStream)
BlkCount: LongInt; | Number of allocated memory blocks
BlkSize: Word; | Size of one memory block
MemSize: LongInt; | Total memory size
BlkList: PPointerArray; | Pointer to list of allocated blocks.
constructor Init(); | Initialize memory stream, reserves memory for stream data.
destructor Done; virtual; | Clean up memory and destroy the object instance.
procedure Truncate; virtual; | Set the stream size to the current position.
procedure Read(); virtual; | Read data from the stream to a location in memory.
procedure Write(); virtual; | Write data to the stream.
end;

Inheritance

TMemoryStream | Stream which keeps data in memory.
TStream | Base stream class
TObject | Basis of all objects

Description

The TMemoryStream object implements a stream that stores it's data in memory. The data is stored on the heap, with the possibility to specify the maximum amout of data, and the size of the memory blocks being used.

See also

TStream

Base stream class


TMemoryStream

TStream

TObject


TMemoryStream
 | Init
 | Done
 | Truncate
 | Read
 | Write
TStream
 | Init
 | Get
 | StrRead
 | GetPos
 | GetSize
 | ReadStr
 | Open
 | Close
 | Reset
 | Flush
 | Truncate
 | Put
 | StrWrite
 | WriteStr
 | Seek
 | Error
 | Read
 | Write
 | CopyFrom
TObject
 | Init
 | Free
 | Is_Object
 | Done


Close (TStream)

CopyFrom (TStream)

Done (TObject)

Done (TMemoryStream)

Error (TStream)

Flush (TStream)

Free (TObject)

Get (TStream)

GetPos (TStream)

GetSize (TStream)

Init (TObject)

Init (TStream)

Init (TMemoryStream)

Is_Object (TObject)

Open (TStream)

Put (TStream)

Read (TStream)

Read (TMemoryStream)

ReadStr (TStream)

Reset (TStream)

Seek (TStream)

StrRead (TStream)

StrWrite (TStream)

Truncate (TStream)

Truncate (TMemoryStream)

Write (TStream)

Write (TMemoryStream)

WriteStr (TStream)


TMemoryStream.BlkCount

Number of allocated memory blocks

Declaration

Source position: objects.pp line 371

TMemoryStream.BlkCount : LongInt;


TMemoryStream.BlkList

Pointer to list of allocated blocks.

Declaration

Source position: objects.pp line 374

TMemoryStream.BlkList : PPointerArray;


TMemoryStream.BlkSize

Size of one memory block

Declaration

Source position: objects.pp line 372

TMemoryStream.BlkSize : Word;


TMemoryStream.Done

Clean up memory and destroy the object instance.

Declaration

Source position: objects.pp line 376

destructor TMemoryStream.Done; virtual;

Description

Done releases the memory blocks used by the stream, and then cleans up the memory used by the stream object itself.

For an example, see e.g TStream.CopyFrom.

Errors

None.

See also

TMemoryStream.Init

Initialize memory stream, reserves memory for stream data.


TMemoryStream.Init

Initialize memory stream, reserves memory for stream data.

Declaration

Source position: objects.pp line 375

constructor TMemoryStream.Init(

  ALimit: LongInt;

  ABlockSize: Word

);

Description

Init instantiates a new TMemoryStream object. The memorystreamobject will initially allocate at least ALimit bytes memory, divided into memory blocks of size ABlockSize. The number of blocks needed to get to ALimit bytes is rounded up.

By default, the number of blocks is 1, and the size of a block is 8192. This is selected if you specify 0 as the blocksize.

For an example, see e.g TStream.CopyFrom.

Errors

If the stream cannot allocate the initial memory needed for the memory blocks, then the stream's status is set to stInitError.

See also

TMemoryStream.Done

Clean up memory and destroy the object instance.


TMemoryStream.MemSize

Total memory size

Declaration

Source position: objects.pp line 373

TMemoryStream.MemSize : LongInt;


TMemoryStream.Read

Read data from the stream to a location in memory.

Declaration

Source position: objects.pp line 378

procedure TMemoryStream.Read(

  var Buf;

  Count: LongInt

); virtual;

Description

Read reads Count bytes from the stream to Buf. It updates the position of the stream.

For an example, see TStream.Read.

Errors

If there is not enough data available, no data is read, and the stream's status is set to stReadError.

See also

TStream.Read | Read data from stream to buffer.
TMemoryStream.Write | Write data to the stream.


TMemoryStream.Truncate

Set the stream size to the current position.

Declaration

Source position: objects.pp line 377

procedure TMemoryStream.Truncate; virtual;

Description

Truncate sets the size of the memory stream equal to the current position. It de-allocates any memory-blocks that are no longer needed, so that the new size of the stream is the current position in the stream, rounded up to the first multiple of the stream blocksize.

Errors

If an error occurs during memory de-allocation, the stream's status is set to stError

See also

TStream.Truncate

Truncate the stream size on current position.

Example

Program ex20;

{ Program to demonstrate the TMemoryStream.Truncate method }

Uses Objects;

Var L : String;
    P : PString;
    S : PMemoryStream;
    I : Longint;

begin
  L:='Some constant string';
  { Buffer size of 100 }
  S:=New(PMemoryStream,Init(1000,100));
  Writeln ('Writing 100 times "',L,'" to stream.');
  For I:=1 to 100 do
    S^.WriteStr(@L);
  Writeln ('Finished.');
  S^.Seek(100);
  S^.Truncate;
  Writeln ('Truncated at byte 100.');
  Dispose (S,Done);
  Writeln ('Finished.');
end.


TMemoryStream.Write

Write data to the stream.

Declaration

Source position: objects.pp line 379

procedure TMemoryStream.Write(

  var Buf;

  Count: LongInt

); virtual;

Description

Write copies Count bytes from Buf to the stream. It updates the position of the stream.

If not enough memory is available to hold the extra Count bytes, then the stream will try to expand, by allocating as much blocks with size BlkSize (as specified in the constuctor call Init) as needed.

For an example, see TStream.Read.

Errors

If the stream cannot allocate more memory, then the status is set to stWriteError

See also

TStream.Write | Write a number of bytes to the stream.
TMemoryStream.Read | Read data from the stream to a location in memory.


TObject

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Basis of all objects

Declaration

Source position: objects.pp line 254

type TObject = object
constructor Init; | Construct (initialize) a new object
procedure Free; | Destroy an object and release all memory.
function Is_Object(); | Check whether a pointer points to an object.
destructor Done; virtual; | Destroy an object.
end;

Inheritance

TObject

Basis of all objects

Description

This type serves as the basic object for all other objects in the Objects unit.


TObject


TObject
 | Init
 | Free
 | Is_Object
 | Done


Done (TObject)

Free (TObject)

Init (TObject)

Is_Object (TObject)


TObject.Done

Destroy an object.

Declaration

Source position: objects.pp line 258

destructor TObject.Done; virtual;

Description

Done, the destructor of TObject does nothing. It is mainly intended to be used in the TObject.Free method.

The destructore Done does not free the memory occupied by the object.

Errors

None.

See also

TObject.Free | Destroy an object and release all memory.
TObject.Init | Construct (initialize) a new object

Example

program ex8;

{ Program to demonstrate the TObject.Done call }

Uses Objects;

Var O : PObject;

begin
  // Allocate memory for object.
  O:=New(PObject,Init);
  O^.Done;
end.


TObject.Free

Destroy an object and release all memory.

Declaration

Source position: objects.pp line 256

procedure TObject.Free;

Description

Free calls the destructor of the object, and releases the memory occupied by the instance of the object.

Errors

No checking is performed to see whether self is nil and whether the object is indeed allocated on the heap.

See also

TObject.Init | Construct (initialize) a new object
TObject.Done | Destroy an object.

Example

program ex7;

{ Program to demonstrate the TObject.Free call }

Uses Objects;

Var O : PObject;

begin
  // Allocate memory for object.
  O:=New(PObject,Init);
  // Free memory of object.
  O^.free;
end.


TObject.Init

Construct (initialize) a new object

Declaration

Source position: objects.pp line 255

constructor TObject.Init;

Description

Instantiates a new object of type TObject. It fills the instance up with Zero bytes.

For an example, see Free

Errors

None.

See also

TObject.Free | Destroy an object and release all memory.
TObject.Done | Destroy an object.


TObject.Is_Object

Check whether a pointer points to an object.

Declaration

Source position: objects.pp line 257

function TObject.Is_Object(

  P: Pointer

):Boolean;

Description

Is_Object returns True if the pointer P points to an instance of a TObject descendent, it returns false otherwise.


TPoint

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Record describing a point in a 2 dimensional plane.

Declaration

Source position: objects.pp line 229

type TPoint = object
X: Sw_Integer; | X coordinate
Y: Sw_Integer; | Y coordinate
end;

Inheritance

TPoint

Record describing a point in a 2 dimensional plane.


TPoint


TPoint.X

X coordinate

Declaration

Source position: objects.pp line 230

TPoint.X : Sw_Integer;


TPoint.Y

Y coordinate

Declaration

Source position: objects.pp line 230

TPoint.Y : Sw_Integer;


TPointerArray

Array with maxmimum allowed number of pointers

Declaration

Source position: objects.pp line 145

type TPointerArray = array [0..MaxPtrs-1] of Pointer;


TRect

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Describes a rectangular region in a plane.

Declaration

Source position: objects.pp line 237

type TRect = object
A: TPoint; | Top left corner of rectangle
B: TPoint; | Bottom right corner of rectangle
function Empty; | Is the surface of the rectangle zero
function Equals(); | Do the corners of the rectangles match
function Contains(); | Determine if a point is inside the rectangle
procedure Copy(); | Copy cornerpoints from another rectangle.
procedure Union(); | Enlarges rectangle to encompas another rectangle.
procedure Intersect(); | Reduce rectangle to intersection with another rectangle
procedure Move(); | Move rectangle along a vector.
procedure Grow(); | Expand rectangle with certain size.
procedure Assign(); | Set rectangle corners.
end;

Inheritance

TRect

Describes a rectangular region in a plane.


TRect


TRect
 | Empty
 | Equals
 | Contains
 | Copy
 | Union
 | Intersect
 | Move
 | Grow
 | Assign


Assign (TRect)

Contains (TRect)

Copy (TRect)

Empty (TRect)

Equals (TRect)

Grow (TRect)

Intersect (TRect)

Move (TRect)

Union (TRect)


TRect.A

Top left corner of rectangle

Declaration

Source position: objects.pp line 238

TRect.A : TPoint;


TRect.Assign

Set rectangle corners.

Declaration

Source position: objects.pp line 247

procedure TRect.Assign(

  XA: Sw_Integer;

  YA: Sw_Integer;

  XB: Sw_Integer;

  YB: Sw_Integer

);

Description

Assign sets the corner points of the rectangle to (XA,YA) and (Xb,Yb).

For an example, see TRect.Copy.

Errors

None.

See also

TRect.Copy

Copy cornerpoints from another rectangle.


TRect.B

Bottom right corner of rectangle

Declaration

Source position: objects.pp line 238

TRect.B : TPoint;


TRect.Contains

Determine if a point is inside the rectangle

Declaration

Source position: objects.pp line 241

function TRect.Contains(

  P: TPoint

):Boolean;

Description

Contains returns True if the point P is contained in the rectangle (including borders), False otherwise.

Errors

None.

See also

TRect.Intersect | Reduce rectangle to intersection with another rectangle
TRect.Equals | Do the corners of the rectangles match


TRect.Copy

Copy cornerpoints from another rectangle.

Declaration

Source position: objects.pp line 242

procedure TRect.Copy(

  R: TRect

);

Description

Assigns the rectangle R to the object. After the call to Copy, the rectangle R has been copied to the object that invoked Copy.

Errors

None.

See also

TRect.Assign

Set rectangle corners.

Example

Program ex2;

{ Program to demonstrate TRect.Copy }

Uses objects;

Var ARect,BRect,CRect : TRect;

begin
  ARect.Assign(10,10,20,20);
  BRect.Assign(15,15,25,25);
  CRect.Copy(ARect);
  If ARect.Equals(CRect) Then
    Writeln ('ARect equals CRect')
  Else
    Writeln ('ARect does not equal CRect !');
end.


TRect.Empty

Is the surface of the rectangle zero

Declaration

Source position: objects.pp line 239

function TRect.Empty: Boolean;

Description

Empty returns True if the rectangle defined by the corner points A, B has zero or negative surface.

Errors

None.

See also

TRect.Equals | Do the corners of the rectangles match
TRect.Contains | Determine if a point is inside the rectangle

Example

Program ex1;

{ Program to demonstrate TRect.Empty }

Uses objects;

Var ARect,BRect : TRect;
    P : TPoint;

begin
  With ARect.A do
    begin
    X:=10;
    Y:=10;
    end;
  With ARect.B do
    begin
    X:=20;
    Y:=20;
    end;
  { Offset B by (5,5) }
  With BRect.A do
    begin
    X:=15;
    Y:=15;
    end;
  With BRect.B do
    begin
    X:=25;
    Y:=25;
    end;
  { Point }
  With P do
    begin
    X:=15;
    Y:=15;
    end;
  Writeln ('A empty : ',ARect.Empty);
  Writeln ('B empty : ',BRect.Empty);
  Writeln ('A Equals B : ',ARect.Equals(BRect));
  Writeln ('A Contains (15,15) : ',ARect.Contains(P));
end.


TRect.Equals

Do the corners of the rectangles match

Declaration

Source position: objects.pp line 240

function TRect.Equals(

  R: TRect

):Boolean;

Description

Equals returns True if the rectangle has the same corner points A,B as the rectangle R, and False otherwise.

For an example, see TRect.Empty

Errors

None.

See also

TRect.Empty | Is the surface of the rectangle zero
TRect.Contains | Determine if a point is inside the rectangle


TRect.Grow

Expand rectangle with certain size.

Declaration

Source position: objects.pp line 246

procedure TRect.Grow(

  ADX: Sw_Integer;

  ADY: Sw_Integer

);

Description

Grow expands the rectangle with an amount ADX in the X direction (both on the left and right side of the rectangle, thus adding a length 2*ADX to the width of the rectangle), and an amount ADY in the Y direction (both on the top and the bottom side of the rectangle, adding a length 2*ADY to the height of the rectangle.

ADX and ADY can be negative. If the resulting rectangle is empty, it is set to the empty rectangle at (0,0).

Errors

None.

See also

TRect.Move

Move rectangle along a vector.

Example

Program ex6;

{ Program to demonstrate TRect.Grow }

Uses objects;

Var ARect,BRect : TRect;

begin
  ARect.Assign(10,10,20,20);
  ARect.Grow(5,5);
  // Brect should be where new ARect is.
  BRect.Assign(5,5,25,25);
  If ARect.Equals(BRect) Then
    Writeln ('ARect equals BRect')
  Else
    Writeln ('ARect does not equal BRect !');
end.


TRect.Intersect

Reduce rectangle to intersection with another rectangle

Declaration

Source position: objects.pp line 244

procedure TRect.Intersect(

  R: TRect

);

Description

Intersect makes the intersection of the current rectangle with R. If the intersection is empty, then the rectangle is set to the empty rectangle at coordinate (0,0).

Errors

None.

See also

TRect.Union

Enlarges rectangle to encompas another rectangle.

Example

Program ex4;

{ Program to demonstrate TRect.Intersect }

Uses objects;

Var ARect,BRect,CRect : TRect;

begin
  ARect.Assign(10,10,20,20);
  BRect.Assign(15,15,25,25);
  { CRect is intersection of ARect and BRect }
  CRect.Assign(15,15,20,20);
  { Calculate it explicitly}
  ARect.Intersect(BRect);
  If ARect.Equals(CRect) Then
    Writeln ('ARect equals CRect')
  Else
    Writeln ('ARect does not equal CRect !');
  BRect.Assign(25,25,30,30);
  Arect.Intersect(BRect);
  If ARect.Empty Then
    Writeln ('ARect is empty');
end.


TRect.Move

Move rectangle along a vector.

Declaration

Source position: objects.pp line 245

procedure TRect.Move(

  ADX: Sw_Integer;

  ADY: Sw_Integer

);

Description

Move moves the current rectangle along a vector with components (ADX,ADY). It adds ADX to the X-coordinate of both corner points, and ADY to both end points.

Errors

None.

See also

TRect.Grow

Expand rectangle with certain size.

Example

Program ex5;

{ Program to demonstrate TRect.Move }

Uses objects;

Var ARect,BRect : TRect;

begin
  ARect.Assign(10,10,20,20);
  ARect.Move(5,5);
  // Brect should be where new ARect is.
  BRect.Assign(15,15,25,25);
  If ARect.Equals(BRect) Then
    Writeln ('ARect equals BRect')
  Else
    Writeln ('ARect does not equal BRect !');
end.


TRect.Union

Enlarges rectangle to encompas another rectangle.

Declaration

Source position: objects.pp line 243

procedure TRect.Union(

  R: TRect

);

Description

Union enlarges the current rectangle so that it becomes the union of the current rectangle with the rectangle R.

Errors

None.

See also

TRect.Intersect

Reduce rectangle to intersection with another rectangle

Example

Program ex3;

{ Program to demonstrate TRect.Union }

Uses objects;

Var ARect,BRect,CRect : TRect;

begin
  ARect.Assign(10,10,20,20);
  BRect.Assign(15,15,25,25);
  { CRect is union of ARect and BRect }
  CRect.Assign(10,10,25,25);
  { Calculate it explicitly}
  ARect.Union(BRect);
  If ARect.Equals(CRect) Then
    Writeln ('ARect equals CRect')
  Else
    Writeln ('ARect does not equal CRect !');
end.


TResourceCollection

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Collection of resource names

Declaration

Source position: objects.pp line 491

type TResourceCollection = object(TStringCollection)
function KeyOf(); virtual; | Return the key of an item in the collection.
function GetItem(); virtual; | Read an item from the stream.
procedure FreeItem(); virtual; | Release memory occupied by item.
procedure PutItem(); virtual; | Write an item to the stream.
end;

Inheritance

TResourceCollection | Collection of resource names
TStringCollection | Collection of pascal strings.
TSortedCollection | Abstract sorted collection.
TCollection | Manage a collection of pointers of objects
TObject | Basis of all objects

Description

A TResourceCollection manages a collection of resource names. It stores the position and the size of a resource, as well as the name of the resource. It stores these items in records that look like this:

TYPE
   TResourceItem = packed RECORD
      Posn: LongInt;
      Size: LongInt;
      Key : String;
   End;
   PResourceItem = ^TResourceItem;

It overrides some methods of TStringCollection in order to accomplish this.

Remark: Remark that the TResourceCollection manages the names of the resources and their assiciated positions and sizes, it doesn't manage the resources themselves.


TResourceCollection

TStringCollection

TSortedCollection

TCollection

TObject


TResourceCollection
 | KeyOf
 | GetItem
 | FreeItem
 | PutItem
TStringCollection
 | GetItem
 | Compare
 | FreeItem
 | PutItem
TSortedCollection
 | Init
 | Load
 | KeyOf
 | IndexOf
 | Compare
 | Search
 | Insert
 | Store
TCollection
 | Init
 | Load
 | Done
 | At
 | IndexOf
 | GetItem
 | LastThat
 | FirstThat
 | Pack
 | FreeAll
 | DeleteAll
 | Free
 | Insert
 | Delete
 | AtFree
 | FreeItem
 | AtDelete
 | ForEach
 | SetLimit
 | Error
 | AtPut
 | AtInsert
 | Store
 | PutItem
TObject
 | Init
 | Free
 | Is_Object
 | Done


At (TCollection)

AtDelete (TCollection)

AtFree (TCollection)

AtInsert (TCollection)

AtPut (TCollection)

Compare (TSortedCollection)

Compare (TStringCollection)

Delete (TCollection)

DeleteAll (TCollection)

Done (TObject)

Done (TCollection)

Error (TCollection)

FirstThat (TCollection)

ForEach (TCollection)

Free (TObject)

Free (TCollection)

FreeAll (TCollection)

FreeItem (TCollection)

FreeItem (TStringCollection)

FreeItem (TResourceCollection)

GetItem (TCollection)

GetItem (TStringCollection)

GetItem (TResourceCollection)

IndexOf (TCollection)

IndexOf (TSortedCollection)

Init (TObject)

Init (TCollection)

Init (TSortedCollection)

Insert (TCollection)

Insert (TSortedCollection)

Is_Object (TObject)

KeyOf (TSortedCollection)

KeyOf (TResourceCollection)

LastThat (TCollection)

Load (TCollection)

Load (TSortedCollection)

Pack (TCollection)

PutItem (TCollection)

PutItem (TStringCollection)

PutItem (TResourceCollection)

Search (TSortedCollection)

SetLimit (TCollection)

Store (TCollection)

Store (TSortedCollection)


TResourceCollection.FreeItem

Release memory occupied by item.

Declaration

Source position: objects.pp line 494

procedure TResourceCollection.FreeItem(

  Item: Pointer

); virtual;

Description

FreeItem releases the memory occupied by Item. It de-allocates the name, and then the resourceitem record.

It does NOT remove the item from the collection.

Errors

None.

See also

TCollection.FreeItem

Destroy a non-nil item.


TResourceCollection.GetItem

Read an item from the stream.

Declaration

Source position: objects.pp line 493

function TResourceCollection.GetItem(

  var S: TStream

):Pointer; virtual;

Description

GetItem reads a resource item from the stream S. It reads the position, size and name from the stream, in that order. It DOES NOT read the resource itself from the stream.

The resulting item is not inserted in the collection. This call is manly for internal use by the TCollection.Load method.

Errors

Errors returned are those by TStream.Read

See also

TCollection.Load | Initialize a new collection and load collection from a stream.
TStream.Read | Read data from stream to buffer.


TResourceCollection.KeyOf

Return the key of an item in the collection.

Declaration

Source position: objects.pp line 492

function TResourceCollection.KeyOf(

  Item: Pointer

):Pointer; virtual;

Description

KeyOf returns the key of an item in the collection. For resources, the key is a pointer to the string with the resource name.

Errors

None.

See also

TStringCollection.Compare

Compare two strings in the collection.


TResourceCollection.PutItem

Write an item to the stream.

Declaration

Source position: objects.pp line 495

procedure TResourceCollection.PutItem(

  var S: TStream;

  Item: Pointer

); virtual;

Description

PutItem writes Item to the stream S. It does this by writing the position and size and name of the resource item to the stream.

This method is used primarily by the Store method.

Errors

Errors returned are those by TStream.Write.

See also

TCollection.Store

Write collection to a stream.


TResourceFile

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Resource file

Declaration

Source position: objects.pp line 503

type TResourceFile = object(TObject)
Stream: PStream; | Actual file stream
Modified: Boolean; | Have resources changed ?
constructor Init(); | Instantiate a new instance.
destructor Done; virtual; | Destroy the instance and remove it from memory.
function Count; | Number of resources in the file
function KeyAt(); | Return the key of the item at a certain position.
function Get(); | Return a resource by key name.
function SwitchTo(); | Write resources to a new stream.
procedure Flush; | Writes the resources to the stream.
procedure Delete(); | Delete a resource from the file
procedure Put(); | Set a resource by key name.
end;

Inheritance

TResourceFile | Resource file
TObject | Basis of all objects

Description

TResourceFile represents the resources in a binary file image.


TResourceFile

TObject


TResourceFile
 | Init
 | Done
 | Count
 | KeyAt
 | Get
 | SwitchTo
 | Flush
 | Delete
 | Put
TObject
 | Init
 | Free
 | Is_Object
 | Done


Count (TResourceFile)

Delete (TResourceFile)

Done (TObject)

Done (TResourceFile)

Flush (TResourceFile)

Free (TObject)

Get (TResourceFile)

Init (TObject)

Init (TResourceFile)

Is_Object (TObject)

KeyAt (TResourceFile)

Put (TResourceFile)

SwitchTo (TResourceFile)


TResourceFile.Count

Number of resources in the file

Declaration

Source position: objects.pp line 508

function TResourceFile.Count: Sw_Integer;

Description

Count returns the number of resources. If no resources were read, zero is returned.

Errors

None.

See also

TResourceFile.Init

Instantiate a new instance.


TResourceFile.Delete

Delete a resource from the file

Declaration

Source position: objects.pp line 513

procedure TResourceFile.Delete(

  Key: string

);

Description

Delete deletes the resource identified by Key from the collection. It sets the Modified flag to true.

Errors

None.

See also

TResourceFile.Flush

Writes the resources to the stream.


TResourceFile.Done

Destroy the instance and remove it from memory.

Declaration

Source position: objects.pp line 507

destructor TResourceFile.Done; virtual;

Description

Done cleans up the instance of the TResourceFile Object. If Stream was specified at initialization, then Stream is disposed of too.

Errors

None.

See also

TResourceFile.Init

Instantiate a new instance.


TResourceFile.Flush

Writes the resources to the stream.

Declaration

Source position: objects.pp line 512

procedure TResourceFile.Flush;

Description

If the Modified flag is set to True, then Flush writes the resources to the stream Stream. It sets the Modified flag to true after that.

Errors

Errors can be those by TStream.Seek and TStream.Write.

See also

TResourceFile.SwitchTo

Write resources to a new stream.


TResourceFile.Get

Return a resource by key name.

Declaration

Source position: objects.pp line 510

function TResourceFile.Get(

  Key: string

):PObject;

Description

Get returns a pointer to a instance of a resource identified by Key. If Key cannot be found in the list of resources, then Nil is returned.

Errors

Errors returned may be those by TStream.Get


TResourceFile.Init

Instantiate a new instance.

Declaration

Source position: objects.pp line 506

constructor TResourceFile.Init(

  AStream: PStream

);

Description

Init instantiates a new instance of a TResourceFile object. If AStream is not nil then it is considered as a stream describing an executable image on disk.

Init will try to position the stream on the start of the resources section, and read all resources from the stream.

Errors

None.

See also

TResourceFile.Done

Destroy the instance and remove it from memory.


TResourceFile.KeyAt

Return the key of the item at a certain position.

Declaration

Source position: objects.pp line 509

function TResourceFile.KeyAt(

  I: Sw_Integer

):string;

Description

KeyAt returns the key (the name) of the I-th resource.

Errors

In case I is invalid, TCollection.Error will be executed.

See also

TResourceFile.Get

Return a resource by key name.


TResourceFile.Modified

Have resources changed ?

Declaration

Source position: objects.pp line 505

TResourceFile.Modified : Boolean;

Description

Modified is set to True if one of the resources has been changed. It is set by the SwitchTo, Delete and Put methods. Calling Flush will clear the Modified flag.


TResourceFile.Put

Set a resource by key name.

Declaration

Source position: objects.pp line 514

procedure TResourceFile.Put(

  Item: PObject;

  Key: string

);

Description

Put sets the resource identified by Key to Item. If no such resource exists, a new one is created. The item is written to the stream.

Errors

Errors returned may be those by TStream.Put and TStream.Seek

See also

Get

Return a resource by key name.


TResourceFile.Stream

Actual file stream

Declaration

Source position: objects.pp line 504

TResourceFile.Stream : PStream;

Description

contains the (file) stream that has the executable image and the resources. It can be initialized by the Init constructor call.


TResourceFile.SwitchTo

Write resources to a new stream.

Declaration

Source position: objects.pp line 511

function TResourceFile.SwitchTo(

  AStream: PStream;

  Pack: Boolean

):PStream;

Description

SwitchTo switches to a new stream to hold the resources in. AStream will be the new stream after the call to SwitchTo.

If Pack is true, then all the known resources will be copied from the current stream to the new stream (AStream). If Pack is False, then only the current resource is copied.

The return value is the value of the original stream: Stream.

The Modified flag is set as a consequence of this call.

Errors

Errors returned can be those of TStream.Read and TStream.Write.

See also

TResourceFile.Flush

Writes the resources to the stream.


TSortedCollection

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Abstract sorted collection.

Declaration

Source position: objects.pp line 435

type TSortedCollection = object(TCollection)
Duplicates: Boolean; | If True duplicate strings are allowed in the collection.
constructor Init(); | Instantiates a new instance of a TSortedCollection
constructor Load(); | Instantiates a new instance of a TSortedCollection and loads it from stream.
function KeyOf(); virtual; | Return the key of an item
function IndexOf(); virtual; | Return index of an item in the collection.
function Compare(); virtual; | Compare two items in the collection.
function Search(); virtual; | Search for item with given key.
procedure Insert(); virtual; | Insert new item in collection.
procedure Store(); | Write the collection to the stream.
end;

Inheritance

TSortedCollection | Abstract sorted collection.
TCollection | Manage a collection of pointers of objects
TObject | Basis of all objects

Description

TSortedCollection is an abstract class, implementing a sorted collection. You should never use an instance of TSortedCollection directly, instead you should declare a descendent type, and override the Compare method.

Because the collection is ordered, TSortedCollection overrides some TCollection methods, to provide faster routines for lookup.

The Compare method decides how elements in the collection should be ordered. Since TCollection has no way of knowing how to order pointers, you must override the compare method.

Additionally, TCollection provides a means to filter out duplicates. if you set Duplicates to False (the default) then duplicates will not be allowed.

The example below defines a descendent of TSortedCollection which is used in the examples.

Example

Unit MySortC;

Interface

Uses Objects;

Type
  PMySortedCollection = ^TMySortedCollection;
  TMySortedCollection = Object(TSortedCollection)
       Function Compare (Key1,Key2 : Pointer): Sw_integer; virtual;
       end;

Implementation

Uses MyObject;

Function TMySortedCollection.Compare (Key1,Key2 : Pointer) :sw_integer;

begin
  Compare:=PMyobject(Key1)^.GetField - PMyObject(Key2)^.GetField;
end;

end.


TSortedCollection

TCollection

TObject


TSortedCollection
 | Init
 | Load
 | KeyOf
 | IndexOf
 | Compare
 | Search
 | Insert
 | Store
TCollection
 | Init
 | Load
 | Done
 | At
 | IndexOf
 | GetItem
 | LastThat
 | FirstThat
 | Pack
 | FreeAll
 | DeleteAll
 | Free
 | Insert
 | Delete
 | AtFree
 | FreeItem
 | AtDelete
 | ForEach
 | SetLimit
 | Error
 | AtPut
 | AtInsert
 | Store
 | PutItem
TObject
 | Init
 | Free
 | Is_Object
 | Done


At (TCollection)

AtDelete (TCollection)

AtFree (TCollection)

AtInsert (TCollection)

AtPut (TCollection)

Compare (TSortedCollection)

Delete (TCollection)

DeleteAll (TCollection)

Done (TObject)

Done (TCollection)

Error (TCollection)

FirstThat (TCollection)

ForEach (TCollection)

Free (TObject)

Free (TCollection)

FreeAll (TCollection)

FreeItem (TCollection)

GetItem (TCollection)

IndexOf (TCollection)

IndexOf (TSortedCollection)

Init (TObject)

Init (TCollection)

Init (TSortedCollection)

Insert (TCollection)

Insert (TSortedCollection)

Is_Object (TObject)

KeyOf (TSortedCollection)

LastThat (TCollection)

Load (TCollection)

Load (TSortedCollection)

Pack (TCollection)

PutItem (TCollection)

Search (TSortedCollection)

SetLimit (TCollection)

Store (TCollection)

Store (TSortedCollection)


TSortedCollection.Compare

Compare two items in the collection.

Declaration

Source position: objects.pp line 441

function TSortedCollection.Compare(

  Key1: Pointer;

  Key2: Pointer

):Sw_Integer; virtual;

Description

Compare is an abstract method that should be overridden by descendent objects in order to compare two items in the collection. This method is used in the Search method and in the Insert method to determine the ordering of the objects.

The function should compare the two keys of items and return the following function results:

Result < 0
If Key1 is logically before Key2 (Key1<Key2)
Result = 0
If Key1 and Key2 are equal. (Key1=Key2)
Result > 0
If Key1 is logically after Key2 (Key1>Key2)

Errors

An 'abstract run-time error' will be generated if you call TSortedCollection.Compare directly.

See also

TSortedCollection.IndexOf | Return index of an item in the collection.
TSortedCollection.Search | Search for item with given key.

Example

Unit MySortC;

Interface

Uses Objects;

Type
  PMySortedCollection = ^TMySortedCollection;
  TMySortedCollection = Object(TSortedCollection)
       Function Compare (Key1,Key2 : Pointer): Sw_integer; virtual;
       end;

Implementation

Uses MyObject;

Function TMySortedCollection.Compare (Key1,Key2 : Pointer) :sw_integer;

begin
  Compare:=PMyobject(Key1)^.GetField - PMyObject(Key2)^.GetField;
end;

end.


TSortedCollection.Duplicates

If True duplicate strings are allowed in the collection.

Declaration

Source position: objects.pp line 436

TSortedCollection.Duplicates : Boolean;


TSortedCollection.IndexOf

Return index of an item in the collection.

Declaration

Source position: objects.pp line 440

function TSortedCollection.IndexOf(

  Item: Pointer

):Sw_Integer; virtual;

Description

IndexOf returns the index of Item in the collection. It searches for the object based on it's key. If duplicates are allowed, then it returns the index of last object that matches Item.

In case Item is not found in the collection, -1 is returned.

For an example, see TCollection.IndexOf

Errors

None.

See also

TSortedCollection.Search | Search for item with given key.
TSortedCollection.Compare | Compare two items in the collection.


TSortedCollection.Init

Instantiates a new instance of a TSortedCollection

Declaration

Source position: objects.pp line 437

constructor TSortedCollection.Init(

  ALimit: Sw_Integer;

  ADelta: Sw_Integer

);

Description

Init calls the inherited constuctor (see TCollection.Init) and sets the Duplicates flag to false.

You should not call this method directly, since TSortedCollection is a abstract class. Instead, the descendent classes should call it via the inherited keyword.

Errors

None.

See also

TSortedCollection.Load | Instantiates a new instance of a TSortedCollection and loads it from stream.
TCollection.Done | Clean up collection, release all memory.


TSortedCollection.Insert

Insert new item in collection.

Declaration

Source position: objects.pp line 443

procedure TSortedCollection.Insert(

  Item: Pointer

); virtual;

Description

Insert inserts an item in the collection at the correct position, such that the collection is ordered at all times. You should never use Atinsert, since then the collection ordering is not guaranteed.

If Item is already present in the collection, and Duplicates is False, the item will not be inserted.

Errors

None.

See also

TCollection.AtInsert

Insert an element at a certain position in the collection.

Example

Program ex35;

{ Program to demonstrate the TSortedCollection.Insert method }

Uses Objects,MyObject,MySortC;
 { For TMyObject,TMySortedCollection definition and registration }

Var C : PSortedCollection;
    M : PMyObject;
    I : Longint;

Procedure PrintField (Dummy: Pointer;P : PMyObject);

begin
  Writeln ('Field : ',P^.GetField);
end;

begin
  Randomize;
  C:=New(PMySortedCollection,Init(120,10));
  Writeln ('Inserting 100 records at random places.');
  For I:=1 to 100 do
    begin
    M:=New(PMyObject,Init);
    M^.SetField(Random(100));
    C^.Insert(M)
    end;
  Writeln ('Values : ');
  C^.Foreach(@PrintField);
  Dispose(C,Done);
end.


TSortedCollection.KeyOf

Return the key of an item

Declaration

Source position: objects.pp line 439

function TSortedCollection.KeyOf(

  Item: Pointer

):Pointer; virtual;

Description

KeyOf returns the key associated with Item. TSortedCollection returns the item itself as the key, descendent objects can override this method to calculate a (unique) key based on the item passed (such as hash values).

Keys are used to sort the objects, they are used to search and sort the items in the collection. If descendent types override this method then it allows possibly for faster search/sort methods based on keys rather than on the objects themselves.

Errors

None.

See also

TSortedCollection.IndexOf | Return index of an item in the collection.
TSortedCollection.Compare | Compare two items in the collection.


TSortedCollection.Load

Instantiates a new instance of a TSortedCollection and loads it from stream.

Declaration

Source position: objects.pp line 438

constructor TSortedCollection.Load(

  var S: TStream

);

Description

Load calls the inherited constuctor (see TCollection.Load) and reads the Duplicates flag from the stream..

You should not call this method directly, since TSortedCollection is a abstract class. Instead, the descendent classes should call it via the inherited keyword.

For an example, see TCollection.Load.

Errors

None.

See also

TSortedCollection.Init | Instantiates a new instance of a TSortedCollection
TCollection.Done | Clean up collection, release all memory.


TSortedCollection.Search

Search for item with given key.

Declaration

Source position: objects.pp line 442

function TSortedCollection.Search(

  Key: Pointer;

  var Index: Sw_Integer

):Boolean; virtual;

Description

Search looks for the item with key Key and returns the position of the item (if present) in the collection in Index.

Instead of a linear search as TCollection does, TSortedCollection uses a binary search based on the keys of the objects. It uses the Compare function to implement this search.

If the item is found, Search returns True, otherwise False is returned.

Errors

None.

See also

TCollection.IndexOf

Find the position of a certain item.

Example

Program ex36;

{ Program to demonstrate the TSortedCollection.Insert method }

Uses Objects,MyObject,MySortC;
 { For TMyObject,TMySortedCollection definition and registration }

Var C : PSortedCollection;
    M : PMyObject;
    I : Longint;

Procedure PrintField (Dummy: Pointer;P : PMyObject);

begin
  Writeln ('Field : ',P^.GetField);
end;

begin
  Randomize;
  C:=New(PMySortedCollection,Init(120,10));
  C^.Duplicates:=True;
  Writeln ('Inserting 100 records at random places.');
  For I:=1 to 100 do
    begin
    M:=New(PMyObject,Init);
    M^.SetField(Random(100));
    C^.Insert(M)
    end;
  M:=New(PMyObject,Init);
  Repeat;
    Write ('Value to search for (-1 stops) :');
    read (I);
    If I<>-1 then
      begin
      M^.SetField(i);
      If Not C^.Search (M,I) then
        Writeln ('No such value found')
      else
        begin
        Write ('Value ',PMyObject(C^.At(I))^.GetField);
        Writeln (' present at position ',I);
        end;
      end;
  Until I=-1;
  Dispose(M,Done);
  Dispose(C,Done);
end.


TSortedCollection.Store

Write the collection to the stream.

Declaration

Source position: objects.pp line 444

procedure TSortedCollection.Store(

  var S: TStream

);

Description

Store writes the collection to the stream S. It does this by calling the inherited TCollection.Store, and then writing the Duplicates flag to the stream.

After a Store, the collection can be loaded from the stream with the constructor Load

For an example, see TCollection.Load.

Errors

Errors can be those of TStream.Put.

See also

TSortedCollection.Load

Instantiates a new instance of a TSortedCollection and loads it from stream.


TStrCollection

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Collection of null-terminated strings

Declaration

Source position: objects.pp line 464

type TStrCollection = object(TSortedCollection)
function Compare(); virtual; | Compare two strings in the collection.
function GetItem(); virtual; | Read a null-terminated string from the stream.
procedure FreeItem(); virtual; | Free null-terminated string from the collection.
procedure PutItem(); virtual; | Write a null-terminated string to the stream.
end;

Inheritance

TStrCollection | Collection of null-terminated strings
TSortedCollection | Abstract sorted collection.
TCollection | Manage a collection of pointers of objects
TObject | Basis of all objects

Description

The TStrCollection object manages a sorted collection of null-terminated strings (pchar strings). To this end, it overrides the Compare method of TSortedCollection, and it introduces methods to read/write strings from a stream.


TStrCollection

TSortedCollection

TCollection

TObject


TStrCollection
 | Compare
 | GetItem
 | FreeItem
 | PutItem
TSortedCollection
 | Init
 | Load
 | KeyOf
 | IndexOf
 | Compare
 | Search
 | Insert
 | Store
TCollection
 | Init
 | Load
 | Done
 | At
 | IndexOf
 | GetItem
 | LastThat
 | FirstThat
 | Pack
 | FreeAll
 | DeleteAll
 | Free
 | Insert
 | Delete
 | AtFree
 | FreeItem
 | AtDelete
 | ForEach
 | SetLimit
 | Error
 | AtPut
 | AtInsert
 | Store
 | PutItem
TObject
 | Init
 | Free
 | Is_Object
 | Done


At (TCollection)

AtDelete (TCollection)

AtFree (TCollection)

AtInsert (TCollection)

AtPut (TCollection)

Compare (TSortedCollection)

Compare (TStrCollection)

Delete (TCollection)

DeleteAll (TCollection)

Done (TObject)

Done (TCollection)

Error (TCollection)

FirstThat (TCollection)

ForEach (TCollection)

Free (TObject)

Free (TCollection)

FreeAll (TCollection)

FreeItem (TCollection)

FreeItem (TStrCollection)

GetItem (TCollection)

GetItem (TStrCollection)

IndexOf (TCollection)

IndexOf (TSortedCollection)

Init (TObject)

Init (TCollection)

Init (TSortedCollection)

Insert (TCollection)

Insert (TSortedCollection)

Is_Object (TObject)

KeyOf (TSortedCollection)

LastThat (TCollection)

Load (TCollection)

Load (TSortedCollection)

Pack (TCollection)

PutItem (TCollection)

PutItem (TStrCollection)

Search (TSortedCollection)

SetLimit (TCollection)

Store (TCollection)

Store (TSortedCollection)


TStrCollection.Compare

Compare two strings in the collection.

Declaration

Source position: objects.pp line 465

function TStrCollection.Compare(

  Key1: Pointer;

  Key2: Pointer

):Sw_Integer; virtual;

Description

TStrCollection overrides the Compare function so it compares the two keys as if they were pointers to strings. The compare is done case sensitive. It returns

-1
if the first string is alphabetically earlier than the second string.
0
if the two strings are equal.
1
if the first string is alphabetically later than the second string.

Errors

None.

See also

TSortedCollection.Compare

Compare two items in the collection.

Example

Program ex38;

{ Program to demonstrate the TStrCollection.Compare method }

Uses Objects,Strings;

Var C : PStrCollection;
    S : String;
    I : longint;
    P : Pchar;

begin
  Randomize;
  C:=New(PStrCollection,Init(120,10));
  C^.Duplicates:=True; { Duplicates allowed }
  Writeln ('Inserting 100 records at random places.');
  For I:=1 to 100 do
    begin
    Str(Random(100),S);
    S:='String with value '+S;
    P:=StrAlloc(Length(S)+1);
    C^.Insert(StrPCopy(P,S));
    end;
  For I:=0 to 98 do
    With C^ do
      If Compare (At(I),At(I+1))=0 then
        Writeln ('Duplicate string found at position ',I);
  Dispose(C,Done);
end.


TStrCollection.FreeItem

Free null-terminated string from the collection.

Declaration

Source position: objects.pp line 467

procedure TStrCollection.FreeItem(

  Item: Pointer

); virtual;

Description

TStrCollection overrides FreeItem so that the string pointed to by Item is disposed from memory.

Errors

None.

See also

TCollection.FreeItem

Destroy a non-nil item.


TStrCollection.GetItem

Read a null-terminated string from the stream.

Declaration

Source position: objects.pp line 466

function TStrCollection.GetItem(

  var S: TStream

):Pointer; virtual;

Description

GetItem reads a null-terminated string from the stream S and returns a pointer to it. It doesn't insert the string in the collection.

This method is primarily introduced to be able to load and store the collection from and to a stream.

Errors

The errors returned are those of TStream.StrRead.

See also

TStrCollection.PutItem

Write a null-terminated string to the stream.


TStrCollection.PutItem

Write a null-terminated string to the stream.

Declaration

Source position: objects.pp line 468

procedure TStrCollection.PutItem(

  var S: TStream;

  Item: Pointer

); virtual;

Description

PutItem writes the string pointed to by Item to the stream S.

This method is primarily used in the Load and Store methods, and should not be used directly.

Errors

Errors are those of TStream.StrWrite.

See also

TStrCollection.GetItem

Read a null-terminated string from the stream.


TStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Base stream class

Declaration

Source position: objects.pp line 275

type TStream = object(TObject)
Status: Integer; | Current stream status
ErrorInfo: Integer; | Additional error info when there is an error.
StreamSize: LongInt; | Current size of the stream
Position: LongInt; | Current Stream position
TPCompatible: Boolean; | If set to True streamed data is written in a TP compatible format.
constructor Init; | Constructor for TStream instance
function Get; | Read an object definition from the stream.
function StrRead; | Read a null-terminated string from the stream.
function GetPos; virtual; | Return current position in the stream
function GetSize; virtual; | Return the size of the stream.
function ReadStr; | Read a shortstring from the stream.
procedure Open(); virtual; | Open the stream
procedure Close; virtual; | Close the stream
procedure Reset; | Reset the stream
procedure Flush; virtual; | Flush the stream data from the buffer, if any.
procedure Truncate; virtual; | Truncate the stream size on current position.
procedure Put(); | Write an object to the stream.
procedure StrWrite(); | Write a null-terminated string to the stream.
procedure WriteStr(); | Write a pascal string to the stream.
procedure Seek(); virtual; | Set stream position.
procedure Error(); virtual; | Set stream status
procedure Read(); virtual; | Read data from stream to buffer.
procedure Write(); virtual; | Write a number of bytes to the stream.
procedure CopyFrom(); | Copy data from another stream.
end;

Inheritance

TStream | Base stream class
TObject | Basis of all objects

Description

The TStream object is the ancestor for all streaming objects, i.e. objects that have the capability to store and retrieve data.

It defines a number of methods that are common to all objects that implement streaming, many of them are virtual, and are only implemented in the descendent types.

Programs should not instantiate objects of type TStream directly, but instead instantiate a descendant type, such as TDosStream, TMemoryStream.

See also

PStream | Pointer type to TStream
TDosStream | DOS file stream
TMemoryStream | Stream which keeps data in memory.


TStream
 | Init
 | Get
 | StrRead
 | GetPos
 | GetSize
 | ReadStr
 | Open
 | Close
 | Reset
 | Flush
 | Truncate
 | Put
 | StrWrite
 | WriteStr
 | Seek
 | Error
 | Read
 | Write
 | CopyFrom
TObject
 | Init
 | Free
 | Is_Object
 | Done


Close (TStream)

CopyFrom (TStream)

Done (TObject)

Error (TStream)

Flush (TStream)

Free (TObject)

Get (TStream)

GetPos (TStream)

GetSize (TStream)

Init (TObject)

Init (TStream)

Is_Object (TObject)

Open (TStream)

Put (TStream)

Read (TStream)

ReadStr (TStream)

Reset (TStream)

Seek (TStream)

StrRead (TStream)

StrWrite (TStream)

Truncate (TStream)

Write (TStream)

WriteStr (TStream)


TStream.Close

Close the stream

Declaration

Source position: objects.pp line 288

procedure TStream.Close; virtual;

Description

Close is an abstract method, that should be overridden by descendent objects. Since Closing a stream depends on the stream's type this is not surprising.

for an example, see TDosStream.Open.

Errors

None.

See also

TStream.Open | Open the stream
TStream.Reset | Reset the stream


TStream.CopyFrom

Copy data from another stream.

Declaration

Source position: objects.pp line 299

procedure TStream.CopyFrom(

  var S: TStream;

  Count: LongInt

);

Description

CopyFrom reads Count bytes from stream S and stores them in the current stream. It uses the Read method to read the data, and the Write method to write in the current stream.

Errors

None.

See also

Read | Read data from stream to buffer.
Write | Write a number of bytes to the stream.

Example

Program ex19;

{ Program to demonstrate the TStream.CopyFrom function }

Uses objects;

Var P : PString;
    L : String;
    S1,S2 : PStream;

begin
  L:='Constant string line';
  Writeln ('Writing to stream 1 : "',L,'"');
  S1:=New(PMemoryStream,Init(100,10));
  S2:=New(PMemoryStream,Init(100,10));
  S1^.WriteStr(@L);
  S1^.Seek(0);
  Writeln ('Copying contents of stream 1 to stream 2');
  S2^.Copyfrom(S1^,S1^.GetSize);
  S2^.Seek(0);
  P:=S2^.ReadStr;
  L:=P^;
  DisposeStr(P);
  Dispose (S1,Done);
  Dispose (S2,Done);
  Writeln ('Read from stream 2 : "',L,'"');
end.


TStream.Error

Set stream status

Declaration

Source position: objects.pp line 296

procedure TStream.Error(

  Code: Integer;

  Info: Integer

); virtual;

Description

Error sets the stream's status to Code and ErrorInfo to Info. If the StreamError procedural variable is set, Error executes it, passing Self as an argument.

This method should not be called directly from a program. It is intended to be used in descendent objects.

Errors

None.


TStream.ErrorInfo

Additional error info when there is an error.

Declaration

Source position: objects.pp line 277

TStream.ErrorInfo : Integer;


TStream.Flush

Flush the stream data from the buffer, if any.

Declaration

Source position: objects.pp line 290

procedure TStream.Flush; virtual;

Description

Flush is an abstract method that should be overridden by descendent objects. It serves to enable the programmer to tell streams that implement a buffer to clear the buffer.

for an example, see TBufStream.Flush.

Errors

None.

See also

TStream.Truncate

Truncate the stream size on current position.


TStream.Get

Read an object definition from the stream.

Declaration

Source position: objects.pp line 282

function TStream.Get: PObject;

Description

Get reads an object definition from a stream, and returns a pointer to an instance of this object.

Errors

On error, TStream.Status is set, and NIL is returned.

See also

TStream.Put

Write an object to the stream.

Example

Program ex9;

{ Program to demonstrate TStream.Get and TStream.Put }

Uses Objects,MyObject;  { Definition and registration of TMyObject}

Var Obj : PMyObject;
    S : PStream;

begin
  Obj:=New(PMyObject,Init);
  Obj^.SetField($1111) ;
  Writeln ('Field value : ',Obj^.GetField);
  { Since Stream is an abstract type, we instantiate a TMemoryStream }
  S:=New(PMemoryStream,Init(100,10));
  S^.Put(Obj);
  Writeln ('Disposing object');
  S^.Seek(0);
  Dispose(Obj,Done);
  Writeln ('Reading object');
  Obj:=PMyObject(S^.Get);
  Writeln ('Field Value : ',Obj^.GetField);
  Dispose(Obj,Done);
end.


TStream.GetPos

Return current position in the stream

Declaration

Source position: objects.pp line 284

function TStream.GetPos: LongInt; virtual;

Description

If the stream's status is stOk, GetPos returns the current position in the stream. Otherwise it returns -1

Errors

-1 is returned if the status is an error condition.

See also

TStream.Seek | Set stream position.
TStream.GetSize | Return the size of the stream.

Example

Program ex11;

{ Program to demonstrate the TStream.GetPos function }

Uses objects;

Var L : String;
    S : PStream;

begin
  L:='Some kind of string';
  S:=New(PMemoryStream,Init(100,10));
  Writeln ('Stream position before write: ',S^.GetPos);
  S^.WriteStr(@L);
  Writeln ('Stream position after write : ',S^.GetPos);
  Dispose(S,Done);
end.


TStream.GetSize

Return the size of the stream.

Declaration

Source position: objects.pp line 285

function TStream.GetSize: LongInt; virtual;

Description

If the stream's status is stOk then GetSize returns the size of the stream, otherwise it returns -1.

Errors

-1 is returned if the status is an error condition.

See also

TStream.Seek | Set stream position.
TStream.GetPos | Return current position in the stream

Example

Program ex12;

{ Program to demonstrate the TStream.GetSize function }

Uses objects;

Var L : String;
    S : PStream;

begin
  L:='Some kind of string';
  S:=New(PMemoryStream,Init(100,10));
  Writeln ('Stream size before write: ',S^.GetSize);
  S^.WriteStr(@L);
  Writeln ('Stream size after write : ',S^.GetSize);
  Dispose(S,Done);
end.


TStream.Init

Constructor for TStream instance

Declaration

Source position: objects.pp line 281

constructor TStream.Init;

Description

Init initializes a TStream instance. Descendent streams should always call the inherited Init.


TStream.Open

Open the stream

Declaration

Source position: objects.pp line 287

procedure TStream.Open(

  OpenMode: Word

); virtual;

Description

Open is an abstract method, that should be overridden by descendent objects. Since opening a stream depends on the stream's type this is not surprising.

For an example, see TDosStream.Open.

Errors

None.

See also

TStream.Close | Close the stream
TStream.Reset | Reset the stream


TStream.Position

Current Stream position

Declaration

Source position: objects.pp line 279

TStream.Position : LongInt;


TStream.Put

Write an object to the stream.

Declaration

Source position: objects.pp line 292

procedure TStream.Put(

  P: PObject

);

Description

Put writes the object pointed to by P. P should be non-nil. The object type must have been registered with RegisterType.

After the object has been written, it can be read again with Get.

For an example, see TStream.Get;

Errors

No check is done whether P is Nil or not. Passing Nil will cause a run-time error 216 to be generated. If the object has not been registered, the status of the stream will be set to stPutError.

See also

TStream.Get

Read an object definition from the stream.


TStream.Read

Read data from stream to buffer.

Declaration

Source position: objects.pp line 297

procedure TStream.Read(

  var Buf;

  Count: LongInt

); virtual;

Description

Read is an abstract method that should be overridden by descendent objects.

Read reads Count bytes from the stream into Buf. It updates the position pointer, increasing it's value with Count. Buf must be large enough to contain Count bytes.

Errors

No checking is done to see if Buf is large enough to contain Count bytes.

See also

TStream.Write | Write a number of bytes to the stream.
TStream.ReadStr | Read a shortstring from the stream.
TStream.StrRead | Read a null-terminated string from the stream.

Example

program ex18;

{ Program to demonstrate the TStream.Read method }

Uses Objects;

Var Buf1,Buf2 : Array[1..1000] of Byte;
    I : longint;
    S : PMemorySTream;

begin
  For I:=1 to 1000 do
    Buf1[I]:=Random(1000);
  Buf2:=Buf1;
  S:=New(PMemoryStream,Init(100,10));
  S^.Write(Buf1,SizeOf(Buf1));
  S^.Seek(0);
  For I:=1 to 1000 do
    Buf1[I]:=0;
  S^.Read(Buf1,SizeOf(Buf1));
  For I:=1 to 1000 do
    If Buf1[I]<>buf2[i] then
      Writeln ('Buffer differs at position ',I);
  Dispose(S,Done);
end.


TStream.ReadStr

Read a shortstring from the stream.

Declaration

Source position: objects.pp line 286

function TStream.ReadStr: PString;

Description

ReadStr reads a string from the stream, copies it to the heap and returns a pointer to this copy. The string is saved as a pascal string, and hence is NOT null terminated.

Errors

On error (e.g. not enough memory), Nil is returned.

See also

TStream.StrRead

Read a null-terminated string from the stream.

Example

Program ex13;

{
Program to demonstrate the TStream.ReadStr TStream.WriteStr functions
}

Uses objects;

Var P : PString;
    L : String;
    S : PStream;

begin
  L:='Constant string line';
  Writeln ('Writing to stream : "',L,'"');
  S:=New(PMemoryStream,Init(100,10));
  S^.WriteStr(@L);
  S^.Seek(0);
  P:=S^.ReadStr;
  L:=P^;
  DisposeStr(P);
  DisPose (S,Done);
  Writeln ('Read from stream : "',L,'"');
end.


TStream.Reset

Reset the stream

Declaration

Source position: objects.pp line 289

procedure TStream.Reset;

Description

Reset sets the stream's status to 0, as well as the ErrorInfo

Errors

None.

See also

TStream.Open | Open the stream
TStream.Close | Close the stream


TStream.Seek

Set stream position.

Declaration

Source position: objects.pp line 295

procedure TStream.Seek(

  Pos: LongInt

); virtual;

Description

Seek sets the position to Pos. This position is counted from the beginning, and is zero based. (i.e. seeek(0) sets the position pointer on the first byte of the stream)

For an example, see TDosStream.Seek.

Errors

If Pos is larger than the stream size, Status is set to StSeekError.

See also

TStream.GetPos | Return current position in the stream
TStream.GetSize | Return the size of the stream.


TStream.Status

Current stream status

Declaration

Source position: objects.pp line 276

TStream.Status : Integer;


TStream.StreamSize

Current size of the stream

Declaration

Source position: objects.pp line 278

TStream.StreamSize : LongInt;


TStream.StrRead

Read a null-terminated string from the stream.

Declaration

Source position: objects.pp line 283

function TStream.StrRead: PChar;

Description

StrRead reads a string from the stream, allocates memory for it, and returns a pointer to a null-terminated copy of the string on the heap.

Errors

On error, Nil is returned.

See also

TStream.StrWrite | Write a null-terminated string to the stream.
TStream.ReadStr | Read a shortstring from the stream.

Example

Program ex10;

{
Program to demonstrate the TStream.StrRead TStream.StrWrite functions
}

Uses objects;

Var P : PChar;
    S : PStream;

begin
  P:='Constant Pchar string';
  Writeln ('Writing to stream : "',P,'"');
  S:=New(PMemoryStream,Init(100,10));
  S^.StrWrite(P);
  S^.Seek(0);
  P:=Nil;
  P:=S^.StrRead;
  DisPose (S,Done);
  Writeln ('Read from stream : "',P,'"');
  Freemem(P,Strlen(P)+1);
end.


TStream.StrWrite

Write a null-terminated string to the stream.

Declaration

Source position: objects.pp line 293

procedure TStream.StrWrite(

  P: PChar

);

Description

StrWrite writes the null-terminated string P to the stream. P can only be 65355 bytes long.

For an example, see TStream.StrRead.

Errors

None.

See also

TStream.WriteStr | Write a pascal string to the stream.
TStream.StrRead | Read a null-terminated string from the stream.
TStream.ReadStr | Read a shortstring from the stream.


TStream.TPCompatible

If set to True streamed data is written in a TP compatible format.

Declaration

Source position: objects.pp line 280

TStream.TPCompatible : Boolean;


TStream.Truncate

Truncate the stream size on current position.

Declaration

Source position: objects.pp line 291

procedure TStream.Truncate; virtual;

Description

Truncate is an abstract procedure that should be overridden by descendent objects. It serves to enable the programmer to truncate the size of the stream to the current file position.

For an example, see TDosStream.Truncate.

Errors

None.

See also

TStream.Seek

Set stream position.


TStream.Write

Write a number of bytes to the stream.

Declaration

Source position: objects.pp line 298

procedure TStream.Write(

  var Buf;

  Count: LongInt

); virtual;

Description

Write is an abstract method that should be overridden by descendent objects.

Write writes Count bytes to the stream from Buf. It updates the position pointer, increasing it's value with Count.

For an example, see TStream.Read.

Errors

No checking is done to see if Buf actually contains Count bytes.

See also

TStream.Read | Read data from stream to buffer.
TStream.WriteStr | Write a pascal string to the stream.
TStream.StrWrite | Write a null-terminated string to the stream.


TStream.WriteStr

Write a pascal string to the stream.

Declaration

Source position: objects.pp line 294

procedure TStream.WriteStr(

  P: PString

);

Description

StrWrite writes the pascal string pointed to by P to the stream.

For an example, see TStream.ReadStr.

Errors

None.

See also

TStream.StrWrite | Write a null-terminated string to the stream.
TStream.StrRead | Read a null-terminated string from the stream.
TStream.ReadStr | Read a shortstring from the stream.


TStreamRec

Record used in streaming mechanism.

Declaration

Source position: objects.pp line 212

type TStreamRec = packed record
ObjType: Sw_Word; | Unique identifier for this object type.
VmtLink: pointer; | Pointer to object VMT
Load: CodePointer; | Procedure to call when object must be loaded from a stream
Store: CodePointer; | Procedure to call when object must be stored in a stream.
Next: PStreamRec; | Next item in list
end;

Description

TSreamRec is used by the Objects unit streaming mechanism: when an object is registered, a TStreamRec record is added to a list of records. This list is used when objects need to be streamed from/streamed to a stream. It contains all the information needed to stream the object.


TStringCollection

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Collection of pascal strings.

Declaration

Source position: objects.pp line 452

type TStringCollection = object(TSortedCollection)
function GetItem(); virtual; | Get string from the stream.
function Compare(); virtual; | Compare two strings in the collection.
procedure FreeItem(); virtual; | Dispose a string in the collection from memory.
procedure PutItem(); virtual; | Write a string to the stream.
end;

Inheritance

TStringCollection | Collection of pascal strings.
TSortedCollection | Abstract sorted collection.
TCollection | Manage a collection of pointers of objects
TObject | Basis of all objects

Description

The TStringCollection object manages a sorted collection of pascal strings. To this end, it overrides the Compare method of TSortedCollection, and it introduces methods to read/write strings from a stream.


TStringCollection

TSortedCollection

TCollection

TObject


TStringCollection
 | GetItem
 | Compare
 | FreeItem
 | PutItem
TSortedCollection
 | Init
 | Load
 | KeyOf
 | IndexOf
 | Compare
 | Search
 | Insert
 | Store
TCollection
 | Init
 | Load
 | Done
 | At
 | IndexOf
 | GetItem
 | LastThat
 | FirstThat
 | Pack
 | FreeAll
 | DeleteAll
 | Free
 | Insert
 | Delete
 | AtFree
 | FreeItem
 | AtDelete
 | ForEach
 | SetLimit
 | Error
 | AtPut
 | AtInsert
 | Store
 | PutItem
TObject
 | Init
 | Free
 | Is_Object
 | Done


At (TCollection)

AtDelete (TCollection)

AtFree (TCollection)

AtInsert (TCollection)

AtPut (TCollection)

Compare (TSortedCollection)

Compare (TStringCollection)

Delete (TCollection)

DeleteAll (TCollection)

Done (TObject)

Done (TCollection)

Error (TCollection)

FirstThat (TCollection)

ForEach (TCollection)

Free (TObject)

Free (TCollection)

FreeAll (TCollection)

FreeItem (TCollection)

FreeItem (TStringCollection)

GetItem (TCollection)

GetItem (TStringCollection)

IndexOf (TCollection)

IndexOf (TSortedCollection)

Init (TObject)

Init (TCollection)

Init (TSortedCollection)

Insert (TCollection)

Insert (TSortedCollection)

Is_Object (TObject)

KeyOf (TSortedCollection)

LastThat (TCollection)

Load (TCollection)

Load (TSortedCollection)

Pack (TCollection)

PutItem (TCollection)

PutItem (TStringCollection)

Search (TSortedCollection)

SetLimit (TCollection)

Store (TCollection)

Store (TSortedCollection)


TStringCollection.Compare

Compare two strings in the collection.

Declaration

Source position: objects.pp line 454

function TStringCollection.Compare(

  Key1: Pointer;

  Key2: Pointer

):Sw_Integer; virtual;

Description

TStringCollection overrides the Compare function so it compares the two keys as if they were pointers to strings. The compare is done case sensitive. It returns the following results:

-1
if the first string is alphabetically earlier than the second string.
0
if the two strings are equal.
1
if the first string is alphabetically later than the second string.

Errors

None.

See also

TSortedCollection.Compare

Compare two items in the collection.

Example

Program ex37;

{ Program to demonstrate the TStringCollection.Compare method }

Uses Objects;

Var C : PStringCollection;
    S : String;
    I : longint;

begin
  Randomize;
  C:=New(PStringCollection,Init(120,10));
  C^.Duplicates:=True; { Duplicates allowed }
  Writeln ('Inserting 100 records at random places.');
  For I:=1 to 100 do
    begin
    Str(Random(100),S);
    S:='String with value '+S;
    C^.Insert(NewStr(S));
    end;
  For I:=0 to 98 do
    With C^ do
    If Compare (At(i),At(I+1))=0 then
      Writeln ('Duplicate string found at position ',i);
  Dispose(C,Done);
end.


TStringCollection.FreeItem

Dispose a string in the collection from memory.

Declaration

Source position: objects.pp line 455

procedure TStringCollection.FreeItem(

  Item: Pointer

); virtual;

Description

TStringCollection overrides FreeItem so that the string pointed to by Item is disposed from memory.

Errors

None.

See also

TCollection.FreeItem

Destroy a non-nil item.


TStringCollection.GetItem

Get string from the stream.

Declaration

Source position: objects.pp line 453

function TStringCollection.GetItem(

  var S: TStream

):Pointer; virtual;

Description

GetItem reads a string from the stream S and returns a pointer to it. It doesn't insert the string in the collection.

This method is primarily introduced to be able to load and store the collection from and to a stream.

Errors

The errors returned are those of TStream.ReadStr.

See also

TStringCollection.PutItem

Write a string to the stream.


TStringCollection.PutItem

Write a string to the stream.

Declaration

Source position: objects.pp line 456

procedure TStringCollection.PutItem(

  var S: TStream;

  Item: Pointer

); virtual;

Description

PutItem writes the string pointed to by Item to the stream S.

This method is primarily used in the Load and Store methods, and should not be used directly.

Errors

Errors are those of TStream.WriteStr.

See also

TStringCollection.GetItem

Get string from the stream.


TStringList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Collection of strings

Declaration

Source position: objects.pp line 534

type TStringList = object(TObject)
constructor Load(); | Load stringlist from stream.
destructor Done; virtual; | Clean up the instance
function Get(); | Return a string by key name
end;

Inheritance

TStringList | Collection of strings
TObject | Basis of all objects

Description

A TStringList object can be used to read a collection of strings stored in a stream. If you register this object with the RegisterType function, you cannot register the TStrListMaker object.


TStringList

TObject


TStringList
 | Load
 | Done
 | Get
TObject
 | Init
 | Free
 | Is_Object
 | Done


Done (TObject)

Done (TStringList)

Free (TObject)

Get (TStringList)

Init (TObject)

Is_Object (TObject)

Load (TStringList)


TStringList.Done

Clean up the instance

Declaration

Source position: objects.pp line 536

destructor TStringList.Done; virtual;

Description

The Done destructor frees the memory occupied by the string descriptions, and destroys the object.

Errors

None.

See also

Load | Load stringlist from stream.
TObject.Done | Destroy an object.


TStringList.Get

Return a string by key name

Declaration

Source position: objects.pp line 537

function TStringList.Get(

  Key: Sw_Word

):string;

Description

Get reads the string with key Key from the list of strings on the stream, and returns this string. If there is no string with such a key, an empty string is returned.

Errors

If no string with key Key is found, an empty string is returned. A stream error may result if the stream doesn't contain the needed strings.

See also

TStrListMaker.Put

Add a new string to the list with associated key.


TStringList.Load

Load stringlist from stream.

Declaration

Source position: objects.pp line 535

constructor TStringList.Load(

  var S: TStream

);

Description

The Load constructor reads the TStringList object from the stream S. It also reads the descriptions of the strings from the stream. The string descriptions are stored as an array of TstrIndexrec records, where each record describes a string on the stream. These records are kept in memory.

Errors

If an error occurs, a stream error is triggered.

See also

TStringList.Done

Clean up the instance


TStrListMaker

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Generate a stream with strings, readable by TStringList

Declaration

Source position: objects.pp line 551

type TStrListMaker = object(TObject)
constructor Init(); | Instantiate a new instance of TStrListMaker
destructor Done; virtual; | Clean up the instance and free all related memory.
procedure Put(); | Add a new string to the list with associated key.
procedure Store(); | Write the strings to the stream.
end;

Inheritance

TStrListMaker | Generate a stream with strings, readable by TStringList
TObject | Basis of all objects

Description

The TStrListMaker object can be used to generate a stream with strings, which can be read with the TStringList object. If you register this object with the RegisterType function, you cannot register the TStringList object.


TStrListMaker

TObject


TStrListMaker
 | Init
 | Done
 | Put
 | Store
TObject
 | Init
 | Free
 | Is_Object
 | Done


Done (TObject)

Done (TStrListMaker)

Free (TObject)

Init (TObject)

Init (TStrListMaker)

Is_Object (TObject)

Put (TStrListMaker)

Store (TStrListMaker)


TStrListMaker.Done

Clean up the instance and free all related memory.

Declaration

Source position: objects.pp line 553

destructor TStrListMaker.Done; virtual;

Description

The Done destructor de-allocates the memory for the index description records and the string data, and then destroys the object.

Errors

None.

See also

TObject.Done | Destroy an object.
TStrListMaker.Init | Instantiate a new instance of TStrListMaker


TStrListMaker.Init

Instantiate a new instance of TStrListMaker

Declaration

Source position: objects.pp line 552

constructor TStrListMaker.Init(

  AStrSize: Sw_Word;

  AIndexSize: Sw_Word

);

Description

The Init constructor creates a new instance of the TstrListMaker object. It allocates AStrSize bytes on the heap to hold all the strings you wish to store. It also allocates enough room for AIndexSize key description entries (of the type TStrIndexrec).

AStrSize must be large enough to contain all the strings you wish to store. If not enough memory is allocated, other memory will be overwritten. The same is true for AIndexSize : maximally AIndexSize strings can be written to the stream.

Errors

None.

See also

TObject.Init | Construct (initialize) a new object
TStrListMaker.Done | Clean up the instance and free all related memory.


TStrListMaker.Put

Add a new string to the list with associated key.

Declaration

Source position: objects.pp line 554

procedure TStrListMaker.Put(

  Key: Sw_Word;

  S: string

);

Description

Put adds they string S with key Key to the collection of strings. This action doesn't write the string to a stream. To write the strings to the stream, see the Store method.

Errors

None.

See also

TStrListMaker.Store

Write the strings to the stream.


TStrListMaker.Store

Write the strings to the stream.

Declaration

Source position: objects.pp line 555

procedure TStrListMaker.Store(

  var S: TStream

);

Description

Store writes the collection of strings to the stream S. The collection can then be read with the TStringList object.

Errors

A stream error may occur when writing the strings to the stream.

See also

TStringList.Load | Load stringlist from stream.
TStrListMaker.Put | Add a new string to the list with associated key.


TUnSortedStrCollection

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Unsorted string collection

Declaration

Source position: objects.pp line 482

type TUnSortedStrCollection = object(TStringCollection)

  procedure Insert(); virtual;

Insert a new string in the collection.

end;

Inheritance

TUnSortedStrCollection | Unsorted string collection
TStringCollection | Collection of pascal strings.
TSortedCollection | Abstract sorted collection.
TCollection | Manage a collection of pointers of objects
TObject | Basis of all objects

Description

The TUnSortedStrCollection object manages an unsorted list of strings. To this end, it overrides the TSortedCollection.Insert method to add strings at the end of the collection, rather than in the alphabetically correct position.

Take care, the Search and IndexOf methods will not work on an unsorted string collection.


TUnSortedStrCollection

TStringCollection

TSortedCollection

TCollection

TObject


TUnSortedStrCollection
 | Insert
TStringCollection
 | GetItem
 | Compare
 | FreeItem
 | PutItem
TSortedCollection
 | Init
 | Load
 | KeyOf
 | IndexOf
 | Compare
 | Search
 | Insert
 | Store
TCollection
 | Init
 | Load
 | Done
 | At
 | IndexOf
 | GetItem
 | LastThat
 | FirstThat
 | Pack
 | FreeAll
 | DeleteAll
 | Free
 | Insert
 | Delete
 | AtFree
 | FreeItem
 | AtDelete
 | ForEach
 | SetLimit
 | Error
 | AtPut
 | AtInsert
 | Store
 | PutItem
TObject
 | Init
 | Free
 | Is_Object
 | Done


At (TCollection)

AtDelete (TCollection)

AtFree (TCollection)

AtInsert (TCollection)

AtPut (TCollection)

Compare (TSortedCollection)

Compare (TStringCollection)

Delete (TCollection)

DeleteAll (TCollection)

Done (TObject)

Done (TCollection)

Error (TCollection)

FirstThat (TCollection)

ForEach (TCollection)

Free (TObject)

Free (TCollection)

FreeAll (TCollection)

FreeItem (TCollection)

FreeItem (TStringCollection)

GetItem (TCollection)

GetItem (TStringCollection)

IndexOf (TCollection)

IndexOf (TSortedCollection)

Init (TObject)

Init (TCollection)

Init (TSortedCollection)

Insert (TCollection)

Insert (TSortedCollection)

Insert (TUnSortedStrCollection)

Is_Object (TObject)

KeyOf (TSortedCollection)

LastThat (TCollection)

Load (TCollection)

Load (TSortedCollection)

Pack (TCollection)

PutItem (TCollection)

PutItem (TStringCollection)

Search (TSortedCollection)

SetLimit (TCollection)

Store (TCollection)

Store (TSortedCollection)


TUnSortedStrCollection.Insert

Insert a new string in the collection.

Declaration

Source position: objects.pp line 483

procedure TUnSortedStrCollection.Insert(

  Item: Pointer

); virtual;

Description

Insert inserts a string at the end of the collection, instead of on it's alphabetical place, resulting in an unsorted collection of strings.

Errors

None.

See also

TCollection.Insert

Insert a new item in the collection at the end.

Example

Program ex39;

{ Program to demonstrate the TUnsortedStrCollection.Insert method }

Uses Objects,Strings;

Var C : PUnsortedStrCollection;
    S : String;
    I : longint;
    P : Pchar;

begin
  Randomize;
  C:=New(PUnsortedStrCollection,Init(120,10));
  Writeln ('Inserting 100 records at random places.');
  For I:=1 to 100 do
    begin
    Str(Random(100),S);
    S:='String with value '+S;
    C^.Insert(NewStr(S));
    end;
  For I:=0 to 99 do
    Writeln (I:2,': ',PString(C^.At(i))^ );
  Dispose(C,Done);
end.


tport

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Type implemented to support integer-sized port access

Declaration

Source position: ports.pp line 26

type tport = class

public

  property pp []: Byte; default; [rw]

Access integer-sized port by port number

end;

Inheritance

tport

Type implemented to support integer-sized port access
|

TObject

Description

The TPort type is implemented specially for access to the ports in a TP compatible manner. There is no need to create an instance of this type: the standard TP variables are instantiated at unit initialization.

See also

port | Provide port access per integer
TPortW | Type implemented to support word-sized port access
TPortL | Type implemented to support Longint-sized port access


tport

pp


pp (tport)


tport


tport.pp

Access integer-sized port by port number

Declaration

Source position: ports.pp line 31

public property tport.pp[w: LongInt] : Byte
  read readport
  write writeport;
  default;


tportl

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Type implemented to support Longint-sized port access

Declaration

Source position: ports.pp line 42

type tportl = class

public

  property pp []: LongInt; default; [rw]

Access Longint-sized port by port number

end;

Inheritance

tportl

Type implemented to support Longint-sized port access
|

TObject

Description

The TPortL type is implemented specially for access to the ports in a TP compatible manner. There is no need to create an instance of this type: the standard TP variables are instantiated at unit initialization.

See also

portw | Provide port access per word
TPort | Type implemented to support integer-sized port access
TPortL | Type implemented to support Longint-sized port access


tportl

pp


pp (tportl)


tportl


tportl.pp

Access Longint-sized port by port number

Declaration

Source position: ports.pp line 47

public property tportl.pp[w: LongInt] : LongInt
  read readport
  write writeport;
  default;


tportw

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Type implemented to support word-sized port access

Declaration

Source position: ports.pp line 34

type tportw = class

public

  property pp []: Word; default; [rw]

Access word-sized port by port number

end;

Inheritance

tportw

Type implemented to support word-sized port access
|

TObject

Description

The TPortW type is implemented specially for access to the ports in a TP compatible manner. There is no need to create an instance of this type: the standard TP variables are instantiated at unit initialization.

See also

portw | Provide port access per word
TPort | Type implemented to support integer-sized port access
TPortL | Type implemented to support Longint-sized port access


tportw

pp


pp (tportw)


tportw


tportw.pp

Access word-sized port by port number

Declaration

Source position: ports.pp line 39

public property tportw.pp[w: LongInt] : Word
  read readport
  write writeport;
  default;


IDispatch

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Dispatch interface

Declaration

Source position: objpash.inc line 272

type IDispatch = interface(IUnknown)
function GetTypeInfoCount(); | Return number of properties.
function GetTypeInfo(); | Return type information about properties
function GetIDsOfNames(); | Return IDs of named procedures
function Invoke(); | Invoke a dispatch method
end;

Inheritance

IDispatch | Dispatch interface
IUnknown | Basic interface for all COM-based interfaces

Description

IDispatch is the pascal definition of the Windows Dispatch interface definition.

See also

IUnknown

Basic interface for all COM-based interfaces


IDispatch

IUnknown


IDispatch
 | GetTypeInfoCount
 | GetTypeInfo
 | GetIDsOfNames
 | Invoke
IUnknown
 | QueryInterface
 | _AddRef
 | _Release


GetIDsOfNames (IDispatch)

GetTypeInfo (IDispatch)

GetTypeInfoCount (IDispatch)

Invoke (IDispatch)

QueryInterface (IUnknown)

_AddRef (IUnknown)

_Release (IUnknown)


IDispatch.GetIDsOfNames

Return IDs of named procedures

Declaration

Source position: objpash.inc line 277

function IDispatch.GetIDsOfNames(

  const iid: TGuid;

  names: Pointer;

  NameCount: LongInt;

  LocaleID: LongInt;

  DispIDs: Pointer

):HRESULT;

Description

Return the ID of a procedure.


IDispatch.GetTypeInfo

Return type information about properties

Declaration

Source position: objpash.inc line 275

function IDispatch.GetTypeInfo(

  Index: LongInt;

  LocaleID: LongInt;

  out TypeInfo

):HRESULT;


IDispatch.GetTypeInfoCount

Return number of properties.

Declaration

Source position: objpash.inc line 274

function IDispatch.GetTypeInfoCount(

  out count: LongInt

):HRESULT;


IDispatch.Invoke

Invoke a dispatch method

Declaration

Source position: objpash.inc line 279

function IDispatch.Invoke(

  DispID: LongInt;

  const iid: TGuid;

  LocaleID: LongInt;

  Flags: Word;

  var params;

  VarResult: pointer;

  ExcepInfo: pointer;

  ArgErr: pointer

):HRESULT;


IEnumerable

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Interface to retrieve an enumerator from a class.

Declaration

Source position: objpash.inc line 267

type IEnumerable = interface(IInterface)

  function GetEnumerator;

Return an enumerator interface for this class

end;

Inheritance

IEnumerable

Interface to retrieve an enumerator from a class.

IInterface
?

Description

IEnumerable can be used to get an enumerator from a class. If a class implements IEnumerable, it can return an enumerator interface IEnumerator.

See also

IEnumerator

Enumerator support interface


IEnumerable


IEnumerable

GetEnumerator


GetEnumerator (IEnumerable)


IEnumerable.GetEnumerator

Return an enumerator interface for this class

Declaration

Source position: objpash.inc line 268

function IEnumerable.GetEnumerator: IEnumerator;

Description

GetEnumerator returns a new IEnumerator interface for this class. This is called by the compiler whenever a for in loop is encountered in the source code to retrieve the enumerator instance.

See also

IEnumerator

Enumerator support interface


IEnumerator

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Enumerator support interface

Declaration

Source position: objpash.inc line 260

type IEnumerator = interface(IInterface)
function GetCurrent; | Returns the current element in the iteration cycle
function MoveNext; | Move to the next value
procedure Reset; | Reset the pointer
property Current: TObject; [r] | Return the current item
end;

Inheritance

IEnumerator

Enumerator support interface

IInterface
?

Description

IEnumerator is the interface needed by the For ... in ... language construct, when operating on classes. It contains all methods that the compiler needs to implement a loop.

A for in loop like the following:

For O in MyObject do
  begin
  // do things
  end;

is treated by the compiler as equivalent to the following code:

Var
  I : IEnumerator;
  O : TObject;

begin
  I:=MyObject.GetEnumerator;
  While I.MoveNext do
    begin
    O:=I.GetCurrent;
    // Do things
    end;
end.

Any class that implements the IEnumerable interface must be able to return an IEnumerator instance for the compiler to use in a For in loop.

See also

IEnumerable

Interface to retrieve an enumerator from a class.


IEnumerator

ro

Current


IEnumerator
 | GetCurrent
 | MoveNext
 | Reset


GetCurrent (IEnumerator)

MoveNext (IEnumerator)

Reset (IEnumerator)


IEnumerator


IEnumerator.Current

Return the current item

Declaration

Source position: objpash.inc line 264

property IEnumerator.Current : TObject
  read GetCurrent;

Description

Current simply is the redefinition of IEnumerator.GetCurrent as a property. It is read-only.

See also

IEnumerator.GetCurrent | Returns the current element in the iteration cycle
IEnumerator.MoveNext | Move to the next value


IEnumerator.GetCurrent

Returns the current element in the iteration cycle

Declaration

Source position: objpash.inc line 261

function IEnumerator.GetCurrent: TObject;

Description

getCurrent should return the object instance representing the current value in the for in loop. GetCurrent will always be called immediately after IEnumerator.MoveNext returned True.

Remark: The actual return type of the interface should not necessarily be TObject, it can be any type. The compiler will check the actual return type with the type of the loop variable, and they should match.

See also

IEnumerator.MoveNext | Move to the next value
IEnumerator.Reset | Reset the pointer


IEnumerator.MoveNext

Move to the next value

Declaration

Source position: objpash.inc line 262

function IEnumerator.MoveNext: Boolean;

Description

MoveNext should move the current item pointer to the next available item. It should return True if an item is available, False if no more items are available. The first time it is called It will be called at the beginning of the for loop, so it should position the enumerator on the first value (if there is one). After MoveNext has returned True, IEnumerator.GetCurrent will be called to retrieve the item.

See also

IEnumerator.Reset | Reset the pointer
IEnumerator.GetCurrent | Returns the current element in the iteration cycle


IEnumerator.Reset

Reset the pointer

Declaration

Source position: objpash.inc line 263

procedure IEnumerator.Reset;

Description

Reset can be implemented to put the pointer at the start of the list. It is not mandatory to implement this method, the compiler does not use it.

See also

IEnumerator.GetCurrent | Returns the current element in the iteration cycle
IEnumerator.MoveNext | Move to the next value


IInvokable

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Interface with RTTI associated with it.

Declaration

Source position: objpash.inc line 255

type IInvokable = interface(IInterface) end;

Inheritance

IInvokable

Interface with RTTI associated with it.

IInterface
?

Description

IInvokable is a descendent of IInterface, compiled in the {$M+} state, so Run-Time Type Information (RTTI) is generated for it.

See also

IDispatch | Dispatch interface
IInterface | Basic interface for all COM based interfaces


IInvokable


IUnknown

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Basic interface for all COM-based interfaces

Declaration

Source position: objpash.inc line 246

type IUnknown = interface
function QueryInterface(); | Return pointer to VMT table of interface
function _AddRef; | Increase reference count of the interface
function _Release; | Decrease reference count of the interface
end;

Inheritance

IUnknown

Basic interface for all COM-based interfaces

Description

IUnknown is defined by windows. It's the basic interface which all COM objects must implement. The definition does not contain any code.

See also

IInterface | Basic interface for all COM based interfaces
IDispatch | Dispatch interface
IInvokable | Interface with RTTI associated with it.


IUnknown


IUnknown
 | QueryInterface
 | _AddRef
 | _Release


QueryInterface (IUnknown)

_AddRef (IUnknown)

_Release (IUnknown)


IUnknown._AddRef

Increase reference count of the interface

Declaration

Source position: objpash.inc line 249

function IUnknown._AddRef: LongInt;

See also

IUnknown._Release

Decrease reference count of the interface


IUnknown._Release

Decrease reference count of the interface

Declaration

Source position: objpash.inc line 250

function IUnknown._Release: LongInt;

See also

IUnknown._AddRef

Increase reference count of the interface


IUnknown.QueryInterface

Return pointer to VMT table of interface

Declaration

Source position: objpash.inc line 248

function IUnknown.QueryInterface(

  const iid: TGuid;

  out obj

):LongInt;


TAggregatedObject

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Aggregated object

Declaration

Source position: objpash.inc line 299

type TAggregatedObject = class(TObject)
public
constructor Create(); | Create a new instance of TAggregatedObject
property Controller: IUnknown; [r] | Controlling instance
end;

Inheritance

TAggregatedObject | Aggregated object
|
TObject | Base class of all classes.

Description

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.

See also

Create | Create a new instance of TAggregatedObject
Controller | Controlling instance


TAggregatedObject

ro

Controller

TObject


TAggregatedObject
 | Create
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Create (TObject)

Create (TAggregatedObject)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

FieldAddress (TObject)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

SafeCallException (TObject)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)


TAggregatedObject

TObject


TAggregatedObject.Controller

Controlling instance

Declaration

Source position: objpash.inc line 310

public property TAggregatedObject.Controller : IUnknown
  read GetController;

Description

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

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

See also

TAggregatedObject.Create

Create a new instance of TAggregatedObject


TAggregatedObject.Create

Create a new instance of TAggregatedObject

Declaration

Source position: objpash.inc line 309

public constructor TAggregatedObject.Create(

  const aController: IUnknown

);

Description

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.

Errors

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.

See also

Controller

Controlling instance


TContainedObject

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Base class for contained objects

Declaration

Source position: objpash.inc line 313

type TContainedObject = class(TAggregatedObject, IInterface)

end;

Inheritance

TContainedObject,IInterface | Base class for contained objects
|
TAggregatedObject | Aggregated object
|
TObject | Base class of all classes.

Description

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.

See also

IInterface

Basic interface for all COM based interfaces


TContainedObject

TAggregatedObject

ro

Controller

TObject


TContainedObject
TAggregatedObject
 | Create
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


TContainedObject

TAggregatedObject

TObject


TInterfacedObject

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TObject descendent implementing the IUnknown interface

Declaration

Source position: objpash.inc line 284

type TInterfacedObject = class(TObject, IUnknown)
public
procedure AfterConstruction; override; | Handle reference count properly.
procedure BeforeDestruction; override; | Check reference count.
class function NewInstance; override; | Create a new instance
property RefCount: LongInt; [r] | Return the current reference count
end;

Inheritance

TInterfacedObject,IUnknown | TObject descendent implementing the IUnknown interface
|
TObject | Base class of all classes.

Description

TInterfacedObject is a descendent of TObject which implements the IUnknown interface. It can be used as a base class for all classes which need reference counting.

See also

IUnknown | Basic interface for all COM-based interfaces
TObject | Base class of all classes.


TInterfacedObject

ro

RefCount

TObject


TInterfacedObject
 | AfterConstruction
 | BeforeDestruction
 | NewInstance
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

AfterConstruction (TInterfacedObject)

BeforeDestruction (TObject)

BeforeDestruction (TInterfacedObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Create (TObject)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

FieldAddress (TObject)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

NewInstance (TInterfacedObject)

SafeCallException (TObject)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)


TInterfacedObject

TObject


TInterfacedObject.AfterConstruction

Handle reference count properly.

Declaration

Source position: objpash.inc line 292

public procedure TInterfacedObject.AfterConstruction; override;

Description

AfterConstruction overrides the basic method in TObject and adds some additional reference count handling.

Errors

None.

See also

BeforeDestruction

Check reference count.


TInterfacedObject.BeforeDestruction

Check reference count.

Declaration

Source position: objpash.inc line 293

public procedure TInterfacedObject.BeforeDestruction; override;

Description

AfterConstruction overrides the basic method in TObject and adds a reference count check: if the reference count is not zero, an error occurs.

Errors

A runtime-error 204 will be generated if the reference count is nonzero when the object is destroyed.

See also

AfterConstruction

Handle reference count properly.


TInterfacedObject.NewInstance

Create a new instance

Declaration

Source position: objpash.inc line 294

public class function TInterfacedObject.NewInstance: TObject; override;

Description

NewInstance initializes a new instance of TInterfacedObject

Errors

None.


TInterfacedObject.RefCount

Return the current reference count

Declaration

Source position: objpash.inc line 295

public property TInterfacedObject.RefCount : LongInt
  read frefcount;

Description

RefCount returns the current reference count. This reference count cannot be manipulated, except through the methods of IUnknown. When it reaches zero, the class instance is destroyed.

See also

IUnknown

Basic interface for all COM-based interfaces


TObject

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Base class of all classes.

Declaration

Source position: objpash.inc line 189

type TObject = class
public
constructor Create; | TObject Constructor
destructor Destroy; virtual; | TObject destructor.
class function newinstance; virtual; | Allocate memory on the heap for a new instance
procedure FreeInstance; virtual; | Clean up instance and free the memory reserved for the instance.
function SafeCallException(); virtual; | Handle exception object
procedure DefaultHandler(); virtual; | Default handler for integer message handlers.
procedure Free; | Check for Nil and call destructor.
class function InitInstance(); | Initialize a new class instance.
procedure CleanupInstance; | Finalize the class instance.
class function ClassType; | Return a "class of" pointer for the current class
class function ClassInfo; | Return a pointer to the type information for this class.
class function ClassName; | Return the current class name.
class function ClassNameIs(); | Check whether the class name equals the given name.
class function ClassParent; | Return the parent class.
class function InstanceSize; | Return the size of an instance.
class function InheritsFrom(); | Check whether class is an ancestor.
class function StringMessageTable; | Return a pointer to the string message table.
class function MethodAddress(); | Return the address of a method
class function MethodName(); | Return the name of a method.
function FieldAddress(); | Return the address of a field.
procedure AfterConstruction; virtual; | Method called after the constructor was called.
procedure BeforeDestruction; virtual; | Method called before the destructor is called.
procedure DefaultHandlerStr(); virtual; | Default handler for string messages.
procedure Dispatch(); virtual; | Dispatch an integer message
procedure DispatchStr(); virtual; | Dispatch a string message.
function GetInterface(); | Return a reference to an interface
function GetInterfaceByStr(); | Return an interface based on its GUID
function GetInterfaceWeak(); | Get a reference to an interface, not increasing the reference count
class function GetInterfaceEntry(); | Return the interface table entry by GUID
class function GetInterfaceEntryByStr(); | Return the interface table entry by string
class function GetInterfaceTable; | Return a pointer to the table of implemented interfaces for a class
class function UnitName; | Unit name
function Equals(); virtual; | Check if two objects are equal.
function GetHashCode; virtual; | Return a hash code for the object
function ToString; virtual; | Return a string representation for the object
end;

Inheritance

TObject

Base class of all classes.

Description

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

See also

TClass

Class of TObject.


TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Create (TObject)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

FieldAddress (TObject)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

SafeCallException (TObject)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)


TObject.AfterConstruction

Method called after the constructor was called.

Declaration

Source position: objpash.inc line 220

public procedure TObject.AfterConstruction; virtual;

Description

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)

Errors

None.

See also

BeforeDestruction | Method called before the destructor is called.
Create | TObject Constructor


TObject.BeforeDestruction

Method called before the destructor is called.

Declaration

Source position: objpash.inc line 221

public procedure TObject.BeforeDestruction; virtual;

Description

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)

Errors

None.

See also

AfterConstruction | Method called after the constructor was called.
Destroy | TObject destructor.
Free | Check for Nil and call destructor.


TObject.ClassInfo

Return a pointer to the type information for this class.

Declaration

Source position: objpash.inc line 207

public class function TObject.ClassInfo: pointer;

Description

ClassInfo returns a pointer to the type information for this class. This pointer can be used in the various type information routines.


TObject.ClassName

Return the current class name.

Declaration

Source position: objpash.inc line 208

public class function TObject.ClassName: shortstring;

Description

ClassName returns the class name for the current class, in all-uppercase letters. To check for the class name, use the ClassNameIs class method.

Errors

None.

See also

ClassInfo | Return a pointer to the type information for this class.
ClassType | Return a "class of" pointer for the current class
ClassNameIs | Check whether the class name equals the given name.


TObject.ClassNameIs

Check whether the class name equals the given name.

Declaration

Source position: objpash.inc line 209

public class function TObject.ClassNameIs(

  const name: string

):Boolean;

Description

ClassNameIs checks whether Name equals the class name. It takes of case sensitivity, i.e. it converts both names to uppercase before comparing.

See also

ClassInfo | Return a pointer to the type information for this class.
ClassType | Return a "class of" pointer for the current class
ClassName | Return the current class name.


TObject.ClassParent

Return the parent class.

Declaration

Source position: objpash.inc line 210

public class function TObject.ClassParent: TClass;

Description

ClassParent returns the class of the parent class of the current class. This is always different from Nil, except for TObject.

Errors

None.

See also

ClassInfo | Return a pointer to the type information for this class.
ClassType | Return a "class of" pointer for the current class
ClassNameIs | Return the current class name.


TObject.ClassType

Return a "class of" pointer for the current class

Declaration

Source position: objpash.inc line 206

public class function TObject.ClassType: TClass;

Description

ClassType returns a TClass class type reference for the current class.

See also

TClass | Class of TObject.
ClassInfo | Return a pointer to the type information for this class.
ClassName | Return the current class name.


TObject.CleanupInstance

Finalize the class instance.

Declaration

Source position: objpash.inc line 205

public procedure TObject.CleanupInstance;

Description

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.

Errors

None.

See also

Destroy | TObject destructor.
Free | Check for Nil and call destructor.
InitInstance | Initialize a new class instance.


TObject.Create

TObject Constructor

Declaration

Source position: objpash.inc line 194

public constructor TObject.Create;

Description

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.

See also

Destroy

TObject destructor.


TObject.DefaultHandler

Default handler for integer message handlers.

Declaration

Source position: objpash.inc line 201

public procedure TObject.DefaultHandler(

  var message

); virtual;

Description

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.

See also

Dispatch | Dispatch an integer message
DefaultHandlerStr | Default handler for string messages.


TObject.DefaultHandlerStr

Default handler for string messages.

Declaration

Source position: objpash.inc line 224

public procedure TObject.DefaultHandlerStr(

  var message

); virtual;

Description

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.

See also

DispatchStr | Dispatch a string message.
Dispatch | Dispatch an integer message
DefaultHandler | Default handler for integer message handlers.


TObject.Destroy

TObject destructor.

Declaration

Source position: objpash.inc line 196

public destructor TObject.Destroy; virtual;

Description

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.

See also

Create | TObject Constructor
Free | Check for Nil and call destructor.


TObject.Dispatch

Dispatch an integer message

Declaration

Source position: objpash.inc line 227

public procedure TObject.Dispatch(

  var message

); virtual;

Description

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.

See also

DispatchStr | Dispatch a string message.
DefaultHandler | Default handler for integer message handlers.


TObject.DispatchStr

Dispatch a string message.

Declaration

Source position: objpash.inc line 228

public procedure TObject.DispatchStr(

  var message

); virtual;

Description

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.

Errors

None.

See also

DefaultHandlerStr | Default handler for string messages.
Dispatch | Dispatch an integer message
DefaultHandler | Default handler for integer message handlers.


TObject.Equals

Check if two objects are equal.

Declaration

Source position: objpash.inc line 241

public function TObject.Equals(

  Obj: TObject

):Boolean; virtual;

Description

Equals returns True if the object instance pointer (Self) equals the instance pointer Obj.

Descendent classes can override to check properties etc. in case the instance pointers are different.

See also

TObject.GetHashCode | Return a hash code for the object
TObject.ToString | Return a string representation for the object


TObject.FieldAddress

Return the address of a field.

Declaration

Source position: objpash.inc line 217

public function TObject.FieldAddress(

  const name: shortstring

):pointer;

Description

FieldAddress returns the address of the field with name name. The address is the address of the field in the current class instance.

Errors

If no field with the specified name is found, Nil is returned.

See also

MethodAddress | Return the address of a method
MethodName | Return the name of a method.


TObject.Free

Check for Nil and call destructor.

Declaration

Source position: objpash.inc line 203

public procedure TObject.Free;

Description

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.

Errors

None.

See also

Destroy | TObject destructor.
FreeAndNil | Free object if needed, and set object reference to Nil


TObject.FreeInstance

Clean up instance and free the memory reserved for the instance.

Declaration

Source position: objpash.inc line 198

public procedure TObject.FreeInstance; virtual;

Description

FreeInstance cleans up an instance of the current class, and releases the heap memory occupied by the class instance.

See also

Destroy | TObject destructor.
InitInstance | Initialize a new class instance.
NewInstance | Allocate memory on the heap for a new instance


TObject.GetHashCode

Return a hash code for the object

Declaration

Source position: objpash.inc line 242

public function TObject.GetHashCode: PtrInt; virtual;

Description

GetHashCode should return a hash code for the object. By default, the numerical (integer) address of Self is returned.

Descendent classes can use this to generate better suitable values to be used in a hash table.

See also

TObject.ToString | Return a string representation for the object
TObject.Equals | Check if two objects are equal.


TObject.GetInterface

Return a reference to an interface

Declaration

Source position: objpash.inc line 231

public function TObject.GetInterface(

  const iid: TGuid;

  out obj

):Boolean;

function TObject.GetInterface(

  const iidstr: shortstring;

  out obj

):Boolean;

Description

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.

Errors

If no interface was found, False is returned.

See also

GetInterfaceByStr

Return an interface based on its GUID


TObject.GetInterfaceByStr

Return an interface based on its GUID

Declaration

Source position: objpash.inc line 233

public function TObject.GetInterfaceByStr(

  const iidstr: shortstring;

  out obj

):Boolean;

Description

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.

Errors

The function returns false if the requested interface is not implemented.

See also

TObject.GetInterfaceEntry | Return the interface table entry by GUID
TObject.GetInterfaceEntryByStr | Return the interface table entry by string


TObject.GetInterfaceEntry

Return the interface table entry by GUID

Declaration

Source position: objpash.inc line 235

public class function TObject.GetInterfaceEntry(

  const iid: TGuid

):pinterfaceentry;

Description

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.

See also

TObject.GetInterfaceByStr | Return an interface based on its GUID
TObject.GetInterfaceEntryByStr | Return the interface table entry by string


TObject.GetInterfaceEntryByStr

Return the interface table entry by string

Declaration

Source position: objpash.inc line 236

public class function TObject.GetInterfaceEntryByStr(

  const iidstr: shortstring

):pinterfaceentry;

Description

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.

See also

TObject.GetInterfaceByStr | Return an interface based on its GUID
TObject.GetInterfaceEntry | Return the interface table entry by GUID


TObject.GetInterfaceTable

Return a pointer to the table of implemented interfaces for a class

Declaration

Source position: objpash.inc line 237

public class function TObject.GetInterfaceTable: pinterfacetable;

Description

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.

See also

TObject.GetInterfaceByStr | Return an interface based on its GUID
TObject.GetInterfaceEntry | Return the interface table entry by GUID


TObject.GetInterfaceWeak

Get a reference to an interface, not increasing the reference count

Declaration

Source position: objpash.inc line 234

public function TObject.GetInterfaceWeak(

  const iid: TGuid;

  out obj

):Boolean;

Description

GetInterfaceWeak performs the same function as Getinterface, but unlike the latter, it will not increase the reference count of the interface.

See also

TObject.GetInterface

Return a reference to an interface


TObject.InheritsFrom

Check whether class is an ancestor.

Declaration

Source position: objpash.inc line 212

public class function TObject.InheritsFrom(

  aclass: TClass

):Boolean;

Description

InheritsFrom returns True if AClass is an ancestor class from the current class, and returns false if it is not.

See also

ClassName | Return the current class name.
ClassInfo | Return a pointer to the type information for this class.
ClassType | Return a "class of" pointer for the current class
TClass | Class of TObject.


TObject.InitInstance

Initialize a new class instance.

Declaration

Source position: objpash.inc line 204

public class function TObject.InitInstance(

  instance: pointer

):TObject;

Description

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.

See also

NewInstance | Allocate memory on the heap for a new instance
Create | TObject Constructor


TObject.InstanceSize

Return the size of an instance.

Declaration

Source position: objpash.inc line 211

public class function TObject.InstanceSize: SizeInt;

Description

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.

Errors

None.

See also

InitInstance | Initialize a new class instance.
ClassName | Return the current class name.
ClassInfo | Return a pointer to the type information for this class.
ClassType | Return a "class of" pointer for the current class


TObject.MethodAddress

Return the address of a method

Declaration

Source position: objpash.inc line 215

public class function TObject.MethodAddress(

  const name: shortstring

):CodePointer;

Description

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.

Errors

If no matching method is found, Nil is returned.

See also

MethodName | Return the name of a method.
FieldAddress | Return the address of a field.


TObject.MethodName

Return the name of a method.

Declaration

Source position: objpash.inc line 216

public class function TObject.MethodName(

  address: CodePointer

):shortstring;

Description

MethodName searches the VMT for a method with the specified address and returns the name of the method.

Errors

If no method with the matching address is found, an empty string is returned.

See also

MethodAddress | Return the address of a method
FieldAddress | Return the address of a field.


TObject.newinstance

Allocate memory on the heap for a new instance

Declaration

Source position: objpash.inc line 197

public class function TObject.newinstance: TObject; virtual;

Description

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.

This method can be overridden to implement e.g. object pooling. Note that the method is responsible for correctly initializing the object, i.e. zeroing out the new instance.

Errors

If not enough memory is available, a Nil pointer may be returned, or an exception may be raised.

See also

Create | TObject Constructor
InitInstance | Initialize a new class instance.
InstanceSize | Return the size of an instance.
FreeInstance | Clean up instance and free the memory reserved for the instance.


TObject.SafeCallException

Handle exception object

Declaration

Source position: objpash.inc line 199

public function TObject.SafeCallException(

  exceptobject: TObject;

  exceptaddr: CodePointer

):HRESULT; virtual;

Description

SafeCallException should be overridden to handle exceptions in a method marked with the savecall directive. The implementation in TObject simply returns zero.


TObject.StringMessageTable

Return a pointer to the string message table.

Declaration

Source position: objpash.inc line 213

public class function TObject.StringMessageTable: pstringmessagetable;

Description

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.

Errors

If there are no string message handlers, nil is returned.

See also

DispatchStr | Dispatch a string message.
Dispatch | Dispatch an integer message


TObject.ToString

Return a string representation for the object

Declaration

Source position: objpash.inc line 243

public function TObject.ToString: ansistring; virtual;

Description

ToString returns by default the class name of the object. It is useful during sending of debug messages.

Descendent classes can override this method to give a better description of the object than just the class name.

See also

TObject.GetHashCode | Return a hash code for the object
TObject.Equals | Check if two objects are equal.


TObject.UnitName

Unit name

Declaration

Source position: objpash.inc line 240

public class function TObject.UnitName: ansistring;

Description

UnitName returns the unit name in which the class was defined. The name is obtained from the class definition data the compiler generates for each class.


EAbort

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Abort error.

Declaration

Source position: sysutilh.inc line 191

type EAbort = class(Exception)

Inheritance

EAbort | Abort error.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

Abort is raised by the Abort procedure. It is not displayed in GUI applications, and serves only to immediately abort the current procedure, and return control to the main program loop.

See also

Abort

Abort program execution.


EAbort
Exception
 | HelpContext
 | Message
TObject


EAbort
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EAbort

Exception

TObject


EAbstractError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Abstract error.

Declaration

Source position: sysutilh.inc line 192

type EAbstractError = class(Exception)

Inheritance

EAbstractError | Abstract error.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EAbstractError is raised when an abstract error occurs, i.e. when an unimplemented abstract method is called.


EAbstractError
Exception
 | HelpContext
 | Message
TObject


EAbstractError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EAbstractError

Exception

TObject


EAccessViolation

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Access Violation error

Declaration

Source position: sysutilh.inc line 180

type EAccessViolation = class(EExternal)

Inheritance

EAccessViolation | Access Violation error
|
EExternal | External Exception.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EAccessViolation is raised when the OS reports an Access Violation, i.e. when invalid memory is accessed.

See also

EObjectCheck

A Nil object reference was encountered


EAccessViolation
EExternal
Exception
 | HelpContext
 | Message
TObject


EAccessViolation
EExternal
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EAccessViolation

EExternal

Exception

TObject


EArgumentException

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Invalid argument passed to a function

Declaration

Source position: sysutilh.inc line 215

type EArgumentException = class(Exception)

Inheritance

EArgumentException | Invalid argument passed to a function
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EArgumentException is raised by many character conversion/handling routines to indicate an erroneous argument was passed to the function (usually indicating an invalid codepoint in a unicode string).

Errors

None.

See also

EArgumentOutOfRangeException

Argument out of valid range passed to a function


EArgumentException
Exception
 | HelpContext
 | Message
TObject


EArgumentException
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EArgumentException

Exception

TObject


EArgumentNilException

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when a required argument is Nil.

Declaration

Source position: sysutilh.inc line 217

type EArgumentNilException = class(EArgumentException)

Inheritance

EArgumentNilException | Exception raised when a required argument is Nil.
|
EArgumentException | Invalid argument passed to a function
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EArgumentNilException is an exception raised when an argument is Nil when it should not be Nil.

This exception class is provided for Delphi compatibility, but is not actually used in FPC.

See also

Exception

Base class of all exceptions.


EArgumentNilException
EArgumentException
Exception
 | HelpContext
 | Message
TObject


EArgumentNilException
EArgumentException
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EArgumentNilException

EArgumentException

Exception

TObject


EArgumentOutOfRangeException

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Argument out of valid range passed to a function

Declaration

Source position: sysutilh.inc line 216

type EArgumentOutOfRangeException = class(EArgumentException)

Inheritance

EArgumentOutOfRangeException | Argument out of valid range passed to a function
|
EArgumentException | Invalid argument passed to a function
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EArgumentOutOfRangeException is raised by many character conversion/handling routines to indicate an erroneous argument was passed to the function (indicating an invalid character index in a unicode string).

See also

EArgumentException

Invalid argument passed to a function


EArgumentOutOfRangeException
EArgumentException
Exception
 | HelpContext
 | Message
TObject


EArgumentOutOfRangeException
EArgumentException
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EArgumentOutOfRangeException

EArgumentException

Exception

TObject


EAssertionFailed

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Assertion failed error.

Declaration

Source position: sysutilh.inc line 193

type EAssertionFailed = class(Exception)

Inheritance

EAssertionFailed | Assertion failed error.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EAssertionFailed is raised when an application that is compiled with assertions, encounters an invalid assertion.


EAssertionFailed
Exception
 | HelpContext
 | Message
TObject


EAssertionFailed
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EAssertionFailed

Exception

TObject


EBusError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Bus error exception

Declaration

Source position: sysutilh.inc line 181

type EBusError = class(EAccessViolation)

Inheritance

EBusError | Bus error exception
|
EAccessViolation | Access Violation error
|
EExternal | External Exception.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EBusError is raised in case of a bus error.


EBusError
EAccessViolation
EExternal
Exception
 | HelpContext
 | Message
TObject


EBusError
EAccessViolation
EExternal
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EBusError

EAccessViolation

EExternal

Exception

TObject


EControlC

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Control-C (abort) was pressed on the console.

Declaration

Source position: sysutilh.inc line 184

type EControlC = class(EExternal)

Inheritance

EControlC | Control-C (abort) was pressed on the console.
|
EExternal | External Exception.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EControlC is raised when the user has pressed CTRL-C in a console application.


EControlC
EExternal
Exception
 | HelpContext
 | Message
TObject


EControlC
EExternal
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EControlC

EExternal

Exception

TObject


EConvertError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Conversion error.

Declaration

Source position: sysutilh.inc line 187

type EConvertError = class(Exception)

Inheritance

EConvertError | Conversion error.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EConvertError is raised by the various conversion routines in the SysUtils unit. The message will contain more specific error information.


EConvertError
Exception
 | HelpContext
 | Message
TObject


EConvertError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EConvertError

Exception

TObject


EDirectoryNotFoundException

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when a directory is not found.

Declaration

Source position: sysutilh.inc line 221

type EDirectoryNotFoundException = class(Exception)

Inheritance

EDirectoryNotFoundException | Exception raised when a directory is not found.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EDirectoryNotFoundException is an exception raised when a directory is referenced that does not exist.

This exception class is provided for Delphi compatibility, but is not actually used in FPC.

See also

Exception | Base class of all exceptions.
EFileNotFoundException | Exception raised when a file is not found.
EPathNotFoundException | Exception raised when a path is not found.
EPathTooLongException | Exception raised when a path name is too long.


EDirectoryNotFoundException
Exception
 | HelpContext
 | Message
TObject


EDirectoryNotFoundException
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EDirectoryNotFoundException

Exception

TObject


EDivByZero

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Division by zero error.

Declaration

Source position: sysutilh.inc line 145

type EDivByZero = class(EInterror)

Inheritance

EDivByZero | Division by zero error.
|
EInterror | Integer operation error.
|
EExternal | External Exception.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EDivByZero is used when the operating system or CPU signals a division by zero error.


EDivByZero
EInterror
EExternal
Exception
 | HelpContext
 | Message
TObject


EDivByZero
EInterror
EExternal
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EDivByZero

EInterror

EExternal

Exception

TObject


EEncodingError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised by the TEncoding class.

Declaration

Source position: sysencodingh.inc line 17

type EEncodingError = class(Exception)

Inheritance

EEncodingError | Exception raised by the TEncoding class.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EEncodingError is the exception classed used by the TEncoding class to indicatee errors.

See also

TEncoding

Encoding support


EEncodingError
Exception
 | HelpContext
 | Message
TObject


EEncodingError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EEncodingError

Exception

TObject


EExternal

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

External Exception.

Declaration

Source position: sysutilh.inc line 131

type EExternal = class(Exception) end;

Inheritance

EExternal | External Exception.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EExternal is the base exception for all external exceptions, as reported by the CPU or operating system, as opposed to internal exceptions, which are raised by the program itself. The SysUtils unit converts all operating system errors to descendents of EExternal.

See also

EInterror | Integer operation error.
EExternal | External Exception.
EMathError | Mathematical error
EExternalException | External exception
EAccessViolation | Access Violation error
EPrivilege | Privileged instruction error.
EStackOverflow | Stack overflow error.
EControlC | Control-C (abort) was pressed on the console.


EExternal
Exception
 | HelpContext
 | Message
TObject


EExternal
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EExternal

Exception

TObject


EExternalException

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

External exception

Declaration

Source position: sysutilh.inc line 171

type EExternalException = class(EExternal)

Inheritance

EExternalException | External exception
|
EExternal | External Exception.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EExternalException is raised when an external routine raises an exception.

See also

EExternal

External Exception.


EExternalException
EExternal
Exception
 | HelpContext
 | Message
TObject


EExternalException
EExternal
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EExternalException

EExternal

Exception

TObject


EFileNotFoundException

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when a file is not found.

Declaration

Source position: sysutilh.inc line 222

type EFileNotFoundException = class(Exception)

Inheritance

EFileNotFoundException | Exception raised when a file is not found.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EFileNotFoundException is an exception raised when a file is referenced that does not exist.

This exception class is provided for Delphi compatibility, but is not actually used in FPC.

See also

Exception | Base class of all exceptions.
EPathNotFoundException | Exception raised when a path is not found.
EDirectoryNotFoundException | Exception raised when a directory is not found.
EPathTooLongException | Exception raised when a path name is too long.


EFileNotFoundException
Exception
 | HelpContext
 | Message
TObject


EFileNotFoundException
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EFileNotFoundException

Exception

TObject


EFormatError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Formatting error exception

Declaration

Source position: sysutilh.inc line 188

type EFormatError = class(Exception)

Inheritance

EFormatError | Formatting error exception
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EformatError is raised in case of an error in one of the various Format functions.

See also

Format

Format a string with given arguments.


EFormatError
Exception
 | HelpContext
 | Message
TObject


EFormatError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EFormatError

Exception

TObject


EHeapMemoryError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Heap memory error

Declaration

Source position: sysutilh.inc line 162

type EHeapMemoryError = class(Exception)

public

  procedure FreeInstance; override;

Free the exception instance

end;

Inheritance

EHeapMemoryError | Heap memory error
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EHeapMemoryError is raised when an error occurs in heap (dynamically allocated) memory.

See also

EHeapException | Heap exception
EoutOfMemory | Out of memory error.
EInvalidPointer | Invalid pointer operation


EHeapMemoryError
Exception
 | HelpContext
 | Message
TObject


EHeapMemoryError
 | FreeInstance
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EHeapMemoryError

Exception

TObject


EHeapMemoryError.FreeInstance

Free the exception instance

Declaration

Source position: sysutilh.inc line 166

public procedure EHeapMemoryError.FreeInstance; override;

Description

FreeInstance checks whether the exception instance may be freed prior to calling the inherited FreeInstance. The exception is only freed in case of normal program shutdown, if a heap error occurred, the exception instance is not freed.


EInOutError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Input/Output error

Declaration

Source position: sysutilh.inc line 157

type EInOutError = class(Exception)

public

  ErrorCode: Integer;

Error code for Input/Output operation.

end;

Inheritance

EInOutError | Input/Output error
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EInOutError is raised when a IO routine of Free Pascal returns an error. The error is converted to an EInOutError only if the input/output checking feature of FPC is turned on. The error code of the input/output operation is returned in ErrorCode.

See also

EInOutError.ErrorCode

Error code for Input/Output operation.


EInOutError
Exception
 | HelpContext
 | Message
TObject


EInOutError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EInOutError

Exception

TObject


EInOutError.ErrorCode

Error code for Input/Output operation.

Declaration

Source position: sysutilh.inc line 159

public EInOutError.ErrorCode : Integer;

Description

ErrorCode contains the error code from the I/O operation which raised the EInoutError exception. An explanation of the error codes can be found in the user's manual.


EInterror

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Integer operation error.

Declaration

Source position: sysutilh.inc line 144

type EInterror = class(EExternal)

Inheritance

EInterror | Integer operation error.
|
EExternal | External Exception.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EInterror is used when the operating system or CPU signals an integer operation error, e.g., an overflow.


EInterror
EExternal
Exception
 | HelpContext
 | Message
TObject


EInterror
EExternal
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EInterror

EExternal

Exception

TObject


EIntfCastError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Invalid interface cast error.

Declaration

Source position: sysutilh.inc line 199

type EIntfCastError = class(Exception)

Inheritance

EIntfCastError | Invalid interface cast error.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EIntfCastError is raised when an invalid interface cast is encountered.

See also

EInvalidCast

Invalid typecast error.


EIntfCastError
Exception
 | HelpContext
 | Message
TObject


EIntfCastError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EIntfCastError

Exception

TObject


EIntOverflow

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Integer overflow error.

Declaration

Source position: sysutilh.inc line 147

type EIntOverflow = class(EInterror)

Inheritance

EIntOverflow | Integer overflow error.
|
EInterror | Integer operation error.
|
EExternal | External Exception.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EIntOverflow is used when the operating system or CPU signals a integer overflow error.

See also

EIntError | Integer operation error.
EDivByZero | Division by zero error.
ERangeError | Range check error.


EIntOverflow
EInterror
EExternal
Exception
 | HelpContext
 | Message
TObject


EIntOverflow
EInterror
EExternal
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EIntOverflow

EInterror

EExternal

Exception

TObject


EInvalidCast

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Invalid typecast error.

Declaration

Source position: sysutilh.inc line 174

type EInvalidCast = class(Exception)

Inheritance

EInvalidCast | Invalid typecast error.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EInvalidCast is raised when an invalid typecast error (using the as operator) is encountered.

See also

EIntfCastError

Invalid interface cast error.


EInvalidCast
Exception
 | HelpContext
 | Message
TObject


EInvalidCast
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EInvalidCast

Exception

TObject


EInvalidContainer

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Invalid container error.

Declaration

Source position: sysutilh.inc line 200

type EInvalidContainer = class(Exception)

Inheritance

EInvalidContainer | Invalid container error.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EInvalidContainer is not yet used by Free Pascal, and is provided for Delphi compatibility only.


EInvalidContainer
Exception
 | HelpContext
 | Message
TObject


EInvalidContainer
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EInvalidContainer

Exception

TObject


EInvalidInsert

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Invalid insert error.

Declaration

Source position: sysutilh.inc line 201

type EInvalidInsert = class(Exception)

Inheritance

EInvalidInsert | Invalid insert error.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EInvalidInsert is not yet used by Free Pascal, and is provided for Delphi compatibility only.


EInvalidInsert
Exception
 | HelpContext
 | Message
TObject


EInvalidInsert
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EInvalidInsert

Exception

TObject


EInvalidOp

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Invalid operation.

Declaration

Source position: sysutilh.inc line 151

type EInvalidOp = class(EMathError)

Inheritance

EInvalidOp | Invalid operation.
|
EMathError | Mathematical error
|
EExternal | External Exception.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EInvalidOp is raised when an invalid operation is encountered.


EInvalidOp
EMathError
EExternal
Exception
 | HelpContext
 | Message
TObject


EInvalidOp
EMathError
EExternal
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EInvalidOp

EMathError

EExternal

Exception

TObject


EInvalidPointer

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Invalid pointer operation

Declaration

Source position: sysutilh.inc line 172

type EInvalidPointer = class(EHeapMemoryError)

Inheritance

EInvalidPointer | Invalid pointer operation
|
EHeapMemoryError | Heap memory error
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EInvalidPointer is raised when an invalid heap pointer is used.

See also

EHeapException | Heap exception
EHeapMemoryError | Heap memory error
EOutOfMemory | Out of memory error.


EInvalidPointer
EHeapMemoryError
Exception
 | HelpContext
 | Message
TObject


EInvalidPointer
EHeapMemoryError
 | FreeInstance
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EInvalidPointer

EHeapMemoryError

Exception

TObject


EMathError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Mathematical error

Declaration

Source position: sysutilh.inc line 150

type EMathError = class(EExternal)

Inheritance

EMathError | Mathematical error
|
EExternal | External Exception.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EMathError is used when the operating system or CPU signals a floating point overflow error.

See also

EIntError | Integer operation error.
EIntOverflow | Integer overflow error.
EDivByZero | Division by zero error.
ERangeError | Range check error.


EMathError
EExternal
Exception
 | HelpContext
 | Message
TObject


EMathError
EExternal
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EMathError

EExternal

Exception

TObject


ENoConstructException

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Error raised when instantiating a TCharacter class

Declaration

Source position: sysutilh.inc line 225

type ENoConstructException = class(Exception)

Inheritance

ENoConstructException | Error raised when instantiating a TCharacter class
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

ENoConstructException is the exception raised when an instance of type TCharacter is being created. The TCharacter class only contains static methods, no instances of this class should be instantiated.


ENoConstructException
Exception
 | HelpContext
 | Message
TObject


ENoConstructException
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


ENoConstructException

Exception

TObject


ENoThreadSupport

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

No Thread support error.

Declaration

Source position: sysutilh.inc line 211

type ENoThreadSupport = class(Exception)

Inheritance

ENoThreadSupport | No Thread support error.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

ENoThreadSupport is raised when some thread routines are invoked, and thread support was not enabled when the program was compiled.


ENoThreadSupport
Exception
 | HelpContext
 | Message
TObject


ENoThreadSupport
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


ENoThreadSupport

Exception

TObject


ENotImplemented

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised in case of a not implemented feature.

Declaration

Source position: sysutilh.inc line 213

type ENotImplemented = class(Exception)

Inheritance

ENotImplemented | Exception raised in case of a not implemented feature.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

ENotImplemented can be used to raise an exception when a particular call had been defined, but was not implemented.


ENotImplemented
Exception
 | HelpContext
 | Message
TObject


ENotImplemented
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


ENotImplemented

Exception

TObject


ENotSupportedException

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when a feature is not supported.

Declaration

Source position: sysutilh.inc line 220

type ENotSupportedException = class(Exception)

Inheritance

ENotSupportedException | Exception raised when a feature is not supported.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

ENotSupportedException is an exception raised when a function or procedure is not supported for a certain platform.

This exception class is provided for Delphi compatibility, but is not actually used in FPC.

See also

Exception

Base class of all exceptions.


ENotSupportedException
Exception
 | HelpContext
 | Message
TObject


ENotSupportedException
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


ENotSupportedException

Exception

TObject


ENoWideStringSupport

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised if no widestring support is available in the executable

Declaration

Source position: sysutilh.inc line 212

type ENoWideStringSupport = class(Exception)

Inheritance

ENoWideStringSupport | Exception raised if no widestring support is available in the executable
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

ENoWideStringSupport is the exception raised when a run-time 233 occurs, i.e. when widestring routines are called and the application does not contain widestring support.


ENoWideStringSupport
Exception
 | HelpContext
 | Message
TObject


ENoWideStringSupport
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


ENoWideStringSupport

Exception

TObject


EObjectCheck

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

A Nil object reference was encountered

Declaration

Source position: sysutilh.inc line 194

type EObjectCheck = class(Exception)

Inheritance

EObjectCheck | A Nil object reference was encountered
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EObjectCheck is raised when the -CR (check object references) command-line option or {$OBJECTCHECKS ON} directive is in effect and a Nil reference to an object or class was encountered.

See also

EAccessViolation

Access Violation error


EObjectCheck
Exception
 | HelpContext
 | Message
TObject


EObjectCheck
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EObjectCheck

Exception

TObject


EOSError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Operating system error.

Declaration

Source position: sysutilh.inc line 205

type EOSError = class(Exception)

public

  ErrorCode: LongInt;

Operating system error code.

end;

Inheritance

EOSError | Operating system error.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EOSError is raised when some Operating System call fails. The ErrorCode property contains the operating system error code.

See also

EOSError.ErrorCode

Operating system error code.


EOSError
Exception
 | HelpContext
 | Message
TObject


EOSError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EOSError

Exception

TObject


EOSError.ErrorCode

Operating system error code.

Declaration

Source position: sysutilh.inc line 207

public EOSError.ErrorCode : LongInt;

Description

ErrorCode contains the error code reported by the operating system for the call which caused the EOSError to be raised.

See also

EOSError

Operating system error.


EOutOfMemory

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Out of memory error.

Declaration

Source position: sysutilh.inc line 173

type EOutOfMemory = class(EHeapMemoryError)

Inheritance

EOutOfMemory | Out of memory error.
|
EHeapMemoryError | Heap memory error
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EOutOfMemory occurs when memory can no longer be allocated on the heap. An instance of EOutOfMemory is allocated on the heap at program startup, so it is available when needed.

See also

EHeapException | Heap exception
EHeapMemoryError | Heap memory error
EInvalidPointer | Invalid pointer operation


EOutOfMemory
EHeapMemoryError
Exception
 | HelpContext
 | Message
TObject


EOutOfMemory
EHeapMemoryError
 | FreeInstance
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EOutOfMemory

EHeapMemoryError

Exception

TObject


EOverflow

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Float overflow error.

Declaration

Source position: sysutilh.inc line 153

type EOverflow = class(EMathError)

Inheritance

EOverflow | Float overflow error.
|
EMathError | Mathematical error
|
EExternal | External Exception.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EOverflow occurs when a float operation overflows. (i.e. result is too big to represent).

See also

EIntError | Integer operation error.
EIntOverflow | Integer overflow error.
EDivByZero | Division by zero error.
ERangeError | Range check error.
EUnderFlow | Float underflow error


EOverflow
EMathError
EExternal
Exception
 | HelpContext
 | Message
TObject


EOverflow
EMathError
EExternal
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EOverflow

EMathError

EExternal

Exception

TObject


EPackageError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Package error.

Declaration

Source position: sysutilh.inc line 203

type EPackageError = class(Exception)

Inheritance

EPackageError | Package error.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EPackageError is not yet used by Free Pascal, and is provided for Delphi compatibility only.


EPackageError
Exception
 | HelpContext
 | Message
TObject


EPackageError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EPackageError

Exception

TObject


EPathNotFoundException

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when a path is not found.

Declaration

Source position: sysutilh.inc line 223

type EPathNotFoundException = class(Exception)

Inheritance

EPathNotFoundException | Exception raised when a path is not found.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EPathNotFoundException is an exception raised when a path is referenced that does not exist.

This exception class is provided for Delphi compatibility, but is not actually used in FPC.

See also

Exception | Base class of all exceptions.
EFileNotFoundException | Exception raised when a file is not found.
EDirectoryNotFoundException | Exception raised when a directory is not found.
EPathTooLongException | Exception raised when a path name is too long.


EPathNotFoundException
Exception
 | HelpContext
 | Message
TObject


EPathNotFoundException
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EPathNotFoundException

Exception

TObject


EPathTooLongException

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when a path name is too long.

Declaration

Source position: sysutilh.inc line 219

type EPathTooLongException = class(Exception)

Inheritance

EPathTooLongException | Exception raised when a path name is too long.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EPathTooLongException is an exception raised when a pathname argument is longer than the allowed pathname length for files.

This exception class is provided for Delphi compatibility, but is not actually used in FPC.

See also

Exception | Base class of all exceptions.
EFileNotFoundException | Exception raised when a file is not found.
EDirectoryNotFoundException | Exception raised when a directory is not found.
EPathNotFoundException | Exception raised when a path is not found.


EPathTooLongException
Exception
 | HelpContext
 | Message
TObject


EPathTooLongException
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EPathTooLongException

Exception

TObject


EPrivilege

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Privileged instruction error.

Declaration

Source position: sysutilh.inc line 182

type EPrivilege = class(EExternal)

Inheritance

EPrivilege | Privileged instruction error.
|
EExternal | External Exception.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EPrivilege is raised when the OS reports that an invalid instruction was executed.


EPrivilege
EExternal
Exception
 | HelpContext
 | Message
TObject


EPrivilege
EExternal
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EPrivilege

EExternal

Exception

TObject


EPropReadOnly

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Read-only property error.

Declaration

Source position: sysutilh.inc line 196

type EPropReadOnly = class(Exception)

Inheritance

EPropReadOnly | Read-only property error.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EPropReadOnly is raised when an attempt is made to write to a read-only property.


EPropReadOnly
Exception
 | HelpContext
 | Message
TObject


EPropReadOnly
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EPropReadOnly

Exception

TObject


EPropWriteOnly

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Write-only property error.

Declaration

Source position: sysutilh.inc line 197

type EPropWriteOnly = class(Exception)

Inheritance

EPropWriteOnly | Write-only property error.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EPropWriteOnly is raised when an attempt is made to read from a write-only property.

See also

EPropReadOnly

Read-only property error.


EPropWriteOnly
Exception
 | HelpContext
 | Message
TObject


EPropWriteOnly
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EPropWriteOnly

Exception

TObject


ERangeError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Range check error.

Declaration

Source position: sysutilh.inc line 146

type ERangeError = class(EInterror)

Inheritance

ERangeError | Range check error.
|
EInterror | Integer operation error.
|
EExternal | External Exception.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

ERangeError is raised by the Free Pascal runtime library if range checking is on, and a range check error occurs.

See also

EIntError | Integer operation error.
EDivByZero | Division by zero error.
EIntOverflow | Integer overflow error.


ERangeError
EInterror
EExternal
Exception
 | HelpContext
 | Message
TObject


ERangeError
EInterror
EExternal
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


ERangeError

EInterror

EExternal

Exception

TObject


ESafecallException

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

SafeCall exception.

Declaration

Source position: sysutilh.inc line 210

type ESafecallException = class(Exception)

Inheritance

ESafecallException | SafeCall exception.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

ESafecallException is not yet used by Free Pascal, and is provided for Delphi compatibility only.


ESafecallException
Exception
 | HelpContext
 | Message
TObject


ESafecallException
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


ESafecallException

Exception

TObject


EStackOverflow

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Stack overflow error.

Declaration

Source position: sysutilh.inc line 183

type EStackOverflow = class(EExternal)

Inheritance

EStackOverflow | Stack overflow error.
|
EExternal | External Exception.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EStackOverflow occurs when the stack has grown too big (e.g. by infinite recursion).


EStackOverflow
EExternal
Exception
 | HelpContext
 | Message
TObject


EStackOverflow
EExternal
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EStackOverflow

EExternal

Exception

TObject


EUnderflow

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Float underflow error

Declaration

Source position: sysutilh.inc line 154

type EUnderflow = class(EMathError)

Inheritance

EUnderflow | Float underflow error
|
EMathError | Mathematical error
|
EExternal | External Exception.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EOverflow occurs when a float operation underflows (i.e. result is too small to represent).

See also

EIntError | Integer operation error.
EIntOverflow | Integer overflow error.
EDivByZero | Division by zero error.
ERangeError | Range check error.
EOverFlow | Float overflow error.


EUnderflow
EMathError
EExternal
Exception
 | HelpContext
 | Message
TObject


EUnderflow
EMathError
EExternal
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EUnderflow

EMathError

EExternal

Exception

TObject


EVariantError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Variant error.

Declaration

Source position: sysutilh.inc line 175

type EVariantError = class(Exception)
ErrCode: LongInt; | Variant error code.
constructor CreateCode(); | Create an instance of EVariantError with a particular error code.
end;

Inheritance

EVariantError | Variant error.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EVariantError is raised by the internal variant routines.


EVariantError
Exception
 | HelpContext
 | Message
TObject


EVariantError
 | CreateCode
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

BeforeDestruction (TObject)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Create (TObject)

Create (Exception)

CreateCode (EVariantError)

CreateFmt (Exception)

CreateFmtHelp (Exception)

CreateHelp (Exception)

CreateRes (Exception)

CreateResFmt (Exception)

CreateResFmtHelp (Exception)

CreateResHelp (Exception)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Dispatch (TObject)

DispatchStr (TObject)

Equals (TObject)

FieldAddress (TObject)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

SafeCallException (TObject)

StringMessageTable (TObject)

ToString (TObject)

ToString (Exception)

UnitName (TObject)


EVariantError

Exception

TObject


EVariantError.CreateCode

Create an instance of EVariantError with a particular error code.

Declaration

Source position: sysutilh.inc line 177

constructor EVariantError.CreateCode(

  Code: LongInt

);

Description

CreateCode calls the inherited constructor, and sets the ErrCode property to Code.

See also

ErrCode

Variant error code.


EVariantError.ErrCode

Variant error code.

Declaration

Source position: sysutilh.inc line 176

EVariantError.ErrCode : LongInt;

Description

ErrCode is the error code describing the actual error.


Exception

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Base class of all exceptions.

Declaration

Source position: sysutilh.inc line 107

type Exception = class(TObject)
public
constructor Create(); | Constructs a new exception object with a given message.
constructor CreateFmt(); | Constructs a new exception object and formats a new message.
constructor CreateRes(); | Constructs a new exception object and gets the message from a resource.
constructor CreateResFmt(); | Constructs a new exception object and formats the message from a reasource.
constructor CreateHelp(); | Constructs a new exception object and sets the help context.
constructor CreateFmtHelp(); | Constructs a new exception object and sets the help context and formats the message
constructor CreateResHelp(); | Constructs a new exception object and sets the help context and gets the message from a resource
constructor CreateResFmtHelp(); | Constructs a new exception object and sets the help context and formats the message from a resource
function ToString; override; | Nicely formatted version of the exception message
property HelpContext: LongInt; [rw] | Help context associated with the exception.
property Message: string; [rw] | Message associated with the exception.
end;

Inheritance

Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

Exception is the base class for all exception handling routines in the RTL and FCL. While it is possible to raise an exception with any class descending from TObject, it is recommended to use Exception as the basis of exception class objects: the Exception class introduces properties to associate a message and a help context with the exception being raised. What is more, the SysUtils unit sets the necessary hooks to catch and display unhandled exceptions: in such cases, the message displayed to the end user, will be the message stored in the exception class.

See also

ExceptObject | Current Exception object.
ExceptAddr | Current exception address.
ExceptionErrorMessage | Return a message describing the exception.
ShowException | Show the current exception to the user.
Abort | Abort program execution.


Exception
 | HelpContext
 | Message
TObject


Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


Exception

TObject


Exception.Create

Constructs a new exception object with a given message.

Declaration

Source position: sysutilh.inc line 112

public constructor Exception.Create(

  const msg: string

);

Errors

Construction may fail if there is not enough memory on the heap.

See also

Exception.CreateFmt | Constructs a new exception object and formats a new message.
Exception.Message | Message associated with the exception.


Exception.CreateFmt

Constructs a new exception object and formats a new message.

Declaration

Source position: sysutilh.inc line 113

public constructor Exception.CreateFmt(

  const msg: string;

  const args: array of Const

);

Errors

Construction may fail if there is not enough memory on the heap.

See also

Exception.Create | Constructs a new exception object with a given message.
Exception.Message | Message associated with the exception.
Format | Format a string with given arguments.


Exception.CreateFmtHelp

Constructs a new exception object and sets the help context and formats the message

Declaration

Source position: sysutilh.inc line 117

public constructor Exception.CreateFmtHelp(

  const Msg: string;

  const Args: array of Const;

  AHelpContext: LongInt

);

Description

CreateFmtHelp does the same as the CreateFmt constructor, but additionally stores AHelpContext in the HelpContext property.

See also

Exception.CreateFmt

Constructs a new exception object and formats a new message.


Exception.CreateHelp

Constructs a new exception object and sets the help context.

Declaration

Source position: sysutilh.inc line 116

public constructor Exception.CreateHelp(

  const Msg: string;

  AHelpContext: LongInt

);

Description

CreateHelp does the same as the Create constructor, but additionally stores AHelpContext in the HelpContext property.

See also

Exception.Create

Constructs a new exception object with a given message.


Exception.CreateRes

Constructs a new exception object and gets the message from a resource.

Declaration

Source position: sysutilh.inc line 114

public constructor Exception.CreateRes(

  ResString: PString

);

Errors

Construction may fail if there is not enough memory on the heap.

See also

Exception.Create | Constructs a new exception object with a given message.
Exception.CreateFmt | Constructs a new exception object and formats a new message.
Exception.CreateResFmt | Constructs a new exception object and formats the message from a reasource.
Exception.Message | Message associated with the exception.


Exception.CreateResFmt

Constructs a new exception object and formats the message from a reasource.

Declaration

Source position: sysutilh.inc line 115

public constructor Exception.CreateResFmt(

  ResString: PString;

  const Args: array of Const

);

Description

CreateResFmt does the same as CreateFmt, but fetches the message from the resource string ResString.

Errors

Construction may fail if there is not enough memory on the heap.

See also

Exception.Create | Constructs a new exception object with a given message.
Exception.CreateFmt | Constructs a new exception object and formats a new message.
Exception.CreateRes | Constructs a new exception object and gets the message from a resource.
Exception.Message | Message associated with the exception.


Exception.CreateResFmtHelp

Constructs a new exception object and sets the help context and formats the message from a resource

Declaration

Source position: sysutilh.inc line 120

public constructor Exception.CreateResFmtHelp(

  ResString: PString;

  const Args: array of Const;

  AHelpContext: LongInt

);

Description

CreateResFmtHelp does the same as the CreateResFmt constructor, but additionally stores AHelpContext in the HelpContext property.

See also

Exception.CreateResFmt

Constructs a new exception object and formats the message from a reasource.


Exception.CreateResHelp

Constructs a new exception object and sets the help context and gets the message from a resource

Declaration

Source position: sysutilh.inc line 119

public constructor Exception.CreateResHelp(

  ResString: PString;

  AHelpContext: LongInt

);

Description

CreateResHelp does the same as the CreateRes constructor, but additionally stores AHelpContext in the HelpContext property.

See also

Exception.CreateRes

Constructs a new exception object and gets the message from a resource.


Exception.HelpContext

Help context associated with the exception.

Declaration

Source position: sysutilh.inc line 124

public property Exception.HelpContext : LongInt
  read fhelpcontext
  write fhelpcontext;

Description

HelpContext is the help context associated with the exception, and can be used to provide context-sensitive help when the exception error message is displayed. It should be set in the exception constructor.

See also

Exception.CreateHelp | Constructs a new exception object and sets the help context.
Exception.Message | Message associated with the exception.


Exception.Message

Message associated with the exception.

Declaration

Source position: sysutilh.inc line 125

public property Exception.Message : string
  read fmessage
  write fmessage;

Description

Message provides additional information about the exception. It is shown to the user in e.g. the ShowException routine, and should be set in the constructor when the exception is raised.

See also

Exception.Create | Constructs a new exception object with a given message.
Exception.HelpContext | Help context associated with the exception.


Exception.ToString

Nicely formatted version of the exception message

Declaration

Source position: sysutilh.inc line 122

public function Exception.ToString: string; override;

Description

ToString overrides the ToString method to return a concatenation of classname and Exception.Message.

See also

Exception.Message

Message associated with the exception.


EZeroDivide

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Division by zero error.

Declaration

Source position: sysutilh.inc line 152

type EZeroDivide = class(EMathError)

Inheritance

EZeroDivide | Division by zero error.
|
EMathError | Mathematical error
|
EExternal | External Exception.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EZeroDivide occurs when a float division by zero occurs.

See also

EIntError | Integer operation error.
EIntOverflow | Integer overflow error.
EDivByZero | Division by zero error.
ERangeError | Range check error.


EZeroDivide
EMathError
EExternal
Exception
 | HelpContext
 | Message
TObject


EZeroDivide
EMathError
EExternal
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EZeroDivide

EMathError

EExternal

Exception

TObject


IReadWriteSync

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Read/Write synchronizer

Declaration

Source position: systhrdh.inc line 16

type IReadWriteSync = interface
procedure BeginRead; | Start a read operation.
procedure EndRead; | End a read operation
function BeginWrite; | Start a write operation.
procedure EndWrite; | End a write operation.
end;

Inheritance

IReadWriteSync

Read/Write synchronizer

Description

IReadWriteSync is an interface for synchronizing read/write operations. Writers are always guaranteed to have exclusive access: readers may or may not have simultaneous access, depending on the implementation.


IReadWriteSync


IReadWriteSync
 | BeginRead
 | EndRead
 | BeginWrite
 | EndWrite


BeginRead (IReadWriteSync)

BeginWrite (IReadWriteSync)

EndRead (IReadWriteSync)

EndWrite (IReadWriteSync)


IReadWriteSync.BeginRead

Start a read operation.

Declaration

Source position: systhrdh.inc line 19

procedure IReadWriteSync.BeginRead;

Description

BeginRead indicates that a read operation is about to be started. If a write operation is in progress, then the call will block untill the write operation finished. Depending on the implementation the call may also block if another read operation is in progress.

After BeginRead, any write operation started with BeginWrite will block until EndRead is called.

See also

IReadWriteSync.EndRead | End a read operation
IReadWriteSync.BeginWrite | Start a write operation.
IReadWriteSync.EndWrite | End a write operation.


IReadWriteSync.BeginWrite

Start a write operation.

Declaration

Source position: systhrdh.inc line 21

function IReadWriteSync.BeginWrite: Boolean;

Description

BeginWrite signals the begin of a write operation. This call will block if any other read or write operation is currently in progress. It will resumt only after all other read or write operations have finished.

See also

IReadWriteSync.EndRead | End a read operation
IReadWriteSync.EndWrite | End a write operation.
IReadWriteSync.BeginRead | Start a read operation.


IReadWriteSync.EndRead

End a read operation

Declaration

Source position: systhrdh.inc line 20

procedure IReadWriteSync.EndRead;

Description

EndRead signals the end of a read operation. If there was any blocked write operation, that will be unblocked by a call to EndRead.

See also

IReadWriteSync.BeginRead | Start a read operation.
IReadWriteSync.BeginWrite | Start a write operation.
IReadWriteSync.EndWrite | End a write operation.


IReadWriteSync.EndWrite

End a write operation.

Declaration

Source position: systhrdh.inc line 22

procedure IReadWriteSync.EndWrite;

Description

EndWrite signals the end of a write operation. After the call to EndWrite any other read or write operations can start.

See also

IReadWriteSync.EndRead | End a read operation
IReadWriteSync.EndWrite | End a write operation.
IReadWriteSync.BeginRead | Start a read operation.


TBigEndianUnicodeEncoding

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Big-endian UTF-16 unicode encoding

Declaration

Source position: sysencodingh.inc line 165

type TBigEndianUnicodeEncoding = class(TUnicodeEncoding)
public
function Clone; override; | Clone a TBigEndianUnicodeEncoding instance
function GetPreamble; override; | Return BOM marker bytes
end;

Inheritance

TBigEndianUnicodeEncoding | Big-endian UTF-16 unicode encoding
|
TUnicodeEncoding | UTF-16 unicode encoding
|
TEncoding | Encoding support
|
TObject

Description

TBigEndianUnicodeEncoding is the encoding class used to represent the UTF-16 big-endian encoding.

See also

TBigEndianUnicodeEncoding | Big-endian UTF-16 unicode encoding
TUTF7Encoding | UTF-7 unicode encoding
TMBCSEncoding | Multi-Byte character set encoding
TBigendianUnicodeEncoding | Big-endian UTF-16 unicode encoding


TBigEndianUnicodeEncoding
TUnicodeEncoding
TEncoding
 | ro | CodePage
 | ro | EncodingName
 | ro | IsSingleByte
 | ro | ANSI
 | ro | ASCII
 | ro | BigEndianUnicode
 | ro | Default
 | ro | Unicode
 | ro | UTF7
 | ro | UTF8


ro | ANSI (TEncoding)
ro | ASCII (TEncoding)
ro | BigEndianUnicode (TEncoding)
ro | CodePage (TEncoding)
ro | Default (TEncoding)
ro | EncodingName (TEncoding)
ro | IsSingleByte (TEncoding)
ro | Unicode (TEncoding)
ro | UTF7 (TEncoding)
ro |


TBigEndianUnicodeEncoding
 | Clone
 | GetPreamble
TUnicodeEncoding
 | Create
 | Clone
 | GetMaxByteCount
 | GetMaxCharCount
 | GetPreamble
TEncoding
 | FreeEncodings
 | Clone
 | Convert
 | IsStandardEncoding
 | GetBufferEncoding
 | GetEncoding
 | GetMaxByteCount
 | GetMaxCharCount
 | GetPreamble
 | GetString


Clone (TEncoding)

Clone (TUnicodeEncoding)

Clone (TBigEndianUnicodeEncoding)

Convert (TEncoding)

Create (TUnicodeEncoding)

FreeEncodings (TEncoding)

GetBufferEncoding (TEncoding)

GetEncoding (TEncoding)

GetMaxByteCount (TEncoding)

GetMaxByteCount (TUnicodeEncoding)

GetMaxCharCount (TEncoding)

GetMaxCharCount (TUnicodeEncoding)

GetPreamble (TEncoding)

GetPreamble (TUnicodeEncoding)

GetPreamble (TBigEndianUnicodeEncoding)

GetString (TEncoding)

IsStandardEncoding (TEncoding)


TBigEndianUnicodeEncoding

TUnicodeEncoding

TEncoding


TBooleanHelper

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Helper for the Boolean type.

Declaration

Source position: syshelph.inc line 576

type TBooleanHelper = type helper
public
class function Parse(); | Convert string value to boolean value.
class function Size; | Return the size (in bytes) of the
class function ToString(); | Convert a boolean value to string.
class function TryToParse(); | Try to convert a string to a boolean value
function ToInteger; | Convert to an integer value
end;

Inheritance

TBooleanHelper

Helper for the Boolean type.

Description

TBooleanHelper is a helper type for the Boolean type. It contains mostly conversion routines to and from other types.

See also

TStringHelper | Helper type for strings.
TShortIntHelper | Helper for a ShortInt-typed ordinal value
TSmallIntHelper | Helper for a SmallInt-typed ordinal value
TWordHelper | Helper for a Word-typed ordinal value
TCardinalHelper | Helper for a Cardinal-typed ordinal value
TIntegerHelper | Helper for a Integer-typed ordinal value
TInt64Helper | Helper for a Int64-typed ordinal value
TQWordHelper | Helper for a QWord-typed ordinal value
TNativeIntHelper | Helper for a NativeInt-typed ordinal value
TByteHelper | Helper for a byte-typed ordinal value
TByteBoolHelper | Helper for the ByteBool type.
TWordBoolHelper | Helper for the WordBool type.
TLongBoolHelper | Helper for the LongBool type.


TBooleanHelper


TBooleanHelper
 | Parse
 | Size
 | ToString
 | TryToParse
 | ToInteger


Parse (TBooleanHelper)

Size (TBooleanHelper)

ToInteger (TBooleanHelper)

ToString (TBooleanHelper)

TryToParse (TBooleanHelper)


TBooleanHelper.Parse

Convert string value to boolean value.

Declaration

Source position: syshelph.inc line 578

public class function TBooleanHelper.Parse(

  const S: string

):Boolean;

Description

Parse attempts to convert the string S to a boolean value. It uses the StrToBool function to perform the conversion.

Errors

If S does not contain a valid string representation, then an EConvertError exception is raised.

See also

TBooleanHelper.TryToParse | Try to convert a string to a boolean value
TBooleanHelper.ToString | Convert a boolean value to string.
TBooleanHelper.ToInteger | Convert to an integer value


TBooleanHelper.Size

Return the size (in bytes) of the

Declaration

Source position: syshelph.inc line 579

public class function TBooleanHelper.Size: Integer;

Description

Size returns the size (in bytes) of the boolean value. This is equivalent to SizeOf(Boolean).

See also

SizeOf

Return size of a variable or type.


TBooleanHelper.ToInteger

Convert to an integer value

Declaration

Source position: syshelph.inc line 583

public function TBooleanHelper.ToInteger: Integer;

Description

ToInteger will return the boolean value, typecasted to Integer.

See also

TBooleanHelper.ToString

Convert a boolean value to string.


TBooleanHelper.ToString

Convert a boolean value to string.

Declaration

Source position: syshelph.inc line 580

public class function TBooleanHelper.ToString(

  const AValue: Boolean;

  UseBoolStrs: TUseBoolStrs = TUseBoolStrs.False

):string; overload;

function TBooleanHelper.ToString(

  UseBoolStrs: TUseBoolStrs = TUseBoolStrs.False

):string; overload;

Description

ToString will, in the class method version, convert the AValue boolean to a string representation. In the function method version the boolean value itself (Self) will be converted.

If the UseBoolStrs parameter equals TUseBoolStrs.True, then the string representation will use the boolean strings BoolStrs. The default value for UseBoolStrs is TUseBoolStrs.False.

The conversion is done using the BoolTostr function.

See also

BoolStrs

BoolToStr

Convert a boolean value to a string.


TBooleanHelper.TryToParse

Try to convert a string to a boolean value

Declaration

Source position: syshelph.inc line 581

public class function TBooleanHelper.TryToParse(

  const S: string;

  out AValue: Boolean

):Boolean;

Description

TryToParse will attempt to convert the string S to a boolean value. If the attempt is succesful, True is returned, and the actual value is returned in AValue. If the attempt failed, False is returned.

See also

TBooleanHelper.Parse | Convert string value to boolean value.
TBooleanHelper.ToString | Convert a boolean value to string.


TByteBoolHelper

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Helper for the ByteBool type.

Declaration

Source position: syshelph.inc line 587

type TByteBoolHelper = type helper
public
class function Parse(); | Convert string value to ByteBool value.
class function Size; | Return the size (in bytes) of the
class function ToString(); | Convert a ByteBool value to string.
class function TryToParse(); | Try to convert a string to a ByteBool value
function ToInteger; | Convert to an integer value
end;

Inheritance

TByteBoolHelper

Helper for the ByteBool type.

Description

TByteBoolHelper is a helper type for the ByteBool type. It contains mostly conversion routines to and from other types.

See also

TStringHelper | Helper type for strings.
TShortIntHelper | Helper for a ShortInt-typed ordinal value
TSmallIntHelper | Helper for a SmallInt-typed ordinal value
TWordHelper | Helper for a Word-typed ordinal value
TCardinalHelper | Helper for a Cardinal-typed ordinal value
TIntegerHelper | Helper for a Integer-typed ordinal value
TInt64Helper | Helper for a Int64-typed ordinal value
TQWordHelper | Helper for a QWord-typed ordinal value
TNativeIntHelper | Helper for a NativeInt-typed ordinal value
TByteHelper | Helper for a byte-typed ordinal value
TByteBoolHelper | Helper for the ByteBool type.
TWordBoolHelper | Helper for the WordBool type.
TLongBoolHelper | Helper for the LongBool type.


TByteBoolHelper


TByteBoolHelper
 | Parse
 | Size
 | ToString
 | TryToParse
 | ToInteger


Parse (TByteBoolHelper)

Size (TByteBoolHelper)

ToInteger (TByteBoolHelper)

ToString (TByteBoolHelper)

TryToParse (TByteBoolHelper)


TByteBoolHelper.Parse

Convert string value to ByteBool value.

Declaration

Source position: syshelph.inc line 589

public class function TByteBoolHelper.Parse(

  const S: string

):Boolean;

Description

Parse attempts to convert the string S to a ByteBool value. It uses the StrToBool function to perform the conversion.

Errors

If S does not contain a valid string representation, then an EConvertError exception is raised.

See also

TByteBoolHelper.TryToParse | Try to convert a string to a ByteBool value
TByteBoolHelper.ToString | Convert a ByteBool value to string.
TByteBoolHelper.ToInteger | Convert to an integer value


TByteBoolHelper.Size

Return the size (in bytes) of the

Declaration

Source position: syshelph.inc line 590

public class function TByteBoolHelper.Size: Integer;

Description

Size returns the size (in bytes) of the ByteBool value. This is equivalent to SizeOf(ByteBool).

See also

SizeOf

Return size of a variable or type.


TByteBoolHelper.ToInteger

Convert to an integer value

Declaration

Source position: syshelph.inc line 594

public function TByteBoolHelper.ToInteger: Integer;

Description

ToInteger will return the ByteBool value, typecasted to Integer.

See also

TByteBoolHelper.ToString

Convert a ByteBool value to string.


TByteBoolHelper.ToString

Convert a ByteBool value to string.

Declaration

Source position: syshelph.inc line 591

public class function TByteBoolHelper.ToString(

  const AValue: Boolean;

  UseBoolStrs: TUseBoolStrs = TUseBoolStrs.False

):string; overload;

function TByteBoolHelper.ToString(

  UseBoolStrs: TUseBoolStrs = TUseBoolStrs.False

):string; overload;

Description

ToString will, in the class method version, convert the AValue ByteBool to a string representation. In the function method version the ByteBool value itself (Self) will be converted.

If the UseBoolStrs parameter equals TUseBoolStrs.True, then the string representation will use the ByteBool strings BoolStrs. The default value for UseBoolStrs is TUseBoolStrs.False.

The conversion is done using the BoolTostr function.

See also

BoolStrs

BoolToStr

Convert a boolean value to a string.


TByteBoolHelper.TryToParse

Try to convert a string to a ByteBool value

Declaration

Source position: syshelph.inc line 592

public class function TByteBoolHelper.TryToParse(

  const S: string;

  out AValue: Boolean

):Boolean;

Description

TryToParse will attempt to convert the string S to a ByteBool value. If the attempt is succesful, True is returned, and the actual value is returned in AValue. If the attempt failed, False is returned.

See also

TByteBoolHelper.Parse | Convert string value to ByteBool value.
TByteBoolHelper.ToString | Convert a ByteBool value to string.


TByteHelper

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Helper for a byte-typed ordinal value

Declaration

Source position: syshelph.inc line 363

type TByteHelper = type helper
public
Const
MaxValue = 255 | Maximum value for a byte
MinValue = 0 | Minimum value for a byte
class function Parse(); | Convert from a string
class function Size; | Size, in bytes, of the byte value
class function ToString(); | Convert the value to string
class function TryParse(); | Try to convert a string to a byte, report success or failure
function ToBoolean; | Convert to a boolean value
function ToDouble; | Convert to a double-sized floating point value
function ToExtended; | Convert to an extended-sized floating point value
function ToHexString(); | Convert to a hexadecimal string representation
function ToSingle; | Convert to an single-sized floating point value
end;

Inheritance

TByteHelper

Helper for a byte-typed ordinal value

Description

TByteHelper contains some auxiliary routines for a byte-typed ordinal value. It consists mainly of conversion routines to and from other types.

See also

TStringHelper | Helper type for strings.
TShortIntHelper | Helper for a ShortInt-typed ordinal value
TSmallIntHelper | Helper for a SmallInt-typed ordinal value
TWordHelper | Helper for a Word-typed ordinal value
TCardinalHelper | Helper for a Cardinal-typed ordinal value
TIntegerHelper | Helper for a Integer-typed ordinal value
TInt64Helper | Helper for a Int64-typed ordinal value
TQWordHelper | Helper for a QWord-typed ordinal value
TNativeIntHelper | Helper for a NativeInt-typed ordinal value
TNativeUIntHelper | Helper for a NativeUInt-typed ordinal value


TByteHelper


TByteHelper
 | Parse
 | Size
 | ToString
 | TryParse
 | ToBoolean
 | ToDouble
 | ToExtended
 | ToHexString
 | ToSingle


Parse (TByteHelper)

Size (TByteHelper)

ToBoolean (TByteHelper)

ToDouble (TByteHelper)

ToExtended (TByteHelper)

ToHexString (TByteHelper)

ToSingle (TByteHelper)

ToString (TByteHelper)

TryParse (TByteHelper)


TByteHelper.MaxValue

Maximum value for a byte

Declaration

Source position: syshelph.inc line 366

public const TByteHelper.MaxValue = 255;

Description

MaxValue is the biggest value a byte-typed value can contain.

See also

TByteHelper.MinValue

Minimum value for a byte


TByteHelper.MinValue

Minimum value for a byte

Declaration

Source position: syshelph.inc line 367

public const TByteHelper.MinValue = 0;

Description

MinValue is the smallest value a byte-typed value can contain.

See also

TByteHelper.MaxValue

Maximum value for a byte


TByteHelper.Parse

Convert from a string

Declaration

Source position: syshelph.inc line 369

public class function TByteHelper.Parse(

  const AString: string

):Byte;

Description

Parse will attempt to convert the string AString to a byte value. It uses the StrToInt function to perform the conversion, so no localization is taken into account.

Errors

If the string does not contain a valid byte value, an EConvertError exception is raised.

See also

TByteHelper.ToString | Convert the value to string
TByteHelper.TryParse | Try to convert a string to a byte, report success or failure
StrToInt | Convert a string to an integer value.


TByteHelper.Size

Size, in bytes, of the byte value

Declaration

Source position: syshelph.inc line 370

public class function TByteHelper.Size: Integer;

Description

Size returns the size (in bytes) of the byte value. This is equivalent to SizeOf(Byte).

Errors

None.

See also

SizeOf

Return size of a variable or type.


TByteHelper.ToBoolean

Convert to a boolean value

Declaration

Source position: syshelph.inc line 374

public function TByteHelper.ToBoolean: Boolean;

Description

ToBoolean converts the byte value to a boolean: it returns True if the value is nonzero, False if it is zero.

See also

TByteHelper.ToSingle | Convert to an single-sized floating point value
TByteHelper.ToDouble | Convert to a double-sized floating point value
TByteHelper.ToExtended | Convert to an extended-sized floating point value
TByteHelper.ToString | Convert the value to string
TByteHelper.ToHexString | Convert to a hexadecimal string representation


TByteHelper.ToDouble

Convert to a double-sized floating point value

Declaration

Source position: syshelph.inc line 375

public function TByteHelper.ToDouble: Double;

Description

ToDouble converts the byte value to a double-sized floating point value.

See also

TByteHelper.ToBoolean | Convert to a boolean value
TByteHelper.ToExtended | Convert to an extended-sized floating point value
TByteHelper.ToSingle | Convert to an single-sized floating point value
TByteHelper.ToString | Convert the value to string
TByteHelper.ToHexString | Convert to a hexadecimal string representation


TByteHelper.ToExtended

Convert to an extended-sized floating point value

Declaration

Source position: syshelph.inc line 376

public function TByteHelper.ToExtended: Extended;

Description

ToDouble converts the byte value to an extended-sized floating point value

See also

TByteHelper.ToBoolean | Convert to a boolean value
TByteHelper.ToSingle | Convert to an single-sized floating point value
TByteHelper.ToDouble | Convert to a double-sized floating point value
TByteHelper.ToString | Convert the value to string
TByteHelper.ToHexString | Convert to a hexadecimal string representation


TByteHelper.ToHexString

Convert to a hexadecimal string representation

Declaration

Source position: syshelph.inc line 377

public function TByteHelper.ToHexString(

  const AMinDigits: Integer

):string; overload;

function TByteHelper.ToHexString: string; overload;

Description

ToHexString converts the byte value to a hexadecimal string representation. The AMinDigits argument specifies the minimal number of characters in the resulting string. The string will be left-padded with zeroes if the representation contains less than AMinDigits characters.

See also

TByteHelper.ToBoolean | Convert to a boolean value
TByteHelper.ToSingle | Convert to an single-sized floating point value
TByteHelper.ToDouble | Convert to a double-sized floating point value
TByteHelper.ToString | Convert the value to string
TByteHelper.ToExtended | Convert to an extended-sized floating point value


TByteHelper.ToSingle

Convert to an single-sized floating point value

Declaration

Source position: syshelph.inc line 379

public function TByteHelper.ToSingle: Single;

Description

ToSingle converts the byte value to a single-sized floating point value.

See also

TByteHelper.ToBoolean | Convert to a boolean value
TByteHelper.ToDouble | Convert to a double-sized floating point value
TByteHelper.ToExtended | Convert to an extended-sized floating point value
TByteHelper.ToString | Convert the value to string
TByteHelper.ToHexString | Convert to a hexadecimal string representation


TByteHelper.ToString

Convert the value to string

Declaration

Source position: syshelph.inc line 371

public class function TByteHelper.ToString(

  const AValue: Byte

):string; overload;

function TByteHelper.ToString: string; overload;

Description

ToString will, in the class function variant of this method, convert AValue to a string representation. In the regular method overloaded version of ToString, the byte value itself is used. The IntToStr function is used to do the conversion.

See also

TByteHelper.Parse | Convert from a string
IntToStr | Convert an integer value to a decimal string.


TByteHelper.TryParse

Try to convert a string to a byte, report success or failure

Declaration

Source position: syshelph.inc line 372

public class function TByteHelper.TryParse(

  const AString: string;

  out AValue: Byte

):Boolean;

Description

TryParse attempts to convert the string AString to a byte, and reports the success of the attempt. If the attempt is succesful, then True is returned, and the actual value of the byte is returned in AValue.

It uses the val function to perform the conversion, so no localization is taken into account.

See also

TByteHelper.Parse | Convert from a string
Val | Calculate numerical/enumerated value of a string.


TCardinalHelper

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Helper for a Cardinal-typed ordinal value

Declaration

Source position: syshelph.inc line 443

type TCardinalHelper = type helper
public
Const
MaxValue = 4294967295 | Maximum value for a Cardinal
MinValue = 0 | Minimum value for a Cardinal
class function Parse(); | Convert from a string
class function Size; | Size, in bytes, of the Cardinal value
class function ToString(); | Convert the value to string
class function TryParse(); | Try to convert a string to a Cardinal, report success or failure
function ToBoolean; | Convert to a boolean value
function ToDouble; | Convert to a double-sized floating point value
function ToExtended; | Convert to an extended-sized floating point value
function ToHexString(); | Convert to a hexadecimal string representation
function ToSingle; | Convert to an single-sized floating point value
end;

Inheritance

TCardinalHelper

Helper for a Cardinal-typed ordinal value

Description

TCardinalHelper contains some auxiliary routines for a Cardinal-typed ordinal value. It consists mainly of conversion routines to and from other types.

See also

TStringHelper | Helper type for strings.
TShortIntHelper | Helper for a ShortInt-typed ordinal value
TSmallIntHelper | Helper for a SmallInt-typed ordinal value
TWordHelper | Helper for a Word-typed ordinal value
TByteHelper | Helper for a byte-typed ordinal value
TIntegerHelper | Helper for a Integer-typed ordinal value
TInt64Helper | Helper for a Int64-typed ordinal value
TQWordHelper | Helper for a QWord-typed ordinal value
TNativeIntHelper | Helper for a NativeInt-typed ordinal value
TNativeUIntHelper | Helper for a NativeUInt-typed ordinal value


TCardinalHelper


TCardinalHelper
 | Parse
 | Size
 | ToString
 | TryParse
 | ToBoolean
 | ToDouble
 | ToExtended
 | ToHexString
 | ToSingle


Parse (TCardinalHelper)

Size (TCardinalHelper)

ToBoolean (TCardinalHelper)

ToDouble (TCardinalHelper)

ToExtended (TCardinalHelper)

ToHexString (TCardinalHelper)

ToSingle (TCardinalHelper)

ToString (TCardinalHelper)

TryParse (TCardinalHelper)


TCardinalHelper.MaxValue

Maximum value for a Cardinal

Declaration

Source position: syshelph.inc line 446

public const TCardinalHelper.MaxValue = 4294967295;

Description

MaxValue is the biggest value a Cardinal-typed value can contain.

See also

TCardinalHelper.MinValue

Minimum value for a Cardinal


TCardinalHelper.MinValue

Minimum value for a Cardinal

Declaration

Source position: syshelph.inc line 447

public const TCardinalHelper.MinValue = 0;

Description

MinValue is the smallest value a Cardinal-typed value can contain.

See also

TCardinalHelper.MaxValue

Maximum value for a Cardinal


TCardinalHelper.Parse

Convert from a string

Declaration

Source position: syshelph.inc line 449

public class function TCardinalHelper.Parse(

  const AString: string

):Cardinal;

Description

Parse will attempt to convert the string AString to a Cardinal value. It uses the StrToInt function to perform the conversion, so no localization is taken into account.

Errors

If the string does not contain a valid Cardinal value, an EConvertError exception is raised.

See also

TCardinalHelper.ToString | Convert the value to string
TCardinalHelper.TryParse | Try to convert a string to a Cardinal, report success or failure
StrToInt | Convert a string to an integer value.


TCardinalHelper.Size

Size, in bytes, of the Cardinal value

Declaration

Source position: syshelph.inc line 450

public class function TCardinalHelper.Size: Integer;

Description

Size returns the size (in Cardinals) of the Cardinal value. This is equivalent to SizeOf(Cardinal).

Errors

None.

See also

SizeOf

Return size of a variable or type.


TCardinalHelper.ToBoolean

Convert to a boolean value

Declaration

Source position: syshelph.inc line 454

public function TCardinalHelper.ToBoolean: Boolean;

Description

ToBoolean converts the Cardinal value to a boolean: it returns True if the value is nonzero, False if it is zero.

See also

TCardinalHelper.ToSingle | Convert to an single-sized floating point value
TCardinalHelper.ToDouble | Convert to a double-sized floating point value
TCardinalHelper.ToExtended | Convert to an extended-sized floating point value
TCardinalHelper.ToString | Convert the value to string
TCardinalHelper.ToHexString | Convert to a hexadecimal string representation


TCardinalHelper.ToDouble

Convert to a double-sized floating point value

Declaration

Source position: syshelph.inc line 455

public function TCardinalHelper.ToDouble: Double;

Description

ToDouble converts the Cardinal value to a double-sized floating point value.

See also

TCardinalHelper.ToBoolean | Convert to a boolean value
TCardinalHelper.ToExtended | Convert to an extended-sized floating point value
TCardinalHelper.ToSingle | Convert to an single-sized floating point value
TCardinalHelper.ToString | Convert the value to string
TCardinalHelper.ToHexString | Convert to a hexadecimal string representation


TCardinalHelper.ToExtended

Convert to an extended-sized floating point value

Declaration

Source position: syshelph.inc line 456

public function TCardinalHelper.ToExtended: Extended;

Description

ToDouble converts the Cardinal value to an extended-sized floating point value.

See also

TCardinalHelper.ToBoolean | Convert to a boolean value
TCardinalHelper.ToSingle | Convert to an single-sized floating point value
TCardinalHelper.ToDouble | Convert to a double-sized floating point value
TCardinalHelper.ToString | Convert the value to string
TCardinalHelper.ToHexString | Convert to a hexadecimal string representation


TCardinalHelper.ToHexString

Convert to a hexadecimal string representation

Declaration

Source position: syshelph.inc line 457

public function TCardinalHelper.ToHexString(

  const AMinDigits: Integer

):string; overload;

function TCardinalHelper.ToHexString: string; overload;

Description

ToHexString converts the Cardinal value to a hexadecimal string representation. The AMinDigits argument specifies the minimal number of characters in the resulting string. The string will be left-padded with zeroes if the representation contains less than AMinDigits characters.

See also

TCardinalHelper.ToBoolean | Convert to a boolean value
TCardinalHelper.ToSingle | Convert to an single-sized floating point value
TCardinalHelper.ToDouble | Convert to a double-sized floating point value
TCardinalHelper.ToString | Convert the value to string
TCardinalHelper.ToExtended | Convert to an extended-sized floating point value


TCardinalHelper.ToSingle

Convert to an single-sized floating point value

Declaration

Source position: syshelph.inc line 459

public function TCardinalHelper.ToSingle: Single;

Description

ToSingle converts the Cardinal value to a single-sized floating point value.

See also

TCardinalHelper.ToBoolean | Convert to a boolean value
TCardinalHelper.ToDouble | Convert to a double-sized floating point value
TCardinalHelper.ToExtended | Convert to an extended-sized floating point value
TCardinalHelper.ToString | Convert the value to string
TCardinalHelper.ToHexString | Convert to a hexadecimal string representation


TCardinalHelper.ToString

Convert the value to string

Declaration

Source position: syshelph.inc line 451

public class function TCardinalHelper.ToString(

  const AValue: Cardinal

):string; overload;

function TCardinalHelper.ToString: string; overload;

Description

ToString will, in the class function variant of this method, convert AValue to a string representation. In the regular method overloaded version of ToString, the Cardinal value itself is used. The IntToStr function is used to do the conversion.

See also

TCardinalHelper.Parse | Convert from a string
IntToStr | Convert an integer value to a decimal string.


TCardinalHelper.TryParse

Try to convert a string to a Cardinal, report success or failure

Declaration

Source position: syshelph.inc line 452

public class function TCardinalHelper.TryParse(

  const AString: string;

  out AValue: Cardinal

):Boolean;

Description

TryParse attempts to convert the string AString to a Cardinal, and reports the success of the attempt. If the attempt is succesful, then True is returned, and the actual value of the Cardinal is returned in AValue.

It uses the val function to perform the conversion, so no localization is taken into account.

See also

TCardinalHelper.Parse | Convert from a string
Val | Calculate numerical/enumerated value of a string.


TDoubleHelper

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Helper for Double floating point type

Declaration

Source position: syshelph.inc line 242

type TDoubleHelper = type helper
public
Const
Epsilon = Epsilon; = 4.9406564584124654418e-324 | Precision for this floating point type
MaxValue = MaxValue; = 1.7976931348623157081e+308 | Largest possible value for the Double floating point type
MinValue = MinValue; = - 1.7976931348623157081e+308 | Smallest (negative) possible value for the Double floating point type
PositiveInfinity = PositiveInfinity; = 1.0 / 0.0 | Positive infinity as represented by a Double floating point type
NegativeInfinity = NegativeInfinity; = (- 1.0) / (0.0) | Negative infinity as represented by a Double floating point type
NaN = NaN; = 0.0 / 0.0 | Representation of NaN (Not a Number)
class function IsInfinity(); | Check whether a value is positive or negative infinity.
class function IsNan(); | Check whether a value equals NaN.
class function IsNegativeInfinity(); | Check whether a value is negative infinity.
class function IsPositiveInfinity(); | Check whether a value is positive infinity.
class function Parse(); | Convert a string to a floating point value
class function Size; | Size (in bytes) of a Double-sized floating point value.
class function ToString(); | Convert a Double-sized floating point value to a string
class function TryParse(); | Try to convert a string to a Double-sized floating point value.
procedure BuildUp(); | Build a Double-sized floating point from its composing parts
function Exponent; | Exponent of the floating-point value
function Fraction; | Fraction of the floating-point value
function Mantissa; | Mantissa of the floating-point
function SpecialType; | Return the type of the Double-sized floating point value
property Bytes []: Byte; [rw] | Indexed access to the individual bytes of the floating point value
property Words []: Word; [rw] | Indexed access to the words that make up the floating point value
property Sign: Boolean; [rw] | Sign of the floating point value
property Exp: QWord; [rw] | The bit pattern of the exponent as stored in memory.
property Frac: QWord; [rw] | Bitpattern that makes up the fractional part.
end;

Inheritance

TDoubleHelper

Helper for Double floating point type

Description

TDoubleHelper is the helper type for the Double-sized floating point type. It contains some conversion methods, as well as access to the low-level structure of the floating-point representation of a Double.

See also

TDoubleHelper | Helper for Double floating point type
TExtendedHelper | Helper for Extended floating point type


TDoubleHelper
 | Bytes
 | Words
 | Sign
 | Exp
 | Frac


Bytes (TDoubleHelper)

Exp (TDoubleHelper)

Frac (TDoubleHelper)

Sign (TDoubleHelper)

Words (TDoubleHelper)


TDoubleHelper
 | IsInfinity
 | IsNan
 | IsNegativeInfinity
 | IsPositiveInfinity
 | Parse
 | Size
 | ToString
 | TryParse
 | BuildUp
 | Exponent
 | Fraction
 | Mantissa
 | SpecialType


BuildUp (TDoubleHelper)

Exponent (TDoubleHelper)

Fraction (TDoubleHelper)

IsInfinity (TDoubleHelper)

IsNan (TDoubleHelper)

IsNegativeInfinity (TDoubleHelper)

IsPositiveInfinity (TDoubleHelper)

Mantissa (TDoubleHelper)

Parse (TDoubleHelper)

Size (TDoubleHelper)

SpecialType (TDoubleHelper)

ToString (TDoubleHelper)

TryParse (TDoubleHelper)


TDoubleHelper


TDoubleHelper.BuildUp

Build a Double-sized floating point from its composing parts

Declaration

Source position: syshelph.inc line 280

public procedure TDoubleHelper.BuildUp(

  const ASignFlag: Boolean;

  const AMantissa: QWord;

  const AExponent: Integer

);

Description

BuildUp will compose a Double-sized floating point value from the sign ASignFlag, mantissa AMantissa and exponent AExponent. It simply sets the Sign, Exp and Frac properties in 1 call.

See also

TDoubleHelper.Sign | Sign of the floating point value
TDoubleHelper.Exp | The bit pattern of the exponent as stored in memory.
TDoubleHelper.Frac | Bitpattern that makes up the fractional part.


TDoubleHelper.Bytes

Indexed access to the individual bytes of the floating point value

Declaration

Source position: syshelph.inc line 294

public property TDoubleHelper.Bytes[AIndex: Cardinal] : Byte
  read GetB
  write SetB;

Description

Bytes can be used to get or set the various bytes that make up the Double-sized floating point value. The index runs from 0 to Size-1.

See also

TDoubleHelper.Words | Indexed access to the words that make up the floating point value
TDoubleHelper.Size | Size (in bytes) of a Double-sized floating point value.


TDoubleHelper.Epsilon

Precision for this floating point type

Declaration

Source position: syshelph.inc line 259

public const TDoubleHelper.Epsilon: Double = 4.9406564584124654418e-324;

Description

Epsilon returns the precision of the floating point value : differences smaller than this value cannot be detected or represented. It can also be viewed as the smallest positive value that can be represented.

See also

TDoubleHelper.MinValue | Smallest (negative) possible value for the Double floating point type
TDoubleHelper.MaxValue | Largest possible value for the Double floating point type


TDoubleHelper.Exp

The bit pattern of the exponent as stored in memory.

Declaration

Source position: syshelph.inc line 297

public property TDoubleHelper.Exp : QWord
  read GetE
  write SetE;

Description

Exp is the internal representation of the Exponent.

See also

TDoubleHelper.Bytes | Indexed access to the individual bytes of the floating point value
TDoubleHelper.Sign | Sign of the floating point value
TDoubleHelper.Frac | Bitpattern that makes up the fractional part.
TDoubleHelper.Mantissa | Mantissa of the floating-point
TDoubleHelper.Fraction | Fraction of the floating-point value
TDoubleHelper.Exponent | Exponent of the floating-point value


TDoubleHelper.Exponent

Exponent of the floating-point value

Declaration

Source position: syshelph.inc line 281

public function TDoubleHelper.Exponent: Integer;

Description

Exponent is the value X in the representation of the floating-point value in m*2^X, i.e. the exponent.

See also

TDoubleHelper.Sign | Sign of the floating point value
TDoubleHelper.Exp | The bit pattern of the exponent as stored in memory.
TDoubleHelper.Frac | Bitpattern that makes up the fractional part.
TDoubleHelper.Fraction | Fraction of the floating-point value
TDoubleHelper.Mantissa | Mantissa of the floating-point


TDoubleHelper.Frac

Bitpattern that makes up the fractional part.

Declaration

Source position: syshelph.inc line 298

public property TDoubleHelper.Frac : QWord
  read GetF
  write SetF;

Description

Frac is the bit pattern representing the fractional part (significand) including the preceding 1 (the hidden bit).

See also

TDoubleHelper.Bytes | Indexed access to the individual bytes of the floating point value
TDoubleHelper.Sign | Sign of the floating point value
TDoubleHelper.Exp | The bit pattern of the exponent as stored in memory.
TDoubleHelper.Mantissa | Mantissa of the floating-point
TDoubleHelper.Fraction | Fraction of the floating-point value
TDoubleHelper.Exponent | Exponent of the floating-point value


TDoubleHelper.Fraction

Fraction of the floating-point value

Declaration

Source position: syshelph.inc line 282

public function TDoubleHelper.Fraction: Extended;

Description

Fraction is the decimal part of the floating-point value.

See also

TDoubleHelper.Sign | Sign of the floating point value
TDoubleHelper.Exp | The bit pattern of the exponent as stored in memory.
TDoubleHelper.Exponent | Exponent of the floating-point value
TDoubleHelper.Frac | Bitpattern that makes up the fractional part.
TDoubleHelper.Mantissa | Mantissa of the floating-point


TDoubleHelper.IsInfinity

Check whether a value is positive or negative infinity.

Declaration

Source position: syshelph.inc line 266

public class function TDoubleHelper.IsInfinity(

  const AValue: Double

):Boolean; overload;

function TDoubleHelper.IsInfinity: Boolean; overload;

Description

IsInfinity checks whether a Double-sized floating point value represents a positive or negative infinity. If so, it returns True. When the class function version is used, the value can be specified using AValue. In the method version, the used value is (Self).

See also

TDoubleHelper.IsNan | Check whether a value equals NaN.
TDoubleHelper.IsPositiveInfinity | Check whether a value is positive infinity.
TDoubleHelper.IsNegativeInfinity | Check whether a value is negative infinity.


TDoubleHelper.IsNan

Check whether a value equals NaN.

Declaration

Source position: syshelph.inc line 267

public class function TDoubleHelper.IsNan(

  const AValue: Double

):Boolean; overload;

function TDoubleHelper.IsNan: Boolean; overload;

Description

IsNan checks whether a Double-sized floating point value is NaN (Not a Number). If so, it returns True. When the class function version is used, the value can be specified using AValue. In the method version, the used value is (Self).

See also

TDoubleHelper.IsInfinity | Check whether a value is positive or negative infinity.
TDoubleHelper.IsPositiveInfinity | Check whether a value is positive infinity.
TDoubleHelper.IsNegativeInfinity | Check whether a value is negative infinity.


TDoubleHelper.IsNegativeInfinity

Check whether a value is negative infinity.

Declaration

Source position: syshelph.inc line 268

public class function TDoubleHelper.IsNegativeInfinity(

  const AValue: Double

):Boolean; overload;

function TDoubleHelper.IsNegativeInfinity: Boolean; overload;

Description

IsNegativeInfinity checks whether a Double-sized floating point value represents a negative infinity. If so, it returns True. When the class function version is used, the value can be specified using AValue. In the method version, the used value is (Self).

See also

TDoubleHelper.IsNan | Check whether a value equals NaN.
TDoubleHelper.IsPositiveInfinity | Check whether a value is positive infinity.
TDoubleHelper.IsInfinity | Check whether a value is positive or negative infinity.


TDoubleHelper.IsPositiveInfinity

Check whether a value is positive infinity.

Declaration

Source position: syshelph.inc line 269

public class function TDoubleHelper.IsPositiveInfinity(

  const AValue: Double

):Boolean; overload;

function TDoubleHelper.IsPositiveInfinity: Boolean; overload;

Description

IsPositiveInfinity checks whether a Double-sized floating point value represents a positive infinity. If so, it returns True. When the class function version is used, the value can be specified using AValue. In the method version, the used value is (Self).

See also

TDoubleHelper.IsNan | Check whether a value equals NaN.
TDoubleHelper.IsNegativeInfinity | Check whether a value is negative infinity.
TDoubleHelper.IsInfinity | Check whether a value is positive or negative infinity.


TDoubleHelper.Mantissa

Mantissa of the floating-point

Declaration

Source position: syshelph.inc line 287

public function TDoubleHelper.Mantissa: QWord;

Description

Mantissa is the value of the significand without the hidden bit. This means it the plain bit pattern as it is stored in memory.

See also

TDoubleHelper.Sign | Sign of the floating point value
TDoubleHelper.Exp | The bit pattern of the exponent as stored in memory.
TDoubleHelper.Exponent | Exponent of the floating-point value
TDoubleHelper.Frac | Bitpattern that makes up the fractional part.
TDoubleHelper.Fraction | Fraction of the floating-point value


TDoubleHelper.MaxValue

Largest possible value for the Double floating point type

Declaration

Source position: syshelph.inc line 260

public const TDoubleHelper.MaxValue: Double = 1.7976931348623157081e+308;

Description

MaxValue is the largest possible value that can be represented by the Double floating point type. For bigger values, Double or Extended types must be used.

See also

TDoubleHelper.MinValue | Smallest (negative) possible value for the Double floating point type
TDoubleHelper.Epsilon | Precision for this floating point type


TDoubleHelper.MinValue

Smallest (negative) possible value for the Double floating point type

Declaration

Source position: syshelph.inc line 261

public const TDoubleHelper.MinValue: Double = - 1.7976931348623157081e+308;

Description

MaxValue is the largest possible value that can be represented by the Double floating point type. For bigger values, Double or Extended types must be used.

See also

TDoubleHelper.MaxValue | Largest possible value for the Double floating point type
TDoubleHelper.Epsilon | Precision for this floating point type
TDoubleHelper.PositiveInfinity | Positive infinity as represented by a Double floating point type
TDoubleHelper.NegativeInfinity | Negative infinity as represented by a Double floating point type
TDoubleHelper.NaN | Representation of NaN (Not a Number)


TDoubleHelper.NaN

Representation of NaN (Not a Number)

Declaration

Source position: syshelph.inc line 264

public const TDoubleHelper.NaN: Double = 0.0 / 0.0;

Description

NaN is the Representation of NaN (Not a Number) for a Double-sized floating point type.

See also

TDoubleHelper.MaxValue | Largest possible value for the Double floating point type
TDoubleHelper.MinValue | Smallest (negative) possible value for the Double floating point type
TDoubleHelper.Epsilon | Precision for this floating point type
TDoubleHelper.PositiveInfinity | Positive infinity as represented by a Double floating point type
TDoubleHelper.NegativeInfinity | Negative infinity as represented by a Double floating point type


TDoubleHelper.NegativeInfinity

Negative infinity as represented by a Double floating point type

Declaration

Source position: syshelph.inc line 263

public const TDoubleHelper.NegativeInfinity: Double = (- 1.0) / (0.0);

Description

NegativeInfinity is the value representing negative infinity in a Double-sized floating point value.

See also

TDoubleHelper.MaxValue | Largest possible value for the Double floating point type
TDoubleHelper.MinValue | Smallest (negative) possible value for the Double floating point type
TDoubleHelper.Epsilon | Precision for this floating point type
TDoubleHelper.PositiveInfinity | Positive infinity as represented by a Double floating point type
TDoubleHelper.NaN | Representation of NaN (Not a Number)


TDoubleHelper.Parse

Convert a string to a floating point value

Declaration

Source position: syshelph.inc line 270

public class function TDoubleHelper.Parse(

  const AString: string

):Double; overload;

class function TDoubleHelper.Parse(

  const AString: string;

  const AFormatSettings: TFormatSettings

):Double; overload;

Description

Parse will try to convert AString to a Double-sized floating point value. It will take into account internationalization settings. (it uses FloatToStr).

Errors

If the string AString is not a valid floating-point value, a EConvertError exception is raised.

See also

FloatToStr | Convert a float value to a string using a fixed format.
TDoubleHelper.ToString | Convert a Double-sized floating point value to a string
TDoubleHelper.TryParse | Try to convert a string to a Double-sized floating point value.


TDoubleHelper.PositiveInfinity

Positive infinity as represented by a Double floating point type

Declaration

Source position: syshelph.inc line 262

public const TDoubleHelper.PositiveInfinity: Double = 1.0 / 0.0;

Description

PositiveInfinity is the value representing positive infinity in a Double-sized floating point value.

See also

TDoubleHelper.MaxValue | Largest possible value for the Double floating point type
TDoubleHelper.MinValue | Smallest (negative) possible value for the Double floating point type
TDoubleHelper.Epsilon | Precision for this floating point type
TDoubleHelper.NegativeInfinity | Negative infinity as represented by a Double floating point type
TDoubleHelper.NaN | Representation of NaN (Not a Number)


TDoubleHelper.Sign

Sign of the floating point value

Declaration

Source position: syshelph.inc line 296

public property TDoubleHelper.Sign : Boolean
  read GetS
  write SetS;

Description

Sign returns True if the sign bit of the value is set (i.e. it is a negative value) or False if it is not set (i.e. it is a positive value).

See also

TDoubleHelper.Bytes | Indexed access to the individual bytes of the floating point value
TDoubleHelper.Exp | The bit pattern of the exponent as stored in memory.
TDoubleHelper.Frac | Bitpattern that makes up the fractional part.
TDoubleHelper.Mantissa | Mantissa of the floating-point
TDoubleHelper.Fraction | Fraction of the floating-point value
TDoubleHelper.Exponent | Exponent of the floating-point value


TDoubleHelper.Size

Size (in bytes) of a Double-sized floating point value.

Declaration

Source position: syshelph.inc line 272

public class function TDoubleHelper.Size: Integer;

Description

Size is the size (in bytes) of a Double-sized floating point value. It is equivalent to calling SizeOf(Double).

See also

SizeOf

Return size of a variable or type.


TDoubleHelper.SpecialType

Return the type of the Double-sized floating point value

Declaration

Source position: syshelph.inc line 288

public function TDoubleHelper.SpecialType: TFloatSpecial;

Description

SpecialType checks whether the Double-sized floating point value equals one of several special values, and returns an enumerated value describing which value this is. See TFloatSpecial for an explanation of the possible values.

See also

TFloatSpecial

Special floating point values


TDoubleHelper.ToString

Convert a Double-sized floating point value to a string

Declaration

Source position: syshelph.inc line 273

public class function TDoubleHelper.ToString(

  const AValue: Double

):string; overload;

class function TDoubleHelper.ToString(

  const AValue: Double;

  const AFormat: TFloatFormat;

  const APrecision: Integer;

  const ADigits: Integer

):string; overload;

class function TDoubleHelper.ToString(

  const AValue: Double;

  const AFormat: TFloatFormat;

  const APrecision: Integer;

  const ADigits: Integer;

  const AFormatSettings: TFormatSettings

):string; overload;

class function TDoubleHelper.ToString(

  const AValue: Double;

  const AFormatSettings: TFormatSettings

):string; overload;

function TDoubleHelper.ToString(

  const AFormat: TFloatFormat;

  const APrecision: Integer;

  const ADigits: Integer

):string; overload;

function TDoubleHelper.ToString(

  const AFormat: TFloatFormat;

  const APrecision: Integer;

  const ADigits: Integer;

  const AFormatSettings: TFormatSettings

):string; overload;

function TDoubleHelper.ToString(

  const AFormatSettings: TFormatSettings

):string; overload;

function TDoubleHelper.ToString: string; overload;

Description

ToString will convert AValue (or Self in the plain method version) to a string. Optionally FormatSettings can be specified, to be able to specify the decimal separator character to use.

Additionally, a precision APrecision and number of digits ADigits can be specified, in conjunction with a AFormat parameter to specify the form in which the floating-point value must be represented. (see TFloatFormat for an explanation of the various values). In this case, FloatToStrF is used to format the value. In the absence of these parameters, FloatToStr is called.

See also

FloatToStr | Convert a float value to a string using a fixed format.
FloatToStrF | Convert a float value to a string using a given format.
TFloatFormat | Formats for the FloatToText function.


TDoubleHelper.TryParse

Try to convert a string to a Double-sized floating point value.

Declaration

Source position: syshelph.inc line 277

public class function TDoubleHelper.TryParse(

  const AString: string;

  out AValue: Double

):Boolean; overload;

class function TDoubleHelper.TryParse(

  const AString: string;

  out AValue: Double;

  const AFormatSettings: TFormatSettings

):Boolean; overload;

Description

TryParse attempts to convert the string AString to a Double-sized floating point value and reports True if the conversion was succesful. In that case the parsed value is returned in AValue.

If the conversion failed, False is returned.

See also

TDoubleHelper.Parse | Convert a string to a floating point value
TDoubleHelper.ToString | Convert a Double-sized floating point value to a string


TDoubleHelper.Words

Indexed access to the words that make up the floating point value

Declaration

Source position: syshelph.inc line 295

public property TDoubleHelper.Words[AIndex: Cardinal] : Word
  read GetW
  write SetW;

Description

Words can be used to get or set the various bytes that make up the Double-sized floating point value. The index runs from 0 to (Size-1) div 2.

See also

TDoubleHelper.Bytes | Indexed access to the individual bytes of the floating point value
TDoubleHelper.Size | Size (in bytes) of a Double-sized floating point value.


TEncoding

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Encoding support

Declaration

Source position: sysencodingh.inc line 21

type TEncoding = class
public
class procedure FreeEncodings; | Free all standard encodings
function Clone; virtual; | Clone a TEncoding instance
class function Convert(); | Convert an array of bytes from one encoding to another
class function IsStandardEncoding(); | Check if the encoding is one of the standard encodings
class function GetBufferEncoding(); | Attempt to guess the encoding of a buffer
class function GetEncoding(); | Get an encoding instance for a given codepage.
function GetMaxByteCount(); virtual; abstract; | Returns the maximum number of bytes needed to represent a string
function GetMaxCharCount(); virtual; abstract; | Return the maximum number of characters that can be represented in a number of bytes
function GetPreamble; virtual; abstract; | Return the BOM Marker used by the encoding
function GetString(); | Return a string based on an array of bytes
property CodePage: Cardinal; [r] | Codepage for this encoding
property EncodingName: UnicodeString; [r] | Name of this encoding
property IsSingleByte: Boolean; [r] | Is the encoding a single-byte encoding or not ?
property ANSI: TEncoding; [r] | Ansi encoding instance
property ASCII: TEncoding; [r] | ASCII encoding instance
property BigEndianUnicode: TEncoding; [r] | Big-endian Unicode (UTF16BE) encoding instance
property Default: TEncoding; [r] | Default codepage
property Unicode: TEncoding; [r] | UTF16 encoding instance
property UTF7: TEncoding; [r] | UTF7 encoding instance
property UTF8: TEncoding; [r] | UTF8 encoding instance
end;

Inheritance

TEncoding

Encoding support
|

TObject

Description

TEncoding is a mostly abstract class that contains various methods to deal with different encodings in single- and double-byte strings. In practice, one instance of a descendent of this class for each needed encoding can be instantiated and used. The class contains several class methods and properties to create such instances, and has several often-used instances available as class properties, in particular the default encoding.

When using encodings (and in particular TEncoding.Default or TEncoding.ANSI), if the DefaultSystemCodePage changes, you should call TEncoding.FreeEncodings to regenerate the encodings.

See also

TEncoding.ANSI | Ansi encoding instance
TEncoding.ASCII | ASCII encoding instance
TEncoding.Default | Default codepage
TEncoding.BigEndianUnicode | Big-endian Unicode (UTF16BE) encoding instance
TEncoding.Unicode | UTF16 encoding instance
TEncoding.UTF7 | UTF7 encoding instance
TEncoding.UTF8 | UTF8 encoding instance


TEncoding
 | ro | CodePage
 | ro | EncodingName
 | ro | IsSingleByte
 | ro | ANSI
 | ro | ASCII
 | ro | BigEndianUnicode
 | ro | Default
 | ro | Unicode
 | ro | UTF7
 | ro | UTF8


TEncoding
 | FreeEncodings
 | Clone
 | Convert
 | IsStandardEncoding
 | GetBufferEncoding
 | GetEncoding
 | GetMaxByteCount
 | GetMaxCharCount
 | GetPreamble
 | GetString


Clone (TEncoding)

Convert (TEncoding)

FreeEncodings (TEncoding)

GetBufferEncoding (TEncoding)

GetEncoding (TEncoding)

GetMaxByteCount (TEncoding)

GetMaxCharCount (TEncoding)

GetPreamble (TEncoding)

GetString (TEncoding)

IsStandardEncoding (TEncoding)


TEncoding


TEncoding.ANSI

Ansi encoding instance

Declaration

Source position: sysencodingh.inc line 91

public property TEncoding.ANSI : TEncoding
  read GetANSI;

Description

ANSI is the ANSI codepage encoding instance, it is the default single-byte string codepage on windows (as returned by DefaultSystemCodePage). This instance is created and maintained by the system, it should not be freed.

See also

TEncoding.ASCII | ASCII encoding instance
TEncoding.Default | Default codepage
TEncoding.BigEndianUnicode | Big-endian Unicode (UTF16BE) encoding instance
TEncoding.Unicode | UTF16 encoding instance
TEncoding.UTF7 | UTF7 encoding instance
TEncoding.UTF8 | UTF8 encoding instance


TEncoding.ASCII

ASCII encoding instance

Declaration

Source position: sysencodingh.inc line 92

public property TEncoding.ASCII : TEncoding
  read GetASCII;

Description

ASCII is the ASCII codepage (CP_ASCII) encoding instance. This instance is created and maintained by the system, it should not be freed.

See also

TEncoding.ANSI | Ansi encoding instance
TEncoding.ASCII | ASCII encoding instance
TEncoding.Default | Default codepage
TEncoding.BigEndianUnicode | Big-endian Unicode (UTF16BE) encoding instance
TEncoding.Unicode | UTF16 encoding instance
TEncoding.UTF7 | UTF7 encoding instance
TEncoding.UTF8 | UTF8 encoding instance


TEncoding.BigEndianUnicode

Big-endian Unicode (UTF16BE) encoding instance

Declaration

Source position: sysencodingh.inc line 93

public property TEncoding.BigEndianUnicode : TEncoding
  read GetBigEndianUnicode;

Description

BigEndianUnicode is the Big-endian Unicode encoding instance (CP_UTF16BE) This instance is created and maintained by the system, it should not be freed.

See also

TEncoding.ANSI | Ansi encoding instance
TEncoding.ASCII | ASCII encoding instance
TEncoding.Default | Default codepage
TEncoding.Unicode | UTF16 encoding instance
TEncoding.UTF7 | UTF7 encoding instance
TEncoding.UTF8 | UTF8 encoding instance


TEncoding.Clone

Clone a TEncoding instance

Declaration

Source position: sysencodingh.inc line 55

public function TEncoding.Clone: TEncoding; virtual;

Description

Clone creates a copy of a TEncoding instance. This method returns Nil in TEncoding and must be implemented in descendent classes.

See also

TEncoding.Create


TEncoding.CodePage

Codepage for this encoding

Declaration

Source position: sysencodingh.inc line 87

public property TEncoding.CodePage : Cardinal
  read GetCodePage;

Description

CodePage is the numerical codepage for this encoding. It is a number as used in the Windows codepage registry.

See also

TEncoding.EncodingName

Name of this encoding


TEncoding.Convert

Convert an array of bytes from one encoding to another

Declaration

Source position: sysencodingh.inc line 56

public class function TEncoding.Convert(

  Source: TEncoding;

  Destination: TEncoding;

  const Bytes: TBytes

):TBytes; overload;

class function TEncoding.Convert(

  Source: TEncoding;

  Destination: TEncoding;

  const Bytes: TBytes;

  StartIndex: Integer;

  Count: Integer

):TBytes; overload;

Description

Convert will convert the bytes in Bytes from encoding Source to encoding Destination and returns the converted bytes as an array. If StartIndex and Count are specified, the conversion starts at (zero-based) index StartIndex, and only Count bytes will be converted.

See also

TEncoding.GetBytes

TEncoding.GetChars


TEncoding.Default

Default codepage

Declaration

Source position: sysencodingh.inc line 94

public property TEncoding.Default : TEncoding
  read GetDefault;

Description

Defaulte is the default encoding instance (it equals the ANSI codepage). This instance is created and maintained by the system, it should not be freed.

if the DefaultSystemCodePage changes, you should call TEncoding.FreeEncodings to regenerate the default encoding using the new code page.

See also

TEncoding.ANSI | Ansi encoding instance
TEncoding.ASCII | ASCII encoding instance
TEncoding.BigEndianUnicode | Big-endian Unicode (UTF16BE) encoding instance
TEncoding.Unicode | UTF16 encoding instance
TEncoding.UTF7 | UTF7 encoding instance
TEncoding.UTF8 | UTF8 encoding instance


TEncoding.EncodingName

Name of this encoding

Declaration

Source position: sysencodingh.inc line 88

public property TEncoding.EncodingName : UnicodeString
  read GetEncodingName;

Description

EncodingName is the name for this encoding. It's based on the windows name for the encoding and is calculated from the codepage.

See also

TEncoding.CodePage

Codepage for this encoding


TEncoding.FreeEncodings

Free all standard encodings

Declaration

Source position: sysencodingh.inc line 54

public class procedure TEncoding.FreeEncodings;

Description

FreeEncodings frees all the standard encodings TEncoding.ANSI, TEncoding.ASCII, TEncoding.Default, TEncoding.BigEndianUnicode, TEncoding.Unicode, TEncoding.UTF7 and TEncoding.UTF8. There should be no need to call this function directly, it is called automatically w hen the program exits.

See also

TEncoding.ANSI | Ansi encoding instance
TEncoding.ASCII | ASCII encoding instance
TEncoding.Default | Default codepage
TEncoding.BigEndianUnicode | Big-endian Unicode (UTF16BE) encoding instance
TEncoding.Unicode | UTF16 encoding instance
TEncoding.UTF7 | UTF7 encoding instance
TEncoding.UTF8 | UTF8 encoding instance


TEncoding.GetBufferEncoding

Attempt to guess the encoding of a buffer

Declaration

Source position: sysencodingh.inc line 59

public class function TEncoding.GetBufferEncoding(

  const Buffer: TBytes;

  var AEncoding: TEncoding

):Integer; overload;

class function TEncoding.GetBufferEncoding(

  const Buffer: TBytes;

  var AEncoding: TEncoding;

  ADefaultEncoding: TEncoding

):Integer; overload;

Description

GetBufferEncoding checks the BOM marker of an array of bytes Buffer, and returns the found encoding in AEncoding. Only the TEncoding.BigEndianUnicode TEncoding.Unicode and TEncoding.UTF8 encodings will be tried.

If AEncoding is non-Nil on entry, it will be used to check the BOM marker with. No other encoding will be tried in that case.

If ADefaultEncoding is specified, it will be returned in case no match was found.

The function returns the number of bytes in the BOM Marker.

See also

TEncoding.BigEndianUnicode | Big-endian Unicode (UTF16BE) encoding instance
TEncoding.Unicode | UTF16 encoding instance
TEncoding.UTF8 | UTF8 encoding instance
TEncoding.GetPreamble | Return the BOM Marker used by the encoding


TEncoding.GetEncoding

Get an encoding instance for a given codepage.

Declaration

Source position: sysencodingh.inc line 79

public class function TEncoding.GetEncoding(

  CodePage: Integer

):TEncoding; overload;

class function TEncoding.GetEncoding(

  const EncodingName: UnicodeString

):TEncoding; overload;

Description

GetEncoding will return an instance of TEncoding for the given codepage CodePage. The codepage can also be specified by name EncodingName. The returned instance is an appropriate descendent of TEncoding and needs to be freed by the caller.

See also

TUnicodeEncoding | UTF-16 unicode encoding
TBigEndianUnicodeEncoding | Big-endian UTF-16 unicode encoding
TUTF8Encoding | UTF-8 unicode encoding
TUTF7Encoding | UTF-7 unicode encoding
TMBCSEncoding | Multi-Byte character set encoding


TEncoding.GetMaxByteCount

Returns the maximum number of bytes needed to represent a string

Declaration

Source position: sysencodingh.inc line 81

public function TEncoding.GetMaxByteCount(

  CharCount: Integer

):Integer; virtual; abstract;

Description

GetMaxByteCount returns the maximum number of bytes needed to represent a string of CharCount characters in the given encoding.

This is an abstract method, implemented by descendents of TEncoding.

See also

TEncoding.GetMaxCharCount

Return the maximum number of characters that can be represented in a number of bytes


TEncoding.GetMaxCharCount

Return the maximum number of characters that can be represented in a number of bytes

Declaration

Source position: sysencodingh.inc line 82

public function TEncoding.GetMaxCharCount(

  ByteCount: Integer

):Integer; virtual; abstract;

Description

GetMaxCharCount returns the theoretical maximum number of characters that can be represented in a buffer of length ByteCount in the given encoding. Note that the actual number of characters that can be represented may well be much less and depends on the encoding and the actual characters.

This is an abstract method, implemented by descendents of TEncoding.

See also

TEncoding.GetMaxByteCount

Returns the maximum number of bytes needed to represent a string


TEncoding.GetPreamble

Return the BOM Marker used by the encoding

Declaration

Source position: sysencodingh.inc line 83

public function TEncoding.GetPreamble: TBytes; virtual; abstract;

Description

GetPreamble returns the BOM marker bytes used by the encoding. This is only meaningful for the UTF8 and Unicode encodings, for all other encodings there is no BOM Marker.

See also

TUnicodeEncoding | UTF-16 unicode encoding
TBigEndianUnicodeEncoding | Big-endian UTF-16 unicode encoding
TUTF8Encoding | UTF-8 unicode encoding


TEncoding.GetString

Return a string based on an array of bytes

Declaration

Source position: sysencodingh.inc line 84

public function TEncoding.GetString(

  const Bytes: TBytes

):UnicodeString; overload;

function TEncoding.GetString(

  const Bytes: TBytes;

  ByteIndex: Integer;

  ByteCount: Integer

):UnicodeString; overload;

Description

GetString will return a unicode string, created from the bytes in the Bytes array. The bytes array will be interpreted according to the encoding which the TEncoding represents.

If ByteIndex and ByteCount are specified, only the ByteCount bytes starting at position ByteIndex will be converted.

Errors

In case of invalid bytes, an EEncodingError exception may be raised.


TEncoding.IsSingleByte

Is the encoding a single-byte encoding or not ?

Declaration

Source position: sysencodingh.inc line 89

public property TEncoding.IsSingleByte : Boolean
  read FIsSingleByte;

Description

IsSingleByte determines whether an encoding is single-byte or not. It is false for all standard encodings.


TEncoding.IsStandardEncoding

Check if the encoding is one of the standard encodings

Declaration

Source position: sysencodingh.inc line 58

public class function TEncoding.IsStandardEncoding(

  AEncoding: TEncoding

):Boolean;

Description

IsStandardEncoding will return True is one of the standard encoding instances TEncoding.ANSI, TEncoding.ASCII, TEncoding.Default, TEncoding.BigEndianUnicode, TEncoding.Unicode, TEncoding.UTF7 or TEncoding.UTF8. Otherwise it returns False.

See also

TEncoding.ANSI | Ansi encoding instance
TEncoding.ASCII | ASCII encoding instance
TEncoding.Default | Default codepage
TEncoding.BigEndianUnicode | Big-endian Unicode (UTF16BE) encoding instance
TEncoding.Unicode | UTF16 encoding instance
TEncoding.UTF7 | UTF7 encoding instance
TEncoding.UTF8 | UTF8 encoding instance


TEncoding.Unicode

UTF16 encoding instance

Declaration

Source position: sysencodingh.inc line 95

public property TEncoding.Unicode : TEncoding
  read GetUnicode;

Description

Unicode is the Big-endian Unicode encoding instance (CP_UTF16) This instance is created and maintained by the system, it should not be freed.

See also

TEncoding.ANSI | Ansi encoding instance
TEncoding.ASCII | ASCII encoding instance
TEncoding.Default | Default codepage
TEncoding.BigEndianUnicode | Big-endian Unicode (UTF16BE) encoding instance
TEncoding.Unicode | UTF16 encoding instance
TEncoding.UTF7 | UTF7 encoding instance
TEncoding.UTF8 | UTF8 encoding instance


TEncoding.UTF7

UTF7 encoding instance

Declaration

Source position: sysencodingh.inc line 96

public property TEncoding.UTF7 : TEncoding
  read GetUTF7;

Description

UTF7 is the UTF7 encoding instance (CP_UTF7) This instance is created and maintained by the system, it should not be freed.

See also

TEncoding.ANSI | Ansi encoding instance
TEncoding.ASCII | ASCII encoding instance
TEncoding.Default | Default codepage
TEncoding.BigEndianUnicode | Big-endian Unicode (UTF16BE) encoding instance
TEncoding.Unicode | UTF16 encoding instance
TEncoding.UTF8 | UTF8 encoding instance


TEncoding.UTF8

UTF8 encoding instance

Declaration

Source position: sysencodingh.inc line 97

public property TEncoding.UTF8 : TEncoding
  read GetUTF8;

Description

UTF8 is the UTF7 encoding instance (CP_UTF7) This instance is created and maintained by the system, it should not be freed.

See also

TEncoding.ANSI | Ansi encoding instance
TEncoding.ASCII | ASCII encoding instance
TEncoding.Default | Default codepage
TEncoding.BigEndianUnicode | Big-endian Unicode (UTF16BE) encoding instance
TEncoding.Unicode | UTF16 encoding instance
TEncoding.UTF7 | UTF7 encoding instance


TExtendedHelper

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Helper for Extended floating point type

Declaration

Source position: syshelph.inc line 303

type TExtendedHelper = type helper
public
Const
Epsilon = Epsilon; = 3.64519953188247460253e-4951 | Precision for this floating point type
MaxValue = MaxValue; = 1.18973149535723176505e+4932 | Largest possible value for the Extended floating point type
MinValue = MinValue; = - 1.18973149535723176505e+4932 | Smallest (negative) possible value for the Extended floating point type
PositiveInfinity = PositiveInfinity; = 1.0 / 0.0 | Positive infinity as represented by a Extended floating point type
NegativeInfinity = NegativeInfinity; = (- 1.0) / (0.0) | Negative infinity as represented by a Extended floating point type
NaN = NaN; = 0.0 / 0.0 | Representation of NaN (Not a Number)
class function ToString(); | Convert a Extended-sized floating point value to a string
class function Parse(); | Convert a string to a floating point value
class function TryParse(); | Try to convert a string to a Extended-sized floating point value.
class function IsNan(); | Check whether a value equals NaN.
class function IsInfinity(); | Check whether a value is positive or negative infinity.
class function IsNegativeInfinity(); | Check whether a value is negative infinity.
class function IsPositiveInfinity(); | Check whether a value is positive infinity.
class function Size; | Size (in bytes) of a Extended-sized floating point value.
procedure BuildUp(); | Build a Extended-sized floating point from its composing parts
function Exponent; | Exponent of the floating-point value
function Fraction; | Fraction of the floating-point value
function Mantissa; | Mantissa of the floating-point
function SpecialType; | Return the type of the Extended-sized floating point value
property Bytes []: Byte; [rw] | Indexed access to the individual bytes of the floating point value
property Words []: Word; [rw] | Indexed access to the words that make up the floating point value
property Sign: Boolean; [rw] | Sign of the floating point value
property Exp: QWord; [rw] | The bit pattern of the exponent as stored in memory.
property Frac: QWord; [rw] | Bitpattern that makes up the fractional part.
end;

Inheritance

TExtendedHelper

Helper for Extended floating point type

Description

TExtendedHelper is the helper type for the Extended-sized floating point type. It contains some conversion methods, as well as access to the low-level structure of the floating-point representation of a Extended.

See also

TDoubleHelper | Helper for Double floating point type
TExtendedHelper | Helper for Extended floating point type


TExtendedHelper
 | Bytes
 | Words
 | Sign
 | Exp
 | Frac


Bytes (TExtendedHelper)

Exp (TExtendedHelper)

Frac (TExtendedHelper)

Sign (TExtendedHelper)

Words (TExtendedHelper)


TExtendedHelper
 | ToString
 | Parse
 | TryParse
 | IsNan
 | IsInfinity
 | IsNegativeInfinity
 | IsPositiveInfinity
 | Size
 | BuildUp
 | Exponent
 | Fraction
 | Mantissa
 | SpecialType


BuildUp (TExtendedHelper)

Exponent (TExtendedHelper)

Fraction (TExtendedHelper)

IsInfinity (TExtendedHelper)

IsNan (TExtendedHelper)

IsNegativeInfinity (TExtendedHelper)

IsPositiveInfinity (TExtendedHelper)

Mantissa (TExtendedHelper)

Parse (TExtendedHelper)

Size (TExtendedHelper)

SpecialType (TExtendedHelper)

ToString (TExtendedHelper)

TryParse (TExtendedHelper)


TExtendedHelper


TExtendedHelper.BuildUp

Build a Extended-sized floating point from its composing parts

Declaration

Source position: syshelph.inc line 341

public procedure TExtendedHelper.BuildUp(

  const ASignFlag: Boolean;

  const AMantissa: QWord;

  const AExponent: Integer

);

Description

BuildUp will compose a Extended-sized floating point value from the sign ASignFlag, mantissa AMantissa and exponent AExponent. It simply sets the Sign, Exp and Frac properties in 1 call.

See also

TExtendedHelper.Sign | Sign of the floating point value
TExtendedHelper.Exp | The bit pattern of the exponent as stored in memory.
TExtendedHelper.Frac | Bitpattern that makes up the fractional part.


TExtendedHelper.Bytes

Indexed access to the individual bytes of the floating point value

Declaration

Source position: syshelph.inc line 355

public property TExtendedHelper.Bytes[AIndex: Cardinal] : Byte
  read GetB
  write SetB;

Description

Bytes can be used to get or set the various bytes that make up the Extended-sized floating point value. The index runs from 0 to Size-1.

See also

TExtendedHelper.Words | Indexed access to the words that make up the floating point value
TExtendedHelper.Size | Size (in bytes) of a Extended-sized floating point value.


TExtendedHelper.Epsilon

Precision for this floating point type

Declaration

Source position: syshelph.inc line 320

public const TExtendedHelper.Epsilon: Extended = 3.64519953188247460253e-4951;

Description

Epsilon returns the precision of the floating point value : differences smaller than this value cannot be detected or represented. It can also be viewed as the smallest positive value that can be represented.

See also

TExtendedHelper.MinValue | Smallest (negative) possible value for the Extended floating point type
TExtendedHelper.MaxValue | Largest possible value for the Extended floating point type


TExtendedHelper.Exp

The bit pattern of the exponent as stored in memory.

Declaration

Source position: syshelph.inc line 358

public property TExtendedHelper.Exp : QWord
  read GetE
  write SetE;

Description

Exp is the internal representation of the Exponent.

See also

TExtendedHelper.Bytes | Indexed access to the individual bytes of the floating point value
TExtendedHelper.Sign | Sign of the floating point value
TExtendedHelper.Frac | Bitpattern that makes up the fractional part.
TExtendedHelper.Mantissa | Mantissa of the floating-point
TExtendedHelper.Fraction | Fraction of the floating-point value
TExtendedHelper.Exponent | Exponent of the floating-point value


TExtendedHelper.Exponent

Exponent of the floating-point value

Declaration

Source position: syshelph.inc line 342

public function TExtendedHelper.Exponent: Integer;

Description

Exponent is the value X in the representation of the floating-point value in m*2^X, i.e. the exponent.

See also

TExtendedHelper.Sign | Sign of the floating point value
TExtendedHelper.Exp | The bit pattern of the exponent as stored in memory.
TExtendedHelper.Frac | Bitpattern that makes up the fractional part.
TExtendedHelper.Fraction | Fraction of the floating-point value
TExtendedHelper.Mantissa | Mantissa of the floating-point


TExtendedHelper.Frac

Bitpattern that makes up the fractional part.

Declaration

Source position: syshelph.inc line 359

public property TExtendedHelper.Frac : QWord
  read GetF
  write SetF;

Description

Frac is the bit pattern representing the fractional part (significand) including the preceding 1 (the hidden bit).

See also

TExtendedHelper.Bytes | Indexed access to the individual bytes of the floating point value
TExtendedHelper.Sign | Sign of the floating point value
TExtendedHelper.Exp | The bit pattern of the exponent as stored in memory.
TExtendedHelper.Mantissa | Mantissa of the floating-point
TExtendedHelper.Fraction | Fraction of the floating-point value
TExtendedHelper.Exponent | Exponent of the floating-point value


TExtendedHelper.Fraction

Fraction of the floating-point value

Declaration

Source position: syshelph.inc line 343

public function TExtendedHelper.Fraction: Extended;

Description

Fraction is the decimal part of the floating-point value.

See also

TExtendedHelper.Sign | Sign of the floating point value
TExtendedHelper.Exp | The bit pattern of the exponent as stored in memory.
TExtendedHelper.Exponent | Exponent of the floating-point value
TExtendedHelper.Frac | Bitpattern that makes up the fractional part.
TExtendedHelper.Mantissa | Mantissa of the floating-point


TExtendedHelper.IsInfinity

Check whether a value is positive or negative infinity.

Declaration

Source position: syshelph.inc line 336

public class function TExtendedHelper.IsInfinity(

  const AValue: Extended

):Boolean; overload;

function TExtendedHelper.IsInfinity: Boolean; overload;

Description

IsInfinity checks whether a Extended-sized floating point value represents a positive or negative infinity. If so, it returns True. When the class function version is used, the value can be specified using AValue. In the method version, the used value is (Self).

See also

TExtendedHelper.IsNan | Check whether a value equals NaN.
TExtendedHelper.IsPositiveInfinity | Check whether a value is positive infinity.
TExtendedHelper.IsNegativeInfinity | Check whether a value is negative infinity.


TExtendedHelper.IsNan

Check whether a value equals NaN.

Declaration

Source position: syshelph.inc line 335

public class function TExtendedHelper.IsNan(

  const AValue: Extended

):Boolean; overload;

function TExtendedHelper.IsNan: Boolean; overload;

Description

IsNan checks whether a Extended-sized floating point value is NaN (Not a Number). If so, it returns True. When the class function version is used, the value can be specified using AValue. In the method version, the used value is (Self).

See also

TExtendedHelper.IsInfinity | Check whether a value is positive or negative infinity.
TExtendedHelper.IsPositiveInfinity | Check whether a value is positive infinity.
TExtendedHelper.IsNegativeInfinity | Check whether a value is negative infinity.


TExtendedHelper.IsNegativeInfinity

Check whether a value is negative infinity.

Declaration

Source position: syshelph.inc line 337

public class function TExtendedHelper.IsNegativeInfinity(

  const AValue: Extended

):Boolean; overload;

function TExtendedHelper.IsNegativeInfinity: Boolean; overload;

Description

IsNegativeInfinity checks whether a Extended-sized floating point value represents a negative infinity. If so, it returns True. When the class function version is used, the value can be specified using AValue. In the method version, the used value is (Self).

See also

TExtendedHelper.IsNan | Check whether a value equals NaN.
TExtendedHelper.IsPositiveInfinity | Check whether a value is positive infinity.
TExtendedHelper.IsInfinity | Check whether a value is positive or negative infinity.


TExtendedHelper.IsPositiveInfinity

Check whether a value is positive infinity.

Declaration

Source position: syshelph.inc line 338

public class function TExtendedHelper.IsPositiveInfinity(

  const AValue: Extended

):Boolean; overload;

function TExtendedHelper.IsPositiveInfinity: Boolean; overload;

Description

IsPositiveInfinity checks whether a Extended-sized floating point value represents a positive infinity. If so, it returns True. When the class function version is used, the value can be specified using AValue. In the method version, the used value is (Self).

See also

TExtendedHelper.IsNan | Check whether a value equals NaN.
TExtendedHelper.IsNegativeInfinity | Check whether a value is negative infinity.
TExtendedHelper.IsInfinity | Check whether a value is positive or negative infinity.


TExtendedHelper.Mantissa

Mantissa of the floating-point

Declaration

Source position: syshelph.inc line 348

public function TExtendedHelper.Mantissa: QWord;

Description

Mantissa is the value of the significand without the hidden bit. This means it the plain bit pattern as it is stored in memory.

See also

TExtendedHelper.Sign | Sign of the floating point value
TExtendedHelper.Exp | The bit pattern of the exponent as stored in memory.
TExtendedHelper.Exponent | Exponent of the floating-point value
TExtendedHelper.Frac | Bitpattern that makes up the fractional part.
TExtendedHelper.Fraction | Fraction of the floating-point value


TExtendedHelper.MaxValue

Largest possible value for the Extended floating point type

Declaration

Source position: syshelph.inc line 321

public const TExtendedHelper.MaxValue: Extended = 1.18973149535723176505e+4932;

Description

MaxValue is the largest possible value that can be represented by the Extended floating point type. For bigger values, Double or Extended types must be used.

See also

TExtendedHelper.MinValue | Smallest (negative) possible value for the Extended floating point type
TExtendedHelper.Epsilon | Precision for this floating point type


TExtendedHelper.MinValue

Smallest (negative) possible value for the Extended floating point type

Declaration

Source position: syshelph.inc line 322

public const TExtendedHelper.MinValue: Extended = - 1.18973149535723176505e+4932;

Description

MaxValue is the largest possible value that can be represented by the Extended floating point type. For bigger values, Double or Extended types must be used.

See also

TExtendedHelper.MaxValue | Largest possible value for the Extended floating point type
TExtendedHelper.Epsilon | Precision for this floating point type
TExtendedHelper.PositiveInfinity | Positive infinity as represented by a Extended floating point type
TExtendedHelper.NegativeInfinity | Negative infinity as represented by a Extended floating point type
TExtendedHelper.NaN | Representation of NaN (Not a Number)


TExtendedHelper.NaN

Representation of NaN (Not a Number)

Declaration

Source position: syshelph.inc line 325

public const TExtendedHelper.NaN: Extended = 0.0 / 0.0;

Description

NaN is the Representation of NaN (Not a Number) for a Extended-sized floating point type.

See also

TExtendedHelper.MaxValue | Largest possible value for the Extended floating point type
TExtendedHelper.MinValue | Smallest (negative) possible value for the Extended floating point type
TExtendedHelper.Epsilon | Precision for this floating point type
TExtendedHelper.PositiveInfinity | Positive infinity as represented by a Extended floating point type
TExtendedHelper.NegativeInfinity | Negative infinity as represented by a Extended floating point type


TExtendedHelper.NegativeInfinity

Negative infinity as represented by a Extended floating point type

Declaration

Source position: syshelph.inc line 324

public const TExtendedHelper.NegativeInfinity: Extended = (- 1.0) / (0.0);

Description

NegativeInfinity is the value representing negative infinity in a Extended-sized floating point value.

See also

TExtendedHelper.MaxValue | Largest possible value for the Extended floating point type
TExtendedHelper.MinValue | Smallest (negative) possible value for the Extended floating point type
TExtendedHelper.Epsilon | Precision for this floating point type
TExtendedHelper.PositiveInfinity | Positive infinity as represented by a Extended floating point type
TExtendedHelper.NaN | Representation of NaN (Not a Number)


TExtendedHelper.Parse

Convert a string to a floating point value

Declaration

Source position: syshelph.inc line 331

public class function TExtendedHelper.Parse(

  const AString: string

):Extended; overload;

class function TExtendedHelper.Parse(

  const AString: string;

  const AFormatSettings: TFormatSettings

):Extended; overload;

Description

Parse will try to convert AString to a Extended-sized floating point value. It will take into account internationalization settings. (it uses FloatToStr).

Errors

If the string AString is not a valid floating-point value, a EConvertError exception is raised.

See also

FloatToStr | Convert a float value to a string using a fixed format.
TExtendedHelper.ToString | Convert a Extended-sized floating point value to a string
TExtendedHelper.TryParse | Try to convert a string to a Extended-sized floating point value.


TExtendedHelper.PositiveInfinity

Positive infinity as represented by a Extended floating point type

Declaration

Source position: syshelph.inc line 323

public const TExtendedHelper.PositiveInfinity: Extended = 1.0 / 0.0;

Description

PositiveInfinity is the value representing positive infinity in a Extended-sized floating point value.

See also

TExtendedHelper.MaxValue | Largest possible value for the Extended floating point type
TExtendedHelper.MinValue | Smallest (negative) possible value for the Extended floating point type
TExtendedHelper.Epsilon | Precision for this floating point type
TExtendedHelper.NegativeInfinity | Negative infinity as represented by a Extended floating point type
TExtendedHelper.NaN | Representation of NaN (Not a Number)


TExtendedHelper.Sign

Sign of the floating point value

Declaration

Source position: syshelph.inc line 357

public property TExtendedHelper.Sign : Boolean
  read GetS
  write SetS;

Description

Sign returns True if the sign bit of the value is set (i.e. it is a negative value) or False if it is not set (i.e. it is a positive value).

See also

TExtendedHelper.Bytes | Indexed access to the individual bytes of the floating point value
TExtendedHelper.Exp | The bit pattern of the exponent as stored in memory.
TExtendedHelper.Frac | Bitpattern that makes up the fractional part.
TExtendedHelper.Mantissa | Mantissa of the floating-point
TExtendedHelper.Fraction | Fraction of the floating-point value
TExtendedHelper.Exponent | Exponent of the floating-point value


TExtendedHelper.Size

Size (in bytes) of a Extended-sized floating point value.

Declaration

Source position: syshelph.inc line 339

public class function TExtendedHelper.Size: Integer;

Description

Size is the size (in bytes) of a Extended-sized floating point value. It is equivalent to calling SizeOf(Extended).

See also

SizeOf

Return size of a variable or type.


TExtendedHelper.SpecialType

Return the type of the Extended-sized floating point value

Declaration

Source position: syshelph.inc line 349

public function TExtendedHelper.SpecialType: TFloatSpecial;

Description

SpecialType checks whether the Extended-sized floating point value equals one of several special values, and returns an enumerated value describing which value this is. See TFloatSpecial for an explanation of the possible values.

See also

TFloatSpecial

Special floating point values


TExtendedHelper.ToString

Convert a Extended-sized floating point value to a string

Declaration

Source position: syshelph.inc line 327

public class function TExtendedHelper.ToString(

  const AValue: Extended

):string; overload;

class function TExtendedHelper.ToString(

  const AValue: Extended;

  const AFormatSettings: TFormatSettings

):string; overload;

class function TExtendedHelper.ToString(

  const AValue: Extended;

  const AFormat: TFloatFormat;

  const APrecision: Integer;

  const ADigits: Integer

):string; overload;

class function TExtendedHelper.ToString(

  const AValue: Extended;

  const AFormat: TFloatFormat;

  const APrecision: Integer;

  const ADigits: Integer;

  const AFormatSettings: TFormatSettings

):string; overload;

function TExtendedHelper.ToString(

  const AFormat: TFloatFormat;

  const APrecision: Integer;

  const ADigits: Integer

):string; overload;

function TExtendedHelper.ToString(

  const AFormat: TFloatFormat;

  const APrecision: Integer;

  const ADigits: Integer;

  const AFormatSettings: TFormatSettings

):string; overload;

function TExtendedHelper.ToString(

  const AFormatSettings: TFormatSettings

):string; overload;

function TExtendedHelper.ToString: string; overload;

Description

ToString will convert AValue (or Self in the plain method version) to a string. Optionally FormatSettings can be specified, to be able to specify the decimal separator character to use.

Additionally, a precision APrecision and number of digits ADigits can be specified, in conjunction with a AFormat parameter to specify the form in which the floating-point value must be represented. (see TFloatFormat for an explanation of the various values). In this case, FloatToStrF is used to format the value. In the absence of these parameters, FloatToStr is called.

See also

FloatToStr | Convert a float value to a string using a fixed format.
FloatToStrF | Convert a float value to a string using a given format.
TFloatFormat | Formats for the FloatToText function.


TExtendedHelper.TryParse

Try to convert a string to a Extended-sized floating point value.

Declaration

Source position: syshelph.inc line 333

public class function TExtendedHelper.TryParse(

  const AString: string;

  out AValue: Extended

):Boolean; overload;

class function TExtendedHelper.TryParse(

  const AString: string;

  out AValue: Extended;

  const AFormatSettings: TFormatSettings

):Boolean; overload;

Description

TryParse attempts to convert the string AString to a Extended-sized floating point value and reports True if the conversion was succesful. In that case the parsed value is returned in AValue.

If the conversion failed, False is returned.

See also

TExtendedHelper.Parse | Convert a string to a floating point value
TExtendedHelper.ToString | Convert a Extended-sized floating point value to a string


TExtendedHelper.Words

Indexed access to the words that make up the floating point value

Declaration

Source position: syshelph.inc line 356

public property TExtendedHelper.Words[AIndex: Cardinal] : Word
  read GetW
  write SetW;

Description

Words can be used to get or set the various bytes that make up the Extended-sized floating point value. The index runs from 0 to (Size-1) div 2.

See also

TExtendedHelper.Bytes | Indexed access to the individual bytes of the floating point value
TExtendedHelper.Size | Size (in bytes) of a Extended-sized floating point value.


TGuidHelper

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Helper type for TGUID

Declaration

Source position: syshelph.inc line 15

type TGuidHelper = record helper
class function Create(); | Initialize a TGUID instance from data.
class function NewGuid; | Create a new GUID
function ToByteArray(); | Convert to array of bytes
function ToString(); | Convert to string
end;

Inheritance

TGuidHelper

Helper type for TGUID

Description

TGuidHelper provides various methods for a TGUID type.

See also

TGUID

Standard GUID representation type.


TGuidHelper


TGuidHelper
 | Create
 | NewGuid
 | ToByteArray
 | ToString


Create (TGuidHelper)

NewGuid (TGuidHelper)

ToByteArray (TGuidHelper)

ToString (TGuidHelper)


TGuidHelper.Create

Initialize a TGUID instance from data.

Declaration

Source position: syshelph.inc line 16

class function TGuidHelper.Create(

  const Data;

  BigEndian: Boolean

):TGuid; overload;

class function TGuidHelper.Create(

  const Data: array of Byte;

  AStartIndex: Cardinal;

  BigEndian: Boolean

):TGuid; overload;

class function TGuidHelper.Create(

  const Data;

  DataEndian: TEndian = CPUEndian

):TGuid; overload;

class function TGuidHelper.Create(

  const B: TBytes;

  DataEndian: TEndian = CPUEndian

):TGuid; overload;

class function TGuidHelper.Create(

  const B: TBytes;

  AStartIndex: Cardinal;

  DataEndian: TEndian = CPUEndian

):TGuid; overload;

class function TGuidHelper.Create(

  const S: string

):TGuid; overload;

class function TGuidHelper.Create(

  A: Integer;

  B: SmallInt;

  C: SmallInt;

  const D: TBytes

):TGuid; overload;

class function TGuidHelper.Create(

  A: Integer;

  B: SmallInt;

  C: SmallInt;

  D: Byte;

  E: Byte;

  F: Byte;

  G: Byte;

  H: Byte;

  I: Byte;

  J: Byte;

  K: Byte

):TGuid; overload;

class function TGuidHelper.Create(

  A: Cardinal;

  B: Word;

  C: Word;

  D: Byte;

  E: Byte;

  F: Byte;

  G: Byte;

  H: Byte;

  I: Byte;

  J: Byte;

  K: Byte

):TGuid; overload;

Description

Create will initialize a TGUID from byte data. The byte-data can come in different forms

Data
can be a plain buffer. The GUID Data will be read from the buffer (SizeOf(TGUID) bytes), according to the BigEndian argument.
Data
can be an array of bytes. SizeOf(TGUID) bytes will be read from the array, starting at index StartIndex (default 0). The GUID Data will be read according to the BigEndian argument.
S
can be a string containing a string representation of the GUID, which is converted using StringToGUID.
A,B,C,D (optionally E,F,G,H,I,J,K)
where the arguments are simply the various components of the GUID.

See also

TGUID | Standard GUID representation type.
StringToGUID | Convert a string to a native TGUID type.


TGuidHelper.NewGuid

Create a new GUID

Declaration

Source position: syshelph.inc line 25

class function TGuidHelper.NewGuid: TGuid;

Description

NewGUID creates and returns a new using CreateGUID

See also

CreateGUID

Create a new GUID


TGuidHelper.ToByteArray

Convert to array of bytes

Declaration

Source position: syshelph.inc line 26

function TGuidHelper.ToByteArray(

  DataEndian: TEndian = CPUEndian

):TBytes;

Description

ToByteArray converts the TGUID to an array of bytes (of length SizeOf(TGUID)). The bytes will be ordered accoring to DataEndian.

See also

TGUIDHelper.ToString | Convert to string
TGUIDHelper.Create | Initialize a TGUID instance from data.


TGuidHelper.ToString

Convert to string

Declaration

Source position: syshelph.inc line 27

function TGuidHelper.ToString(

  SkipBrackets: Boolean = False

):string;

Description

ToString will convert the TGUID to a string representation, using GUIDToString

See also

GUIDToString

Convert a TGUID to a string representation.


TInt64Helper

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Helper for a Int64-typed ordinal value

Declaration

Source position: syshelph.inc line 483

type TInt64Helper = type helper
public
Const
MaxValue = 9223372036854775807 | Maximum value for a Int64
MinValue = - 9223372036854775808 | Minimum value for a Int64
class function Parse(); | Convert from a string
class function Size; | Size, in bytes, of the Int64 value
class function ToString(); | Convert the value to string
class function TryParse(); | Try to convert a string to a Int64, report success or failure
function ToBoolean; | Convert to a boolean value
function ToDouble; | Convert to a double-sized floating point value
function ToExtended; | Convert to an extended-sized floating point value
function ToHexString(); | Convert to a hexadecimal string representation
function ToSingle; | Convert to an single-sized floating point value
end;

Inheritance

TInt64Helper

Helper for a Int64-typed ordinal value

Description

TInt64Helper contains some auxiliary routines for a Int64-typed ordinal value. It consists mainly of conversion routines to and from other types.

See also

TStringHelper | Helper type for strings.
TShortIntHelper | Helper for a ShortInt-typed ordinal value
TSmallIntHelper | Helper for a SmallInt-typed ordinal value
TWordHelper | Helper for a Word-typed ordinal value
TCardinalHelper | Helper for a Cardinal-typed ordinal value
TIntegerHelper | Helper for a Integer-typed ordinal value
TByteHelper | Helper for a byte-typed ordinal value
TQWordHelper | Helper for a QWord-typed ordinal value
TNativeIntHelper | Helper for a NativeInt-typed ordinal value
TNativeUIntHelper | Helper for a NativeUInt-typed ordinal value


TInt64Helper


TInt64Helper
 | Parse
 | Size
 | ToString
 | TryParse
 | ToBoolean
 | ToDouble
 | ToExtended
 | ToHexString
 | ToSingle


Parse (TInt64Helper)

Size (TInt64Helper)

ToBoolean (TInt64Helper)

ToDouble (TInt64Helper)

ToExtended (TInt64Helper)

ToHexString (TInt64Helper)

ToSingle (TInt64Helper)

ToString (TInt64Helper)

TryParse (TInt64Helper)


TInt64Helper.MaxValue

Maximum value for a Int64

Declaration

Source position: syshelph.inc line 486

public const TInt64Helper.MaxValue = 9223372036854775807;

Description

MaxValue is the biggest value a Int64-typed value can contain.

See also

TInt64Helper.MinValue

Minimum value for a Int64


TInt64Helper.MinValue

Minimum value for a Int64

Declaration

Source position: syshelph.inc line 487

public const TInt64Helper.MinValue = - 9223372036854775808;

Description

MinValue is the smallest value a Int64-typed value can contain.

See also

TInt64Helper.MaxValue

Maximum value for a Int64


TInt64Helper.Parse

Convert from a string

Declaration

Source position: syshelph.inc line 489

public class function TInt64Helper.Parse(

  const AString: string

):Int64;

Description

Parse will attempt to convert the string AString to a Int64 value. It uses the StrToInt64 function to perform the conversion, so no localization is taken into account.

Errors

If the string does not contain a valid Int64 value, an EConvertError exception is raised.

See also

TInt64Helper.ToString | Convert the value to string
TInt64Helper.TryParse | Try to convert a string to a Int64, report success or failure
StrToInt64 | Convert a string to an Int64 value.


TInt64Helper.Size

Size, in bytes, of the Int64 value

Declaration

Source position: syshelph.inc line 490

public class function TInt64Helper.Size: Integer;

Description

Size returns the size (in Int64s) of the Int64 value. This is equivalent to SizeOf(Int64).

Errors

None.

See also

SizeOf

Return size of a variable or type.


TInt64Helper.ToBoolean

Convert to a boolean value

Declaration

Source position: syshelph.inc line 494

public function TInt64Helper.ToBoolean: Boolean;

Description

ToBoolean converts the Int64 value to a boolean: it returns True if the value is nonzero, False if it is zero.

See also

TInt64Helper.ToSingle | Convert to an single-sized floating point value
TInt64Helper.ToDouble | Convert to a double-sized floating point value
TInt64Helper.ToExtended | Convert to an extended-sized floating point value
TInt64Helper.ToString | Convert the value to string
TInt64Helper.ToHexString | Convert to a hexadecimal string representation


TInt64Helper.ToDouble

Convert to a double-sized floating point value

Declaration

Source position: syshelph.inc line 495

public function TInt64Helper.ToDouble: Double;

Description

ToDouble converts the Int64 value to a double-sized floating point value.

See also

TInt64Helper.ToBoolean | Convert to a boolean value
TInt64Helper.ToExtended | Convert to an extended-sized floating point value
TInt64Helper.ToSingle | Convert to an single-sized floating point value
TInt64Helper.ToString | Convert the value to string
TInt64Helper.ToHexString | Convert to a hexadecimal string representation


TInt64Helper.ToExtended

Convert to an extended-sized floating point value

Declaration

Source position: syshelph.inc line 496

public function TInt64Helper.ToExtended: Extended;

Description

ToDouble converts the Int64 value to an extended-sized floating point value.

See also

TInt64Helper.ToBoolean | Convert to a boolean value
TInt64Helper.ToSingle | Convert to an single-sized floating point value
TInt64Helper.ToDouble | Convert to a double-sized floating point value
TInt64Helper.ToString | Convert the value to string
TInt64Helper.ToHexString | Convert to a hexadecimal string representation


TInt64Helper.ToHexString

Convert to a hexadecimal string representation

Declaration

Source position: syshelph.inc line 497

public function TInt64Helper.ToHexString(

  const AMinDigits: Integer

):string; overload;

function TInt64Helper.ToHexString: string; overload;

Description

ToHexString converts the Int64 value to a hexadecimal string representation. The AMinDigits argument specifies the minimal number of characters in the resulting string. The string will be left-padded with zeroes if the representation contains less than AMinDigits characters.

See also

TInt64Helper.ToBoolean | Convert to a boolean value
TInt64Helper.ToSingle | Convert to an single-sized floating point value
TInt64Helper.ToDouble | Convert to a double-sized floating point value
TInt64Helper.ToString | Convert the value to string
TInt64Helper.ToExtended | Convert to an extended-sized floating point value


TInt64Helper.ToSingle

Convert to an single-sized floating point value

Declaration

Source position: syshelph.inc line 499

public function TInt64Helper.ToSingle: Single;

Description

ToSingle converts the Int64 value to a single-sized floating point value.

See also

TInt64Helper.ToBoolean | Convert to a boolean value
TInt64Helper.ToDouble | Convert to a double-sized floating point value
TInt64Helper.ToExtended | Convert to an extended-sized floating point value
TInt64Helper.ToString | Convert the value to string
TInt64Helper.ToHexString | Convert to a hexadecimal string representation


TInt64Helper.ToString

Convert the value to string

Declaration

Source position: syshelph.inc line 491

public class function TInt64Helper.ToString(

  const AValue: Int64

):string; overload;

function TInt64Helper.ToString: string; overload;

Description

ToString will, in the class function variant of this method, convert AValue to a string representation. In the regular method overloaded version of ToString, the Int64 value itself is used. The IntToStr function is used to do the conversion.

See also

TInt64Helper.Parse | Convert from a string
IntToStr | Convert an integer value to a decimal string.


TInt64Helper.TryParse

Try to convert a string to a Int64, report success or failure

Declaration

Source position: syshelph.inc line 492

public class function TInt64Helper.TryParse(

  const AString: string;

  out AValue: Int64

):Boolean;

Description

TryParse attempts to convert the string AString to a Int64, and reports the success of the attempt. If the attempt is succesful, then True is returned, and the actual value of the Int64 is returned in AValue.

It uses the val function to perform the conversion, so no localization is taken into account.

See also

TInt64Helper.Parse | Convert from a string
Val | Calculate numerical/enumerated value of a string.


TIntegerHelper

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Helper for a Integer-typed ordinal value

Declaration

Source position: syshelph.inc line 463

type TIntegerHelper = type helper
public
Const
MaxValue = 2147483647 | Maximum value for a Integer
MinValue = - 2147483648 | Minimum value for a Integer
class function Size; | Size, in bytes, of the Integer value
class function ToString(); | Convert the value to string
class function Parse(); | Convert from a string
class function TryParse(); | Try to convert a string to a Integer, report success or failure
function ToBoolean; | Convert to a boolean value
function ToDouble; | Convert to a double-sized floating point value
function ToExtended; | Convert to an extended-sized floating point value
function ToHexString(); | Convert to a hexadecimal string representation
function ToSingle; | Convert to an single-sized floating point value
end;

Inheritance

TIntegerHelper

Helper for a Integer-typed ordinal value

Description

TIntegerHelper contains some auxiliary routines for a Integer-typed ordinal value. It consists mainly of conversion routines to and from other types.

See also

TStringHelper | Helper type for strings.
TShortIntHelper | Helper for a ShortInt-typed ordinal value
TSmallIntHelper | Helper for a SmallInt-typed ordinal value
TWordHelper | Helper for a Word-typed ordinal value
TCardinalHelper | Helper for a Cardinal-typed ordinal value
TByteHelper | Helper for a byte-typed ordinal value
TInt64Helper | Helper for a Int64-typed ordinal value
TQWordHelper | Helper for a QWord-typed ordinal value
TNativeIntHelper | Helper for a NativeInt-typed ordinal value
TNativeUIntHelper | Helper for a NativeUInt-typed ordinal value


TIntegerHelper


TIntegerHelper
 | Size
 | ToString
 | Parse
 | TryParse
 | ToBoolean
 | ToDouble
 | ToExtended
 | ToHexString
 | ToSingle


Parse (TIntegerHelper)

Size (TIntegerHelper)

ToBoolean (TIntegerHelper)

ToDouble (TIntegerHelper)

ToExtended (TIntegerHelper)

ToHexString (TIntegerHelper)

ToSingle (TIntegerHelper)

ToString (TIntegerHelper)

TryParse (TIntegerHelper)


TIntegerHelper.MaxValue

Maximum value for a Integer

Declaration

Source position: syshelph.inc line 466

public const TIntegerHelper.MaxValue = 2147483647;

Description

MaxValue is the biggest value a Integer-typed value can contain.

See also

TIntegerHelper.MinValue

Minimum value for a Integer


TIntegerHelper.MinValue

Minimum value for a Integer

Declaration

Source position: syshelph.inc line 467

public const TIntegerHelper.MinValue = - 2147483648;

Description

MinValue is the smallest value a Integer-typed value can contain.

See also

TIntegerHelper.MaxValue

Maximum value for a Integer


TIntegerHelper.Parse

Convert from a string

Declaration

Source position: syshelph.inc line 471

public class function TIntegerHelper.Parse(

  const AString: string

):Integer;

Description

Parse will attempt to convert the string AString to a Integer value. It uses the StrToInt function to perform the conversion, so no localization is taken into account.

Errors

If the string does not contain a valid Integer value, an EConvertError exception is raised.

See also

TIntegerHelper.ToString | Convert the value to string
TIntegerHelper.TryParse | Try to convert a string to a Integer, report success or failure
StrToInt | Convert a string to an integer value.


TIntegerHelper.Size

Size, in bytes, of the Integer value

Declaration

Source position: syshelph.inc line 469

public class function TIntegerHelper.Size: Integer;

Description

Size returns the size (in Integers) of the Integer value. This is equivalent to SizeOf(Integer).

Errors

None.

See also

SizeOf

Return size of a variable or type.


TIntegerHelper.ToBoolean

Convert to a boolean value

Declaration

Source position: syshelph.inc line 474

public function TIntegerHelper.ToBoolean: Boolean;

Description

ToBoolean converts the Integer value to a boolean: it returns True if the value is nonzero, False if it is zero.

See also

TIntegerHelper.ToSingle | Convert to an single-sized floating point value
TIntegerHelper.ToDouble | Convert to a double-sized floating point value
TIntegerHelper.ToExtended | Convert to an extended-sized floating point value
TIntegerHelper.ToString | Convert the value to string
TIntegerHelper.ToHexString | Convert to a hexadecimal string representation


TIntegerHelper.ToDouble

Convert to a double-sized floating point value

Declaration

Source position: syshelph.inc line 475

public function TIntegerHelper.ToDouble: Double;

Description

ToDouble converts the Integer value to a double-sized floating point value.

See also

TIntegerHelper.ToBoolean | Convert to a boolean value
TIntegerHelper.ToExtended | Convert to an extended-sized floating point value
TIntegerHelper.ToSingle | Convert to an single-sized floating point value
TIntegerHelper.ToString | Convert the value to string
TIntegerHelper.ToHexString | Convert to a hexadecimal string representation


TIntegerHelper.ToExtended

Convert to an extended-sized floating point value

Declaration

Source position: syshelph.inc line 476

public function TIntegerHelper.ToExtended: Extended;

Description

ToDouble converts the Integer value to an extended-sized floating point value.

See also

TIntegerHelper.ToBoolean | Convert to a boolean value
TIntegerHelper.ToSingle | Convert to an single-sized floating point value
TIntegerHelper.ToDouble | Convert to a double-sized floating point value
TIntegerHelper.ToString | Convert the value to string
TIntegerHelper.ToHexString | Convert to a hexadecimal string representation


TIntegerHelper.ToHexString

Convert to a hexadecimal string representation

Declaration

Source position: syshelph.inc line 477

public function TIntegerHelper.ToHexString(

  const AMinDigits: Integer

):string; overload;

function TIntegerHelper.ToHexString: string; overload;

Description

ToHexString converts the Integer value to a hexadecimal string representation. The AMinDigits argument specifies the minimal number of characters in the resulting string. The string will be left-padded with zeroes if the representation contains less than AMinDigits characters.

See also

TIntegerHelper.ToBoolean | Convert to a boolean value
TIntegerHelper.ToSingle | Convert to an single-sized floating point value
TIntegerHelper.ToDouble | Convert to a double-sized floating point value
TIntegerHelper.ToString | Convert the value to string
TIntegerHelper.ToExtended | Convert to an extended-sized floating point value


TIntegerHelper.ToSingle

Convert to an single-sized floating point value

Declaration

Source position: syshelph.inc line 479

public function TIntegerHelper.ToSingle: Single;

Description

ToSingle converts the Integer value to a single-sized floating point value.

See also

TIntegerHelper.ToBoolean | Convert to a boolean value
TIntegerHelper.ToDouble | Convert to a double-sized floating point value
TIntegerHelper.ToExtended | Convert to an extended-sized floating point value
TIntegerHelper.ToString | Convert the value to string
TIntegerHelper.ToHexString | Convert to a hexadecimal string representation


TIntegerHelper.ToString

Convert the value to string

Declaration

Source position: syshelph.inc line 470

public class function TIntegerHelper.ToString(

  const AValue: Integer

):string; overload;

function TIntegerHelper.ToString: string; overload;

Description

ToString will, in the class function variant of this method, convert AValue to a string representation. In the regular method overloaded version of ToString, the Integer value itself is used. The IntToStr function is used to do the conversion.

See also

TIntegerHelper.Parse | Convert from a string
IntToStr | Convert an integer value to a decimal string.


TIntegerHelper.TryParse

Try to convert a string to a Integer, report success or failure

Declaration

Source position: syshelph.inc line 472

public class function TIntegerHelper.TryParse(

  const AString: string;

  out AValue: Integer

):Boolean;

Description

TryParse attempts to convert the string AString to a Integer, and reports the success of the attempt. If the attempt is succesful, then True is returned, and the actual value of the Integer is returned in AValue.

It uses the val function to perform the conversion, so no localization is taken into account.

See also

TIntegerHelper.Parse | Convert from a string
Val | Calculate numerical/enumerated value of a string.


TLongBoolHelper

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Helper for the LongBool type.

Declaration

Source position: syshelph.inc line 609

type TLongBoolHelper = type helper
public
class function Parse(); | Convert string value to LongBool value.
class function Size; | Return the size (in bytes) of the
class function ToString(); | Convert a LongBool value to string.
class function TryToParse(); | Try to convert a string to a LongBool value
function ToInteger; | Convert to an integer value
end;

Inheritance

TLongBoolHelper

Helper for the LongBool type.

Description

TLongBoolHelper is a helper type for the LongBool type. It contains mostly conversion routines to and from other types.

See also

TStringHelper | Helper type for strings.
TShortIntHelper | Helper for a ShortInt-typed ordinal value
TSmallIntHelper | Helper for a SmallInt-typed ordinal value
TWordHelper | Helper for a Word-typed ordinal value
TCardinalHelper | Helper for a Cardinal-typed ordinal value
TIntegerHelper | Helper for a Integer-typed ordinal value
TInt64Helper | Helper for a Int64-typed ordinal value
TQWordHelper | Helper for a QWord-typed ordinal value
TNativeIntHelper | Helper for a NativeInt-typed ordinal value
TByteHelper | Helper for a byte-typed ordinal value
TByteBoolHelper | Helper for the ByteBool type.
TWordBoolHelper | Helper for the WordBool type.
TLongBoolHelper | Helper for the LongBool type.


TLongBoolHelper


TLongBoolHelper
 | Parse
 | Size
 | ToString
 | TryToParse
 | ToInteger


Parse (TLongBoolHelper)

Size (TLongBoolHelper)

ToInteger (TLongBoolHelper)

ToString (TLongBoolHelper)

TryToParse (TLongBoolHelper)


TLongBoolHelper.Parse

Convert string value to LongBool value.

Declaration

Source position: syshelph.inc line 611

public class function TLongBoolHelper.Parse(

  const S: string

):Boolean;

Description

Parse attempts to convert the string S to a LongBool value. It uses the StrToBool function to perform the conversion.

Errors

If S does not contain a valid string representation, then an EConvertError exception is raised.

See also

TLongBoolHelper.TryToParse | Try to convert a string to a LongBool value
TLongBoolHelper.ToString | Convert a LongBool value to string.
TLongBoolHelper.ToInteger | Convert to an integer value


TLongBoolHelper.Size

Return the size (in bytes) of the

Declaration

Source position: syshelph.inc line 612

public class function TLongBoolHelper.Size: Integer;

Description

Size returns the size (in bytes) of the LongBool value. This is equivalent to SizeOf(LongBool).

See also

SizeOf

Return size of a variable or type.


TLongBoolHelper.ToInteger

Convert to an integer value

Declaration

Source position: syshelph.inc line 616

public function TLongBoolHelper.ToInteger: Integer;

Description

ToInteger will return the LongBool value, typecasted to Integer.

See also

TLongBoolHelper.ToString

Convert a LongBool value to string.


TLongBoolHelper.ToString

Convert a LongBool value to string.

Declaration

Source position: syshelph.inc line 613

public class function TLongBoolHelper.ToString(

  const AValue: Boolean;

  UseBoolStrs: TUseBoolStrs = TUseBoolStrs.False

):string; overload;

function TLongBoolHelper.ToString(

  UseBoolStrs: TUseBoolStrs = TUseBoolStrs.False

):string; overload;

Description

ToString will, in the class method version, convert the AValue LongBool to a string representation. In the function method version the LongBool value itself (Self) will be converted.

If the UseBoolStrs parameter equals TUseBoolStrs.True, then the string representation will use the LongBool strings BoolStrs. The default value for UseBoolStrs is TUseBoolStrs.False.

The conversion is done using the BoolTostr function.

See also

BoolStrs

BoolToStr

Convert a boolean value to a string.


TLongBoolHelper.TryToParse

Try to convert a string to a LongBool value

Declaration

Source position: syshelph.inc line 614

public class function TLongBoolHelper.TryToParse(

  const S: string;

  out AValue: Boolean

):Boolean;

Description

TryToParse will attempt to convert the string S to a LongBool value. If the attempt is succesful, True is returned, and the actual value is returned in AValue. If the attempt failed, False is returned.

See also

TLongBoolHelper.Parse | Convert string value to LongBool value.
TLongBoolHelper.ToString | Convert a LongBool value to string.


TMBCSEncoding

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Multi-Byte character set encoding

Declaration

Source position: sysencodingh.inc line 102

type TMBCSEncoding = class(TEncoding)
public
constructor Create(); | Create a new instance of a multi-byte character set encoding
function Clone; override; | Clone a TMBCSEncoding instance
function GetMaxByteCount(); override; | Return max number of bytes needed to represent a string
function GetMaxCharCount(); override; | Return max number of characters that can be represented by an array of bytes
function GetPreamble; override; | Return BOM marker bytes
end;

Inheritance

TMBCSEncoding | Multi-Byte character set encoding
|
TEncoding | Encoding support
|
TObject

Description

TMBCSEncoding is the encoding class used for most of the encodings, except the actual Unicode encodings. The codepage is specified during creation, and is by default the system codepage.

The name is somewhat misleading, since the MBCS is also used for single-byte encodings.

See also

TUnicodeEncoding | UTF-16 unicode encoding
TUTF8Encoding | UTF-8 unicode encoding
TUTF7Encoding | UTF-7 unicode encoding
TBigendianUnicodeEncoding | Big-endian UTF-16 unicode encoding


TMBCSEncoding
TEncoding
 | ro | CodePage
 | ro | EncodingName
 | ro | IsSingleByte
 | ro | ANSI
 | ro | ASCII
 | ro | BigEndianUnicode
 | ro | Default
 | ro | Unicode
 | ro | UTF7
 | ro | UTF8


TMBCSEncoding
 | Create
 | Clone
 | GetMaxByteCount
 | GetMaxCharCount
 | GetPreamble
TEncoding
 | FreeEncodings
 | Clone
 | Convert
 | IsStandardEncoding
 | GetBufferEncoding
 | GetEncoding
 | GetMaxByteCount
 | GetMaxCharCount
 | GetPreamble
 | GetString


Clone (TEncoding)

Clone (TMBCSEncoding)

Convert (TEncoding)

Create (TMBCSEncoding)

FreeEncodings (TEncoding)

GetBufferEncoding (TEncoding)

GetEncoding (TEncoding)

GetMaxByteCount (TEncoding)

GetMaxByteCount (TMBCSEncoding)

GetMaxCharCount (TEncoding)

GetMaxCharCount (TMBCSEncoding)

GetPreamble (TEncoding)

GetPreamble (TMBCSEncoding)

GetString (TEncoding)

IsStandardEncoding (TEncoding)


TMBCSEncoding

TEncoding


TMBCSEncoding.Create

Create a new instance of a multi-byte character set encoding

Declaration

Source position: sysencodingh.inc line 115

public constructor TMBCSEncoding.Create; virtual; overload;

constructor TMBCSEncoding.Create(

  ACodePage: Integer

); virtual; overload;

constructor TMBCSEncoding.Create(

  ACodePage: Integer;

  MBToWCharFlags: Integer;

  WCharToMBFlags: Integer

); virtual; overload;

Description

Create instantiates a new instance of the multi-byte character set encoding. The ACodePage parameter is optional, and defaults to DefaultSystemCodePage.

The MBToWCharFlags and WCharToMBFlags parameters are stored but are otherwise unused in the Free Pascal implementation of TMBCSEncoding


TMultiReadExclusiveWriteSynchronizer

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Standard implementation of a IReadWriteSync interface

Declaration

Source position: systhrdh.inc line 40

type TMultiReadExclusiveWriteSynchronizer = class(TInterfacedObject, IReadWriteSync)
public
constructor Create; virtual; | Create a new instance of the TMultiReadExclusiveWriteSynchronizer class
destructor Destroy; override; | Destroys the TMultiReadExclusiveWriteSynchronizer instance
function Beginwrite; | Request write access to the resource.
procedure Endwrite; | Release write access to the resource
procedure Beginread; | Request read access to the resource
procedure Endread; | Release read access to the resource
end;

Inheritance

TMultiReadExclusiveWriteSynchronizer,IReadWriteSync | Standard implementation of a IReadWriteSync interface
|
TInterfacedObject,IUnknown | TObject descendent implementing the IUnknown interface
|
TObject | Base class of all classes.

Description

TMultiReadExclusiveWriteSynchronizer is a default implementation of the IReadWriteSync interface. It uses a single mutex to protect access to the read/write resource, resulting in a single thread having access to the resource.

See also

IReadWriteSync

Read/Write synchronizer


TMultiReadExclusiveWriteSynchronizer

TInterfacedObject

ro

RefCount

TObject


TMultiReadExclusiveWriteSynchronizer
 | Create
 | Destroy
 | Beginwrite
 | Endwrite
 | Beginread
 | Endread
TInterfacedObject
 | AfterConstruction
 | BeforeDestruction
 | NewInstance
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

AfterConstruction (TInterfacedObject)

BeforeDestruction (TObject)

BeforeDestruction (TInterfacedObject)

Beginread (TMultiReadExclusiveWriteSynchronizer)

Beginwrite (TMultiReadExclusiveWriteSynchronizer)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Create (TObject)

Create (TMultiReadExclusiveWriteSynchronizer)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Destroy (TMultiReadExclusiveWriteSynchronizer)

Dispatch (TObject)

DispatchStr (TObject)

Endread (TMultiReadExclusiveWriteSynchronizer)

Endwrite (TMultiReadExclusiveWriteSynchronizer)

Equals (TObject)

FieldAddress (TObject)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

NewInstance (TInterfacedObject)

SafeCallException (TObject)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)


TMultiReadExclusiveWriteSynchronizer

TInterfacedObject

TObject


TMultiReadExclusiveWriteSynchronizer.Beginread

Request read access to the resource

Declaration

Source position: systhrdh.inc line 53

public procedure TMultiReadExclusiveWriteSynchronizer.Beginread;

Description

BeginRead is the implementation of IReadWriteSync.BeginRead. It simply attempts to enter the critical section.

Errors

None.

See also

IReadWriteSync.BeginRead | Start a read operation.
EndRead | Release read access to the resource


TMultiReadExclusiveWriteSynchronizer.Beginwrite

Request write access to the resource.

Declaration

Source position: systhrdh.inc line 51

public function TMultiReadExclusiveWriteSynchronizer.Beginwrite: Boolean;

Description

Beginwrite is the implementation of IReadWriteSync.BeginWrite. It simply enters the critical section, and returns True.

Errors

None.

See also

IReadWriteSync.BeginWrite | Start a write operation.
EndWrite | Release write access to the resource


TMultiReadExclusiveWriteSynchronizer.Create

Create a new instance of the TMultiReadExclusiveWriteSynchronizer class

Declaration

Source position: systhrdh.inc line 49

public constructor TMultiReadExclusiveWriteSynchronizer.Create; virtual;

Description

Create creates a new instance of TMultiReadExclusiveWriteSynchronizer. It initializes a TRTLCriticalSection.

Errors

None.

See also

TRTLCriticalSection

A critical section.


TMultiReadExclusiveWriteSynchronizer.Destroy

Destroys the TMultiReadExclusiveWriteSynchronizer instance

Declaration

Source position: systhrdh.inc line 50

public destructor TMultiReadExclusiveWriteSynchronizer.Destroy; override;

Description

Create destroys the instance of TMultiReadExclusiveWriteSynchronizer. It frees the TRTLCriticalSection it initialized, and calls the inherited destructor.

Errors

None.

See also

TRTLCriticalSection

A critical section.


TMultiReadExclusiveWriteSynchronizer.Endread

Release read access to the resource

Declaration

Source position: systhrdh.inc line 54

public procedure TMultiReadExclusiveWriteSynchronizer.Endread;

Description

EndRead is the implementation of IReadWriteSync.EndRead. It simply leaves the critical section.

Errors

None.

See also

IReadWriteSync.EndRead | End a read operation
BeginRead | Request read access to the resource


TMultiReadExclusiveWriteSynchronizer.Endwrite

Release write access to the resource

Declaration

Source position: systhrdh.inc line 52

public procedure TMultiReadExclusiveWriteSynchronizer.Endwrite;

Description

Beginwrite is the implementation of IReadWriteSync.EndWrite. It simply leaves the critical section.

Errors

None.

See also

IReadWriteSync.EndWrite | End a write operation.
BeginWrite | Request write access to the resource.


TNativeIntHelper

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Helper for a NativeInt-typed ordinal value

Declaration

Source position: syshelph.inc line 523

type TNativeIntHelper = type helper
public
Const
MaxValue = 2147483647 | Maximum value for a NativeInt
MinValue = - 2147483648 | Minimum value for a NativeInt
class function Parse(); | Convert from a string
class function Size; | Size, in bytes, of the NativeInt value
class function ToString(); | Convert the value to string
class function TryParse(); | Try to convert a string to a NativeInt, report success or failure
function ToBoolean; | Convert to a boolean value
function ToDouble; | Convert to a double-sized floating point value
function ToExtended; | Convert to an extended-sized floating point value
function ToHexString(); | Convert to a hexadecimal string representation
function ToSingle; | Convert to an single-sized floating point value
end;

Inheritance

TNativeIntHelper

Helper for a NativeInt-typed ordinal value

Description

TNativeIntHelper contains some auxiliary routines for a NativeInt-typed ordinal value. It consists mainly of conversion routines to and from other types.

See also

TStringHelper | Helper type for strings.
TShortIntHelper | Helper for a ShortInt-typed ordinal value
TSmallIntHelper | Helper for a SmallInt-typed ordinal value
TWordHelper | Helper for a Word-typed ordinal value
TCardinalHelper | Helper for a Cardinal-typed ordinal value
TIntegerHelper | Helper for a Integer-typed ordinal value
TInt64Helper | Helper for a Int64-typed ordinal value
TQWordHelper | Helper for a QWord-typed ordinal value
TNativeIntHelper | Helper for a NativeInt-typed ordinal value
TByteHelper | Helper for a byte-typed ordinal value


TNativeIntHelper


TNativeIntHelper
 | Parse
 | Size
 | ToString
 | TryParse
 | ToBoolean
 | ToDouble
 | ToExtended
 | ToHexString
 | ToSingle


Parse (TNativeIntHelper)

Size (TNativeIntHelper)

ToBoolean (TNativeIntHelper)

ToDouble (TNativeIntHelper)

ToExtended (TNativeIntHelper)

ToHexString (TNativeIntHelper)

ToSingle (TNativeIntHelper)

ToString (TNativeIntHelper)

TryParse (TNativeIntHelper)


TNativeIntHelper.MaxValue

Maximum value for a NativeInt

Declaration

Source position: syshelph.inc line 530

public const TNativeIntHelper.MaxValue = 2147483647;

Description

MaxValue is the biggest value a NativeInt-typed value can contain.

See also

TNativeIntHelper.MinValue

Minimum value for a NativeInt


TNativeIntHelper.MinValue

Minimum value for a NativeInt

Declaration

Source position: syshelph.inc line 531

public const TNativeIntHelper.MinValue = - 2147483648;

Description

MinValue is the smallest value a NativeInt-typed value can contain.

See also

TNativeIntHelper.MaxValue

Maximum value for a NativeInt


TNativeIntHelper.Parse

Convert from a string

Declaration

Source position: syshelph.inc line 534

public class function TNativeIntHelper.Parse(

  const AString: string

):NativeInt;

Description

Parse will attempt to convert the string AString to a NativeInt value. It uses the StrToInt function to perform the conversion, so no localization is taken into account.

Errors

If the string does not contain a valid NativeInt value, an EConvertError exception is raised.

See also

TNativeIntHelper.ToString | Convert the value to string
TNativeIntHelper.TryParse | Try to convert a string to a NativeInt, report success or failure
StrToInt | Convert a string to an integer value.


TNativeIntHelper.Size

Size, in bytes, of the NativeInt value

Declaration

Source position: syshelph.inc line 535

public class function TNativeIntHelper.Size: Integer;

Description

Size returns the size (in NativeInts) of the NativeInt value. This is equivalent to SizeOf(NativeInt).

Errors

None.

See also

SizeOf

Return size of a variable or type.


TNativeIntHelper.ToBoolean

Convert to a boolean value

Declaration

Source position: syshelph.inc line 539

public function TNativeIntHelper.ToBoolean: Boolean;

Description

ToBoolean converts the NativeInt value to a boolean: it returns True if the value is nonzero, False if it is zero.

See also

TNativeIntHelper.ToSingle | Convert to an single-sized floating point value
TNativeIntHelper.ToDouble | Convert to a double-sized floating point value
TNativeIntHelper.ToExtended | Convert to an extended-sized floating point value
TNativeIntHelper.ToString | Convert the value to string
TNativeIntHelper.ToHexString | Convert to a hexadecimal string representation


TNativeIntHelper.ToDouble

Convert to a double-sized floating point value

Declaration

Source position: syshelph.inc line 540

public function TNativeIntHelper.ToDouble: Double;

Description

ToDouble converts the NativeInt value to a double-sized floating point value.

See also

TNativeIntHelper.ToBoolean | Convert to a boolean value
TNativeIntHelper.ToExtended | Convert to an extended-sized floating point value
TNativeIntHelper.ToSingle | Convert to an single-sized floating point value
TNativeIntHelper.ToString | Convert the value to string
TNativeIntHelper.ToHexString | Convert to a hexadecimal string representation


TNativeIntHelper.ToExtended

Convert to an extended-sized floating point value

Declaration

Source position: syshelph.inc line 541

public function TNativeIntHelper.ToExtended: Extended;

Description

ToDouble converts the NativeInt value to an extended-sized floating point value.

See also

TNativeIntHelper.ToBoolean | Convert to a boolean value
TNativeIntHelper.ToSingle | Convert to an single-sized floating point value
TNativeIntHelper.ToDouble | Convert to a double-sized floating point value
TNativeIntHelper.ToString | Convert the value to string
TNativeIntHelper.ToHexString | Convert to a hexadecimal string representation


TNativeIntHelper.ToHexString

Convert to a hexadecimal string representation

Declaration

Source position: syshelph.inc line 542

public function TNativeIntHelper.ToHexString(

  const AMinDigits: Integer

):string; overload;

function TNativeIntHelper.ToHexString: string; overload;

Description

ToHexString converts the NativeInt value to a hexadecimal string representation. The AMinDigits argument specifies the minimal number of characters in the resulting string. The string will be left-padded with zeroes if the representation contains less than AMinDigits characters.

See also

TNativeIntHelper.ToBoolean | Convert to a boolean value
TNativeIntHelper.ToSingle | Convert to an single-sized floating point value
TNativeIntHelper.ToDouble | Convert to a double-sized floating point value
TNativeIntHelper.ToString | Convert the value to string
TNativeIntHelper.ToExtended | Convert to an extended-sized floating point value


TNativeIntHelper.ToSingle

Convert to an single-sized floating point value

Declaration

Source position: syshelph.inc line 544

public function TNativeIntHelper.ToSingle: Single;

Description

ToSingle converts the NativeInt value to a single-sized floating point value.

See also

TNativeIntHelper.ToBoolean | Convert to a boolean value
TNativeIntHelper.ToDouble | Convert to a double-sized floating point value
TNativeIntHelper.ToExtended | Convert to an extended-sized floating point value
TNativeIntHelper.ToString | Convert the value to string
TNativeIntHelper.ToHexString | Convert to a hexadecimal string representation


TNativeIntHelper.ToString

Convert the value to string

Declaration

Source position: syshelph.inc line 536

public class function TNativeIntHelper.ToString(

  const AValue: NativeInt

):string; overload;

function TNativeIntHelper.ToString: string; overload;

Description

ToString will, in the class function variant of this method, convert AValue to a string representation. In the regular method overloaded version of ToString, the NativeInt value itself is used. The IntToStr function is used to do the conversion.

See also

TNativeIntHelper.Parse | Convert from a string
IntToStr | Convert an integer value to a decimal string.


TNativeIntHelper.TryParse

Try to convert a string to a NativeInt, report success or failure

Declaration

Source position: syshelph.inc line 537

public class function TNativeIntHelper.TryParse(

  const AString: string;

  out AValue: NativeInt

):Boolean;

Description

TryParse attempts to convert the string AString to a NativeInt, and reports the success of the attempt. If the attempt is succesful, then True is returned, and the actual value of the NativeInt is returned in AValue.

It uses the val function to perform the conversion, so no localization is taken into account.

See also

TNativeIntHelper.Parse | Convert from a string
Val | Calculate numerical/enumerated value of a string.


TNativeUIntHelper

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Helper for a NativeUInt-typed ordinal value

Declaration

Source position: syshelph.inc line 548

type TNativeUIntHelper = type helper
public
Const
MaxValue = 4294967295 | Maximum value for a NativeUInt
MinValue = 0 | Minimum value for a NativeUInt
class function Parse(); | Convert from a string
class function Size; | Size, in bytes, of the NativeUInt value
class function ToString(); | Convert the value to string
class function TryParse(); | Try to convert a string to a NativeUInt, report success or failure
function ToBoolean; | Convert to a boolean value
function ToDouble; | Convert to a double-sized floating point value
function ToExtended; | Convert to an extended-sized floating point value
function ToHexString(); | Convert to a hexadecimal string representation
function ToSingle; | Convert to an single-sized floating point value
end;

Inheritance

TNativeUIntHelper

Helper for a NativeUInt-typed ordinal value

Description

NativeUInt contains some auxiliary routines for a NativeUInt-typed ordinal value. It consists mainly of conversion routines to and from other types.

See also

TStringHelper | Helper type for strings.
TShortIntHelper | Helper for a ShortInt-typed ordinal value
TSmallIntHelper | Helper for a SmallInt-typed ordinal value
TWordHelper | Helper for a Word-typed ordinal value
TCardinalHelper | Helper for a Cardinal-typed ordinal value
TIntegerHelper | Helper for a Integer-typed ordinal value
TInt64Helper | Helper for a Int64-typed ordinal value
TQWordHelper | Helper for a QWord-typed ordinal value
TNativeIntHelper | Helper for a NativeInt-typed ordinal value
TByteHelper | Helper for a byte-typed ordinal value


TNativeUIntHelper


TNativeUIntHelper
 | Parse
 | Size
 | ToString
 | TryParse
 | ToBoolean
 | ToDouble
 | ToExtended
 | ToHexString
 | ToSingle


Parse (TNativeUIntHelper)

Size (TNativeUIntHelper)

ToBoolean (TNativeUIntHelper)

ToDouble (TNativeUIntHelper)

ToExtended (TNativeUIntHelper)

ToHexString (TNativeUIntHelper)

ToSingle (TNativeUIntHelper)

ToString (TNativeUIntHelper)

TryParse (TNativeUIntHelper)


TNativeUIntHelper.MaxValue

Maximum value for a NativeUInt

Declaration

Source position: syshelph.inc line 554

public const TNativeUIntHelper.MaxValue = 4294967295;

Description

MaxValue is the biggest value a NativeUInt-typed value can contain.

See also

NativeUInt.MinValue


TNativeUIntHelper.MinValue

Minimum value for a NativeUInt

Declaration

Source position: syshelph.inc line 556

public const TNativeUIntHelper.MinValue = 0;

Description

MinValue is the smallest value a NativeUInt-typed value can contain.

See also

NativeUInt.MaxValue


TNativeUIntHelper.Parse

Convert from a string

Declaration

Source position: syshelph.inc line 558

public class function TNativeUIntHelper.Parse(

  const AString: string

):NativeUInt;

Description

Parse will attempt to convert the string AString to a NativeUInt value. It uses the StrToInt function to perform the conversion, so no localization is taken into account.

Errors

If the string does not contain a valid NativeUInt value, an EConvertError exception is raised.

See also

NativeUInt.ToString

NativeUInt.TryParse

StrToInt

Convert a string to an integer value.


TNativeUIntHelper.Size

Size, in bytes, of the NativeUInt value

Declaration

Source position: syshelph.inc line 559

public class function TNativeUIntHelper.Size: Integer;

Description

Size returns the size (in NativeUInts) of the NativeUInt value. This is equivalent to SizeOf(NativeUInt).

Errors

None.

See also

SizeOf

Return size of a variable or type.


TNativeUIntHelper.ToBoolean

Convert to a boolean value

Declaration

Source position: syshelph.inc line 563

public function TNativeUIntHelper.ToBoolean: Boolean;

Description

ToBoolean converts the NativeUInt value to a boolean: it returns True if the value is nonzero, False if it is zero.

See also

NativeUInt.ToSingle

NativeUInt.ToDouble

NativeUInt.ToExtended

NativeUInt.ToString

NativeUInt.ToHexString


TNativeUIntHelper.ToDouble

Convert to a double-sized floating point value

Declaration

Source position: syshelph.inc line 564

public function TNativeUIntHelper.ToDouble: Double;

Description

ToDouble converts the NativeUInt value to a double-sized floating point value.

See also

NativeUInt.ToBoolean

NativeUInt.ToExtended

NativeUInt.ToSingle

NativeUInt.ToString

NativeUInt.ToHexString


TNativeUIntHelper.ToExtended

Convert to an extended-sized floating point value

Declaration

Source position: syshelph.inc line 565

public function TNativeUIntHelper.ToExtended: Extended;

Description

ToDouble converts the NativeUInt value to an extended-sized floating point value.

See also

NativeUInt.ToBoolean

NativeUInt.ToSingle

NativeUInt.ToDouble

NativeUInt.ToString

NativeUInt.ToHexString


TNativeUIntHelper.ToHexString

Convert to a hexadecimal string representation

Declaration

Source position: syshelph.inc line 566

public function TNativeUIntHelper.ToHexString(

  const AMinDigits: Integer

):string; overload;

function TNativeUIntHelper.ToHexString: string; overload;

Description

ToHexString converts the NativeUInt value to a hexadecimal string representation. The AMinDigits argument specifies the minimal number of characters in the resulting string. The string will be left-padded with zeroes if the representation contains less than AMinDigits characters.

See also

NativeUInt.ToBoolean

NativeUInt.ToSingle

NativeUInt.ToDouble

NativeUInt.ToString

NativeUInt.ToExtended


TNativeUIntHelper.ToSingle

Convert to an single-sized floating point value

Declaration

Source position: syshelph.inc line 568

public function TNativeUIntHelper.ToSingle: Single;

Description

ToSingle converts the NativeUInt value to a single-sized floating point value.

See also

NativeUInt.ToBoolean

NativeUInt.ToDouble

NativeUInt.ToExtended

NativeUInt.ToString

NativeUInt.ToHexString


TNativeUIntHelper.ToString

Convert the value to string

Declaration

Source position: syshelph.inc line 560

public class function TNativeUIntHelper.ToString(

  const AValue: NativeUInt

):string; overload;

function TNativeUIntHelper.ToString: string; overload;

Description

ToString will, in the class function variant of this method, convert AValue to a string representation. In the regular method overloaded version of ToString, the NativeUInt value itself is used. The IntToStr function is used to do the conversion.

See also

NativeUInt.Parse

IntToStr

Convert an integer value to a decimal string.


TNativeUIntHelper.TryParse

Try to convert a string to a NativeUInt, report success or failure

Declaration

Source position: syshelph.inc line 561

public class function TNativeUIntHelper.TryParse(

  const AString: string;

  out AValue: NativeUInt

):Boolean;

Description

TryParse attempts to convert the string AString to a NativeUInt, and reports the success of the attempt. If the attempt is succesful, then True is returned, and the actual value of the NativeUInt is returned in AValue.

It uses the val function to perform the conversion, so no localization is taken into account.

See also

NativeUInt.Parse

Val

Calculate numerical/enumerated value of a string.


TQWordHelper

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Helper for a QWord-typed ordinal value

Declaration

Source position: syshelph.inc line 503

type TQWordHelper = type helper
public
Const
MaxValue = 18446744073709551615 | Maximum value for a QWord
MinValue = 0 | Minimum value for a QWord
class function Parse(); | Convert from a string
class function Size; | Size, in bytes, of the QWord value
class function ToString(); | Convert the value to string
class function TryParse(); | Try to convert a string to a QWord, report success or failure
function ToBoolean; | Convert to a boolean value
function ToDouble; | Convert to a double-sized floating point value
function ToExtended; | Convert to an extended-sized floating point value
function ToHexString(); | Convert to a hexadecimal string representation
function ToSingle; | Convert to an single-sized floating point value
end;

Inheritance

TQWordHelper

Helper for a QWord-typed ordinal value

Description

TQWordHelper contains some auxiliary routines for a QWord-typed ordinal value. It consists mainly of conversion routines to and from other types.

See also

TStringHelper | Helper type for strings.
TShortIntHelper | Helper for a ShortInt-typed ordinal value
TSmallIntHelper | Helper for a SmallInt-typed ordinal value
TWordHelper | Helper for a Word-typed ordinal value
TCardinalHelper | Helper for a Cardinal-typed ordinal value
TIntegerHelper | Helper for a Integer-typed ordinal value
TInt64Helper | Helper for a Int64-typed ordinal value
TByteHelper | Helper for a byte-typed ordinal value
TNativeIntHelper | Helper for a NativeInt-typed ordinal value
TNativeUIntHelper | Helper for a NativeUInt-typed ordinal value


TQWordHelper


TQWordHelper
 | Parse
 | Size
 | ToString
 | TryParse
 | ToBoolean
 | ToDouble
 | ToExtended
 | ToHexString
 | ToSingle


Parse (TQWordHelper)

Size (TQWordHelper)

ToBoolean (TQWordHelper)

ToDouble (TQWordHelper)

ToExtended (TQWordHelper)

ToHexString (TQWordHelper)

ToSingle (TQWordHelper)

ToString (TQWordHelper)

TryParse (TQWordHelper)


TQWordHelper.MaxValue

Maximum value for a QWord

Declaration

Source position: syshelph.inc line 506

public const TQWordHelper.MaxValue = 18446744073709551615;

Description

MaxValue is the biggest value a QWord-typed value can contain.

See also

TQWordHelper.MinValue

Minimum value for a QWord


TQWordHelper.MinValue

Minimum value for a QWord

Declaration

Source position: syshelph.inc line 507

public const TQWordHelper.MinValue = 0;

Description

MinValue is the smallest value a QWord-typed value can contain.

See also

TQWordHelper.MaxValue

Maximum value for a QWord


TQWordHelper.Parse

Convert from a string

Declaration

Source position: syshelph.inc line 509

public class function TQWordHelper.Parse(

  const AString: string

):QWord;

Description

Parse will attempt to convert the string AString to a QWord value. It uses the StrToQWord function to perform the conversion, so no localization is taken into account.

Errors

If the string does not contain a valid QWord value, an EConvertError exception is raised.

See also

TQWordHelper.ToString | Convert the value to string
TQWordHelper.TryParse | Try to convert a string to a QWord, report success or failure
StrToQWord | Convert a string to a QWord.


TQWordHelper.Size

Size, in bytes, of the QWord value

Declaration

Source position: syshelph.inc line 510

public class function TQWordHelper.Size: Integer;

Description

Size returns the size (in QWords) of the QWord value. This is equivalent to SizeOf(QWord).

Errors

None.

See also

SizeOf

Return size of a variable or type.


TQWordHelper.ToBoolean

Convert to a boolean value

Declaration

Source position: syshelph.inc line 514

public function TQWordHelper.ToBoolean: Boolean;

Description

ToBoolean converts the QWord value to a boolean: it returns True if the value is nonzero, False if it is zero.

See also

TQWordHelper.ToSingle | Convert to an single-sized floating point value
TQWordHelper.ToDouble | Convert to a double-sized floating point value
TQWordHelper.ToExtended | Convert to an extended-sized floating point value
TQWordHelper.ToString | Convert the value to string
TQWordHelper.ToHexString | Convert to a hexadecimal string representation


TQWordHelper.ToDouble

Convert to a double-sized floating point value

Declaration

Source position: syshelph.inc line 515

public function TQWordHelper.ToDouble: Double;

Description

ToDouble converts the QWord value to a double-sized floating point value.

See also

TQWordHelper.ToBoolean | Convert to a boolean value
TQWordHelper.ToExtended | Convert to an extended-sized floating point value
TQWordHelper.ToSingle | Convert to an single-sized floating point value
TQWordHelper.ToString | Convert the value to string
TQWordHelper.ToHexString | Convert to a hexadecimal string representation


TQWordHelper.ToExtended

Convert to an extended-sized floating point value

Declaration

Source position: syshelph.inc line 516

public function TQWordHelper.ToExtended: Extended;

Description

ToDouble converts the QWord value to an extended-sized floating point value.

See also

TQWordHelper.ToBoolean | Convert to a boolean value
TQWordHelper.ToSingle | Convert to an single-sized floating point value
TQWordHelper.ToDouble | Convert to a double-sized floating point value
TQWordHelper.ToString | Convert the value to string
TQWordHelper.ToHexString | Convert to a hexadecimal string representation


TQWordHelper.ToHexString

Convert to a hexadecimal string representation

Declaration

Source position: syshelph.inc line 517

public function TQWordHelper.ToHexString(

  const AMinDigits: Integer

):string; overload;

function TQWordHelper.ToHexString: string; overload;

Description

ToHexString converts the QWord value to a hexadecimal string representation. The AMinDigits argument specifies the minimal number of characters in the resulting string. The string will be left-padded with zeroes if the representation contains less than AMinDigits characters.

See also

TQWordHelper.ToBoolean | Convert to a boolean value
TQWordHelper.ToSingle | Convert to an single-sized floating point value
TQWordHelper.ToDouble | Convert to a double-sized floating point value
TQWordHelper.ToString | Convert the value to string
TQWordHelper.ToExtended | Convert to an extended-sized floating point value


TQWordHelper.ToSingle

Convert to an single-sized floating point value

Declaration

Source position: syshelph.inc line 519

public function TQWordHelper.ToSingle: Single;

Description

ToSingle converts the QWord value to a single-sized floating point value.

See also

TQWordHelper.ToBoolean | Convert to a boolean value
TQWordHelper.ToDouble | Convert to a double-sized floating point value
TQWordHelper.ToExtended | Convert to an extended-sized floating point value
TQWordHelper.ToString | Convert the value to string
TQWordHelper.ToHexString | Convert to a hexadecimal string representation


TQWordHelper.ToString

Convert the value to string

Declaration

Source position: syshelph.inc line 511

public class function TQWordHelper.ToString(

  const AValue: QWord

):string; overload;

function TQWordHelper.ToString: string; overload;

Description

ToString will, in the class function variant of this method, convert AValue to a string representation. In the regular method overloaded version of ToString, the QWord value itself is used. The IntToStr function is used to do the conversion.

See also

TQWordHelper.Parse | Convert from a string
IntToStr | Convert an integer value to a decimal string.


TQWordHelper.TryParse

Try to convert a string to a QWord, report success or failure

Declaration

Source position: syshelph.inc line 512

public class function TQWordHelper.TryParse(

  const AString: string;

  out AValue: QWord

):Boolean;

Description

TryParse attempts to convert the string AString to a QWord, and reports the success of the attempt. If the attempt is succesful, then True is returned, and the actual value of the QWord is returned in AValue.

It uses the val function to perform the conversion, so no localization is taken into account.

See also

TQWordHelper.Parse | Convert from a string
Val | Calculate numerical/enumerated value of a string.


TShortIntHelper

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Helper for a ShortInt-typed ordinal value

Declaration

Source position: syshelph.inc line 383

type TShortIntHelper = type helper
public
Const
MaxValue = 127 | Maximum value for a ShortInt
MinValue = - 128 | Minimum value for a ShortInt
class function Parse(); | Convert from a string
class function Size; | Size, in bytes, of the ShortInt value
class function ToString(); | Convert the value to string
class function TryParse(); | Try to convert a string to a ShortInt, report success or failure
function ToBoolean; | Convert to a boolean value
function ToDouble; | Convert to a double-sized floating point value
function ToExtended; | Convert to an extended-sized floating point value
function ToHexString(); | Convert to a hexadecimal string representation
function ToSingle; | Convert to an single-sized floating point value
end;

Inheritance

TShortIntHelper

Helper for a ShortInt-typed ordinal value

Description

TShortIntHelper contains some auxiliary routines for a ShortInt-typed ordinal value. It consists mainly of conversion routines to and from other types.

See also

TStringHelper | Helper type for strings.
TByteHelper | Helper for a byte-typed ordinal value
TSmallIntHelper | Helper for a SmallInt-typed ordinal value
TWordHelper | Helper for a Word-typed ordinal value
TCardinalHelper | Helper for a Cardinal-typed ordinal value
TIntegerHelper | Helper for a Integer-typed ordinal value
TInt64Helper | Helper for a Int64-typed ordinal value
TQWordHelper | Helper for a QWord-typed ordinal value
TNativeIntHelper | Helper for a NativeInt-typed ordinal value
TNativeUIntHelper | Helper for a NativeUInt-typed ordinal value


TShortIntHelper


TShortIntHelper
 | Parse
 | Size
 | ToString
 | TryParse
 | ToBoolean
 | ToDouble
 | ToExtended
 | ToHexString
 | ToSingle


Parse (TShortIntHelper)

Size (TShortIntHelper)

ToBoolean (TShortIntHelper)

ToDouble (TShortIntHelper)

ToExtended (TShortIntHelper)

ToHexString (TShortIntHelper)

ToSingle (TShortIntHelper)

ToString (TShortIntHelper)

TryParse (TShortIntHelper)


TShortIntHelper.MaxValue

Maximum value for a ShortInt

Declaration

Source position: syshelph.inc line 386

public const TShortIntHelper.MaxValue = 127;

Description

MaxValue is the biggest value a ShortInt-typed value can contain.

See also

TShortIntHelper.MinValue

Minimum value for a ShortInt


TShortIntHelper.MinValue

Minimum value for a ShortInt

Declaration

Source position: syshelph.inc line 387

public const TShortIntHelper.MinValue = - 128;

Description

MinValue is the smallest value a ShortInt-typed value can contain.

See also

TShortIntHelper.MaxValue

Maximum value for a ShortInt


TShortIntHelper.Parse

Convert from a string

Declaration

Source position: syshelph.inc line 389

public class function TShortIntHelper.Parse(

  const AString: string

):ShortInt;

Description

Parse will attempt to convert the string AString to a ShortInt value. It uses the StrToInt function to perform the conversion, so no localization is taken into account.

Errors

If the string does not contain a valid ShortInt value, an EConvertError exception is raised.

See also

TShortIntHelper.ToString | Convert the value to string
TShortIntHelper.TryParse | Try to convert a string to a ShortInt, report success or failure
StrToInt | Convert a string to an integer value.


TShortIntHelper.Size

Size, in bytes, of the ShortInt value

Declaration

Source position: syshelph.inc line 390

public class function TShortIntHelper.Size: Integer;

Description

Size returns the size (in ShortInts) of the ShortInt value. This is equivalent to SizeOf(Byte).

Errors

None.

See also

SizeOf

Return size of a variable or type.


TShortIntHelper.ToBoolean

Convert to a boolean value

Declaration

Source position: syshelph.inc line 394

public function TShortIntHelper.ToBoolean: Boolean;

Description

ToBoolean converts the ShortInt value to a boolean: it returns True if the value is nonzero, False if it is zero.

See also

TShortIntHelper.ToSingle | Convert to an single-sized floating point value
TShortIntHelper.ToDouble | Convert to a double-sized floating point value
TShortIntHelper.ToExtended | Convert to an extended-sized floating point value
TShortIntHelper.ToString | Convert the value to string
TShortIntHelper.ToHexString | Convert to a hexadecimal string representation


TShortIntHelper.ToDouble

Convert to a double-sized floating point value

Declaration

Source position: syshelph.inc line 395

public function TShortIntHelper.ToDouble: Double;

Description

ToDouble converts the ShortInt value to a double-sized floating point value.

See also

TShortIntHelper.ToBoolean | Convert to a boolean value
TShortIntHelper.ToExtended | Convert to an extended-sized floating point value
TShortIntHelper.ToSingle | Convert to an single-sized floating point value
TShortIntHelper.ToString | Convert the value to string
TShortIntHelper.ToHexString | Convert to a hexadecimal string representation


TShortIntHelper.ToExtended

Convert to an extended-sized floating point value

Declaration

Source position: syshelph.inc line 396

public function TShortIntHelper.ToExtended: Extended;

Description

ToDouble converts the ShortInt value to an extended-sized floating point value.

See also

TShortIntHelper.ToBoolean | Convert to a boolean value
TShortIntHelper.ToSingle | Convert to an single-sized floating point value
TShortIntHelper.ToDouble | Convert to a double-sized floating point value
TShortIntHelper.ToString | Convert the value to string
TShortIntHelper.ToHexString | Convert to a hexadecimal string representation


TShortIntHelper.ToHexString

Convert to a hexadecimal string representation

Declaration

Source position: syshelph.inc line 397

public function TShortIntHelper.ToHexString(

  const AMinDigits: Integer

):string; overload;

function TShortIntHelper.ToHexString: string; overload;

Description

ToHexString converts the ShortInt value to a hexadecimal string representation. The AMinDigits argument specifies the minimal number of characters in the resulting string. The string will be left-padded with zeroes if the representation contains less than AMinDigits characters.

See also

TShortIntHelper.ToBoolean | Convert to a boolean value
TShortIntHelper.ToSingle | Convert to an single-sized floating point value
TShortIntHelper.ToDouble | Convert to a double-sized floating point value
TShortIntHelper.ToString | Convert the value to string
TShortIntHelper.ToExtended | Convert to an extended-sized floating point value


TShortIntHelper.ToSingle

Convert to an single-sized floating point value

Declaration

Source position: syshelph.inc line 399

public function TShortIntHelper.ToSingle: Single;

Description

ToSingle converts the ShortInt value to a single-sized floating point value.

See also

TShortIntHelper.ToBoolean | Convert to a boolean value
TShortIntHelper.ToDouble | Convert to a double-sized floating point value
TShortIntHelper.ToExtended | Convert to an extended-sized floating point value
TShortIntHelper.ToString | Convert the value to string
TShortIntHelper.ToHexString | Convert to a hexadecimal string representation


TShortIntHelper.ToString

Convert the value to string

Declaration

Source position: syshelph.inc line 391

public class function TShortIntHelper.ToString(

  const AValue: ShortInt

):string; overload;

function TShortIntHelper.ToString: string; overload;

Description

ToString will, in the class function variant of this method, convert AValue to a string representation. In the regular method overloaded version of ToString, the ShortInt value itself is used. The IntToStr function is used to do the conversion.

See also

TShortIntHelper.Parse | Convert from a string
IntToStr | Convert an integer value to a decimal string.


TShortIntHelper.TryParse

Try to convert a string to a ShortInt, report success or failure

Declaration

Source position: syshelph.inc line 392

public class function TShortIntHelper.TryParse(

  const AString: string;

  out AValue: ShortInt

):Boolean;

Description

TryParse attempts to convert the string AString to a ShortInt, and reports the success of the attempt. If the attempt is succesful, then True is returned, and the actual value of the ShortInt is returned in AValue.

It uses the val function to perform the conversion, so no localization is taken into account.

See also

TShortIntHelper.Parse | Convert from a string
Val | Calculate numerical/enumerated value of a string.


TSimpleRWSync

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Read/Write synchronizing object.

Declaration

Source position: systhrdh.inc line 26

type TSimpleRWSync = class(TInterfacedObject, IReadWriteSync)
public
constructor Create; virtual; | Create a new instance of TSimpleRWSync
destructor Destroy; override; | Removes the TSimpleRWSync instance from memory
function Beginwrite; | Acquire a write lock
procedure Endwrite; | Release the write lock
procedure Beginread; | Acquire a read lock
procedure Endread; | Release the read lock
end;

Inheritance

TSimpleRWSync,IReadWriteSync | Read/Write synchronizing object.
|
TInterfacedObject,IUnknown | TObject descendent implementing the IUnknown interface
|
TObject | Base class of all classes.

Description

TSimpleRWSync implements a simple read/write locking mechanism. It controls access to an object: only a single thread is allowed access to an object for either read or write operations.

Access is controlled through a single critical section.

See also

TMultiReadExclusiveWriteSynchronizer

Standard implementation of a IReadWriteSync interface


TSimpleRWSync

TInterfacedObject

ro

RefCount

TObject


TSimpleRWSync
 | Create
 | Destroy
 | Beginwrite
 | Endwrite
 | Beginread
 | Endread
TInterfacedObject
 | AfterConstruction
 | BeforeDestruction
 | NewInstance
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


AfterConstruction (TObject)

AfterConstruction (TInterfacedObject)

BeforeDestruction (TObject)

BeforeDestruction (TInterfacedObject)

Beginread (TSimpleRWSync)

Beginwrite (TSimpleRWSync)

ClassInfo (TObject)

ClassName (TObject)

ClassNameIs (TObject)

ClassParent (TObject)

ClassType (TObject)

CleanupInstance (TObject)

Create (TObject)

Create (TSimpleRWSync)

DefaultHandler (TObject)

DefaultHandlerStr (TObject)

Destroy (TObject)

Destroy (TSimpleRWSync)

Dispatch (TObject)

DispatchStr (TObject)

Endread (TSimpleRWSync)

Endwrite (TSimpleRWSync)

Equals (TObject)

FieldAddress (TObject)

Free (TObject)

FreeInstance (TObject)

GetHashCode (TObject)

GetInterface (TObject)

GetInterfaceByStr (TObject)

GetInterfaceEntry (TObject)

GetInterfaceEntryByStr (TObject)

GetInterfaceTable (TObject)

GetInterfaceWeak (TObject)

InheritsFrom (TObject)

InitInstance (TObject)

InstanceSize (TObject)

MethodAddress (TObject)

MethodName (TObject)

newinstance (TObject)

NewInstance (TInterfacedObject)

SafeCallException (TObject)

StringMessageTable (TObject)

ToString (TObject)

UnitName (TObject)


TSimpleRWSync

TInterfacedObject

TObject


TSimpleRWSync.Beginread

Acquire a read lock

Declaration

Source position: systhrdh.inc line 35

public procedure TSimpleRWSync.Beginread;

Description

BeginRead waits till all other threads have released their read or write locks on the object, and then aquires a read lock on the object.

See also

TSimpleRWSync.BeginWrite | Acquire a write lock
TSimpleRWSync.EndRead | Release the read lock


TSimpleRWSync.Beginwrite

Acquire a write lock

Declaration

Source position: systhrdh.inc line 33

public function TSimpleRWSync.Beginwrite: Boolean;

Description

Beginwrite waits till all other threads have released their read or write locks on the object, and then aquires a write lock on the object.

See also

TSimpleRWSync.BeginRead | Acquire a read lock
TSimpleRWSync.EndWrite | Release the write lock


TSimpleRWSync.Create

Create a new instance of TSimpleRWSync

Declaration

Source position: systhrdh.inc line 31

public constructor TSimpleRWSync.Create; virtual;

Description

Create allocates a new instance of TSimpleRWSync and initializes the critical section for use in the various methods.

See also

TSimpleRWSync.Destroy

Removes the TSimpleRWSync instance from memory


TSimpleRWSync.Destroy

Removes the TSimpleRWSync instance from memory

Declaration

Source position: systhrdh.inc line 32

public destructor TSimpleRWSync.Destroy; override;

Description

Destroy releases the critical section and removes the TSimpleRWSync instance from memory.

See also

TSimpleRWSync.Create

Create a new instance of TSimpleRWSync


TSimpleRWSync.Endread

Release the read lock

Declaration

Source position: systhrdh.inc line 36

public procedure TSimpleRWSync.Endread;

Description

EndRead releases the current threads read lock on the object, allowing other threads to acquire a read or write lock on the object.

See also

TSimpleRWSync.BeginRead | Acquire a read lock
TSimpleRWSync.EndWrite | Release the write lock


TSimpleRWSync.Endwrite

Release the write lock

Declaration

Source position: systhrdh.inc line 34

public procedure TSimpleRWSync.Endwrite;

Description

EndWrite releases the current threads lock on the object, allowing other threads to acquire a read or write lock on the object.

See also

TSimpleRWSync.BeginWrite | Acquire a write lock
TSimpleRWSync.EndRead | Release the read lock


TSingleHelper

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Helper for Single floating point type

Declaration

Source position: syshelph.inc line 181

type TSingleHelper = type helper
function GetB();
function GetW();
function GetE;
function GetF;
function GetS;
procedure SetB();
procedure SetW();
procedure SetE();
procedure SetF();
procedure SetS();
public
Const
Epsilon = Epsilon; = 1.4012984643248170709e-45 | Precision for this floating point type
MaxValue = MaxValue; = 340282346638528859811704183484516925440.0 | Largest possible value for the Single floating point type
MinValue = MinValue; = - 340282346638528859811704183484516925440.0 | Smallest (negative) possible value for the Single floating point type
PositiveInfinity = PositiveInfinity; = 1.0 / 0.0 | Positive infinity as represented by a single floating point type
NegativeInfinity = NegativeInfinity; = (- 1.0) / (0.0) | Negative infinity as represented by a single floating point type
NaN = NaN; = 0.0 / 0.0 | Representation of NaN (Not a Number)
class function IsNan(); | Check whether a value equals NaN.
class function IsInfinity(); | Check whether a value is positive or negative infinity.
class function IsNegativeInfinity(); | Check whether a value is negative infinity.
class function IsPositiveInfinity(); | Check whether a value is positive infinity.
class function Parse(); | Convert a string to a floating point value
class function Size; | Size (in bytes) of a single-sized floating point value.
class function ToString(); | Convert a single-sized floating point value to a string
class function TryParse(); | Try to convert a string to a single-sized floating point value.
procedure BuildUp(); | Build a single-sized floating point from its composing parts
function Exponent; | Exponent of the floating-point value
function Fraction; | Fraction of the floating-point value
function Mantissa; | Mantissa of the floating-point
function SpecialType; | Return the type of the single-sized floating point value
property Bytes []: Byte; [rw] | Indexed access to the individual bytes of the floating point value
property Words []: Word; [rw] | Indexed access to the words that make up the floating point value
property Sign: Boolean; [rw] | Sign of the floating point value
property Exp: QWord; [rw] | The bit pattern of the exponent as stored in memory.
property Frac: QWord; [rw] | Bitpattern that makes up the fractional part.
end;

Inheritance

TSingleHelper

Helper for Single floating point type

Description

TSingleHelper is the helper type for the single-sized floating point type. It contains some conversion methods, as well as access to the low-level structure of the floating-point representation of a single.

See also

TDoubleHelper | Helper for Double floating point type
TExtendedHelper | Helper for Extended floating point type


TSingleHelper
 | Bytes
 | Words
 | Sign
 | Exp
 | Frac


Bytes (TSingleHelper)

Exp (TSingleHelper)

Frac (TSingleHelper)

Sign (TSingleHelper)

Words (TSingleHelper)


TSingleHelper
 | GetB
 | GetW
 | GetE
 | GetF
 | GetS
 | SetB
 | SetW
 | SetE
 | SetF
 | SetS
 | IsNan
 | IsInfinity
 | IsNegativeInfinity
 | IsPositiveInfinity
 | Parse
 | Size
 | ToString
 | TryParse
 | BuildUp
 | Exponent
 | Fraction
 | Mantissa
 | SpecialType


BuildUp (TSingleHelper)

Exponent (TSingleHelper)

Fraction (TSingleHelper)

GetB (TSingleHelper)

GetE (TSingleHelper)

GetF (TSingleHelper)

GetS (TSingleHelper)

GetW (TSingleHelper)

IsInfinity (TSingleHelper)

IsNan (TSingleHelper)

IsNegativeInfinity (TSingleHelper)

IsPositiveInfinity (TSingleHelper)

Mantissa (TSingleHelper)

Parse (TSingleHelper)

SetB (TSingleHelper)

SetE (TSingleHelper)

SetF (TSingleHelper)

SetS (TSingleHelper)

SetW (TSingleHelper)

Size (TSingleHelper)

SpecialType (TSingleHelper)

ToString (TSingleHelper)

TryParse (TSingleHelper)


TSingleHelper


TSingleHelper.BuildUp

Build a single-sized floating point from its composing parts

Declaration

Source position: syshelph.inc line 219

public procedure TSingleHelper.BuildUp(

  const ASignFlag: Boolean;

  const AMantissa: QWord;

  const AExponent: Integer

);

Description

BuildUp will compose a single-sized floating point value from the sign ASignFlag, mantissa AMantissa and exponent AExponent. It simply sets the Sign, Exp and Frac properties in 1 call.

See also

TSingleHelper.Sign | Sign of the floating point value
TSingleHelper.Exp | The bit pattern of the exponent as stored in memory.
TSingleHelper.Frac | Bitpattern that makes up the fractional part.


TSingleHelper.Bytes

Indexed access to the individual bytes of the floating point value

Declaration

Source position: syshelph.inc line 233

public property TSingleHelper.Bytes[AIndex: Cardinal] : Byte
  read GetB
  write SetB;

Description

Bytes can be used to get or set the various bytes that make up the single-sized floating point value. The index runs from 0 to Size-1.

See also

TSingleHelper.Words | Indexed access to the words that make up the floating point value
TSingleHelper.Size | Size (in bytes) of a single-sized floating point value.


TSingleHelper.Epsilon

Precision for this floating point type

Declaration

Source position: syshelph.inc line 197

public const TSingleHelper.Epsilon: Single = 1.4012984643248170709e-45;

Description

Epsilon returns the precision of the floating point value : differences smaller than this value cannot be detected or represented. It can also be viewed as the smallest positive value that can be represented.

See also

TSingleHelper.MinValue | Smallest (negative) possible value for the Single floating point type
TSingleHelper.MaxValue | Largest possible value for the Single floating point type


TSingleHelper.Exp

The bit pattern of the exponent as stored in memory.

Declaration

Source position: syshelph.inc line 236

public property TSingleHelper.Exp : QWord
  read GetE
  write SetE;

Description

Exp is the internal representation of the Exponent.

See also

TSingleHelper.Bytes | Indexed access to the individual bytes of the floating point value
TSingleHelper.Sign | Sign of the floating point value
TSingleHelper.Frac | Bitpattern that makes up the fractional part.
TSingleHelper.Mantissa | Mantissa of the floating-point
TSingleHelper.Fraction | Fraction of the floating-point value
TSingleHelper.Exponent | Exponent of the floating-point value


TSingleHelper.Exponent

Exponent of the floating-point value

Declaration

Source position: syshelph.inc line 220

public function TSingleHelper.Exponent: Integer;

Description

Exponent is the value X in the representation of the floating-point value in m*2^X, i.e. the exponent.

See also

TSingleHelper.Sign | Sign of the floating point value
TSingleHelper.Exp | The bit pattern of the exponent as stored in memory.
TSingleHelper.Frac | Bitpattern that makes up the fractional part.
TSingleHelper.Fraction | Fraction of the floating-point value
TSingleHelper.Mantissa | Mantissa of the floating-point


TSingleHelper.Frac

Bitpattern that makes up the fractional part.

Declaration

Source position: syshelph.inc line 237

public property TSingleHelper.Frac : QWord
  read GetF
  write SetF;

Description

Frac is the bit pattern representing the fractional part (significand) including the preceding 1 (the hidden bit).

See also

TSingleHelper.Bytes | Indexed access to the individual bytes of the floating point value
TSingleHelper.Sign | Sign of the floating point value
TSingleHelper.Exp | The bit pattern of the exponent as stored in memory.
TSingleHelper.Mantissa | Mantissa of the floating-point
TSingleHelper.Fraction | Fraction of the floating-point value
TSingleHelper.Exponent | Exponent of the floating-point value


TSingleHelper.Fraction

Fraction of the floating-point value

Declaration

Source position: syshelph.inc line 221

public function TSingleHelper.Fraction: Extended;

Description

Fraction is the decimal part of the floating-point value.

See also

TSingleHelper.Sign | Sign of the floating point value
TSingleHelper.Exp | The bit pattern of the exponent as stored in memory.
TSingleHelper.Exponent | Exponent of the floating-point value
TSingleHelper.Frac | Bitpattern that makes up the fractional part.
TSingleHelper.Mantissa | Mantissa of the floating-point


TSingleHelper.GetB

Declaration

Source position: syshelph.inc line 182

function TSingleHelper.GetB(

  AIndex: Cardinal

):Byte;


TSingleHelper.GetE

Declaration

Source position: syshelph.inc line 184

function TSingleHelper.GetE: QWord;


TSingleHelper.GetF

Declaration

Source position: syshelph.inc line 185

function TSingleHelper.GetF: QWord;


TSingleHelper.GetS

Declaration

Source position: syshelph.inc line 186

function TSingleHelper.GetS: Boolean;


TSingleHelper.GetW

Declaration

Source position: syshelph.inc line 183

function TSingleHelper.GetW(

  AIndex: Cardinal

):Word;


TSingleHelper.IsInfinity

Check whether a value is positive or negative infinity.

Declaration

Source position: syshelph.inc line 205

public class function TSingleHelper.IsInfinity(

  const AValue: Single

):Boolean; overload;

function TSingleHelper.IsInfinity: Boolean; overload;

Description

IsInfinity checks whether a single-sized floating point value represents a positive or negative infinity. If so, it returns True. When the class function version is used, the value can be specified using AValue. In the method version, the used value is (Self).

See also

TSingleHelper.IsNan | Check whether a value equals NaN.
TSingleHelper.IsPositiveInfinity | Check whether a value is positive infinity.
TSingleHelper.IsNegativeInfinity | Check whether a value is negative infinity.


TSingleHelper.IsNan

Check whether a value equals NaN.

Declaration

Source position: syshelph.inc line 204

public class function TSingleHelper.IsNan(

  const AValue: Single

):Boolean; overload;

function TSingleHelper.IsNan: Boolean; overload;

Description

IsNan checks whether a single-sized floating point value is NaN (Not a Number). If so, it returns True. When the class function version is used, the value can be specified using AValue. In the method version, the used value is (Self).

See also

TSingleHelper.IsInfinity | Check whether a value is positive or negative infinity.
TSingleHelper.IsPositiveInfinity | Check whether a value is positive infinity.
TSingleHelper.IsNegativeInfinity | Check whether a value is negative infinity.


TSingleHelper.IsNegativeInfinity

Check whether a value is negative infinity.

Declaration

Source position: syshelph.inc line 206

public class function TSingleHelper.IsNegativeInfinity(

  const AValue: Single

):Boolean; overload;

function TSingleHelper.IsNegativeInfinity: Boolean; overload;

Description

IsNegativeInfinity checks whether a single-sized floating point value represents a negative infinity. If so, it returns True. When the class function version is used, the value can be specified using AValue. In the method version, the used value is (Self).

See also

TSingleHelper.IsNan | Check whether a value equals NaN.
TSingleHelper.IsPositiveInfinity | Check whether a value is positive infinity.
TSingleHelper.IsInfinity | Check whether a value is positive or negative infinity.


TSingleHelper.IsPositiveInfinity

Check whether a value is positive infinity.

Declaration

Source position: syshelph.inc line 207

public class function TSingleHelper.IsPositiveInfinity(

  const AValue: Single

):Boolean; overload;

function TSingleHelper.IsPositiveInfinity: Boolean; overload;

Description

IsPositiveInfinity checks whether a single-sized floating point value represents a positive infinity. If so, it returns True. When the class function version is used, the value can be specified using AValue. In the method version, the used value is (Self).

See also

TSingleHelper.IsNan | Check whether a value equals NaN.
TSingleHelper.IsNegativeInfinity | Check whether a value is negative infinity.
TSingleHelper.IsInfinity | Check whether a value is positive or negative infinity.


TSingleHelper.Mantissa

Mantissa of the floating-point

Declaration

Source position: syshelph.inc line 226

public function TSingleHelper.Mantissa: QWord;

Description

Mantissa is the value of the significand without the hidden bit. This means it the plain bit pattern as it is stored in memory.

See also

TSingleHelper.Sign | Sign of the floating point value
TSingleHelper.Exp | The bit pattern of the exponent as stored in memory.
TSingleHelper.Exponent | Exponent of the floating-point value
TSingleHelper.Frac | Bitpattern that makes up the fractional part.
TSingleHelper.Fraction | Fraction of the floating-point value


TSingleHelper.MaxValue

Largest possible value for the Single floating point type

Declaration

Source position: syshelph.inc line 198

public const TSingleHelper.MaxValue: Single = 340282346638528859811704183484516925440.0;

Description

MaxValue is the largest possible value that can be represented by the Single floating point type. For bigger values, Double or Extended types must be used.

See also

TSingleHelper.MinValue | Smallest (negative) possible value for the Single floating point type
TSingleHelper.Epsilon | Precision for this floating point type


TSingleHelper.MinValue

Smallest (negative) possible value for the Single floating point type

Declaration

Source position: syshelph.inc line 199

public const TSingleHelper.MinValue: Single = - 340282346638528859811704183484516925440.0;

Description

MaxValue is the largest possible value that can be represented by the Single floating point type. For bigger values, Double or Extended types must be used.

See also

TSingleHelper.MaxValue | Largest possible value for the Single floating point type
TSingleHelper.Epsilon | Precision for this floating point type
TSingleHelper.PositiveInfinity | Positive infinity as represented by a single floating point type
TSingleHelper.NegativeInfinity | Negative infinity as represented by a single floating point type
TSingleHelper.NaN | Representation of NaN (Not a Number)


TSingleHelper.NaN

Representation of NaN (Not a Number)

Declaration

Source position: syshelph.inc line 202

public const TSingleHelper.NaN: Single = 0.0 / 0.0;

Description

NaN is the Representation of NaN (Not a Number) for a single-sized floating point type.

See also

TSingleHelper.MaxValue | Largest possible value for the Single floating point type
TSingleHelper.MinValue | Smallest (negative) possible value for the Single floating point type
TSingleHelper.Epsilon | Precision for this floating point type
TSingleHelper.PositiveInfinity | Positive infinity as represented by a single floating point type
TSingleHelper.NegativeInfinity | Negative infinity as represented by a single floating point type


TSingleHelper.NegativeInfinity

Negative infinity as represented by a single floating point type

Declaration

Source position: syshelph.inc line 201

public const TSingleHelper.NegativeInfinity: Single = (- 1.0) / (0.0);

Description

NegativeInfinity is the value representing negative infinity in a single-sized floating point value.

See also

TSingleHelper.MaxValue | Largest possible value for the Single floating point type
TSingleHelper.MinValue | Smallest (negative) possible value for the Single floating point type
TSingleHelper.Epsilon | Precision for this floating point type
TSingleHelper.PositiveInfinity | Positive infinity as represented by a single floating point type
TSingleHelper.NaN | Representation of NaN (Not a Number)


TSingleHelper.Parse

Convert a string to a floating point value

Declaration

Source position: syshelph.inc line 208

public class function TSingleHelper.Parse(

  const AString: string

):Single; overload;

class function TSingleHelper.Parse(

  const AString: string;

  const AFormatSettings: TFormatSettings

):Single; overload;

Description

Parse will try to convert AString to a single-sized floating point value. It will take into account internationalization settings. (it uses FloatToStr).

Errors

If the string AString is not a valid floating-point value, a EConvertError exception is raised.

See also

FloatToStr | Convert a float value to a string using a fixed format.
TSingleHelper.ToString | Convert a single-sized floating point value to a string
TSingleHelper.TryParse | Try to convert a string to a single-sized floating point value.


TSingleHelper.PositiveInfinity

Positive infinity as represented by a single floating point type

Declaration

Source position: syshelph.inc line 200

public const TSingleHelper.PositiveInfinity: Single = 1.0 / 0.0;

Description

PositiveInfinity is the value representing positive infinity in a single-sized floating point value.

See also

TSingleHelper.MaxValue | Largest possible value for the Single floating point type
TSingleHelper.MinValue | Smallest (negative) possible value for the Single floating point type
TSingleHelper.Epsilon | Precision for this floating point type
TSingleHelper.NegativeInfinity | Negative infinity as represented by a single floating point type
TSingleHelper.NaN | Representation of NaN (Not a Number)


TSingleHelper.SetB

Declaration

Source position: syshelph.inc line 187

procedure TSingleHelper.SetB(

  AIndex: Cardinal;

  const AValue: Byte

);


TSingleHelper.SetE

Declaration

Source position: syshelph.inc line 189

procedure TSingleHelper.SetE(

  AValue: QWord

);


TSingleHelper.SetF

Declaration

Source position: syshelph.inc line 190

procedure TSingleHelper.SetF(

  AValue: QWord

);


TSingleHelper.SetS

Declaration

Source position: syshelph.inc line 191

procedure TSingleHelper.SetS(

  AValue: Boolean

);


TSingleHelper.SetW

Declaration

Source position: syshelph.inc line 188

procedure TSingleHelper.SetW(

  AIndex: Cardinal;

  const AValue: Word

);


TSingleHelper.Sign

Sign of the floating point value

Declaration

Source position: syshelph.inc line 235

public property TSingleHelper.Sign : Boolean
  read GetS
  write SetS;

Description

Sign returns True if the sign bit of the value is set (i.e. it is a negative value) or False if it is not set (i.e. it is a positive value).

See also

TSingleHelper.Bytes | Indexed access to the individual bytes of the floating point value
TSingleHelper.Exp | The bit pattern of the exponent as stored in memory.
TSingleHelper.Frac | Bitpattern that makes up the fractional part.
TSingleHelper.Mantissa | Mantissa of the floating-point
TSingleHelper.Fraction | Fraction of the floating-point value
TSingleHelper.Exponent | Exponent of the floating-point value


TSingleHelper.Size

Size (in bytes) of a single-sized floating point value.

Declaration

Source position: syshelph.inc line 210

public class function TSingleHelper.Size: Integer;

Description

Size is the size (in bytes) of a single-sized floating point value. It is equivalent to calling SizeOf(Single).

See also

SizeOf

Return size of a variable or type.


TSingleHelper.SpecialType

Return the type of the single-sized floating point value

Declaration

Source position: syshelph.inc line 227

public function TSingleHelper.SpecialType: TFloatSpecial;

Description

SpecialType checks whether the single-sized floating point value equals one of several special values, and returns an enumerated value describing which value this is. See TFloatSpecial for an explanation of the possible values.

See also

TFloatSpecial

Special floating point values


TSingleHelper.ToString

Convert a single-sized floating point value to a string

Declaration

Source position: syshelph.inc line 211

public class function TSingleHelper.ToString(

  const AValue: Single

):string; overload;

class function TSingleHelper.ToString(

  const AValue: Single;

  const AFormatSettings: TFormatSettings

):string; overload;

class function TSingleHelper.ToString(

  const AValue: Single;

  const AFormat: TFloatFormat;

  const APrecision: Integer;

  const ADigits: Integer

):string; overload;

class function TSingleHelper.ToString(

  const AValue: Single;

  const AFormat: TFloatFormat;

  const APrecision: Integer;

  const ADigits: Integer;

  const AFormatSettings: TFormatSettings

):string; overload;

function TSingleHelper.ToString(

  const AFormat: TFloatFormat;

  const APrecision: Integer;

  const ADigits: Integer

):string; overload;

function TSingleHelper.ToString(

  const AFormat: TFloatFormat;

  const APrecision: Integer;

  const ADigits: Integer;

  const AFormatSettings: TFormatSettings

):string; overload;

function TSingleHelper.ToString(

  const AFormatSettings: TFormatSettings

):string; overload;

function TSingleHelper.ToString: string; overload;

Description

ToString will convert AValue (or Self in the plain method version) to a string. Optionally FormatSettings can be specified, to be able to specify the decimal separator character to use.

Additionally, a precision APrecision and number of digits ADigits can be specified, in conjunction with a AFormat parameter to specify the form in which the floating-point value must be represented. (see TFloatFormat for an explanation of the various values). In this case, FloatToStrF is used to format the value. In the absence of these parameters, FloatToStr is called.

See also

FloatToStr | Convert a float value to a string using a fixed format.
FloatToStrF | Convert a float value to a string using a given format.
TFloatFormat | Formats for the FloatToText function.


TSingleHelper.TryParse

Try to convert a string to a single-sized floating point value.

Declaration

Source position: syshelph.inc line 216

public class function TSingleHelper.TryParse(

  const AString: string;

  out AValue: Single

):Boolean; overload;

class function TSingleHelper.TryParse(

  const AString: string;

  out AValue: Single;

  const AFormatSettings: TFormatSettings

):Boolean; overload;

Description

TryParse attempts to convert the string AString to a single-sized floating point value and reports True if the conversion was succesful. In that case the parsed value is returned in AValue.

If the conversion failed, False is returned.

See also

TSingleHelper.Parse | Convert a string to a floating point value
TSingleHelper.ToString | Convert a single-sized floating point value to a string


TSingleHelper.Words

Indexed access to the words that make up the floating point value

Declaration

Source position: syshelph.inc line 234

public property TSingleHelper.Words[AIndex: Cardinal] : Word
  read GetW
  write SetW;

Description

Words can be used to get or set the various bytes that make up the single-sized floating point value. The index runs from 0 to (Size-1) div 2.

See also

TSingleHelper.Bytes | Indexed access to the individual bytes of the floating point value
TSingleHelper.Size | Size (in bytes) of a single-sized floating point value.


TSmallIntHelper

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Helper for a SmallInt-typed ordinal value

Declaration

Source position: syshelph.inc line 403

type TSmallIntHelper = type helper
public
Const
MaxValue = 32767 | Maximum value for a SmallInt
MinValue = - 32768 | Minimum value for a SmallInt
class function Parse(); | Convert from a string
class function Size; | Size, in bytes, of the SmallInt value
class function ToString(); | Convert the value to string
class function TryParse(); | Try to convert a string to a SmallInt, report success or failure
function ToBoolean; | Convert to a boolean value
function ToHexString(); | Convert to a hexadecimal string representation
function ToSingle; | Convert to an single-sized floating point value
function ToDouble; | Convert to a double-sized floating point value
function ToExtended; | Convert to an extended-sized floating point value
end;

Inheritance

TSmallIntHelper

Helper for a SmallInt-typed ordinal value

Description

TSmallIntHelper contains some auxiliary routines for a SmallInt-typed ordinal value. It consists mainly of conversion routines to and from other types.

See also

TStringHelper | Helper type for strings.
TShortIntHelper | Helper for a ShortInt-typed ordinal value
TByteHelper | Helper for a byte-typed ordinal value
TWordHelper | Helper for a Word-typed ordinal value
TCardinalHelper | Helper for a Cardinal-typed ordinal value
TIntegerHelper | Helper for a Integer-typed ordinal value
TInt64Helper | Helper for a Int64-typed ordinal value
TQWordHelper | Helper for a QWord-typed ordinal value
TNativeIntHelper | Helper for a NativeInt-typed ordinal value
TNativeUIntHelper | Helper for a NativeUInt-typed ordinal value


TSmallIntHelper


TSmallIntHelper
 | Parse
 | Size
 | ToString
 | TryParse
 | ToBoolean
 | ToHexString
 | ToSingle
 | ToDouble
 | ToExtended


Parse (TSmallIntHelper)

Size (TSmallIntHelper)

ToBoolean (TSmallIntHelper)

ToDouble (TSmallIntHelper)

ToExtended (TSmallIntHelper)

ToHexString (TSmallIntHelper)

ToSingle (TSmallIntHelper)

ToString (TSmallIntHelper)

TryParse (TSmallIntHelper)


TSmallIntHelper.MaxValue

Maximum value for a SmallInt

Declaration

Source position: syshelph.inc line 406

public const TSmallIntHelper.MaxValue = 32767;

Description

MaxValue is the biggest value a SmallInt-typed value can contain.

See also

TSmallIntHelper.MinValue

Minimum value for a SmallInt


TSmallIntHelper.MinValue

Minimum value for a SmallInt

Declaration

Source position: syshelph.inc line 407

public const TSmallIntHelper.MinValue = - 32768;

Description

MinValue is the smallest value a SmallInt-typed value can contain.

See also

TSmallIntHelper.MaxValue

Maximum value for a SmallInt


TSmallIntHelper.Parse

Convert from a string

Declaration

Source position: syshelph.inc line 409

public class function TSmallIntHelper.Parse(

  const AString: string

):SmallInt;

Description

Parse will attempt to convert the string AString to a SmallInt value. It uses the StrToInt function to perform the conversion, so no localization is taken into account.

Errors

If the string does not contain a valid SmallInt value, an EConvertError exception is raised.

See also

TSmallIntHelper.ToString | Convert the value to string
TSmallIntHelper.TryParse | Try to convert a string to a SmallInt, report success or failure
StrToInt | Convert a string to an integer value.


TSmallIntHelper.Size

Size, in bytes, of the SmallInt value

Declaration

Source position: syshelph.inc line 410

public class function TSmallIntHelper.Size: Integer;

Description

Size returns the size (in SmallInts) of the SmallInt value. This is equivalent to SizeOf(SmallInt).

Errors

None.

See also

SizeOf

Return size of a variable or type.


TSmallIntHelper.ToBoolean

Convert to a boolean value

Declaration

Source position: syshelph.inc line 415

public function TSmallIntHelper.ToBoolean: Boolean;

Description

ToBoolean converts the SmallInt value to a boolean: it returns True if the value is nonzero, False if it is zero.

See also

TSmallIntHelper.ToSingle | Convert to an single-sized floating point value
TSmallIntHelper.ToDouble | Convert to a double-sized floating point value
TSmallIntHelper.ToExtended | Convert to an extended-sized floating point value
TSmallIntHelper.ToString | Convert the value to string
TSmallIntHelper.ToHexString | Convert to a hexadecimal string representation


TSmallIntHelper.ToDouble

Convert to a double-sized floating point value

Declaration

Source position: syshelph.inc line 419

public function TSmallIntHelper.ToDouble: Double;

Description

ToDouble converts the SmallInt value to a double-sized floating point value

See also

TSmallIntHelper.ToBoolean | Convert to a boolean value
TSmallIntHelper.ToExtended | Convert to an extended-sized floating point value
TSmallIntHelper.ToSingle | Convert to an single-sized floating point value
TSmallIntHelper.ToString | Convert the value to string
TSmallIntHelper.ToHexString | Convert to a hexadecimal string representation


TSmallIntHelper.ToExtended

Convert to an extended-sized floating point value

Declaration

Source position: syshelph.inc line 420

public function TSmallIntHelper.ToExtended: Extended;

Description

ToDouble converts the SmallInt value to an extended-sized floating point value.

See also

TSmallIntHelper.ToBoolean | Convert to a boolean value
TSmallIntHelper.ToSingle | Convert to an single-sized floating point value
TSmallIntHelper.ToDouble | Convert to a double-sized floating point value
TSmallIntHelper.ToString | Convert the value to string
TSmallIntHelper.ToHexString | Convert to a hexadecimal string representation


TSmallIntHelper.ToHexString

Convert to a hexadecimal string representation

Declaration

Source position: syshelph.inc line 416

public function TSmallIntHelper.ToHexString: string; overload;

function TSmallIntHelper.ToHexString(

  const AMinDigits: Integer

):string; overload;

Description

ToHexString converts the SmallInt value to a hexadecimal string representation. The AMinDigits argument specifies the minimal number of characters in the resulting string. The string will be left-padded with zeroes if the representation contains less than AMinDigits characters.

See also

TSmallIntHelper.ToBoolean | Convert to a boolean value
TSmallIntHelper.ToSingle | Convert to an single-sized floating point value
TSmallIntHelper.ToDouble | Convert to a double-sized floating point value
TSmallIntHelper.ToString | Convert the value to string
TSmallIntHelper.ToExtended | Convert to an extended-sized floating point value


TSmallIntHelper.ToSingle

Convert to an single-sized floating point value

Declaration

Source position: syshelph.inc line 418

public function TSmallIntHelper.ToSingle: Single;

Description

ToSingle converts the SmallInt value to a single-sized floating point value.

See also

TSmallIntHelper.ToBoolean | Convert to a boolean value
TSmallIntHelper.ToDouble | Convert to a double-sized floating point value
TSmallIntHelper.ToExtended | Convert to an extended-sized floating point value
TSmallIntHelper.ToString | Convert the value to string
TSmallIntHelper.ToHexString | Convert to a hexadecimal string representation


TSmallIntHelper.ToString

Convert the value to string

Declaration

Source position: syshelph.inc line 411

public class function TSmallIntHelper.ToString(

  const AValue: SmallInt

):string; overload;

function TSmallIntHelper.ToString: string; overload;

Description

ToString will, in the class function variant of this method, convert AValue to a string representation. In the regular method overloaded version of ToString, the SmallInt value itself is used. The IntToStr function is used to do the conversion.

See also

TSmallIntHelper.Parse | Convert from a string
IntToStr | Convert an integer value to a decimal string.


TSmallIntHelper.TryParse

Try to convert a string to a SmallInt, report success or failure

Declaration

Source position: syshelph.inc line 412

public class function TSmallIntHelper.TryParse(

  const AString: string;

  out AValue: SmallInt

):Boolean;

Description

TryParse attempts to convert the string AString to a SmallInt, and reports the success of the attempt. If the attempt is succesful, then True is returned, and the actual value of the SmallInt is returned in AValue.

It uses the val function to perform the conversion, so no localization is taken into account.

See also

TSmallIntHelper.Parse | Convert from a string
Val | Calculate numerical/enumerated value of a string.


TStringHelper

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Helper type for strings.

Declaration

Source position: syshelph.inc line 40

type TStringHelper = type helper
public
Const
Empty = '' | Check if the string is empty
class function Compare(); | Compare 2 strings
class function CompareOrdinal(); | Compare 2 strings byte for byte
class function CompareText(); | Compare 2 strings case insensitively.
class function Copy(); | Return a unique copy of a string
class function Create(); | Create a new string
class function EndsText(); | Check if one string is the ending of another.
class function Equals(); | Check if 2 strings are equal
class function Format(); | Format a string using provided arguments.
class function IsNullOrEmpty(); | Check if a string is empty
class function IsNullOrWhiteSpace(); | Check if a string is empty or contains only whitespace characters.
class function Join(); | Join a series of strings, separated using a given separator
class function LowerCase(); overload; | Return the lowercase version of a string.
class function Parse(); | Return a string representation of the argument
class function ToBoolean(); | Convert string to boolean
class function ToDouble(); | Convert string to double-sized floating point value
class function ToExtended(); | Convert string to extended-sized floating point value
class function ToInt64(); | Convert string to 64-bit signed integer
class function ToInteger(); | Convert string to 32-bit signed integer
class function ToSingle(); | Convert string to single-sized floating point value
class function UpperCase(); overload; | Return uppercase version of a string
function CompareTo(); | Compare string to another
function Contains(); | Check is the string contains another
procedure CopyTo(); | Copy part of the string to an array of characters
function CountChar(); | Count the occurrences of a character
function DeQuotedString(); | Return a dequoted version of the string
function EndsWith(); | Check if the string is ended by another.
function GetHashCode; | Get a hash code for the string
function IndexOf(); | Find the position (index) of a string or character
function IndexOfUnQuoted(); overload; | Index of string, skipping quoted parts.
function IndexOfAny(); | Find the position (index) of any string or character in a list.
function IndexOfAnyUnquoted(); | Find the position (index) of any string or character in a list.
function Insert(); | Insert a string at a given position
function IsDelimiter(); | Check whether a character at a given position is a delimiter
function IsEmpty; | Check whether the string is empty.
function LastDelimiter(); | Return the last position of one of a series of delimiters
function LastIndexOf(); | Find the last position (index) of a string or character
function LastIndexOfAny(); | Find the last position (index) of any string or character in a list.
function PadLeft(); | Pad the string on the left with an indicated character
function PadRight(); | Pad the string on the right with an indicated character
function QuotedString(); | Return a quoted version of the string
function Remove(); | Remove a number of characters from the string
function Replace(); | Replace occurrences of one string with another.
function Split(); | Split a string in a number of parts
function StartsWith(); | Check if one string starts with another
function Substring(); | Return a part of the string
function ToCharArray(); | Return the string ar an array of characters.
function ToLower; overload; | Convert to lowercase
function ToLowerInvariant; | Convert to lowercase
function ToUpper; overload; | Convert to uppercase.
function ToUpperInvariant; | Convert to uppercase
function Trim(); | Strips a set of trim characters from the beginning and end of the string.
function TrimLeft(); | Strips a set of trim characters from the beginning of the string.
function TrimRight(); | Strips a set of trim characters from the end of the string.
function TrimEnd(); deprecated ; | Alias for TrimRight
function TrimStart(); deprecated ; | Alias for TrimLeft
property Chars []: Char; [r] | Zero-based Indexed access to the characters in the string.
property Length: Integer; [r] | Return the length of the string
end;

Inheritance

TStringHelper

Helper type for strings.

Description

TStringHelper adds various helper routines to the string type. These are mostly conversion routines, and some formatting routines.

For similarity to C-like languages, all the indexes in these helper routines are zero based.

See also

TGUIDHelper

Helper type for TGUID


TStringHelper
 | ro | Chars
 | ro | Length


ro | Chars (TStringHelper)
ro |


TStringHelper
 | Compare
 | CompareOrdinal
 | CompareText
 | Copy
 | Create
 | EndsText
 | Equals
 | Format
 | IsNullOrEmpty
 | IsNullOrWhiteSpace
 | Join
 | LowerCase
 | Parse
 | ToBoolean
 | ToDouble
 | ToExtended
 | ToInt64
 | ToInteger
 | ToSingle
 | UpperCase
 | CompareTo
 | Contains
 | CopyTo
 | CountChar
 | DeQuotedString
 | EndsWith
 | GetHashCode
 | IndexOf
 | IndexOfUnQuoted
 | IndexOfAny
 | IndexOfAnyUnquoted
 | Insert
 | IsDelimiter
 | IsEmpty
 | LastDelimiter
 | LastIndexOf
 | LastIndexOfAny
 | PadLeft
 | PadRight
 | QuotedString
 | Remove
 | Replace
 | Split
 | StartsWith
 | Substring
 | ToCharArray
 | ToLower
 | ToLowerInvariant
 | ToUpper
 | ToUpperInvariant
 | Trim
 | TrimLeft
 | TrimRight
 | TrimEnd
 | TrimStart


Compare (TStringHelper)

CompareOrdinal (TStringHelper)

CompareText (TStringHelper)

CompareTo (TStringHelper)

Contains (TStringHelper)

Copy (TStringHelper)

CopyTo (TStringHelper)

CountChar (TStringHelper)

Create (TStringHelper)

DeQuotedString (TStringHelper)

EndsText (TStringHelper)

EndsWith (TStringHelper)

Equals (TStringHelper)

Format (TStringHelper)

GetHashCode (TStringHelper)

IndexOf (TStringHelper)

IndexOfAny (TStringHelper)

IndexOfAnyUnquoted (TStringHelper)

IndexOfUnQuoted (TStringHelper)

Insert (TStringHelper)

IsDelimiter (TStringHelper)

IsEmpty (TStringHelper)

IsNullOrEmpty (TStringHelper)

IsNullOrWhiteSpace (TStringHelper)

Join (TStringHelper)

LastDelimiter (TStringHelper)

LastIndexOf (TStringHelper)

LastIndexOfAny (TStringHelper)

LowerCase (TStringHelper)

PadLeft (TStringHelper)

PadRight (TStringHelper)

Parse (TStringHelper)

QuotedString (TStringHelper)

Remove (TStringHelper)

Replace (TStringHelper)

Split (TStringHelper)

StartsWith (TStringHelper)

Substring (TStringHelper)

ToBoolean (TStringHelper)

ToCharArray (TStringHelper)

ToDouble (TStringHelper)

ToExtended (TStringHelper)

ToInt64 (TStringHelper)

ToInteger (TStringHelper)

ToLower (TStringHelper)

ToLowerInvariant (TStringHelper)

ToSingle (TStringHelper)

ToUpper (TStringHelper)

ToUpperInvariant (TStringHelper)

Trim (TStringHelper)

TrimEnd (TStringHelper)

TrimLeft (TStringHelper)

TrimRight (TStringHelper)

TrimStart (TStringHelper)

UpperCase (TStringHelper)


TStringHelper


TStringHelper.Chars

Zero-based Indexed access to the characters in the string.

Declaration

Source position: syshelph.inc line 176

public property TStringHelper.Chars[AIndex: Integer] : Char
  read GetChar;

Description

Chars provides zero-based indexed access to the characters in the string. The first character is at index 0, the last at Length-1.

See also

TStringHelper.Length

Return the length of the string


TStringHelper.Compare

Compare 2 strings

Declaration

Source position: syshelph.inc line 47

public class function TStringHelper.Compare(

  const A: string;

  const B: string

):Integer; overload;

class function TStringHelper.Compare(

  const A: string;

  const B: string;

  IgnoreCase: Boolean

):Integer; overload;

class function TStringHelper.Compare(

  const A: string;

  const B: string;

  Options: TCompareOptions

):Integer; overload;

class function TStringHelper.Compare(

  const A: string;

  IndexA: Integer;

  const B: string;

  IndexB: Integer;

  ALen: Integer

):Integer; overload;

class function TStringHelper.Compare(

  const A: string;

  IndexA: Integer;

  const B: string;

  IndexB: Integer;

  ALen: Integer;

  IgnoreCase: Boolean

):Integer; overload;

class function TStringHelper.Compare(

  const A: string;

  IndexA: Integer;

  const B: string;

  IndexB: Integer;

  ALen: Integer;

  Options: TCompareOptions

):Integer; overload;

Description

Compare compares strings A and B. It returns the following result:

  • 0 if the strings are equal
  • a negative number if A < B
  • a positive number if A > B

The comparison can be influenced by using the appropriate overloaded version of the function.

  • If the IndexA and IndexB parameters are present, the comparison starts at character index IndexA and IndexB. The indexes are zero-based.
  • If the ALen parameters is present, then only the first ALen characters are compared. If not enough characters are present in either A or B, the comparison will include only as much characters as are present.
  • If IgnoreCase is present and used, it determines whether the comparison is done case-sensitively. This form is deprecated, it is recommended to use the AOptions parameter and to include coIgnoreCase.
  • The AOptions argument can be used to specify additional options. See TCompareOption for a list of possible values in this set.

Errors

None.

See also

TStringHelper.CompareOrdinal | Compare 2 strings byte for byte
TCompareOption | How to compare strings
TStringHelper.CompareTo | Compare string to another


TStringHelper.CompareOrdinal

Compare 2 strings byte for byte

Declaration

Source position: syshelph.inc line 53

public class function TStringHelper.CompareOrdinal(

  const A: string;

  const B: string

):Integer; overload;

class function TStringHelper.CompareOrdinal(

  const A: string;

  IndexA: Integer;

  const B: string;

  IndexB: Integer;

  ALen: Integer

):Integer; overload;

Description

CompareOrdinal compares 2 strings A and B bytewise. It is faster than a regular compare, but offers less options.

  • 0 if the strings are equal
  • a negative number if A < B
  • a positive number if A > B

Optionally, a zero-based starting index for the compare can be given for each of the strings: IndexA and IndexB. In this case a maximum amount of characters (ALen) to be compared must also be specified.

Errors

None.

See also

TStringHelper.Compare | Compare 2 strings
TStringHelper.CompareTo | Compare string to another


TStringHelper.CompareText

Compare 2 strings case insensitively.

Declaration

Source position: syshelph.inc line 55

public class function TStringHelper.CompareText(

  const A: string;

  const B: string

):Integer;

Description

CompareText simply calls SysUtils with the 2 passed arguments.

Errors

None.

See also

SysUtils | Compare 2 ansistrings case insensitive.
TStringHelper.CompareTo | Compare string to another


TStringHelper.CompareTo

Compare string to another

Declaration

Source position: syshelph.inc line 80

public function TStringHelper.CompareTo(

  const B: string

):Integer;

Description

CompareTo will compare the string value to the string B. It returns the following result:

  • 0 if the strings are equal
  • a negative number if Self < B
  • a positive number if Self > B

The StrComp function is used for this.

See also

TStringHelper.Compare | Compare 2 strings
TStringHelper.CompareOrdinal | Compare 2 strings byte for byte
StrComp | Compare 2 null-terminated strings, case sensitive.


TStringHelper.Contains

Check is the string contains another

Declaration

Source position: syshelph.inc line 81

public function TStringHelper.Contains(

  const AValue: string

):Boolean;

Description

Contains returns True if the string value contains AValue, i.e. it returns Pos(Self,AValue)>0.

See also

Pos

Search for substring in a string.


TStringHelper.Copy

Return a unique copy of a string

Declaration

Source position: syshelph.inc line 56

public class function TStringHelper.Copy(

  const Str: string

):string;

Description

Copy will copy the string on which it operates, and makes sure the result has reference count 1.

See also

UniqueString

Make sure reference count of string is 1


TStringHelper.CopyTo

Copy part of the string to an array of characters

Declaration

Source position: syshelph.inc line 82

public procedure TStringHelper.CopyTo(

  SourceIndex: Integer;

  var destination: array of Char;

  DestinationIndex: Integer;

  ACount: Integer

);

Description

CopyTo copies at most ACount characters from the source string (Self) to the array Destination, starting at (zero based) index SourceIndex. The characters are copied to the array starting at position DestinationIndex (zero based).

See also

Copy

Copy part of a string.


TStringHelper.CountChar

Count the occurrences of a character

Declaration

Source position: syshelph.inc line 83

public function TStringHelper.CountChar(

  const C: Char

):Integer;

Description

CountChar returns the number of occurrences of C in the string (Self).

See also

TStringHelper.IndexOf | Find the position (index) of a string or character
TStringHelper.IndexOfAny | Find the position (index) of any string or character in a list.


TStringHelper.Create

Create a new string

Declaration

Source position: syshelph.inc line 57

public class function TStringHelper.Create(

  AChar: Char;

  ACount: Integer

):string; overload;

class function TStringHelper.Create(

  const AValue: array of Char

):string; overload;

class function TStringHelper.Create(

  const AValue: array of Char;

  StartIndex: Integer;

  ALen: Integer

):string; overload;

Description

Create returns a new string with an initial value based on the passed arguments:

  • A character (ACHar) and a count (ACount, in which case a string is returned of the specified length, filled with AChar.
  • An array of characters AValue. The returned string will have the same length as the array, and the characters will be copied from the elements in the array. Optionally, a starting index StartIndex (zero based) and length ALen can be specified, in which case the string will contain at most ALen characters, which will have been copied starting at index StartIndex.

Errors

None.

See also

StringOfChar

Return a string consisting of 1 character repeated N times.


TStringHelper.DeQuotedString

Return a dequoted version of the string

Declaration

Source position: syshelph.inc line 84

public function TStringHelper.DeQuotedString: string; overload;

function TStringHelper.DeQuotedString(

  const AQuoteChar: Char

):string; overload;

Description

DeQuotedString will return a dequoted version of the string (Self), where the quote character is AQuoteChar (default: a single quote '). The string must start and end with the quote character, or it is returned as-is. Any double occurrences of the quote character AQuoteChar will be returned as a single quote.

See also

AnsiQuotedString

AnsiExtractQuotedString


TStringHelper.Empty

Check if the string is empty

Declaration

Source position: syshelph.inc line 45

public const TStringHelper.Empty = '';

Description

Empty returns True if the string has length 0 (zero).


TStringHelper.EndsText

Check if one string is the ending of another.

Declaration

Source position: syshelph.inc line 60

public class function TStringHelper.EndsText(

  const ASubText: string;

  const AText: string

):Boolean;

Description

EndsText returns True if AText ends on SubText, i.e. whether the last characters in AText are the ones found in SubText. The comparison is done case insensitively.

See also

CompareText | Compare 2 ansistrings case insensitive.
TStringHelper.EndsWith | Check if the string is ended by another.


TStringHelper.EndsWith

Check if the string is ended by another.

Declaration

Source position: syshelph.inc line 86

public function TStringHelper.EndsWith(

  const AValue: string

):Boolean; overload;

function TStringHelper.EndsWith(

  const AValue: string;

  IgnoreCase: Boolean

):Boolean; overload;

Description

EndsWith returns True if the string (Self) ends on AValue, i.e. whether the last characters in Self are the ones found in AValue. The comparison is done case insensitively depending on the IgnoreCase argument (which is false by default).

See also

CompareText | Compare 2 ansistrings case insensitive.
TStringHelper.EndsText | Check if one string is the ending of another.


TStringHelper.Equals

Check if 2 strings are equal

Declaration

Source position: syshelph.inc line 61

public class function TStringHelper.Equals(

  const a: string;

  const b: string

):Boolean; overload;

function TStringHelper.Equals(

  const AValue: string

):Boolean; overload;

Description

Equals returns True if A=B, false otherwise.

See also

CompareText | Compare 2 ansistrings case insensitive.
TStringHelper.Compare | Compare 2 strings


TStringHelper.Format

Format a string using provided arguments.

Declaration

Source position: syshelph.inc line 62

public class function TStringHelper.Format(

  const AFormat: string;

  const args: array of Const

):string; overload;

function TStringHelper.Format(

  const args: array of Const

):string; overload;

Description

Format just calls Sysutils.Format, passing on AFormat and Args. If AFormat is omitted, the string itself is used as the formatting string.

See also

Sysutils.Format

Format a string with given arguments.


TStringHelper.GetHashCode

Get a hash code for the string

Declaration

Source position: syshelph.inc line 90

public function TStringHelper.GetHashCode: Integer;

Description

GetHashCode returns a hash value for the string (Self).


TStringHelper.IndexOf

Find the position (index) of a string or character

Declaration

Source position: syshelph.inc line 91

public function TStringHelper.IndexOf(

  AValue: Char

):Integer; overload;

function TStringHelper.IndexOf(

  const AValue: string

):Integer; overload;

function TStringHelper.IndexOf(

  AValue: Char;

  StartIndex: Integer

):Integer; overload;

function TStringHelper.IndexOf(

  const AValue: string;

  StartIndex: Integer

):Integer; overload;

function TStringHelper.IndexOf(

  AValue: Char;

  StartIndex: Integer;

  ACount: Integer

):Integer; overload;

function TStringHelper.IndexOf(

  const AValue: string;

  StartIndex: Integer;

  ACount: Integer

):Integer; overload;

Description

IndexOf returns the zero-based index of AValue in the string (Self). The value to search for can be a character or string (AValue).

if no match is found, -1 is returned.

The search can be refined by specifying a (zero based) index StartIndex. When specified, the search will start at the given character. Not specifying this option is equivalent to specifying zero.

If ACount is given, at most ACount characters in the source string will be considered for the search. This count includes the starting character. Not specifying this argument is equivalent to specifying the amount of remaining characters.

See also

Pos | Search for substring in a string.
TStringHelper.IndexOfUnQuoted | Index of string, skipping quoted parts.
TStringHelper.IndexOfAny | Find the position (index) of any string or character in a list.
TStringHelper.IndexOfAnyUnquoted | Find the position (index) of any string or character in a list.
TStringHelper.LastIndexOf | Find the last position (index) of a string or character
TStringHelper.LastIndexOfAny | Find the last position (index) of any string or character in a list.


TStringHelper.IndexOfAny

Find the position (index) of any string or character in a list.

Declaration

Source position: syshelph.inc line 98

public function TStringHelper.IndexOfAny(

  const AnyOf: array of Char

):Integer; overload;

function TStringHelper.IndexOfAny(

  const AnyOf: array of Char;

  StartIndex: Integer

):Integer; overload;

function TStringHelper.IndexOfAny(

  const AnyOf: array of Char;

  StartIndex: Integer;

  ACount: Integer

):Integer; overload;

function TStringHelper.IndexOfAny(

  const AnyOf: array of string

):Integer; overload;

function TStringHelper.IndexOfAny(

  const AnyOf: array of string;

  StartIndex: Integer

):Integer; overload;

function TStringHelper.IndexOfAny(

  const AnyOf: array of string;

  StartIndex: Integer;

  ACount: Integer

):Integer; overload;

function TStringHelper.IndexOfAny(

  const AnyOf: array of string;

  StartIndex: Integer;

  ACount: Integer;

  out AMatch: Integer

):Integer; overload;

Description

IndexOfAny returns the zero-based index of the first matching element in an array of charaters or strings (AnyOf).

if no match is found, -1 is returned.

The search can be refined by specifying a (zero-based) index StartIndex. When specified, the search will start at the given character. Not specifying this option is equivalent to specifying zero.

If ACount is given, at most ACount characters in the source string will be considered for the search. This count includes the starting character. Not specifying this argument is equivalent to specifying the amount of remaining characters.

If AMatch is specified, on succesful return it will contain the index of the element in the array that contains the found match.

See also

Pos | Search for substring in a string.
TStringHelper.IndexOf | Find the position (index) of a string or character
TStringHelper.IndexOfUnquoted | Index of string, skipping quoted parts.
TStringHelper.IndexOfAnyUnquoted | Find the position (index) of any string or character in a list.
TStringHelper.LastIndexOf | Find the last position (index) of a string or character
TStringHelper.LastIndexOfAny | Find the last position (index) of any string or character in a list.


TStringHelper.IndexOfAnyUnquoted

Find the position (index) of any string or character in a list.

Declaration

Source position: syshelph.inc line 105

public function TStringHelper.IndexOfAnyUnquoted(

  const AnyOf: array of Char;

  StartQuote: Char;

  EndQuote: Char

):Integer; overload;

function TStringHelper.IndexOfAnyUnquoted(

  const AnyOf: array of Char;

  StartQuote: Char;

  EndQuote: Char;

  StartIndex: Integer

):Integer; overload;

function TStringHelper.IndexOfAnyUnquoted(

  const AnyOf: array of Char;

  StartQuote: Char;

  EndQuote: Char;

  StartIndex: Integer;

  ACount: Integer

):Integer; overload;

function TStringHelper.IndexOfAnyUnquoted(

  const AnyOf: array of string;

  StartQuote: Char;

  EndQuote: Char;

  StartIndex: Integer;

  out Matched: Integer

):Integer; overload;

Description

IndexOfAnyUnQuoted returns the zero-based index of the first matching element in an array of charaters or strings (AnyOf), but disregards any quoted parts in the string. A quoted part is determined by a starting StartQuote and end-quote character EndQuote.

if no match is found, -1 is returned.

The search can be refined by specifying a (zero-based) index StartIndex. When specified, the search will start at the given character. Not specifying this option is equivalent to specifying zero.

If ACount is given, at most ACount characters in the source string will be considered for the search. This count includes the starting character. Not specifying this argument is equivalent to specifying the amount of remaining characters.

If AMatch is specified, on succesful return it will contain the index of the element in the array that contains the found match.

See also

Pos | Search for substring in a string.
TStringHelper.IndexOf | Find the position (index) of a string or character
TStringHelper.IndexOfUnquoted | Index of string, skipping quoted parts.
TStringHelper.IndexOfAny | Find the position (index) of any string or character in a list.
TStringHelper.LastIndexOf | Find the last position (index) of a string or character
TStringHelper.LastIndexOfAny | Find the last position (index) of any string or character in a list.


TStringHelper.IndexOfUnQuoted

Index of string, skipping quoted parts.

Declaration

Source position: syshelph.inc line 97

public function TStringHelper.IndexOfUnQuoted(

  const AValue: string;

  StartQuote: Char;

  EndQuote: Char;

  StartIndex: Integer = 0

):Integer; overload;

Description

IndexOfUnQuoted will return the zero-based index of AValue in the string (Self), but disregards any quoted parts in the string. A quoted part is determined by a starting StartQuote and end-quote character EndQuote. The search starts at (zero-based) position StartIndex, which is by default 0.

See also

Pos | Search for substring in a string.
TStringHelper.IndexOf | Find the position (index) of a string or character
TStringHelper.IndexOfAny | Find the position (index) of any string or character in a list.
TStringHelper.IndexOfAnyUnquoted | Find the position (index) of any string or character in a list.
TStringHelper.LastIndexOf | Find the last position (index) of a string or character
TStringHelper.LastIndexOfAny | Find the last position (index) of any string or character in a list.


TStringHelper.Insert

Insert a string at a given position

Declaration

Source position: syshelph.inc line 109

public function TStringHelper.Insert(

  StartIndex: Integer;

  const AValue: string

):string;

Description

Insert inserts the string AValue in a string (Self) at the (zero-based) position StartIndex. It returns the resulting string (Self). If StartIndex is less than zero, it is set to zero. If StartIndex is higher than the length, AValue is appended to the string.

See also

Insert

Insert one string in another.


TStringHelper.IsDelimiter

Check whether a character at a given position is a delimiter

Declaration

Source position: syshelph.inc line 110

public function TStringHelper.IsDelimiter(

  const Delimiters: string;

  Index: Integer

):Boolean;

Description

IsDelimiter returns True if the character at (zero-based) position Index is one of the delimiter characters in Delimiters. If Index is out of range, False is returned.

See also

IsDelimiter

Check whether a given string is a delimiter character.


TStringHelper.IsEmpty

Check whether the string is empty.

Declaration

Source position: syshelph.inc line 111

public function TStringHelper.IsEmpty: Boolean;

Description

IsEmpty returns True if the string has length zero.

See also

TStringHelper.IsNullOrEmpty | Check if a string is empty
TStringHelper.Length | Return the length of the string
Length | Returns length of a string or array.


TStringHelper.IsNullOrEmpty

Check if a string is empty

Declaration

Source position: syshelph.inc line 63

public class function TStringHelper.IsNullOrEmpty(

  const AValue: string

):Boolean;

Description

IsNullOrEmpty returns True if string A has length 0.

See also

System.Length | Returns length of a string or array.
TStringHelper.IsNullOrWhiteSpace | Check if a string is empty or contains only whitespace characters.


TStringHelper.IsNullOrWhiteSpace

Check if a string is empty or contains only whitespace characters.

Declaration

Source position: syshelph.inc line 64

public class function TStringHelper.IsNullOrWhiteSpace(

  const AValue: string

):Boolean;

Description

IsNullOrEmpty returns True if string A has length 0 or contains only whitespace characters (characters with ASCII code 32 or less).

See also

TStringHelper.IsNullOrEmpty | Check if a string is empty
Trim | Trim whitespace from the ends of a string.


TStringHelper.Join

Join a series of strings, separated using a given separator

Declaration

Source position: syshelph.inc line 65

public class function TStringHelper.Join(

  const Separator: string;

  const Values: array of Const

):string; overload;

class function TStringHelper.Join(

  const Separator: string;

  const Values: array of string

):string; overload;

class function TStringHelper.Join(

  const Separator: string;

  const Values: array of string;

  StartIndex: Integer;

  ACount: Integer

):string; overload;

Description

Join will return a string that consists of all the strings in Values concatenated, with Separator between them. Values can be an array of strings, but can also be an array of arbitrary values: the values will first be transformed to a string representation first.

In case an array of strings is passed on, a start index StartIndex and element count ACount can be passed on as well.

Errors

Classes, pointers or interfaces will not be transformed, but will result in a 'unknown type: NNN' string being inserted.

See also

TStringHelper.Split

Split a string in a number of parts


TStringHelper.LastDelimiter

Return the last position of one of a series of delimiters

Declaration

Source position: syshelph.inc line 112

public function TStringHelper.LastDelimiter(

  const Delims: string

):Integer;

Description

LastDelimiter searches the string backwards for an occurence of one of the characters in Delims, and returns the corresponding (zero-based) index in the string. If no occurrence is found, -1 is returned.

See also

TStringHelper.isDelimiter | Check whether a character at a given position is a delimiter
TStringHelper.IndexOf | Find the position (index) of a string or character
TStringHelper.IndexOfAny | Find the position (index) of any string or character in a list.
TStringHelper.LastIndexOf | Find the last position (index) of a string or character
TStringHelper.LastIndexOfAny | Find the last position (index) of any string or character in a list.


TStringHelper.LastIndexOf

Find the last position (index) of a string or character

Declaration

Source position: syshelph.inc line 113

public function TStringHelper.LastIndexOf(

  AValue: Char

):Integer; overload;

function TStringHelper.LastIndexOf(

  const AValue: string

):Integer; overload;

function TStringHelper.LastIndexOf(

  AValue: Char;

  AStartIndex: Integer

):Integer; overload;

function TStringHelper.LastIndexOf(

  const AValue: string;

  AStartIndex: Integer

):Integer; overload;

function TStringHelper.LastIndexOf(

  AValue: Char;

  AStartIndex: Integer;

  ACount: Integer

):Integer; overload;

function TStringHelper.LastIndexOf(

  const AValue: string;

  AStartIndex: Integer;

  ACount: Integer

):Integer; overload;

Description

LasyIndexOf returns the zero-based index of the last occurrence of AValue in the string (Self). The value to search for can be a character or string (AValue).

if no match is found, -1 is returned.

The search can be refined by specifying a (zero based) index StartIndex. When specified, the search will start at the given character and proceeds towards the beginning of the string. Not specifying this option is equivalent to specifying length-1.

If ACount is given, at most ACount characters in the source string will be considered for the search. This count includes the starting character. Not specifying this argument is equivalent to specifying StartIndex+1.

See also

Pos | Search for substring in a string.
TStringHelper.IndexOfUnQuoted | Index of string, skipping quoted parts.
TStringHelper.IndexOfAny | Find the position (index) of any string or character in a list.
TStringHelper.IndexOfAnyUnquoted | Find the position (index) of any string or character in a list.
TStringHelper.IndexOf | Find the position (index) of a string or character
TStringHelper.LastIndexOfAny | Find the last position (index) of any string or character in a list.


TStringHelper.LastIndexOfAny

Find the last position (index) of any string or character in a list.

Declaration

Source position: syshelph.inc line 119

public function TStringHelper.LastIndexOfAny(

  const AnyOf: array of Char

):Integer; overload;

function TStringHelper.LastIndexOfAny(

  const AnyOf: array of Char;

  AStartIndex: Integer

):Integer; overload;

function TStringHelper.LastIndexOfAny(

  const AnyOf: array of Char;

  AStartIndex: Integer;

  ACount: Integer

):Integer; overload;

Description

LasyIndexOfAny returns the zero-based index of the first matching element in an array of charaters or strings (AnyOf).

if no match is found, -1 is returned.

The search can be refined by specifying a (zero-based) index StartIndex. When specified, the search will start at the given character and proceeds to the start of the string. Not specifying this option is equivalent to specifying Length-1.

If ACount is given, at most ACount characters in the source string will be considered for the search. This count includes the starting character. Not specifying this argument is equivalent to specifying StartIndex+1.

See also

Pos | Search for substring in a string.
TStringHelper.IndexOf | Find the position (index) of a string or character
TStringHelper.IndexOfUnquoted | Index of string, skipping quoted parts.
TStringHelper.IndexOfAnyUnquoted | Find the position (index) of any string or character in a list.
TStringHelper.LastIndexOf | Find the last position (index) of a string or character
TStringHelper.IndexOfAny | Find the position (index) of any string or character in a list.


TStringHelper.Length

Return the length of the string

Declaration

Source position: syshelph.inc line 177

public property TStringHelper.Length : Integer
  read GetLength;

Description

Length returns the length (in bytes for single-byte strings) of the string.

See also

Length

Returns length of a string or array.


TStringHelper.LowerCase

Return the lowercase version of a string.

Declaration

Source position: syshelph.inc line 68

public class function TStringHelper.LowerCase(

  const S: string

):string; overload;

Description

LowerCase returns the lowercase version of the string S. This function is an alias for the SysUtils.LowerCase function.

See also

sysutils.LowerCase

Return a lowercase version of a string.


TStringHelper.PadLeft

Pad the string on the left with an indicated character

Declaration

Source position: syshelph.inc line 122

public function TStringHelper.PadLeft(

  ATotalWidth: Integer

):string; overload;

function TStringHelper.PadLeft(

  ATotalWidth: Integer;

  PaddingChar: Char

):string; overload;

Description

PadLeft pads the string (Self) on the left (i.e. at the beginning) till it reaches length ATotalWidth with character PaddingChar. If PaddingChar is omitted, a space is used.

See also

TStringHelper.PadRight

Pad the string on the right with an indicated character


TStringHelper.PadRight

Pad the string on the right with an indicated character

Declaration

Source position: syshelph.inc line 124

public function TStringHelper.PadRight(

  ATotalWidth: Integer

):string; overload;

function TStringHelper.PadRight(

  ATotalWidth: Integer;

  PaddingChar: Char

):string; overload;

Description

PadLeft pads the string (Self) on the right (i.e. at the end) till it reaches length ATotalWidth with character PaddingChar. If PaddingChar is omitted, a space is used.

See also

TStringHelper.PadLeft

Pad the string on the left with an indicated character


TStringHelper.Parse

Return a string representation of the argument

Declaration

Source position: syshelph.inc line 69

public class function TStringHelper.Parse(

  const AValue: Boolean

):string; overload;

class function TStringHelper.Parse(

  const AValue: Extended

):string; overload;

class function TStringHelper.Parse(

  const AValue: Int64

):string; overload;

class function TStringHelper.Parse(

  const AValue: Integer

):string; overload;

Description

Parse will return a string representation of the argument AValue. How this is done depends on the type of the AValueargument:

Boolean
The result is formatted using BoolToStr.
Extended
The result is formatted using FloatToStr.
Int64
The result is formatted using IntToStr.
Integer
he result is formatted using IntToStr.

See also

BoolToStr | Convert a boolean value to a string.
FloatToStr | Convert a float value to a string using a fixed format.
IntToStr | Convert an integer value to a decimal string.


TStringHelper.QuotedString

Return a quoted version of the string

Declaration

Source position: syshelph.inc line 126

public function TStringHelper.QuotedString: string; overload;

function TStringHelper.QuotedString(

  const AQuoteChar: Char

):string; overload;

Description

QuotedString returns a quoted version of the string (Self). The quote character is specified in AQuoteChar, which by default is the double quote ("). Any existing quote characters occurrences will be doubled.

See also

QuotedStr | Return a quotes version of a string.
AnsiQuotedStr | Return a quoted version of a string.


TStringHelper.Remove

Remove a number of characters from the string

Declaration

Source position: syshelph.inc line 128

public function TStringHelper.Remove(

  StartIndex: Integer

):string; overload;

function TStringHelper.Remove(

  StartIndex: Integer;

  ACount: Integer

):string; overload;

Description

Remove removes ACount characters from the string, starting at (zero-based) index StartIndex. If ACount is omitted, all remaining characters are removed.

See also

Delete | Delete part of a string.
TStringHelper.Replace | Replace occurrences of one string with another.
TStringHelper.Insert | Insert a string at a given position


TStringHelper.Replace

Replace occurrences of one string with another.

Declaration

Source position: syshelph.inc line 130

public function TStringHelper.Replace(

  OldChar: Char;

  NewChar: Char

):string; overload;

function TStringHelper.Replace(

  OldChar: Char;

  NewChar: Char;

  ReplaceFlags: TReplaceFlags

):string; overload;

function TStringHelper.Replace(

  const OldValue: string;

  const NewValue: string

):string; overload;

function TStringHelper.Replace(

  const OldValue: string;

  const NewValue: string;

  ReplaceFlags: TReplaceFlags

):string; overload;

Description

Replace will replace occurrences of OldChar with NewChar or OldValue with NewValue.

If rfReplaceAll is in the ReplaceFlags, then all occurrences will be replaced, otherwise only the first occurrence is replaced.

If rfCaseInsensitive is in the ReplaceFlags, then the search for OldChar or OldValue is performed ignoring case.

See also

StringReplace | Replace occurrences of one substring with another in a string.
TReplaceFlags | Flags for StringReplace function


TStringHelper.Split

Split a string in a number of parts

Declaration

Source position: syshelph.inc line 134

public function TStringHelper.Split(

  const Separators: array of Char

):TStringArray; overload;

function TStringHelper.Split(

  const Separators: array of Char;

  ACount: Integer

):TStringArray; overload;

function TStringHelper.Split(

  const Separators: array of Char;

  Options: TStringSplitOptions

):TStringArray; overload;

function TStringHelper.Split(

  const Separators: array of Char;

  ACount: Integer;

  Options: TStringSplitOptions

):TStringArray; overload;

function TStringHelper.Split(

  const Separators: array of string

):TStringArray; overload;

function TStringHelper.Split(

  const Separators: array of string;

  ACount: Integer

):TStringArray; overload;

function TStringHelper.Split(

  const Separators: array of string;

  Options: TStringSplitOptions

):TStringArray; overload;

function TStringHelper.Split(

  const Separators: array of string;

  ACount: Integer;

  Options: TStringSplitOptions

):TStringArray; overload;

function TStringHelper.Split(

  const Separators: array of Char;

  AQuote: Char

):TStringArray; overload;

function TStringHelper.Split(

  const Separators: array of Char;

  AQuoteStart: Char;

  AQuoteEnd: Char

):TStringArray; overload;

function TStringHelper.Split(

  const Separators: array of Char;

  AQuoteStart: Char;

  AQuoteEnd: Char;

  Options: TStringSplitOptions

):TStringArray; overload;

function TStringHelper.Split(

  const Separators: array of Char;

  AQuoteStart: Char;

  AQuoteEnd: Char;

  ACount: Integer

):TStringArray; overload;

function TStringHelper.Split(

  const Separators: array of Char;

  AQuoteStart: Char;

  AQuoteEnd: Char;

  ACount: Integer;

  Options: TStringSplitOptions

):TStringArray; overload;

function TStringHelper.Split(

  const Separators: array of string;

  AQuote: Char

):TStringArray; overload;

function TStringHelper.Split(

  const Separators: array of string;

  AQuoteStart: Char;

  AQuoteEnd: Char

):TStringArray; overload;

function TStringHelper.Split(

  const Separators: array of string;

  AQuoteStart: Char;

  AQuoteEnd: Char;

  Options: TStringSplitOptions

):TStringArray; overload;

function TStringHelper.Split(

  const Separators: array of string;

  AQuoteStart: Char;

  AQuoteEnd: Char;

  ACount: Integer

):TStringArray; overload;

function TStringHelper.Split(

  const Separators: array of string;

  AQuoteStart: Char;

  AQuoteEnd: Char;

  ACount: Integer;

  Options: TStringSplitOptions

):TStringArray; overload;

Description

Split will split the string (Self) using Separators as separator characters.

If ACount is supplied, then at most ACount strings will be included in the result. The default behaviour is to supply all strings.

if Options contains ExcludeEmpty then no empty strings will be included in the result. Empty strings may be included if multiple succesive separator characters are found in the source string.

If AQuoteStart and AQuoteEnd are supplied, then no splitting will be performed between AQuoteStart and AQuoteEnd characters.

See also

TStringHelper.Join | Join a series of strings, separated using a given separator
TStringHelper.IndexOfAny | Find the position (index) of any string or character in a list.
TStringHelper.IndexOfAnyUnquoted | Find the position (index) of any string or character in a list.


TStringHelper.StartsWith

Check if one string starts with another

Declaration

Source position: syshelph.inc line 152

public function TStringHelper.StartsWith(

  const AValue: string

):Boolean; overload;

function TStringHelper.StartsWith(

  const AValue: string;

  IgnoreCase: Boolean

):Boolean; overload;

Description

StartsWith will return True if the first characters of the string (Self) equal the string AValue. If IgnoreCase is True, then the comparison is done case insensitive. The default is to compare strings case sensitively.

See also

TStringHelper.EndsWith

Check if the string is ended by another.


TStringHelper.Substring

Return a part of the string

Declaration

Source position: syshelph.inc line 154

public function TStringHelper.Substring(

  AStartIndex: Integer

):string; overload;

function TStringHelper.Substring(

  AStartIndex: Integer;

  ALen: Integer

):string; overload;

Description

SubString returns the portion of the string starting at (zero-based) index AStartIndex with length ALen. If ALen is omitted, then all remaining characters are returned.

See also

TStringHelper.Insert | Insert a string at a given position
Copy | Copy part of a string.
TStringHelper.ToCharArray | Return the string ar an array of characters.


TStringHelper.ToBoolean

Convert string to boolean

Declaration

Source position: syshelph.inc line 73

public class function TStringHelper.ToBoolean(

  const S: string

):Boolean; overload;

function TStringHelper.ToBoolean: Boolean; overload;

Description

ToBoolean returns the contents of the string S as a boolean (if possible). It uses StrToBool to convert the value to a boolean.

Errors

If the string contains a value that cannot be translated to a boolean, an EConvertError exception may be raised.

See also

StrToBool | Convert a string to a boolean value
EConvertError | Conversion error.
TStringHelper.ToDouble | Convert string to double-sized floating point value
TStringHelper.ToExtended | Convert string to extended-sized floating point value
TStringHelper.ToInt64 | Convert string to 64-bit signed integer
TStringHelper.ToInteger | Convert string to 32-bit signed integer
TStringHelper.ToSingle | Convert string to single-sized floating point value


TStringHelper.ToCharArray

Return the string ar an array of characters.

Declaration

Source position: syshelph.inc line 162

public function TStringHelper.ToCharArray: TCharArray; overload;

function TStringHelper.ToCharArray(

  AStartIndex: Integer;

  ALen: Integer

):TCharArray; overload;

Description

ToCharArray returns part of the string (Self) as an array of characters. The characters are copied starting at (zero-based) index AStartIndex and at most ALen characters are copied. If AStartIndex and ALen are omitted, all the characters are returned.

Errors

If AStartIndex is less than zero, an EAccessViolation exception may be raised.

See also

TStringHelper.Substring | Return a part of the string
TStringHelper.Insert | Insert a string at a given position
Copy | Copy part of a string.


TStringHelper.ToDouble

Convert string to double-sized floating point value

Declaration

Source position: syshelph.inc line 74

public class function TStringHelper.ToDouble(

  const S: string

):Double; overload;

function TStringHelper.ToDouble: Double; overload;

Description

ToDouble returns the contents of the string S as a Double-sized floating point value (if possible). It uses StrToFloat to convert the value to a floating point value.

Errors

If the string contains a value that cannot be translated to a floating point value, an EConvertError exception may be raised.

See also

StrToFloat | Convert a string to a floating-point value.
EConvertError | Conversion error.
TStringHelper.ToBoolean | Convert string to boolean
TStringHelper.ToExtended | Convert string to extended-sized floating point value
TStringHelper.ToInt64 | Convert string to 64-bit signed integer
TStringHelper.ToInteger | Convert string to 32-bit signed integer
TStringHelper.ToSingle | Convert string to single-sized floating point value


TStringHelper.ToExtended

Convert string to extended-sized floating point value

Declaration

Source position: syshelph.inc line 75

public class function TStringHelper.ToExtended(

  const S: string

):Extended; overload;

function TStringHelper.ToExtended: Extended; overload;

Description

ToExtended returns the contents of the string S as a Extended-sized floating point value (if possible). It uses StrToFloat to convert the value to a floating point value.

Errors

If the string contains a value that cannot be translated to a floating point value, an EConvertError exception may be raised.

See also

StrToFloat | Convert a string to a floating-point value.
EConvertError | Conversion error.
TStringHelper.ToBoolean | Convert string to boolean
TStringHelper.ToDouble | Convert string to double-sized floating point value
TStringHelper.ToInt64 | Convert string to 64-bit signed integer
TStringHelper.ToInteger | Convert string to 32-bit signed integer
TStringHelper.ToSingle | Convert string to single-sized floating point value


TStringHelper.ToInt64

Convert string to 64-bit signed integer

Declaration

Source position: syshelph.inc line 76

public class function TStringHelper.ToInt64(

  const S: string

):Int64; overload;

function TStringHelper.ToInt64: Int64; overload;

Description

ToInt64 returns the contents of the string S as a 64-bit signed integer value (if possible). It uses StrToInt64 to convert the value to an 64-bit sized integer value.

Errors

If the string contains a value that cannot be translated to an integer value, an EConvertError exception may be raised.

See also

StrToInt64 | Convert a string to an Int64 value.
EConvertError | Conversion error.
TStringHelper.ToBoolean | Convert string to boolean
TStringHelper.ToDouble | Convert string to double-sized floating point value
TStringHelper.ToExtended | Convert string to extended-sized floating point value
TStringHelper.ToInteger | Convert string to 32-bit signed integer
TStringHelper.ToSingle | Convert string to single-sized floating point value


TStringHelper.ToInteger

Convert string to 32-bit signed integer

Declaration

Source position: syshelph.inc line 77

public class function TStringHelper.ToInteger(

  const S: string

):Integer; overload;

function TStringHelper.ToInteger: Integer; overload;

Description

ToInteger returns the contents of the string S as a 32-bit signed integer value (if possible). It uses StrToInt64 to convert the value to an 64-bit sized integer value.

Errors

If the string contains a value that cannot be translated to an integer value, an EConvertError exception may be raised.

See also

StrToInt64 | Convert a string to an Int64 value.
EConvertError | Conversion error.
TStringHelper.ToBoolean | Convert string to boolean
TStringHelper.ToDouble | Convert string to double-sized floating point value
TStringHelper.ToExtended | Convert string to extended-sized floating point value
TStringHelper.ToInt64 | Convert string to 64-bit signed integer
TStringHelper.ToSingle | Convert string to single-sized floating point value


TStringHelper.ToLower

Convert to lowercase

Declaration

Source position: syshelph.inc line 164

public function TStringHelper.ToLower: string; overload;

Description

ToLower returns a lowercase version of the string.

See also

TStringHelper.LowerCase | Return the lowercase version of a string.
TStringHelper.ToUpper | Convert to uppercase.
TStringHelper.ToUpperInvariant | Convert to uppercase


TStringHelper.ToLowerInvariant

Convert to lowercase

Declaration

Source position: syshelph.inc line 165

public function TStringHelper.ToLowerInvariant: string;

Description

ToLowerInvariant is equal to TStringHelper.ToLower

See also

TStringHelper.ToLower | Convert to lowercase
TStringHelper.ToUpper | Convert to uppercase.
TStringHelper.ToUpperInvariant | Convert to uppercase


TStringHelper.ToSingle

Convert string to single-sized floating point value

Declaration

Source position: syshelph.inc line 78

public class function TStringHelper.ToSingle(

  const S: string

):Single; overload;

function TStringHelper.ToSingle: Single; overload;

Description

ToSingle returns the contents of the string S as a single-sized floating point value (if possible). It uses StrToFloat to convert the value to a floating point value.

Errors

If the string contains a value that cannot be translated to a floating point value, an EConvertError exception may be raised.

See also

StrToFloat | Convert a string to a floating-point value.
EConvertError | Conversion error.
TStringHelper.ToBoolean | Convert string to boolean
TStringHelper.ToDouble | Convert string to double-sized floating point value
TStringHelper.ToInt64 | Convert string to 64-bit signed integer
TStringHelper.ToInteger | Convert string to 32-bit signed integer
TStringHelper.ToExtended | Convert string to extended-sized floating point value


TStringHelper.ToUpper

Convert to uppercase.

Declaration

Source position: syshelph.inc line 166

public function TStringHelper.ToUpper: string; overload;

Description

>ToUpper returns an uppercase version of the string.

See also

TStringHelper.ToLower | Convert to lowercase
TStringHelper.ToLowerInvariant | Convert to lowercase
TStringHelper.ToUpperInvariant | Convert to uppercase


TStringHelper.ToUpperInvariant

Convert to uppercase

Declaration

Source position: syshelph.inc line 167

public function TStringHelper.ToUpperInvariant: string;

Description

ToUpperInvariant is equal to TStringHelper.ToUpper

See also

TStringHelper.ToLower | Convert to lowercase
TStringHelper.ToLowerInvariant | Convert to lowercase
TStringHelper.ToUpper | Convert to uppercase.


TStringHelper.Trim

Strips a set of trim characters from the beginning and end of the string.

Declaration

Source position: syshelph.inc line 168

public function TStringHelper.Trim: string; overload;

function TStringHelper.Trim(

  const ATrimChars: array of Char

):string; overload;

Description

Trim returns the string (Self), removing all characters occurring in ATrimChars from the start and end of the string. If ATrimChars is not specified, all characters with ASCII code 32 or lower are assumed.

See also

Trim | Trim whitespace from the ends of a string.
TStringHelper.TrimLeft | Strips a set of trim characters from the beginning of the string.
TStringHelper.TrimRight | Strips a set of trim characters from the end of the string.


TStringHelper.TrimEnd

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

TStringHelper.TrimEnd (deprecated)

Alias for TrimRight

Declaration

Source position: syshelph.inc line 174

public function TStringHelper.TrimEnd(

  const ATrimChars: array of Char

):string;

Description

TrimEnd is an alias for TStringHelper.TrimRight

See also

TStringHelper.TrimRight | Strips a set of trim characters from the end of the string.
TStringHelper.TrimStart | Alias for TrimLeft


TStringHelper.TrimLeft

Strips a set of trim characters from the beginning of the string.

Declaration

Source position: syshelph.inc line 169

public function TStringHelper.TrimLeft: string; overload;

function TStringHelper.TrimLeft(

  const ATrimChars: array of Char

):string; overload;

Description

Trim returns the string (Self), removing all characters occurring in ATrimChars from the start of the string. If ATrimChars is not specified, all characters with ASCII code 32 or lower are assumed.

See also

TrimLeft | Trim whitespace from the ends of a string.
TStringHelper.Trim | Strips a set of trim characters from the beginning and end of the string.
TStringHelper.TrimRight | Strips a set of trim characters from the end of the string.


TStringHelper.TrimRight

Strips a set of trim characters from the end of the string.

Declaration

Source position: syshelph.inc line 170

public function TStringHelper.TrimRight: string; overload;

function TStringHelper.TrimRight(

  const ATrimChars: array of Char

):string; overload;

Description

Trim returns the string (Self), removing all characters occurring in ATrimChars from the end of the string. If ATrimChars is not specified, all characters with ASCII code 32 or lower are assumed.

See also

Trim | Trim whitespace from the ends of a string.
TStringHelper.Trim | Strips a set of trim characters from the beginning and end of the string.
TStringHelper.TrimLeft | Strips a set of trim characters from the beginning of the string.


TStringHelper.TrimStart

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

TStringHelper.TrimStart (deprecated)

Alias for TrimLeft

Declaration

Source position: syshelph.inc line 175

public function TStringHelper.TrimStart(

  const ATrimChars: array of Char

):string;

Description

TrimStart is an alias for TStringHelper.TrimLeft

See also

TStringHelper.TrimEnd | Alias for TrimRight
TStringHelper.TrimLeft | Strips a set of trim characters from the beginning of the string.


TStringHelper.UpperCase

Return uppercase version of a string

Declaration

Source position: syshelph.inc line 79

public class function TStringHelper.UpperCase(

  const S: string

):string; overload;

Description

UpperCase returns an uppercase version of the string S.

See also

#rtl.sysutils.UpperCase

Return an uppercase version of a string.


TUnicodeEncoding

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

UTF-16 unicode encoding

Declaration

Source position: sysencodingh.inc line 147

type TUnicodeEncoding = class(TEncoding)
public
constructor Create; virtual; | Create a new instance of the TUnicodeEncoding class
function Clone; override; | Clone a TUnicodeEncoding instance
function GetMaxByteCount(); override; | Return max number of bytes needed to represent a string
function GetMaxCharCount(); override; | Return max number of characters that can be represented by an array of bytes
function GetPreamble; override; | Return BOM marker bytes
end;

Inheritance

TUnicodeEncoding | UTF-16 unicode encoding
|
TEncoding | Encoding support
|
TObject

Description

TUnicodeEncoding is the encoding class used to represent the UTF-16 encoding.

See also

TUnicodeEncoding | UTF-16 unicode encoding
TUTF7Encoding | UTF-7 unicode encoding
TMBCSEncoding | Multi-Byte character set encoding
TBigendianUnicodeEncoding | Big-endian UTF-16 unicode encoding


TUnicodeEncoding
TEncoding
 | ro | CodePage
 | ro | EncodingName
 | ro | IsSingleByte
 | ro | ANSI
 | ro | ASCII
 | ro | BigEndianUnicode
 | ro | Default
 | ro | Unicode
 | ro | UTF7
 | ro | UTF8


TUnicodeEncoding
 | Create
 | Clone
 | GetMaxByteCount
 | GetMaxCharCount
 | GetPreamble
TEncoding
 | FreeEncodings
 | Clone
 | Convert
 | IsStandardEncoding
 | GetBufferEncoding
 | GetEncoding
 | GetMaxByteCount
 | GetMaxCharCount
 | GetPreamble
 | GetString


Clone (TEncoding)

Clone (TUnicodeEncoding)

Convert (TEncoding)

Create (TUnicodeEncoding)

FreeEncodings (TEncoding)

GetBufferEncoding (TEncoding)

GetEncoding (TEncoding)

GetMaxByteCount (TEncoding)

GetMaxByteCount (TUnicodeEncoding)

GetMaxCharCount (TEncoding)

GetMaxCharCount (TUnicodeEncoding)

GetPreamble (TEncoding)

GetPreamble (TUnicodeEncoding)

GetString (TEncoding)

IsStandardEncoding (TEncoding)


TUnicodeEncoding

TEncoding


TUnicodeEncoding.Create

Create a new instance of the TUnicodeEncoding class

Declaration

Source position: sysencodingh.inc line 156

public constructor TUnicodeEncoding.Create; virtual;

Description

Create creates a new instance of the TUnicodeEncoding class and sets the codepage to CP_UTF16.

See also

TEncoding.CodePage | Codepage for this encoding
TEncoding | Encoding support


TUTF7Encoding

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

UTF-7 unicode encoding

Declaration

Source position: sysencodingh.inc line 126

type TUTF7Encoding = class(TMBCSEncoding)
public
constructor Create; override; | Create a new instance of the TUTF7Encoding class
function Clone; override; | Clone a TUTF7Encoding instance
function GetMaxByteCount(); override; | Return max number of bytes needed to represent a string
function GetMaxCharCount(); override; | Return max number of characters that can be represented by an array of bytes
end;

Inheritance

TUTF7Encoding | UTF-7 unicode encoding
|
TMBCSEncoding | Multi-Byte character set encoding
|
TEncoding | Encoding support
|
TObject

Description

TUTF7Encoding is the encoding class used to represent the UTF7 encoding. This encoding is not so often used, and the class is provided mostly for completeness.

See also

TUnicodeEncoding | UTF-16 unicode encoding
TUTF8Encoding | UTF-8 unicode encoding
TMBCSEncoding | Multi-Byte character set encoding
TBigendianUnicodeEncoding | Big-endian UTF-16 unicode encoding


TUTF7Encoding
TMBCSEncoding
TEncoding
 | ro | CodePage
 | ro | EncodingName
 | ro | IsSingleByte
 | ro | ANSI
 | ro | ASCII
 | ro | BigEndianUnicode
 | ro | Default
 | ro | Unicode
 | ro | UTF7
 | ro | UTF8


TUTF7Encoding
 | Create
 | Clone
 | GetMaxByteCount
 | GetMaxCharCount
TMBCSEncoding
 | Create
 | Clone
 | GetMaxByteCount
 | GetMaxCharCount
 | GetPreamble
TEncoding
 | FreeEncodings
 | Clone
 | Convert
 | IsStandardEncoding
 | GetBufferEncoding
 | GetEncoding
 | GetMaxByteCount
 | GetMaxCharCount
 | GetPreamble
 | GetString


Clone (TEncoding)

Clone (TMBCSEncoding)

Clone (TUTF7Encoding)

Convert (TEncoding)

Create (TMBCSEncoding)

Create (TUTF7Encoding)

FreeEncodings (TEncoding)

GetBufferEncoding (TEncoding)

GetEncoding (TEncoding)

GetMaxByteCount (TEncoding)

GetMaxByteCount (TMBCSEncoding)

GetMaxByteCount (TUTF7Encoding)

GetMaxCharCount (TEncoding)

GetMaxCharCount (TMBCSEncoding)

GetMaxCharCount (TUTF7Encoding)

GetPreamble (TEncoding)

GetPreamble (TMBCSEncoding)

GetString (TEncoding)

IsStandardEncoding (TEncoding)


TUTF7Encoding

TMBCSEncoding

TEncoding


TUTF7Encoding.Create

Create a new instance of the TUTF7Encoding class

Declaration

Source position: sysencodingh.inc line 128

public constructor TUTF7Encoding.Create; override;

Description

Create creates a new instance of the TUTF7Encoding class and sets the codepage to CP_UTF7.

See also

TEncoding.CodePage | Codepage for this encoding
TEncoding | Encoding support


TUTF8Encoding

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

UTF-8 unicode encoding

Declaration

Source position: sysencodingh.inc line 136

type TUTF8Encoding = class(TUTF7Encoding)
public
constructor Create; override; | Create a new instance of the TUTF8Encoding class
function Clone; override; | Clone a TUTF8Encoding instance
function GetMaxByteCount(); override; | Return max number of bytes needed to represent a string
function GetMaxCharCount(); override; | Return max number of characters that can be represented by an array of bytes
function GetPreamble; override; | Return BOM marker bytes
end;

Inheritance

TUTF8Encoding | UTF-8 unicode encoding
|
TUTF7Encoding | UTF-7 unicode encoding
|
TMBCSEncoding | Multi-Byte character set encoding
|
TEncoding | Encoding support
|
TObject

Description

TUTF8Encoding is the encoding class used to represent the UTF-8 encoding.

See also

TUnicodeEncoding | UTF-16 unicode encoding
TUTF7Encoding | UTF-7 unicode encoding
TMBCSEncoding | Multi-Byte character set encoding
TBigendianUnicodeEncoding | Big-endian UTF-16 unicode encoding


TUTF8Encoding
TUTF7Encoding
TMBCSEncoding
TEncoding
 | ro | CodePage
 | ro | EncodingName
 | ro | IsSingleByte
 | ro | ANSI
 | ro | ASCII
 | ro | BigEndianUnicode
 | ro | Default
 | ro | Unicode
 | ro | UTF7
 | ro | UTF8


TUTF8Encoding
 | Create
 | Clone
 | GetMaxByteCount
 | GetMaxCharCount
 | GetPreamble
TUTF7Encoding
 | Create
 | Clone
 | GetMaxByteCount
 | GetMaxCharCount
TMBCSEncoding
 | Create
 | Clone
 | GetMaxByteCount
 | GetMaxCharCount
 | GetPreamble
TEncoding
 | FreeEncodings
 | Clone
 | Convert
 | IsStandardEncoding
 | GetBufferEncoding
 | GetEncoding
 | GetMaxByteCount
 | GetMaxCharCount
 | GetPreamble
 | GetString


Clone (TEncoding)

Clone (TMBCSEncoding)

Clone (TUTF7Encoding)

Clone (TUTF8Encoding)

Convert (TEncoding)

Create (TMBCSEncoding)

Create (TUTF7Encoding)

Create (TUTF8Encoding)

FreeEncodings (TEncoding)

GetBufferEncoding (TEncoding)

GetEncoding (TEncoding)

GetMaxByteCount (TEncoding)

GetMaxByteCount (TMBCSEncoding)

GetMaxByteCount (TUTF7Encoding)

GetMaxByteCount (TUTF8Encoding)

GetMaxCharCount (TEncoding)

GetMaxCharCount (TMBCSEncoding)

GetMaxCharCount (TUTF7Encoding)

GetMaxCharCount (TUTF8Encoding)

GetPreamble (TEncoding)

GetPreamble (TMBCSEncoding)

GetPreamble (TUTF8Encoding)

GetString (TEncoding)

IsStandardEncoding (TEncoding)


TUTF8Encoding

TUTF7Encoding

TMBCSEncoding

TEncoding


TUTF8Encoding.Create

Create a new instance of the TUTF8Encoding class

Declaration

Source position: sysencodingh.inc line 138

public constructor TUTF8Encoding.Create; override;

Description

Create creates a new instance of the TUTF8Encoding class and sets the codepage to CP_UTF8.

See also

TEncoding.CodePage | Codepage for this encoding
TEncoding | Encoding support


TWordBoolHelper

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Helper for the WordBool type.

Declaration

Source position: syshelph.inc line 598

type TWordBoolHelper = type helper
public
class function Parse(); | Convert string value to WordBool value.
class function Size; | Return the size (in bytes) of the
class function ToString(); | Convert a WordBool value to string.
class function TryToParse(); | Try to convert a string to a WordBool value
function ToInteger; | Convert to an integer value
end;

Inheritance

TWordBoolHelper

Helper for the WordBool type.

Description

TWordBoolHelper is a helper type for the WordBool type. It contains mostly conversion routines to and from other types.

See also

TStringHelper | Helper type for strings.
TShortIntHelper | Helper for a ShortInt-typed ordinal value
TSmallIntHelper | Helper for a SmallInt-typed ordinal value
TWordHelper | Helper for a Word-typed ordinal value
TCardinalHelper | Helper for a Cardinal-typed ordinal value
TIntegerHelper | Helper for a Integer-typed ordinal value
TInt64Helper | Helper for a Int64-typed ordinal value
TQWordHelper | Helper for a QWord-typed ordinal value
TNativeIntHelper | Helper for a NativeInt-typed ordinal value
TByteHelper | Helper for a byte-typed ordinal value
TByteBoolHelper | Helper for the ByteBool type.
TWordBoolHelper | Helper for the WordBool type.
TLongBoolHelper | Helper for the LongBool type.


TWordBoolHelper


TWordBoolHelper
 | Parse
 | Size
 | ToString
 | TryToParse
 | ToInteger


Parse (TWordBoolHelper)

Size (TWordBoolHelper)

ToInteger (TWordBoolHelper)

ToString (TWordBoolHelper)

TryToParse (TWordBoolHelper)


TWordBoolHelper.Parse

Convert string value to WordBool value.

Declaration

Source position: syshelph.inc line 600

public class function TWordBoolHelper.Parse(

  const S: string

):Boolean;

Description

Parse attempts to convert the string S to a WordBool value. It uses the StrToBool function to perform the conversion.

Errors

If S does not contain a valid string representation, then an EConvertError exception is raised.

See also

TWordBoolHelper.TryToParse | Try to convert a string to a WordBool value
TWordBoolHelper.ToString | Convert a WordBool value to string.
TWordBoolHelper.ToInteger | Convert to an integer value


TWordBoolHelper.Size

Return the size (in bytes) of the

Declaration

Source position: syshelph.inc line 601

public class function TWordBoolHelper.Size: Integer;

Description

Size returns the size (in bytes) of the WordBool value. This is equivalent to SizeOf(WordBool).

See also

SizeOf

Return size of a variable or type.


TWordBoolHelper.ToInteger

Convert to an integer value

Declaration

Source position: syshelph.inc line 605

public function TWordBoolHelper.ToInteger: Integer;

Description

ToInteger will return the WordBool value, typecasted to Integer.

See also

TWordBoolHelper.ToString

Convert a WordBool value to string.


TWordBoolHelper.ToString

Convert a WordBool value to string.

Declaration

Source position: syshelph.inc line 602

public class function TWordBoolHelper.ToString(

  const AValue: Boolean;

  UseBoolStrs: TUseBoolStrs = TUseBoolStrs.False

):string; overload;

function TWordBoolHelper.ToString(

  UseBoolStrs: TUseBoolStrs = TUseBoolStrs.False

):string; overload;

Description

ToString will, in the class method version, convert the AValue WordBool to a string representation. In the function method version the WordBool value itself (Self) will be converted.

If the UseBoolStrs parameter equals TUseBoolStrs.True, then the string representation will use the WordBool strings BoolStrs. The default value for UseBoolStrs is TUseBoolStrs.False.

The conversion is done using the BoolTostr function.

See also

BoolStrs

BoolToStr

Convert a boolean value to a string.


TWordBoolHelper.TryToParse

Try to convert a string to a WordBool value

Declaration

Source position: syshelph.inc line 603

public class function TWordBoolHelper.TryToParse(

  const S: string;

  out AValue: Boolean

):Boolean;

Description

TryToParse will attempt to convert the string S to a WordBool value. If the attempt is succesful, True is returned, and the actual value is returned in AValue. If the attempt failed, False is returned.

See also

TWordBoolHelper.Parse | Convert string value to WordBool value.
TWordBoolHelper.ToString | Convert a WordBool value to string.


TWordHelper

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Helper for a Word-typed ordinal value

Declaration

Source position: syshelph.inc line 423

type TWordHelper = type helper
public
Const
MaxValue = 65535 | Maximum value for a Word
MinValue = 0 | Minimum value for a Word
class function Parse(); | Convert from a string
class function Size; | Size, in bytes, of the Word value
class function ToString(); | Convert the value to string
class function TryParse(); | Try to convert a string to a Word, report success or failure
function ToBoolean; | Convert to a boolean value
function ToDouble; | Convert to a double-sized floating point value
function ToExtended; | Convert to an extended-sized floating point value
function ToHexString(); | Convert to a hexadecimal string representation
function ToSingle; | Convert to an single-sized floating point value
end;

Inheritance

TWordHelper

Helper for a Word-typed ordinal value

Description

TWordHelper contains some auxiliary routines for a Word-typed ordinal value. It consists mainly of conversion routines to and from other types.

See also

TStringHelper | Helper type for strings.
TShortIntHelper | Helper for a ShortInt-typed ordinal value
TSmallIntHelper | Helper for a SmallInt-typed ordinal value
TByteHelper | Helper for a byte-typed ordinal value
TCardinalHelper | Helper for a Cardinal-typed ordinal value
TIntegerHelper | Helper for a Integer-typed ordinal value
TInt64Helper | Helper for a Int64-typed ordinal value
TQWordHelper | Helper for a QWord-typed ordinal value
TNativeIntHelper | Helper for a NativeInt-typed ordinal value
TNativeUIntHelper | Helper for a NativeUInt-typed ordinal value


TWordHelper


TWordHelper
 | Parse
 | Size
 | ToString
 | TryParse
 | ToBoolean
 | ToDouble
 | ToExtended
 | ToHexString
 | ToSingle


Parse (TWordHelper)

Size (TWordHelper)

ToBoolean (TWordHelper)

ToDouble (TWordHelper)

ToExtended (TWordHelper)

ToHexString (TWordHelper)

ToSingle (TWordHelper)

ToString (TWordHelper)

TryParse (TWordHelper)


TWordHelper.MaxValue

Maximum value for a Word

Declaration

Source position: syshelph.inc line 426

public const TWordHelper.MaxValue = 65535;

Description

MaxValue is the biggest value a Word-typed value can contain.

See also

TWordHelper.MinValue

Minimum value for a Word


TWordHelper.MinValue

Minimum value for a Word

Declaration

Source position: syshelph.inc line 427

public const TWordHelper.MinValue = 0;

Description

MinValue is the smallest value a Word-typed value can contain.

See also

TWordHelper.MaxValue

Maximum value for a Word


TWordHelper.Parse

Convert from a string

Declaration

Source position: syshelph.inc line 429

public class function TWordHelper.Parse(

  const AString: string

):Word;

Description

Parse will attempt to convert the string AString to a Word value. It uses the StrToInt function to perform the conversion, so no localization is taken into account.

Errors

If the string does not contain a valid Word value, an EConvertError exception is raised.

See also

TWordHelper.ToString | Convert the value to string
TWordHelper.TryParse | Try to convert a string to a Word, report success or failure
StrToInt | Convert a string to an integer value.


TWordHelper.Size

Size, in bytes, of the Word value

Declaration

Source position: syshelph.inc line 430

public class function TWordHelper.Size: Integer;

Description

Size returns the size (in Words) of the Word value. This is equivalent to SizeOf(Word).

Errors

None.

See also

SizeOf

Return size of a variable or type.


TWordHelper.ToBoolean

Convert to a boolean value

Declaration

Source position: syshelph.inc line 434

public function TWordHelper.ToBoolean: Boolean;

Description

ToBoolean converts the Word value to a boolean: it returns True if the value is nonzero, False if it is zero.

See also

TWordHelper.ToSingle | Convert to an single-sized floating point value
TWordHelper.ToDouble | Convert to a double-sized floating point value
TWordHelper.ToExtended | Convert to an extended-sized floating point value
TWordHelper.ToString | Convert the value to string
TWordHelper.ToHexString | Convert to a hexadecimal string representation


TWordHelper.ToDouble

Convert to a double-sized floating point value

Declaration

Source position: syshelph.inc line 435

public function TWordHelper.ToDouble: Double;

Description

ToDouble converts the Word value to a double-sized floating point value.

See also

TWordHelper.ToBoolean | Convert to a boolean value
TWordHelper.ToExtended | Convert to an extended-sized floating point value
TWordHelper.ToSingle | Convert to an single-sized floating point value
TWordHelper.ToString | Convert the value to string
TWordHelper.ToHexString | Convert to a hexadecimal string representation


TWordHelper.ToExtended

Convert to an extended-sized floating point value

Declaration

Source position: syshelph.inc line 436

public function TWordHelper.ToExtended: Extended;

Description

ToDouble converts the Word value to an extended-sized floating point value.

See also

TWordHelper.ToBoolean | Convert to a boolean value
TWordHelper.ToSingle | Convert to an single-sized floating point value
TWordHelper.ToDouble | Convert to a double-sized floating point value
TWordHelper.ToString | Convert the value to string
TWordHelper.ToHexString | Convert to a hexadecimal string representation


TWordHelper.ToHexString

Convert to a hexadecimal string representation

Declaration

Source position: syshelph.inc line 437

public function TWordHelper.ToHexString(

  const AMinDigits: Integer

):string; overload;

function TWordHelper.ToHexString: string; overload;

Description

ToHexString converts the Word value to a hexadecimal string representation. The AMinDigits argument specifies the minimal number of characters in the resulting string. The string will be left-padded with zeroes if the representation contains less than AMinDigits characters.

See also

TWordHelper.ToBoolean | Convert to a boolean value
TWordHelper.ToSingle | Convert to an single-sized floating point value
TWordHelper.ToDouble | Convert to a double-sized floating point value
TWordHelper.ToString | Convert the value to string
TWordHelper.ToExtended | Convert to an extended-sized floating point value


TWordHelper.ToSingle

Convert to an single-sized floating point value

Declaration

Source position: syshelph.inc line 439

public function TWordHelper.ToSingle: Single;

Description

ToSingle converts the Word value to a single-sized floating point value.

See also

TWordHelper.ToBoolean | Convert to a boolean value
TWordHelper.ToDouble | Convert to a double-sized floating point value
TWordHelper.ToExtended | Convert to an extended-sized floating point value
TWordHelper.ToString | Convert the value to string
TWordHelper.ToHexString | Convert to a hexadecimal string representation


TWordHelper.ToString

Convert the value to string

Declaration

Source position: syshelph.inc line 431

public class function TWordHelper.ToString(

  const AValue: Word

):string; overload;

function TWordHelper.ToString: string; overload;

Description

ToString will, in the class function variant of this method, convert AValue to a string representation. In the regular method overloaded version of ToString, the Word value itself is used. The IntToStr function is used to do the conversion.

See also

TWordHelper.Parse | Convert from a string
IntToStr | Convert an integer value to a decimal string.


TWordHelper.TryParse

Try to convert a string to a Word, report success or failure

Declaration

Source position: syshelph.inc line 432

public class function TWordHelper.TryParse(

  const AString: string;

  out AValue: Word

):Boolean;

Description

TryParse attempts to convert the string AString to a Word, and reports the success of the attempt. If the attempt is succesful, then True is returned, and the actual value of the Word is returned in AValue.

It uses the val function to perform the conversion, so no localization is taken into account.

See also

TWordHelper.Parse | Convert from a string
Val | Calculate numerical/enumerated value of a string.


IClassFactory

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Class defined for ActiveX compatibility.

Declaration

Source position: types.pp line 290

type IClassFactory = interface(IUnknown)
function CreateInstance(); | Create a new instance of an interface.
function LockServer(); | Lock ActiveX server object.
end;

Inheritance

IClassFactory | Class defined for ActiveX compatibility.
IUnknown | Basic interface for all COM-based interfaces

Description

IClassFactory is defined for Delphi/Kylix compatibility and should not be used.


IClassFactory

IUnknown


IClassFactory
 | CreateInstance
 | LockServer
IUnknown
 | QueryInterface
 | _AddRef
 | _Release


CreateInstance (IClassFactory)

LockServer (IClassFactory)

QueryInterface (IUnknown)

_AddRef (IUnknown)

_Release (IUnknown)


IClassFactory.CreateInstance

Create a new instance of an interface.

Declaration

Source position: types.pp line 291

function IClassFactory.CreateInstance(

  const unkOuter: IUnknown;

  const riid: TGuid;

  out vObject

):HRESULT;

Description

IClassFactory.CreateInstance is defined for Delphi/Kylix compatibility and should not be used.


IClassFactory.LockServer

Lock ActiveX server object.

Declaration

Source position: types.pp line 292

function IClassFactory.LockServer(

  fLock: LongBool

):HRESULT;

Description

IClassFactory.LocksServer is defined for Delphi/Kylix compatibility and should not be used.


ISequentialStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Sequential stream object interface

Declaration

Source position: types.pp line 295

type ISequentialStream = interface(IUnknown)
function Read(); | Read data from the stream
function Write(); | Write data to the stream
end;

Inheritance

ISequentialStream | Sequential stream object interface
IUnknown | Basic interface for all COM-based interfaces

Description

ISequentialStream is the interface for streams which only support sequential reading of chunks of data. It is defined for Delphi/Kylix compatibility and should not be used.

See also

IStream

COM stream abstraction


ISequentialStream

IUnknown


ISequentialStream
 | Read
 | Write
IUnknown
 | QueryInterface
 | _AddRef
 | _Release


QueryInterface (IUnknown)

Read (ISequentialStream)

Write (ISequentialStream)

_AddRef (IUnknown)

_Release (IUnknown)


ISequentialStream.Read

Read data from the stream

Declaration

Source position: types.pp line 297

function ISequentialStream.Read(

  pv: Pointer;

  cb: DWORD;

  pcbRead: PDWord

):HRESULT;

Description

Read reads cbCount bytes from the stream into the memory pointed to by pv and returns the number of bytes read in pcbread. The result is zero for success or an error code.

See also

ISequentialStream.Write

Write data to the stream


ISequentialStream.Write

Write data to the stream

Declaration

Source position: types.pp line 298

function ISequentialStream.Write(

  pv: Pointer;

  cb: DWORD;

  pcbWritten: PDWord

):HRESULT;

Description

Write writes cbCount bytes from the memory pointed to by pv to the stream and returns the number of bytes written in pcbwritten. The result is zero for success or an error code.

See also

ISequentialStream.Read

Read data from the stream


IStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

COM stream abstraction

Declaration

Source position: types.pp line 301

type IStream = interface(ISequentialStream)
function Seek(); | Set the stream position
function SetSize(); | Set the stream size
function CopyTo(); | Copy data from one stream to another
function Commit(); | Commit data to the stream
function Revert; | Revert changes
function LockRegion(); | Lock a region of bytes in the stream
function UnlockRegion(); | Unlocks a previously locked region of bytes in the stream
function Stat(); | return information about the stream.
function Clone(); | Clone the stream instance
end;

Inheritance

IStream | COM stream abstraction
ISequentialStream | Sequential stream object interface
IUnknown | Basic interface for all COM-based interfaces

Description

An abstract interface for an external (non pascal) stream, as defined in Microsoft COM interfaces


IStream

ISequentialStream

IUnknown


IStream
 | Seek
 | SetSize
 | CopyTo
 | Commit
 | Revert
 | LockRegion
 | UnlockRegion
 | Stat
 | Clone
ISequentialStream
 | Read
 | Write
IUnknown
 | QueryInterface
 | _AddRef
 | _Release


Clone (IStream)

Commit (IStream)

CopyTo (IStream)

LockRegion (IStream)

QueryInterface (IUnknown)

Read (ISequentialStream)

Revert (IStream)

Seek (IStream)

SetSize (IStream)

Stat (IStream)

UnlockRegion (IStream)

Write (ISequentialStream)

_AddRef (IUnknown)

_Release (IUnknown)


IStream.Clone

Clone the stream instance

Declaration

Source position: types.pp line 310

function IStream.Clone(

  out stm: IStream

):HRESULT;

Description

Clone returns an independent but initially equal copy of the stream in stm. The function returns zero if the call was successful.

Errors

On error, a nonzero exit code is returned.


IStream.Commit

Commit data to the stream

Declaration

Source position: types.pp line 305

function IStream.Commit(

  grfCommitFlags: LongInt

):HRESULT;

Description

Commit commits the data in the stream to the underlying medium. Flags is a set of options to control the commit operation (see MSDN for the possible flags).

Errors

On error, a nonzero exit code is returned.


IStream.CopyTo

Copy data from one stream to another

Declaration

Source position: types.pp line 304

function IStream.CopyTo(

  stm: IStream;

  cb: LargeUint;

  out cbRead: LargeUint;

  out cbWritten: LargeUint

):HRESULT;

Description

CopyTo copies cb bytes from the stream to target stream stm. cbRead returns how many bytes were read from the stream, cbwrite returns how many bytes were actually written to the destination stream. The function returns zero on success.

Errors

On error, a nonzero exit code is returned.


IStream.LockRegion

Lock a region of bytes in the stream

Declaration

Source position: types.pp line 307

function IStream.LockRegion(

  libOffset: LargeUint;

  cb: LargeUint;

  dwLockType: LongInt

):HRESULT;

Description

LockRegion locks a region of the storage, starting at libOffset, for cbCount bytes. The applied lock is of type dwLockType. The function returns zero if the lock was succesfully applied.

Errors

On error, a nonzero exit code is returned.


IStream.Revert

Revert changes

Declaration

Source position: types.pp line 306

function IStream.Revert: HRESULT;

Description

Revert reverts all changes that were done to a transacted stream, i.e. all changes since the last commit. The function returns zero on success.

Errors

On error, a nonzero exit code is returned.


IStream.Seek

Set the stream position

Declaration

Source position: types.pp line 302

function IStream.Seek(

  dlibMove: LargeUint;

  dwOrigin: LongInt;

  out libNewPosition: LargeUint

):HRESULT;

Description

Seek sets the stream position at dlibMove bytes from dwOrigin (one of the SEEK_* constants) and returns the new absolute position in libNewPosition. The function returns zero on success, or an error code.

Errors

On error, a nonzero exit code is returned.


IStream.SetSize

Set the stream size

Declaration

Source position: types.pp line 303

function IStream.SetSize(

  libNewSize: LargeUint

):HRESULT;

Description

SetSize sets the size of the stream to libNewSize bytes, if the stream allows it. On sucess, zero is returned.

Errors

On error, a nonzero exit code is returned.


IStream.Stat

return information about the stream.

Declaration

Source position: types.pp line 309

function IStream.Stat(

  out statstg: TStatStg;

  grfStatFlag: LongInt

):HRESULT;

Description

Stat returns information about the stream in statstg, taking into account the flags in grfStatFlag (one of the STATFLAG_ constants). The function returns zero if the call was successful.

Errors

On error, a nonzero exit code is returned.


IStream.UnlockRegion

Unlocks a previously locked region of bytes in the stream

Declaration

Source position: types.pp line 308

function IStream.UnlockRegion(

  libOffset: LargeUint;

  cb: LargeUint;

  dwLockType: LongInt

):HRESULT;

Description

UnlockRegion removes the lock on a region of the storage, starting at libOffset, for cbCount bytes. The lock must be of type dwLockType. The function returns zero if the lock was succesfully removed.

Errors

On error, a nonzero exit code is returned.


EPropertyConvertError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when converting a property

Declaration

Source position: typinfo.pp line 445

type EPropertyConvertError = class(Exception)

Inheritance

EPropertyConvertError | Exception raised when converting a property
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.

Description

EPropertyConvertError is not used in the Free Pascal implementation of the typinfo unit, but is declared for Delphi compatibility.


EPropertyConvertError
Exception
 | HelpContext
 | Message
TObject


EPropertyConvertError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EPropertyConvertError

Exception

TObject


EPropertyError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised in case of an error in one of the functions.

Declaration

Source position: typinfo.pp line 439

type EPropertyError = class(Exception)

Inheritance

EPropertyError | Exception raised in case of an error in one of the functions.
|
Exception | Base class of all exceptions.
|
TObject | Base class of all classes.


EPropertyError
Exception
 | HelpContext
 | Message
TObject


EPropertyError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp
 | ToString
TObject
 | Create
 | Destroy
 | newinstance
 | FreeInstance
 | SafeCallException
 | DefaultHandler
 | Free
 | InitInstance
 | CleanupInstance
 | ClassType
 | ClassInfo
 | ClassName
 | ClassNameIs
 | ClassParent
 | InstanceSize
 | InheritsFrom
 | StringMessageTable
 | MethodAddress
 | MethodName
 | FieldAddress
 | AfterConstruction
 | BeforeDestruction
 | DefaultHandlerStr
 | Dispatch
 | DispatchStr
 | GetInterface
 | GetInterfaceByStr
 | GetInterfaceWeak
 | GetInterfaceEntry
 | GetInterfaceEntryByStr
 | GetInterfaceTable
 | UnitName
 | Equals
 | GetHashCode
 | ToString


EPropertyError

Exception

TObject


CreateShellArgV

Create a null-terminated array of strings from a command-line string

Declaration

Source position: genfunch.inc line 17

function CreateShellArgV(

  const prog: string

):PPChar;

function CreateShellArgV(

  const prog: Ansistring

):PPChar;

Description

CreateShellArgV creates a command-line string for executing a shell command using 'sh -c'. The result is a null-terminated array of null-terminated strings suitable for use in fpExecv and friends.

Errors

If no more memory is available, a heap error may occur.

See also

fpExecv | Execute process
FreeShellArgV | Free the result of a CreateShellArgV function


FpAccess

Check file access

Declaration

Source position: bunxh.inc line 82

function FpAccess(

  pathname: PChar;

  aMode: cint

):cint;

function FpAccess(

  const pathname: RawByteString;

  aMode: cint

):cint;

Description

FpAccess tests user's access rights on the specified file. Mode is a mask existing of one or more of the following:

R_OK
User has read rights.
W_OK
User has write rights.
X_OK
User has execute rights.
F_OK
File exists.

The test is done with the real user ID, instead of the effective user ID. If the user has the requested rights, zero is returned. If access is denied, or an error occurred, a nonzero value is returned.

Errors

Extended error information can be retrieved using fpGetErrno.

sys_eaccess
The requested access is denied, either to the file or one of the directories in its path.
sys_einval
Mode was incorrect.
sys_enoent
A directory component in Path doesn't exist or is a dangling symbolic link.
sys_enotdir
A directory component in Path is not a directory.
sys_enomem
Insufficient kernel memory.
sys_eloop
Path has a circular symbolic link.

See also

FpChown | Change owner of file
FpChmod | Change file permission bits

Example

Program Example26;

{ Program to demonstrate the Access function. }

Uses BaseUnix;

begin
  if fpAccess ('/etc/passwd',W_OK)=0 then
    begin
    Writeln ('Better check your system.');
    Writeln ('I can write to the /etc/passwd file !');
    end;
end.


FpAlarm

Schedule an alarm signal to be delivered

Declaration

Source position: bunxh.inc line 42

function FpAlarm(

  seconds: cuint

):cuint;

Description

FpAlarm schedules an alarm signal to be delivered to your process in Seconds seconds. When Seconds seconds have elapsed, the system will send a SIGALRM signal to the current process. If Seconds is zero, then no new alarm will be set. Whatever the value of Seconds, any previous alarm is cancelled.

The function returns the number of seconds till the previously scheduled alarm was due to be delivered, or zero if there was none. A negative value indicates an error.

See also

fpSigAction | Install signal handler
fpPause | Wait for a signal to arrive

Example

Program Example59;

{ Program to demonstrate the Alarm function. }

Uses BaseUnix;

Procedure AlarmHandler(Sig : cint);cdecl;

begin
  Writeln ('Got to alarm handler');
end;

begin
  Writeln('Setting alarm handler');
  fpSignal(SIGALRM,SignalHandler(@AlarmHandler));
  Writeln ('Scheduling Alarm in 10 seconds');
  fpAlarm(10);
  Writeln ('Pausing');
  fpPause;
  Writeln ('Pause returned');
end.


FpChdir

Change current working directory.

Declaration

Source position: bunxh.inc line 74

function FpChdir(

  path: PChar

):cint;

function FpChdir(

  const path: RawByteString

):cint;

Description

fpChDir sets the current working directory to Path.

It returns zero if the call was succesful, -1 on error.

Note: There exist a portable alterative to fpChDir: system.chdir. Please use fpChDir only if you are writing Unix specific code. System.chdir will work on all operating systems.

Errors

Extended error information can be retrieved using fpGetErrno.

See also

fpGetCwd

Retrieve the current working directory.


FpChmod

Change file permission bits

Declaration

Source position: bunxh.inc line 34

function FpChmod(

  path: PChar;

  Mode: TMode

):cint;

function FpChmod(

  const path: RawByteString;

  Mode: TMode

):cint;

Description

fpChmod sets the Mode bits of the file in Path to Mode. Mode can be specified by 'or'-ing the following values:

S_ISUID
Set user ID on execution.
S_ISGID
Set Group ID on execution.
S_ISVTX
Set sticky bit.
S_IRUSR
Read by owner.
S_IWUSR
Write by owner.
S_IXUSR
Execute by owner.
S_IRGRP
Read by group.
S_IWGRP
Write by group.
S_IXGRP
Execute by group.
S_IROTH
Read by others.
S_IWOTH
Write by others.
S_IXOTH
Execute by others.
S_IRWXO
Read, write, execute by others.
S_IRWXG
Read, write, execute by groups.
S_IRWXU
Read, write, execute by user.

If the function is successful, zero is returned. A nonzero return value indicates an error.

Errors

The following error codes are returned:

sys_eperm
The effective UID doesn't match the ownership of the file, and is not zero. Owner or group were not specified correctly.
sys_eaccess
One of the directories in Path has no search (=execute) permission.
sys_enoent
A directory entry in Path does not exist or is a symbolic link pointing to a non-existent directory.
sys_enomem
Insufficient kernel memory.
sys_erofs
The file is on a read-only filesystem.
sys_eloop
Path has a reference to a circular symbolic link, i.e. a symbolic link, whose expansion points to itself.

See also

fpChown | Change owner of file
fpAccess | Check file access

Example

Program Example23;

{ Program to demonstrate the Chmod function. }

Uses BaseUnix,Unix;

Var F : Text;

begin
  { Create a file }
  Assign (f,'testex21');
  Rewrite (F);
  Writeln (f,'#!/bin/sh');
  Writeln (f,'echo Some text for this file');
  Close (F);
  fpChmod ('testex21',&777);
  { File is now executable  }
  fpexecl ('./testex21',[]);
end.


FpChown

Change owner of file

Declaration

Source position: bunxh.inc line 35

function FpChown(

  path: PChar;

  owner: TUid;

  group: TGid

):cint;

function FpChown(

  const path: RawByteString;

  owner: TUid;

  group: TGid

):cint;

Description

fpChown sets the User ID and Group ID of the file in Path to Owner,Group.

The function returns zero if the call was succesfull, a nonzero return value indicates an error.

Errors

The following error codes are returned:

sys_eperm
The effective UID doesn't match the ownership of the file, and is not zero. Owner or group were not specified correctly.
sys_eaccess
One of the directories in Path has no search (=execute) permission.
sys_enoent
A directory entry in Path does not exist or is a symbolic link pointing to a non-existent directory.
sys_enomem
Insufficient kernel memory.
sys_erofs
The file is on a read-only filesystem.
sys_eloop
Path has a reference to a circular symbolic link, i.e. a symbolic link, whose expansion points to itself.

See also

fpChmod | Change file permission bits
fpAccess | Check file access

Example

Program Example24;

{ Program to demonstrate the Chown function. }

Uses BaseUnix;

Var UID : TUid;
    GID : TGid;
    F : Text;

begin

  Writeln ('This will only work if you are root.');
  Write ('Enter a UID : ');readln(UID);
  Write ('Enter a GID : ');readln(GID);
  Assign (f,'test.txt');
  Rewrite (f);
  Writeln (f,'The owner of this file should become : ');
  Writeln (f,'UID : ',UID);
  Writeln (f,'GID : ',GID);
  Close (F);
  if fpChown ('test.txt',UID,GID)<>0 then
    if fpgeterrno=ESysEPERM then
      Writeln ('You are not root !')
    else
      Writeln ('Chmod failed with exit code : ',fpgeterrno)
  else
    Writeln ('Changed owner successfully !');
end.


FpClose

Close file descriptor

Declaration

Source position: bunxh.inc line 83

function FpClose(

  fd: cint

):cint;

Description

FpClose closes a file with file descriptor Fd. The function returns zero if the file was closed successfully, a nonzero return value indicates an error.

For an example, see FpOpen.

Errors

Extended error information can be retrieved using fpGetErrno.

See also

FpOpen | Open file and return file descriptor
FpRead | Read data from file descriptor
FpWrite | Write data to file descriptor
FpFTruncate | Truncate file on certain size.
FpLSeek | Set file pointer position.


FpClosedir

Close directory file descriptor

Declaration

Source position: bunxh.inc line 73

function FpClosedir(

  var dirp: Dir

):cint;

Description

FpCloseDir closes the directory pointed to by dirp. It returns zero if the directory was closed succesfully, -1 otherwise.

For an example, see fpOpenDir.

Errors

Extended error information can be retrieved using fpGetErrno.

See also

FpOpenDir | Open a directory for reading
FpReadDir | Read entry from directory


FpDup

Duplicate a file handle

Declaration

Source position: bunxh.inc line 38

function FpDup(

  fildes: cint

):cint;

function FpDup(

  var oldfile: text;

  var newfile: text

):cint;

function FpDup(

  var oldfile: file;

  var newfile: file

):cint;

Description

FpDup returns a file descriptor that is a duplicate of the file descriptor fildes.

The second and third forms make NewFile an exact copy of OldFile, after having flushed the buffer of OldFile in case it is a Text file or untyped file. Due to the buffering mechanism of Pascal, these calls do not have the same functionality as the dup call in C. The internal Pascal buffers are not the same after this call, but when the buffers are flushed (e.g. after output), the output is sent to the same file. Doing an lseek will, however, work as in C, i.e. doing a lseek will change the fileposition in both files.

The function returns a negative value in case of an error, a positive value is a file handle, and indicates succes.

Errors

A negative value can be one of the following error codes:

sys_ebadf
OldFile hasn't been assigned.
sys_emfile
Maximum number of open files for the process is reached.

See also

fpDup2

Duplicate one filehandle to another

Example

program Example31;

{ Program to demonstrate the Dup function. }

uses baseunix;

var f : text;

begin
  if  fpdup (output,f)=-1 then
    Writeln ('Dup Failed !');
  writeln ('This is written to stdout.');
  writeln (f,'This is written to the dup file, and flushed');flush(f);
  writeln
end.


FpDup2

Duplicate one filehandle to another

Declaration

Source position: bunxh.inc line 39

function FpDup2(

  fildes: cint;

  fildes2: cint

):cint;

function FpDup2(

  var oldfile: text;

  var newfile: text

):cint;

function FpDup2(

  var oldfile: file;

  var newfile: file

):cint;

Description

Makes fildes2 or NewFile an exact copy of fildes or OldFile, after having flushed the buffer of OldFile in the case of text or untyped files.

After a call to fdup2, the 2 file descriptors point to the same physical device (a file, socket, or a terminal).

NewFile can be an assigned file. If newfile or fildes was open, it is closed first. Due to the buffering mechanism of Pascal, this has not the same functionality as the dup2 call in C. The internal Pascal buffers are not the same after this call, but when the buffers are flushed (e.g. after output), the output is sent to the same file. Doing an lseek will, however, work as in C, i.e. doing a lseek will change the fileposition in both files.

The function returns the new file descriptor number, on error -1 is returned, and the error can be retrieved with fpgeterrno

Errors

In case of error, the following error codes can be reported:

sys_ebadf
OldFile (or fildes) hasn't been assigned.
sys_emfile
Maximum number of open files for the process is reached.

See also

fpDup

Duplicate a file handle

Example

program Example32;

{ Program to demonstrate the FpDup2 function. }

uses BaseUnix;

var f : text;
    i : longint;

begin
  Assign (f,'text.txt');
  Rewrite (F);
  For i:=1 to 10 do writeln (F,'Line : ',i);
  if fpdup2 (output,f)=-1 then
    Writeln ('Dup2 Failed !');
  writeln ('This is written to stdout.');
  writeln (f,'This is written to the dup file, and flushed');
  flush(f);
  writeln;
  { Remove file. Comment this if you want to check flushing.}
  fpUnlink ('text.txt');
end.


FpExecv

Execute process

Declaration

Source position: bunxh.inc line 65

function FpExecv(

  path: PChar;

  argv: PPChar

):cint;

function FpExecv(

  const path: RawByteString;

  argv: PPChar

):cint;

Description

Replaces the currently running program with the program, specified in path. It gives the program the options in argvp. This is a pointer to an array of pointers to null-terminated strings. The last pointer in this array should be nil. The current environment is passed to the program. On success, execv does not return.

Errors

On error, -1 is returned. Extended error information can be retrieved with fpGetErrNo

sys_eacces
File is not a regular file, or has no execute permission. A compononent of the path has no search permission.
sys_eperm
The file system is mounted \textit{noexec}.
sys_e2big
Argument list too big.
sys_enoexec
The magic number in the file is incorrect.
sys_enoent
The file does not exist.
sys_enomem
Not enough memory for kernel.
sys_enotdir
A component of the path is not a directory.
sys_eloop
The path contains a circular reference (via symlinks).

See also

fpExecve | Execute process using environment
fpFork | Create child process

Example

Program Example8;

{ Program to demonstrate the Execv function. }

Uses Unix, strings;

Const Arg0 : PChar = '/bin/ls';
      Arg1 : Pchar = '-l';

Var PP : PPchar;

begin
  GetMem (PP,3*SizeOf(Pchar));
  PP[0]:=Arg0;
  PP[1]:=Arg1;
  PP[3]:=Nil;
  { Execute '/bin/ls -l', with current environment }
  fpExecv ('/bin/ls',pp);
end.


FpExecve

Execute process using environment

Declaration

Source position: bunxh.inc line 64

function FpExecve(

  path: PChar;

  argv: PPChar;

  envp: PPChar

):cint;

function FpExecve(

  const path: RawByteString;

  argv: PPChar;

  envp: PPChar

):cint;

Description

Replaces the currently running program with the program, specified in path. It gives the program the options in argv, and the environment in envp. They are pointers to an array of pointers to null-terminated strings. The last pointer in this array should be nil. On success, execve does not return.

Errors

Extended error information can be retrieved with fpGetErrno, and includes the following:

sys_eacces
File is not a regular file, or has no execute permission. A compononent of the path has no search permission.
sys_eperm
The file system is mounted \textit{noexec}.
sys_e2big
Argument list too big.
sys_enoexec
The magic number in the file is incorrect.
sys_enoent
The file does not exist.
sys_enomem
Not enough memory for kernel.
sys_enotdir
A component of the path is not a directory.
sys_eloop
The path contains a circular reference (via symlinks).

See also

fpExecv | Execute process
fpFork | Create child process

Example

Program Example7;

{ Program to demonstrate the Execve function. }

Uses BaseUnix, strings;

Const Arg0 : PChar = '/bin/ls';
      Arg1 : Pchar = '-l';

Var PP : PPchar;

begin
  GetMem (PP,3*SizeOf(Pchar));
  PP[0]:=Arg0;
  PP[1]:=Arg1;
  PP[3]:=Nil;
  { Execute '/bin/ls -l', with current environment }
  { Envp is defined in system.inc }
  fpExecVe ('/bin/ls',pp,envp);
end.


FpExit

Exit the current process

Declaration

Source position: bunxh.inc line 68

procedure FpExit(

  Status: cint

);

Description

FpExit exits the currently running process, and report Status as the exit status.

Remark: If this call is executed, the normal unit finalization code will not be executed. This may lead to unexpected errors and stray files on your system. It is therefore recommended to use the Halt call instead.

Errors

None.

See also

FpFork | Create child process
FpExecve | Execute process using environment


FpFcntl

File control operations.

Declaration

Source position: bunxh.inc line 58

function FpFcntl(

  fildes: cint;

  cmd: cint

):cint;

function FpFcntl(

  fildes: cint;

  cmd: cint;

  arg: cint

):cint;

function FpFcntl(

  fildes: cint;

  cmd: cint;

  var arg: FLock

):cint;

Description

Read/set a file's attributes. Fildes a valid file descriptor. Cmd speciefies what to do, and is one of the following:

F_GetFd
Read the close_on_exec flag. If the low-order bit is 0, then the file will remain open across execve calls.
F_GetFl
Read the descriptor's flags.
F_GetOwn
Get the Process ID of the owner of a socket.
F_SetFd
Set the close_on_exec flag of fildes. (only the least siginificant bit is used).
F_GetLk
Return the flock record that prevents this process from obtaining the lock, or set the l_type field of the lock of there is no obstruction. Arg is the flock record.
F_SetLk
Set the lock or clear it (depending on l_type in the flock structure). if the lock is held by another process, an error occurs.
F_GetLkw
Same as for F_Setlk, but wait until the lock is released.
F_SetOwn
Set the Process or process group that owns a socket.

The function returns 0 if successful, -1 otherwise.

Errors

On error, -1 is returned. Use fpGetErrno for extended error information.

sys_ebadf
Fd has a bad file descriptor.
sys_eagain or sys_eaccess
For \textbf{F_SetLk}, if the lock is held by another process.


fpfdfillset

Set all filedescriptors in the set.

Declaration

Source position: bunxovlh.inc line 76

function fpfdfillset(

  var nset: TFDSet

):cint;

Description

fpfdfillset sets all filedescriptors in nset.

See also

FpSelect | Wait for events on file descriptors
FpFD_ZERO | Clear all file descriptors in set
FpFD_IsSet | Check whether a filedescriptor is set
FpFD_Clr | Clears a filedescriptor in a set
FpFD_Set | Set a filedescriptor in a set


fpFD_CLR

Clears a filedescriptor in a set

Declaration

Source position: bunxovlh.inc line 73

function fpFD_CLR(

  fdno: cint;

  var nset: TFDSet

):cint;

Description

FpFD_Clr clears file descriptor fdno in filedescriptor set nset.

For an example, see FpSelect.

Errors

None.

See also

FpSelect | Wait for events on file descriptors
FpFD_ZERO | Clear all file descriptors in set
FpFD_Set | Set a filedescriptor in a set
FpFD_IsSet | Check whether a filedescriptor is set


fpFD_ISSET

Check whether a filedescriptor is set

Declaration

Source position: bunxovlh.inc line 75

function fpFD_ISSET(

  fdno: cint;

  const nset: TFDSet

):cint;

Description

FpFD_Set Checks whether file descriptor fdNo in filedescriptor set fds is set. It returns zero if the descriptor is not set, 1 if it is set. If the number of the filedescriptor it wrong, -1 is returned.

For an example, see FpSelect.

Errors

If an invald file descriptor number is passed, -1 is returned.

See also

FpSelect | Wait for events on file descriptors
FpFD_ZERO | Clear all file descriptors in set
FpFD_Clr | Clears a filedescriptor in a set
FpFD_Set | Set a filedescriptor in a set


fpFD_SET

Set a filedescriptor in a set

Declaration

Source position: bunxovlh.inc line 72

function fpFD_SET(

  fdno: cint;

  var nset: TFDSet

):cint;

Description

FpFD_Set sets file descriptor fdno in filedescriptor set nset.

For an example, see FpSelect.

Errors

None.

See also

FpSelect | Wait for events on file descriptors
FpFD_ZERO | Clear all file descriptors in set
FpFD_Clr | Clears a filedescriptor in a set
FpFD_IsSet | Check whether a filedescriptor is set


fpFD_ZERO

Clear all file descriptors in set

Declaration

Source position: bunxovlh.inc line 74

function fpFD_ZERO(

  out nset: TFDSet

):cint;

Description

FpFD_ZERO clears all the filedescriptors in the file descriptor set nset.

For an example, see FpSelect.

Errors

None.

See also

FpSelect | Wait for events on file descriptors
FpFD_Clr | Clears a filedescriptor in a set
FpFD_Set | Set a filedescriptor in a set
FpFD_IsSet | Check whether a filedescriptor is set


FpFork

Create child process

Declaration

Source position: bunxh.inc line 63

function FpFork: TPid;

Description

FpFork creates a child process which is a copy of the parent process. FpFork returns the process ID in the parent process, and zero in the child's process. (you can get the parent's PID with fpGetPPid).

Errors

On error, -1 is returned to the parent, and no child is created.

sys_eagain
Not enough memory to create child process.

See also

fpExecve | Execute process using environment
#rtl.linux.Clone | Clone current process (create new thread)


FPFStat

Retrieve file information about a file descriptor.

Declaration

Source position: bunxh.inc line 80

function FpFStat(

  fd: cint;

  var sb: Stat

):cint;

function FPFStat(

  var F: Text;

  var Info: Stat

):Boolean;

function FPFStat(

  var F: file;

  var Info: Stat

):Boolean;

Description

FpFStat gets information about the file specified in one of the following:

Fd
a valid file descriptor.
F
an opened text file or untyped file.

and stores it in Info, which is of type stat. The function returns zero if the call was succesfull, a nonzero return value indicates failure.

Errors

Extended error information can be retrieved using fpGetErrno.

sys_enoent
Path does not exist.

See also

FpStat | Retrieve file information about a file descriptor.
FpLStat | Return information about symbolic link. Do not follow the link

Example

program example28;

{ Program to demonstrate the FStat function. }

uses BaseUnix;

var f : text;
    i : byte;
    info : stat;

begin
  { Make a file }
  assign (f,'test.fil');
  rewrite (f);
  for i:=1 to 10 do writeln (f,'Testline # ',i);
  close (f);
  { Do the call on made file. }
  if fpstat ('test.fil',info)<>0 then
     begin
       writeln('Fstat failed. Errno : ',fpgeterrno);
       halt (1);
     end;
  writeln;
  writeln ('Result of fstat on file ''test.fil''.');
  writeln ('Inode   : ',info.st_ino);
  writeln ('Mode    : ',info.st_mode);
  writeln ('nlink   : ',info.st_nlink);
  writeln ('uid     : ',info.st_uid);
  writeln ('gid     : ',info.st_gid);
  writeln ('rdev    : ',info.st_rdev);
  writeln ('Size    : ',info.st_size);
  writeln ('Blksize : ',info.st_blksize);
  writeln ('Blocks  : ',info.st_blocks);
  writeln ('atime   : ',info.st_atime);
  writeln ('mtime   : ',info.st_mtime);
  writeln ('ctime   : ',info.st_ctime);
  { Remove file }
  erase (f);
end.


FpFtruncate

Truncate file on certain size.

Declaration

Source position: bunxh.inc line 94

function FpFtruncate(

  fd: cint;

  flength: TOff

):cint;

Description

FpFTruncate sets the length of a file in fd on flength bytes, where flength must be less than or equal to the current length of the file in fd.

The function returns zero if the call was successful, a nonzero return value indicates that an error occurred.

Errors

Extended error information can be retrieved using fpGetErrno.

See also

FpOpen | Open file and return file descriptor
FpClose | Close file descriptor
FpRead | Read data from file descriptor
FpWrite | Write data to file descriptor
FpLSeek | Set file pointer position.


FpGetcwd

Retrieve the current working directory.

Declaration

Source position: bunxh.inc line 62

function FpGetcwd(

  path: PChar;

  siz: TSize

):PChar;

function FpGetcwd: RawByteString;

Description

fpgetCWD returns the current working directory of the running process. It is returned in Path, which points to a memory location of at least siz bytes.

If the function is succesful, a pointer to Path is returned, or a string with the result. On error Nil or an empty string are returned.

Errors

On error Nil or an empty string are returned.

See also

FpGetPID | Return current process ID
FpGetUID | Return current user ID


FpGetegid

Return effective group ID

Declaration

Source position: bunxh.inc line 51

function FpGetegid: TGid;

Description

FpGetegid returns the effective group ID of the currently running process.

Errors

None.

See also

FpGetGid | Return real group ID
FpGetUid | Return current user ID
FpGetEUid | Return effective user ID
FpGetPid | Return current process ID
FpGetPPid | Return parent process ID
fpSetUID | Set the current user ID
FpSetGid | Set the current group ID

Example

Program Example18;

{ Program to demonstrate the GetGid and GetEGid functions. }

Uses BaseUnix;

begin
 writeln ('Group Id = ',fpgetgid,' Effective group Id = ',fpgetegid);
end.


FpGetEnv

Return value of environment variable.

Declaration

Source position: bunxh.inc line 110

function FpGetEnv(

  name: PChar

):PChar;

function FpGetEnv(

  name: string

):PChar;

Description

FPGetEnv returns the value of the environment variable in Name. If the variable is not defined, nil is returned. The value of the environment variable may be the empty string. A PChar is returned to accomodate for strings longer than 255 bytes, TERMCAP and LS_COLORS, for instance.

Errors

None.

Example

Program Example41;

{ Program to demonstrate the GetEnv function. }

Uses BaseUnix;

begin
  Writeln ('Path is : ',fpGetenv('PATH'));
end.


fpgeterrno

Retrieve extended error information.

Declaration

Source position: baseunix.pp line 43

function fpgeterrno: LongInt;

Description

fpgeterrno returns extended information on the latest error. It is set by all functions that communicate with the kernel or C library.

Errors

None.

See also

fpseterrno

Set extended error information.


FpGeteuid

Return effective user ID

Declaration

Source position: bunxh.inc line 49

function FpGeteuid: TUid;

Description

FpGeteuid returns the effective user ID of the currently running process.

Errors

None.

See also

FpGetUid | Return current user ID
FpGetGid | Return real group ID
FpGetEGid | Return effective group ID
FpGetPid | Return current process ID
FpGetPPid | Return parent process ID
fpSetUID | Set the current user ID
FpSetGid | Set the current group ID

Example

Program Example17;

{ Program to demonstrate the GetUid and GetEUid functions. }

Uses BaseUnix;

begin
  writeln ('User Id = ',fpgetuid,' Effective user Id = ',fpgeteuid);
end.


FpGetgid

Return real group ID

Declaration

Source position: bunxh.inc line 50

function FpGetgid: TGid;

Description

FpGetgid returns the real group ID of the currently running process.

Errors

None.

See also

FpGetEGid | Return effective group ID
FpGetUid | Return current user ID
FpGetEUid | Return effective user ID
FpGetPid | Return current process ID
FpGetPPid | Return parent process ID
fpSetUID | Set the current user ID
FpSetGid | Set the current group ID

Example

Program Example18;

{ Program to demonstrate the GetGid and GetEGid functions. }

Uses BaseUnix;

begin
 writeln ('Group Id = ',fpgetgid,' Effective group Id = ',fpgetegid);
end.


FpGetgroups

Get the list of supplementary groups.

Declaration

Source position: bunxh.inc line 54

function FpGetgroups(

  gidsetsize: cint;

  var grouplist: TGrpArr

):cint;

Description

FpGetgroups returns up to gidsetsize groups in GroupList

If the function is successful, then number of groups that were stored is returned. On error, -1 is returned.

Errors

On error, -1 is returned. Extended error information can be retrieved with fpGetErrNo

See also

FpGetpgrp | Get process group ID
FpGetGID | Return real group ID
FpGetEGID | Return effective group ID


FpGetpgrp

Get process group ID

Declaration

Source position: bunxh.inc line 55

function FpGetpgrp: TPid;

Description

FpGetpgrp returns the process group ID of the current process.

Errors

None.

See also

fpGetPID | Return current process ID
fpGetPPID | Return parent process ID
FpGetGID | Return real group ID
FpGetUID | Return current user ID


FpGetpid

Return current process ID

Declaration

Source position: bunxh.inc line 46

function FpGetpid: TPid;

Description

FpGetpid returns the process ID of the currently running process.

Note: There exist a portable alterative to fpGetpid: system.GetProcessID. Please use fpGetpid only if you are writing Unix specific code. System.GetProcessID will work on all operating systems.

Errors

None.

See also

FpGetPPid

Return parent process ID

Example

Program Example16;

{ Program to demonstrate the GetPid, GetPPid function. }

Uses BaseUnix;

begin
  Writeln ('Process Id = ',fpgetpid,' Parent process Id = ',fpgetppid);
end.


FpGetppid

Return parent process ID

Declaration

Source position: bunxh.inc line 47

function FpGetppid: TPid;

Description

FpGetppid returns the Process ID of the parent process.

Errors

None.

See also

FpGetPid

Return current process ID

Example

Program Example16;

{ Program to demonstrate the GetPid, GetPPid function. }

Uses BaseUnix;

begin
  Writeln ('Process Id = ',fpgetpid,' Parent process Id = ',fpgetppid);
end.


fpGetPriority

Return process priority

Declaration

Source position: bunxh.inc line 105

function fpGetPriority(

  Which: cint;

  Who: cint

):cint;

Description

GetPriority returns the priority with which a process is running. Which process(es) is determined by the Which and Who variables. Which can be one of the pre-defined Prio_Process, Prio_PGrp, Prio_User, in which case Who is the process ID, Process group ID or User ID, respectively.

For an example, see FpNice.

Errors

Error information is returned solely by the FpGetErrno function: a priority can be a positive or negative value.

sys_esrch
No process found using which and who.
sys_einval
Which was not one of Prio_Process, Prio_Grp or Prio_User.

See also

FpSetPriority | Set process priority
FpNice | Set process priority


FpGetRLimit

Get process resource limits

Declaration

Source position: bunxh.inc line 113

function FpGetRLimit(

  resource: cint;

  rlim: PRLimit

):cint;

Description

FpGetRLimit gets the resource limits for the current process: resource determines the resource of which the kernel should return the limits (one of the many RLIMIT_* constants). rlim should point to a TRLimit record and on success will contain the resource limits.

The function returns zero if the resource limits were correctly returned.

Errors

On error, -1 is returned and fpgeterrno can be used to retrieve the error code.

See also

FpSetRLimit

Set process resource limits


FpGetsid

Get current session ID

Declaration

Source position: bunxh.inc line 57

function FpGetsid(

  pid: TPid

):TPid;

Description

FpGetsid returns the session ID of the process pid. The return value is the session ID of the process. (it equals the PID of the session leader). The process pid must be in the same session as the current process.

Errors

On error, -1 is returned, and extended error information can be obtained with fpGetErrno.

See also

FpGetpgrp | Get process group ID
FpGetpid | Return current process ID
FpGetPpid | Return parent process ID


FpGetuid

Return current user ID

Declaration

Source position: bunxh.inc line 48

function FpGetuid: TUid;

Description

FpGetuid returns the real user ID of the currently running process.

Errors

None.

See also

FpGetGid | Return real group ID
FpGetEUid | Return effective user ID
FpGetEGid | Return effective group ID
FpGetPid | Return current process ID
FpGetPPid | Return parent process ID
fpSetUID | Set the current user ID

Example

Program Example17;

{ Program to demonstrate the GetUid and GetEUid functions. }

Uses BaseUnix;

begin
  writeln ('User Id = ',fpgetuid,' Effective user Id = ',fpgeteuid);
end.


FpIOCtl

General kernel IOCTL call.

Declaration

Source position: bunxh.inc line 98

function FpIOCtl(

  Handle: cint;

  Ndx: TIOCtlRequest;

  Data: Pointer

):cint;

Description

This is a general interface to the Unix/ Linux ioctl call. It performs various operations on the filedescriptor Handle. Ndx describes the operation to perform. Data points to data needed for the Ndx function. The structure of this data is function-dependent, so we don't elaborate on this here. For more information on this, see various manual pages under Linux.

Errors

Extended error information can be retrieved using fpGetErrno.

Example

Program Example54;

uses BaseUnix,Termio;

{ Program to demonstrate the IOCtl function. }

var
  tios : Termios;

begin
  {$ifdef FreeBSD}
    fpIOCtl(1,TIOCGETA,@tios);  // these constants are very OS dependant.
                                // see the tcgetattr example for a better way
  {$endif}
  WriteLn('Input Flags  : $',hexstr(tios.c_iflag,8));
  WriteLn('Output Flags : $',hexstr(tios.c_oflag,8));
  WriteLn('Line Flags   : $',hexstr(tios.c_lflag,8));
  WriteLn('Control Flags: $',hexstr(tios.c_cflag,8));
end.


FpKill

Send a signal to a process

Declaration

Source position: bunxh.inc line 69

function FpKill(

  pid: TPid;

  sig: cint

):cint;

Description

fpKill sends a signal Sig to a process or process group. If Pid>0 then the signal is sent to Pid, if it equals -1, then the signal is sent to all processes except process 1. If Pid<-1 then the signal is sent to process group -Pid.

The return value is zero, except in case three, where the return value is the number of processes to which the signal was sent.

Errors

Extended error information can be retrieved using fpGetErrno:

sys_einval
An invalid signal is sent.
sys_esrch
The Pid or process group don't exist.
sys_eperm
The effective userid of the current process doesn't math the one of process Pid.

See also

FpSigAction | Install signal handler
FpSignal | Install signal handler (deprecated)


FpLink

Create a hard link to a file

Declaration

Source position: bunxh.inc line 32

function FpLink(

  existing: PChar;

  newone: PChar

):cint;

function FpLink(

  const existing: RawByteString;

  const newone: RawByteString

):cint;

Description

fpLink makes NewOne point to the same file als Existing. The two files then have the same inode number. This is known as a 'hard' link. The function returns zero if the call was succesfull, and returns a non-zero value if the call failed.

Errors

The following error codes are returned:

sys_exdev
Existing and NewOne are not on the same filesystem.
sys_eperm
The filesystem containing Existing and NewOne doesn't support linking files.
sys_eaccess
Write access for the directory containing NewOne is disallowed, or one of the directories in Existing or NewOne has no search (=execute) permission.
sys_enoent
A directory entry in Existing or NewOne does not exist or is a symbolic link pointing to a non-existent directory.
sys_enotdir
A directory entry in Existing or NewOne is nor a directory.
sys_enomem
Insufficient kernel memory.
sys_erofs
The files are on a read-only filesystem.
sys_eexist
NewOne already exists.
sys_emlink
Existing has reached maximal link count.
sys_eloop
existing or NewOne has a reference to a circular symbolic link, i.e. a symbolic link, whose expansion points to itself.
sys_enospc
The device containing NewOne has no room for another entry.
sys_eperm
Existing points to . or .. of a directory.

See also

fpSymLink | Create a symbolic link
fpUnLink | Unlink (i.e. remove) a file.

Example

Program Example21;

{ Program to demonstrate the Link and UnLink functions. }

Uses BaseUnix;

Var F : Text;
    S : String;
begin
  Assign (F,'test.txt');
  Rewrite (F);
  Writeln (F,'This is written to test.txt');
  Close(f);
  { new.txt and test.txt are now the same file }
  if fpLink ('test.txt','new.txt')<>0 then
    writeln ('Error when linking !');
  { Removing test.txt still leaves new.txt }
  If fpUnlink ('test.txt')<>0 then
    Writeln ('Error when unlinking !');
  Assign (f,'new.txt');
  Reset (F);
  While not EOF(f) do
    begin
    Readln(F,S);
    Writeln ('> ',s);
    end;
 Close (f);
 { Remove new.txt also }
 If not FPUnlink ('new.txt')<>0 then
   Writeln ('Error when unlinking !');
end.


FpLseek

Set file pointer position.

Declaration

Source position: bunxh.inc line 92

function FpLseek(

  fd: cint;

  offset: TOff;

  whence: cint

):TOff;

Description

FpLSeek sets the current fileposition of file fd to Offset, starting from Whence, which can be one of the following:

Seek_Set
Offset is the absolute position in the file.
Seek_Cur
Offset is relative to the current position.
Seek_end
Offset is relative to the end of the file.

The function returns the new fileposition, or -1 of an error occurred.

For an example, see FpOpen.

Errors

Extended error information can be retrieved using fpGetErrno.

See also

FpOpen | Open file and return file descriptor
FpWrite | Write data to file descriptor
FpClose | Close file descriptor
FpRead | Read data from file descriptor
FpFTruncate | Truncate file on certain size.


fpLstat

Return information about symbolic link. Do not follow the link

Declaration

Source position: bunxh.inc line 100

function fpLstat(

  path: PChar;

  Info: PStat

):cint;

function fpLstat(

  const path: RawByteString;

  Info: PStat

):cint;

function fpLstat(

  path: PChar;

  var Info: Stat

):cint;

function fpLstat(

  const Filename: RawByteString;

  var Info: Stat

):cint;

Description

FpLstat gets information about the link specified in Path (or FileName, and stores it in Info, which points to a record of type TStat. Contrary to FpFstat, it stores information about the link, not about the file the link points to. The function returns zero if the call was succesful, a nonzero return value indicates failure. failed.

Errors

Extended error information is returned by the FpGetErrno function.

sys_enoent
Path does not exist.

See also

FpFStat | Retrieve file information about a file descriptor.
#rtl.unixtype.TStatFS | Record describing a file system in the unix.fpstatfs call.

Example

program example29;

{ Program to demonstrate the LStat function. }

uses BaseUnix,Unix;

var f : text;
    i : byte;
    info : stat;

begin
  { Make a file }
  assign (f,'test.fil');
  rewrite (f);
  for i:=1 to 10 do writeln (f,'Testline # ',i);
  close (f);
  { Do the call on made file. }
  if fpstat ('test.fil',info)<>0 then
     begin
     writeln('Fstat failed. Errno : ',fpgeterrno);
     halt (1);
     end;
  writeln;
  writeln ('Result of stat on file ''test.fil''.');
  writeln ('Inode   : ',info.st_ino);
  writeln ('Mode    : ',info.st_mode);
  writeln ('nlink   : ',info.st_nlink);
  writeln ('uid     : ',info.st_uid);
  writeln ('gid     : ',info.st_gid);
  writeln ('rdev    : ',info.st_rdev);
  writeln ('Size    : ',info.st_size);
  writeln ('Blksize : ',info.st_blksize);
  writeln ('Blocks  : ',info.st_blocks);
  writeln ('atime   : ',info.st_atime);
  writeln ('mtime   : ',info.st_mtime);
  writeln ('ctime   : ',info.st_ctime);

  If  fpSymLink ('test.fil','test.lnk')<>0 then
    writeln ('Link failed ! Errno :',fpgeterrno);

  if  fplstat ('test.lnk',@info)<>0 then
     begin
     writeln('LStat failed. Errno : ',fpgeterrno);
     halt (1);
     end;
  writeln;
  writeln ('Result of fstat on file ''test.lnk''.');
  writeln ('Inode   : ',info.st_ino);
  writeln ('Mode    : ',info.st_mode);
  writeln ('nlink   : ',info.st_nlink);
  writeln ('uid     : ',info.st_uid);
  writeln ('gid     : ',info.st_gid);
  writeln ('rdev    : ',info.st_rdev);
  writeln ('Size    : ',info.st_size);
  writeln ('Blksize : ',info.st_blksize);
  writeln ('Blocks  : ',info.st_blocks);
  writeln ('atime   : ',info.st_atime);
  writeln ('mtime   : ',info.st_mtime);
  writeln ('ctime   : ',info.st_ctime);
  { Remove file and link }
  erase (f);
  fpunlink ('test.lnk');
end.


FpMkdir

Create a new directory

Declaration

Source position: bunxh.inc line 76

function FpMkdir(

  path: PChar;

  Mode: TMode

):cint;

function FpMkdir(

  const path: RawByteString;

  Mode: TMode

):cint;

Description

FpMkDir creates a new directory Path, and sets the new directory's mode to Mode. Path can be an absolute path or a relative path. Note that only the last element of the directory will be created, higher level directories must already exist, and must be writeable by the current user.

On succes, 0 is returned. if the function fails, -1 is returned.

Note: There exist a portable alterative to fpMkDir: system.mkdir. Please use fpMkDir only if you are writing Unix specific code. System.mkdir will work on all operating systems.

Errors

Extended error information can be retrieved using fpGetErrno.

See also

fpGetCWD | Retrieve the current working directory.
fpChDir | Change current working directory.


FpMkfifo

Create FIFO (named pipe) in file system

Declaration

Source position: bunxh.inc line 33

function FpMkfifo(

  path: PChar;

  Mode: TMode

):cint;

function FpMkfifo(

  const path: RawByteString;

  Mode: TMode

):cint;

Description

fpMkFifo creates named a named pipe in the filesystem, with name Path and mode Mode.

The function returns zero if the command was succesful, and nonzero if it failed.

Errors

The error codes include:

sys_emfile
Too many file descriptors for this process.
sys_enfile
The system file table is full.


Fpmmap

Create memory map of a file

Declaration

Source position: bunxh.inc line 107

function Fpmmap(

  start: pointer;

  len: size_t;

  prot: cint;

  flags: cint;

  fd: cint;

  offst: off_t

):pointer;

Description

FpMMap maps or unmaps files or devices into memory. The different arguments determine what and how the file is mapped:

adr
Address where to mmap the device. This address is a hint, and may not be followed.
len
Size (in bytes) of area to be mapped.
prot

Protection of mapped memory. This is a OR-ed combination of the following constants:

PROT_EXEC
The memory can be executed.
PROT_READ
The memory can be read.
PROT_WRITE
The memory can be written.
PROT_NONE
The memory can not be accessed.
flags

Contains some options for the mmap call. It is an OR-ed combination of the following constants:

MAP_FIXED
Do not map at another address than the given address. If the address cannot be used, MMap will fail.
MAP_SHARED
Share this map with other processes that map this object.
MAP_PRIVATE
Create a private map with copy-on-write semantics.
MAP_ANONYMOUS
fd does not have to be a file descriptor.

One of the options MAP_SHARED and MAP_PRIVATE must be present, but not both at the same time.

fd
File descriptor from which to map.
off
Offset to be used in file descriptor fd.

The function returns a pointer to the mapped memory, or a -1 in case of en error.

Errors

On error, -1 is returned and extended error information is returned by the FpGetErrno function.

Sys_EBADF
fd is not a valid file descriptor and MAP_ANONYMOUS was not specified.
Sys_EACCES
MAP_PRIVATE was specified, but fd is not open for reading. Or MAP_SHARED was asked and PROT_WRITE is set, fd is not open for writing
Sys_EINVAL
One of the record fields Start, length or offset is invalid.
Sys_ETXTBUSY
MAP_DENYWRITE was set but the object specified by fd is open for writing.
Sys_EAGAIN
fd is locked, or too much memory is locked.
Sys_ENOMEM
Not enough memory for this operation.

See also

FpMUnMap

Unmap previously mapped memory block

Example

Program Example66;

{ Program to demonstrate the MMap function. }

Uses BaseUnix,Unix;

Var S    : String;
    fd   : cint;
    Len  : longint;
//    args : tmmapargs;
    P    : PChar;

begin
  s:='This is the string';
  Len:=Length(S);
  fd:=fpOpen('testfile.txt',O_wrOnly or o_creat);
  If fd=-1 then
    Halt(1);
  If fpWrite(fd,S[1],Len)=-1 then
    Halt(2);
  fpClose(fd);
  fd:=fpOpen('testfile.txt',O_rdOnly);
  if fd=-1 then
    Halt(3);
  P:=Pchar(fpmmap(nil,len+1 ,PROT_READ or PROT_WRITE,MAP_PRIVATE,fd,0));

  If longint(P)=-1 then
    Halt(4);
  Writeln('Read in memory  :',P);
  fpclose(fd);
  if fpMUnMap(P,Len)<>0 Then
    Halt(fpgeterrno);
end.


Fpmunmap

Unmap previously mapped memory block

Declaration

Source position: bunxh.inc line 108

function Fpmunmap(

  start: pointer;

  len: size_t

):cint;

Description

FpMUnMap unmaps the memory block of size Len, pointed to by Adr, which was previously allocated with FpMMap.

The function returns True if successful, False otherwise.

For an example, see FpMMap.

Errors

In case of error the function returns a nonzero value, extended error information is returned by the FpGetErrno function. See FpMMap for possible error values.

See also

FpMMap

Create memory map of a file


FpNanoSleep

Suspend process for a short time

Declaration

Source position: bunxh.inc line 99

function FpNanoSleep(

  req: ptimespec;

  rem: ptimespec

):cint;

Description

FpNanoSleep suspends the process till a time period as specified in req has passed. Then the function returns. If the call was interrupted (e.g. by some signal) then the function may return earlier, and rem will contain the remaining time till the end of the intended period. In this case the return value will be -1, and ErrNo will be set to EINTR

If the function returns without error, the return value is zero.

Errors

If an error occurred or the call was interrupted, -1 is returned. Extended error information can be retrieved using fpGetErrno.

See also

FpPause | Wait for a signal to arrive
FpAlarm | Schedule an alarm signal to be delivered

Example

program example72;

{ Program to demonstrate the NanoSleep function. }

uses BaseUnix;

Var
  Req,Rem : TimeSpec;
  Res : Longint;

begin
  With Req do
    begin
    tv_sec:=10;
    tv_nsec:=100;
    end;
  Write('NanoSleep returned : ');
  Flush(Output);
  Res:=(fpNanoSleep(@Req,@rem));
  Writeln(res);
  If (res<>0) then
    With rem do
      begin
      Writeln('Remaining seconds     : ',tv_sec);
      Writeln('Remaining nanoseconds : ',tv_nsec);
      end;
end.


fpNice

Set process priority

Declaration

Source position: bunxh.inc line 104

function fpNice(

  N: cint

):cint;

Description

Nice adds -N to the priority of the running process. The lower the priority numerically, the less the process is favored. Only the superuser can specify a negative N, i.e. increase the rate at which the process is run.

If the function is succesful, zero is returned. On error, a nonzero value is returned.

Errors

Extended error information is returned by the FpGetErrno function.

sys_eperm
A non-superuser tried to specify a negative N, i.e. do a priority increase.

See also

FpGetPriority | Return process priority
FpSetPriority | Set process priority

Example

Program Example15;

{ Program to demonstrate the Nice and Get/SetPriority functions. }

Uses BaseUnix,Unix;

begin
  writeln ('Setting priority to 5');
  fpsetpriority (prio_process,fpgetpid,5);
  writeln ('New priority = ',fpgetpriority (prio_process,fpgetpid));
  writeln ('Doing nice 10');
  fpnice (10);
  writeln ('New Priority = ',fpgetpriority (prio_process,fpgetpid));
end.


FpOpen

Open file and return file descriptor

Declaration

Source position: bunxh.inc line 75

function FpOpen(

  path: PChar;

  flags: cint;

  Mode: TMode

):cint;

function FpOpen(

  path: PChar;

  flags: cint

):cint;

function FpOpen(

  const path: RawByteString;

  flags: cint

):cint;

function FpOpen(

  const path: RawByteString;

  flags: cint;

  Mode: TMode

):cint;

function FpOpen(

  path: ShortString;

  flags: cint

):cint;

function FpOpen(

  path: ShortString;

  flags: cint;

  Mode: TMode

):cint;

Description

FpOpen opens a file in Path with flags flags and mode Mode One of the following:

O_RdOnly
File is opened Read-only
O_WrOnly
File is opened Write-only
O_RdWr
File is opened Read-Write

The flags may beOR-ed with one of the following constants:

O_Creat
File is created if it doesn't exist.
O_Excl
If the file is opened with O_Creat and it already exists, the call wil fail.
O_NoCtty
If the file is a terminal device, it will NOT become the process' controlling terminal.
O_Trunc
If the file exists, it will be truncated.
O_Append
the file is opened in append mode. Before each write, the file pointer is positioned at the end of the file.
O_NonBlock
The file is opened in non-blocking mode. No operation on the file descriptor will cause the calling process to wait till.
O_NDelay
Idem as O_NonBlock
O_Sync
The file is opened for synchronous IO. Any write operation on the file will not return untill the data is physically written to disk.
O_NoFollow
if the file is a symbolic link, the open fails. (Linux 2.1.126 and higher only)
O_Directory
if the file is not a directory, the open fails. (Linux 2.1.126 and higher only)

Path can be of type PChar or String. The optional mode argument specifies the permissions to set when opening the file. This is modified by the umask setting. The real permissions are Mode and not umask. The return value of the function is the filedescriptor, or a negative value if there was an error.

Errors

Extended error information can be retrieved using fpGetErrno.

See also

FpClose | Close file descriptor
FpRead | Read data from file descriptor
FpWrite | Write data to file descriptor
FpFTruncate | Truncate file on certain size.
FpLSeek | Set file pointer position.

Example

Program Example19;

{ Program to demonstrate the fdOpen, fdwrite and fdCLose functions. }

Uses BaseUnix;

Const Line : String[80] = 'This is easy writing !';

Var FD : Cint;

begin
  FD:=fpOpen ('Test.dat',O_WrOnly or O_Creat);
  if FD>0 then
    begin
    if length(Line)<>fpwrite (FD,Line[1],Length(Line)) then
      Writeln ('Error when writing to file !');
    fpClose(FD);
    end;
end.


FpOpendir

Open a directory for reading

Declaration

Source position: bunxh.inc line 71

function FpOpendir(

  dirname: PChar

):pDir;

function FpOpendir(

  const dirname: RawByteString

):pDir;

function FpOpendir(

  dirname: ShortString

):pDir;

Description

FpOpenDir opens the directory DirName, and returns a pdir pointer to a Dir record, which can be used to read the directory structure. If the directory cannot be opened, nil is returned.

Errors

Extended error information can be retrieved using fpGetErrno.

See also

FpCloseDir | Close directory file descriptor
FpReadDir | Read entry from directory

Example

Program Example35;

{ Program to demonstrate the
  OpenDir,ReadDir, SeekDir and TellDir functions. }

Uses BaseUnix;

Var TheDir : PDir;
    ADirent : PDirent;
    Entry : Longint;

begin
  TheDir:=fpOpenDir('./.');
  Repeat
//    Entry:=fpTellDir(TheDir);
    ADirent:=fpReadDir (TheDir^);
    If ADirent<>Nil then
      With ADirent^ do
        begin
        Writeln ('Entry No : ',Entry);
        Writeln ('Inode    : ',d_fileno);
//        Writeln ('Offset   : ',d_off);
        Writeln ('Reclen   : ',d_reclen);
        Writeln ('Name     : ',pchar(@d_name[0]));
        end;
  Until ADirent=Nil;
  Repeat
    Write ('Entry No. you would like to see again (-1 to stop): ');
    ReadLn (Entry);
    If Entry<>-1 then
      begin
//      fpSeekDir (TheDir,Entry);               // not implemented for various platforms
      ADirent:=fpReadDir (TheDir^);
      If ADirent<>Nil then
        With ADirent^ do
          begin
          Writeln ('Entry No : ',Entry);
          Writeln ('Inode    : ',d_fileno);
//          Writeln ('Offset   : ',off);
          Writeln ('Reclen   : ',d_reclen);
          Writeln ('Name     : ',pchar(@d_name[0]));
          end;
    end;
  Until Entry=-1;
  fpCloseDir (TheDir^);
end.


FpPause

Wait for a signal to arrive

Declaration

Source position: bunxh.inc line 43

function FpPause: cint;

Description

FpPause puts the process to sleep and waits until the application receives a signal. If a signal handler is installed for the received sigal, the handler will be called and after that pause will return control to the process.

For an example, see fpAlarm.


FpPipe

Create a set of pipe file handlers

Declaration

Source position: bunxh.inc line 37

function FpPipe(

  var fildes: TFilDes

):cint;

Description

FpPipe creates a pipe, i.e. two file objects, one for input, one for output. The filehandles are returned in the array fildes. The input handle is in the 0-th element of the array, the output handle is in the 1-st element.

The function returns zero if everything went succesfully, a nonzero return value indicates an error.

Errors

In case the function fails, the following return values are possible:

sys_emfile
Too many file descriptors for this process.
sys_enfile
The system file table is full.

See also

#rtl.unix.POpen | Pipe file to standard input/output of program
fpMkFifo | Create FIFO (named pipe) in file system

Example

Program Example36;

{ Program to demonstrate the AssignPipe function. }

Uses BaseUnix,Unix;

Var pipi,pipo : Text;
    s : String;

begin
  Writeln ('Assigning Pipes.');
  If assignpipe(pipi,pipo)<>0 then
    Writeln('Error assigning pipes !',fpgeterrno);
  Writeln ('Writing to pipe, and flushing.');
  Writeln (pipo,'This is a textstring');close(pipo);
  Writeln ('Reading from pipe.');
  While not eof(pipi) do
    begin
    Readln (pipi,s);
    Writeln ('Read from pipe : ',s);
    end;
  close (pipi);
  writeln ('Closed pipes.');
  writeln
end.


FpPoll

Poll a file descriptor for events.

Declaration

Source position: bunxh.inc line 97

function FpPoll(

  fds: ppollfd;

  nfds: cuint;

  timeout: clong

):cint;

Description

fpPoll waits for events on file descriptors. fds points to an array of tpollfd records, each of these records describes a file descriptor on which to wait for events. The number of file descriptors is given by nfds. >timeout specifies the maximum time (in milliseconds) to wait for events.

On timeout, the result value is 0. If an event occurred on some descriptors, then the return value is the number of descriptors on which an event (or error) occurred. The revents field of the tpollfd records will contain the events for the file descriptor it described.

See also

tpollfd

Alias for pollfd type


FppRead

Positional read: read from file descriptor at a certain position.

Declaration

Source position: bunxh.inc line 86

function FpPRead(

  fd: cint;

  buf: PChar;

  nbytes: TSize;

  offset: TOff

):TsSize;

function FppRead(

  fd: cint;

  var buf;

  nbytes: TSize;

  offset: TOff

):TsSize;

Description

FpPRead reads nbytes bytes from file descriptor fd into buffer buf starting at offset offset. Offset is measured from the start of the file. This function can only be used on files, not on pipes or sockets (i.e. any seekable file descriptor).

The function returns the number of bytes actually read, or -1 on error.

Errors

On error, -1 is returned.

See also

FpReadV | Vector read: Read into multiple buffers
FpPWrite | Positional write: write to file descriptor at a certain position.


FppWrite

Positional write: write to file descriptor at a certain position.

Declaration

Source position: bunxh.inc line 89

function FpPWrite(

  fd: cint;

  buf: PChar;

  nbytes: TSize;

  offset: TOff

):TsSize;

function FppWrite(

  fd: cint;

  const buf;

  nbytes: TSize;

  offset: TOff

):TsSize;

Description

FpPWrite writes nbytes bytes from buffer buf into file descriptor fd starting at offset offset. Offset is measured from the start of the file. This function can only be used on files, not on pipes or sockets (i.e. any seekable file descriptor).

The function returns the number of bytes actually written, or -1 on error.

Errors

On error, -1 is returned.

See also

FpPRead | Positional read: read from file descriptor at a certain position.
FpWriteV | Vector write: Write from multiple buffers to a file descriptor


FpRead

Read data from file descriptor

Declaration

Source position: bunxh.inc line 85

function FpRead(

  fd: cint;

  buf: PChar;

  nbytes: TSize

):TsSize;

function FpRead(

  fd: cint;

  var buf;

  nbytes: TSize

):TsSize;

Description

FpdRead reads at most nbytes bytes from the file descriptor fd, and stores them in buf.

The function returns the number of bytes actually read, or -1 if an error occurred. No checking on the length of buf is done.

Errors

Extended error information can be retrieved using fpGetErrno.

See also

FpOpen | Open file and return file descriptor
FpClose | Close file descriptor
FpWrite | Write data to file descriptor
FpFTruncate | Truncate file on certain size.
FpLSeek | Set file pointer position.

Example

Program Example20;

{ Program to demonstrate the fdRead and fdTruncate functions. }

Uses BaseUnix;

Const Data : string[10] = '1234567890';

Var FD : cint;
    l : longint;

begin
  FD:=fpOpen('test.dat',o_wronly or o_creat,&666);
  if fd>0 then
    begin
    { Fill file with data }
    for l:=1 to 10 do
      if fpWrite (FD,Data[1],10)<>10 then
        begin
        writeln ('Error when writing !');
        halt(1);
        end;
    fpClose(FD);
    FD:=fpOpen('test.dat',o_rdonly);
    { Read data again }
    If FD>0 then
      begin
      For l:=1 to 5 do
        if fpRead (FD,Data[1],10)<>10 then
          begin
          Writeln ('Error when Reading !');
          Halt(2);
          end;
      fpClose(FD);
      { Truncating file at 60 bytes }
      { For truncating, file must be open or write }
      FD:=fpOpen('test.dat',o_wronly,&666);
      if FD>0 then
        begin
        if fpfTruncate(FD,60)<>0 then
           Writeln('Error when truncating !');
        fpClose (FD);
        end;
      end;
    end;
end.


FpReaddir

Read entry from directory

Declaration

Source position: bunxh.inc line 72

function FpReaddir(

  var dirp: Dir

):pDirent;

Description

FpReadDir reads the next entry in the directory pointed to by dirp. It returns a pdirent pointer to a dirent record describing the entry. If the next entry can't be read, Nil is returned.

For an example, see FpOpenDir.

Errors

Extended error information can be retrieved using fpGetErrno.

See also

FpCloseDir | Close directory file descriptor
FpOpenDir | Open a directory for reading


fpReadLink

Read destination of symbolic link

Declaration

Source position: bunxh.inc line 102

function fpReadLink(

  name: PChar;

  linkname: PChar;

  maxlen: size_t

):cint;

function fpReadLink(

  const Name: RawByteString

):RawByteString;

Description

FpReadLink returns the file the symbolic link name is pointing to. The first form of this function accepts a buffer linkname of length maxlen where the filename will be stored. It returns the actual number of characters stored in the buffer.

The second form of the function returns simply the name of the file.

Errors

On error, the first form of the function returns -1; the second one returns an empty string. Extended error information is returned by the FpGetErrno function.

SYS_ENOTDIR
A part of the path in Name is not a directory.
SYS_EINVAL
maxlen is not positive, or the file is not a symbolic link.
SYS_ENAMETOOLONG
A pathname, or a component of a pathname, was too long.
SYS_ENOENT
the link name does not exist.
SYS_EACCES
No permission to search a directory in the path
SYS_ELOOP
Too many symbolic links were encountered in translating the pathname.
SYS_EIO
An I/O error occurred while reading from the file system.
SYS_EFAULT
The buffer is not part of the process's memory space.
SYS_ENOMEM
Not enough kernel memory was available.

See also

FpSymLink

Create a symbolic link

Example

Program Example62;

{ Program to demonstrate the ReadLink function. }

Uses BaseUnix,Unix;

Var F : Text;
    S : String;

begin
  Assign (F,'test.txt');
  Rewrite (F);
  Writeln (F,'This is written to test.txt');
  Close(f);
  { new.txt and test.txt are now the same file }
  if fpSymLink ('test.txt','new.txt')<>0 then
    writeln ('Error when symlinking !');
  S:=fpReadLink('new.txt');
  If S='' then
    Writeln ('Error reading link !')
  Else
    Writeln ('Link points to : ',S);
 { Now remove links }
 If fpUnlink ('new.txt')<>0 then
   Writeln ('Error when unlinking !');
 If fpUnlink ('test.txt')<>0 then
   Writeln ('Error when unlinking !');
end.


FpReadV

Vector read: Read into multiple buffers

Declaration

Source position: bunxh.inc line 87

function FpReadV(

  fd: cint;

  const iov: piovec;

  iovcnt: cint

):TsSize;

Description

FpReadV reads data from file descriptor fd and writes it into iovcnt buffers described by the tiovec buffers pointed to by iov. It works like fpRead only on multiple buffers.

Errors

On error, -1 is returned.

See also

FpWriteV | Vector write: Write from multiple buffers to a file descriptor
FpPWrite | Positional write: write to file descriptor at a certain position.
FpPRead | Positional read: read from file descriptor at a certain position.


FpRename

Rename file

Declaration

Source position: bunxh.inc line 79

function FpRename(

  old: PChar;

  newpath: PChar

):cint;

function FpRename(

  const old: RawByteString;

  const newpath: RawByteString

):cint;

Description

FpRename renames the file Old to NewPath. NewPath can be in a different directory than Old, but it cannot be on another partition (device). Any existing file on the new location will be replaced.

If the operation fails, then the Old file will be preserved.

The function returns zero on succes, a nonzero value indicates failure.

Note: There exist a portable alterative to fpRename: system.rename. Please use fpRename only if you are writing Unix specific code. System.rename will work on all operating systems.

Errors

Extended error information can be retrieved using fpGetErrno.

sys_eisdir
NewPath exists and is a directory, but Old is not a directory.
sys_exdev
NewPath and Old are on different devices.
sys_enotempty or sys_eexist
NewPath is an existing, non-empty directory.
sys_ebusy
Old or NewPath is a directory and is in use by another process.
sys_einval
NewPath is part of Old.
sys_emlink
OldPath or NewPath already have tha maximum amount of links pointing to them.
sys_enotdir
part of Old or NewPath is not directory.
sys_efault
For the pchar case: One of the pointers points to an invalid address.
sys_eaccess
access is denied when attempting to move the file.
sys_enametoolong
Either Old or NewPath is too long.
sys_enoent
a directory component in Old or NewPath didn't exist.
sys_enomem
not enough kernel memory.
sys_erofs
NewPath or Old is on a read-only file system.
sys_eloop
too many symbolic links were encountered trying to expand Old or NewPath
sys_enospc
the filesystem has no room for the new directory entry.

See also

FpUnLink

Unlink (i.e. remove) a file.


FpRmdir

Remove a directory.

Declaration

Source position: bunxh.inc line 78

function FpRmdir(

  path: PChar

):cint;

function FpRmdir(

  const path: RawByteString

):cint;

Description

FpRmdir removes the directory Path from the system. The directory must be empty for this call to succeed, and the user must have the necessary permissions in the parent directory. Only the last component of the directory is removed, i.e. higher-lying directories are not removed.

On success, zero is returned. A nonzero return value indicates failure.

Note: There exist a portable alterative to fpRmDir: system.rmdir. Please use fpRmDir only if you are writing Unix specific code. System.rmdir will work on all operating systems.

Errors

Extended error information can be retrieved using fpGetErrno.


fpSelect

Wait for events on file descriptors

Declaration

Source position: bunxh.inc line 96

function FPSelect(

  N: cint;

  readfds: pFDSet;

  writefds: pFDSet;

  exceptfds: pFDSet;

  TimeOut: ptimeval

):cint;

function fpSelect(

  N: cint;

  readfds: pFDSet;

  writefds: pFDSet;

  exceptfds: pFDSet;

  TimeOut: cint

):cint;

function fpSelect(

  var T: Text;

  TimeOut: ptimeval

):cint;

function fpSelect(

  var T: Text;

  TimeOut: time_t

):cint;

Description

FpSelect checks one of the file descriptors in the FDSets to see if the following I/O operation on the file descriptors will block.

readfds, writefds and exceptfds are pointers to arrays of 256 bits. If you want a file descriptor to be checked, you set the corresponding element in the array to 1. The other elements in the array must be set to zero. Three arrays are passed : The entries in readfds are checked to see if the following read operation will block. The entries in writefds are checked to see if the following write operation will block, while entries in exceptfds are checked to see if an exception occorred on them.

You can use the functions fpFD_ZERO, fpFD_Clr, fpFD_Set or fpFD_IsSet to manipulate the individual elements of a set.

The pointers can be Nil.

N is the value of the largest file descriptor in one of the sets, + 1. In other words, it is the position of the last bit which is set in the array of bits.

TimeOut can be used to set a time limit. If TimeOut can be two types :

  1. TimeOut is of type ptimeval and contains a zero time, the call returns immediately. If TimeOut is Nil, the kernel will wait forever, or until a status changed.
  2. TimeOut is of type cint. If it is -1, this has the same effect as a Timeout of type PTime which is Nil. Otherwise, TimeOut contains a time in milliseconds.

When the TimeOut is reached, or one of the file descriptors has changed, the Select call returns. On return, it will have modified the entries in the array which have actually changed, and it returns the number of entries that have been changed. If the timout was reached, and no decsriptor changed, zero is returned; The arrays of indexes are undefined after that. On error, -1 is returned.

The variant with the text file will execute the FpSelect call on the file descriptor associated with the text file T

Errors

On error, the function returns -1. Extended error information can be retrieved using fpGetErrno.

SYS_EBADF
An invalid descriptor was specified in one of the sets.
SYS_EINTR
A non blocked signal was caught.
SYS_EINVAL
N is negative or too big.
SYS_ENOMEM
Select was unable to allocate memory for its internal tables.

See also

fpFD_ZERO | Clear all file descriptors in set
fpFD_Clr | Clears a filedescriptor in a set
fpFD_Set | Set a filedescriptor in a set
fpFD_IsSet | Check whether a filedescriptor is set

Example

Program Example33;

{ Program to demonstrate the Select function. }

Uses BaseUnix;

Var FDS : Tfdset;

begin
  fpfd_zero(FDS);
  fpfd_set(0,FDS);
  Writeln ('Press the <ENTER> to continue the program.');
  { Wait until File descriptor 0 (=Input) changes }
  fpSelect (1,@FDS,nil,nil,nil);
  { Get rid of <ENTER> in buffer }
  readln;
  Writeln ('Press <ENTER> key in less than 2 seconds...');
  Fpfd_zero(FDS);
  FpFd_set (0,FDS);
  if fpSelect (1,@FDS,nil,nil,2000)>0 then
    Writeln ('Thank you !')
    { FD_ISSET(0,FDS) would be true here. }
  else
    Writeln ('Too late !');
end.


fpseterrno

Set extended error information.

Declaration

Source position: baseunix.pp line 44

procedure fpseterrno(

  err: LongInt

);

Description

fpseterrno sets the extended information on the latest error. It is called by all functions that communicate with the kernel or C library.

Unless a direct kernel call is performed, there should never be any need to call this function.

See also

fpgeterrno

Retrieve extended error information.


FpSetgid

Set the current group ID

Declaration

Source position: bunxh.inc line 53

function FpSetgid(

  gid: TGid

):cint;

Description

fpSetUID sets the group ID of the current process. This call will only work if it is executed as root, or the program is setgid root.

On success, zero is returned, on error -1 is returned.

Errors

Extended error information can be retrieved with fpGetErrNo.

See also

FpSetUid | Set the current user ID
FpGetGid | Return real group ID
FpGetUid | Return current user ID
FpGetEUid | Return effective user ID
FpGetEGid | Return effective group ID
FpGetPid | Return current process ID
FpGetPPid | Return parent process ID


fpSetPriority

Set process priority

Declaration

Source position: bunxh.inc line 106

function fpSetPriority(

  Which: cint;

  Who: cint;

  What: cint

):cint;

Description

fpSetPriority sets the priority with which a process is running. Which process(es) is determined by the Which and Who variables. Which can be one of the pre-defined constants:

Prio_Process
Who is interpreted as process ID
Prio_PGrp
Who is interpreted as process group ID
Prio_User
Who is interpreted as user ID

Prio is a value in the range -20 to 20.

For an example, see FpNice.

The function returns zero on success, -1 on failure

Errors

Extended error information is returned by the FpGetErrno function.

sys_esrch
No process found using which and who.
sys_einval
Which was not one of Prio_Process, Prio_Grp or Prio_User.
sys_eperm
A process was found, but neither its effective or real user ID match the effective user ID of the caller.
sys_eacces
A non-superuser tried to a priority increase.

See also

FpGetPriority | Return process priority
FpNice | Set process priority


FpSetRLimit

Set process resource limits

Declaration

Source position: bunxh.inc line 114

function FpSetRLimit(

  Resource: cint;

  rlim: PRLimit

):cint;

Description

FpGetRLimit sets the resource limits for the current process: resource determines the resource of which the kernel should set the limits (one of the many RLIMIT_* constants). rlim should point to a TRLimit record which contains the new limits for the resource indicated in resource.

The function returns zero if the resource limits were successfully set.

Errors

On error, -1 is returned and fpgeterrno can be used to retrieve the error code.

See also

FpGetRLimit

Get process resource limits


FpSetsid

Create a new session.

Declaration

Source position: bunxh.inc line 56

function FpSetsid: TPid;

Description

FpSetsid creates a new session (process group). It returns the new process group id (as returned by FpGetpgrp. This call will fail if the current process is already the process group leader.

Errors

On error, -1 is returned. Extended error information can be retrieved with fpGetErrNo


fpsettimeofday

Set kernel time

Declaration

Source position: bunxh.inc line 111

function fpsettimeofday(

  tp: ptimeval;

  tzp: ptimezone

):cint;

Description

FpSetTimeOfDay sets the kernel time to the number of seconds since 00:00, January 1 1970, GMT specified in the tp record. This time NOT corrected any way, not taking into account timezones, daylight savings time and so on.

It is simply a wrapper to the kernel system call.

See also

#rtl.unix.FPGetTimeOfDay

Return kernel time of day in GMT


FpSetuid

Set the current user ID

Declaration

Source position: bunxh.inc line 52

function FpSetuid(

  uid: TUid

):cint;

Description

fpSetUID sets the user ID of the current process. This call will only work if it is executed as root, or the program is setuid root.

On success, zero is returned, on error -1 is returned.

Errors

Extended error information can be retrieved with fpGetErrNo.

See also

FpGetGid | Return real group ID
FpGetUid | Return current user ID
FpGetEUid | Return effective user ID
FpGetEGid | Return effective group ID
FpGetPid | Return current process ID
FpGetPPid | Return parent process ID
FpSetGid | Set the current group ID


FPSigaction

Install signal handler

Declaration

Source position: bunxh.inc line 95

function FPSigaction(

  sig: cint;

  act: psigactionrec;

  oact: psigactionrec

):cint;

Description

FPSigaction changes the action to take upon receipt of a signal. Act and Oact are pointers to a SigActionRec record. Sig specifies the signal, and can be any signal except SIGKILL or SIGSTOP.

If Act is non-nil, then the new action for signal Sig is taken from it. If OAct is non-nil, the old action is stored there. Sa_Handler may be SIG_DFL for the default action or SIG_IGN to ignore the signal. Sa_Mask Specifies which signals should be ignord during the execution of the signal handler. Sa_Flags Speciefies a series of flags which modify the behaviour of the signal handler. You can 'or' none or more of the following :

SA_NOCLDSTOP
If sig is SIGCHLD do not receive notification when child processes stop.
SA_ONESHOT or SA_RESETHAND
Restore the signal action to the default state once the signal handler has been called.
SA_RESTART
For compatibility with BSD signals.
SA_NOMASK or SA_NODEFER
Do not prevent the signal from being received from within its own signal handler.

Errors

Extended error information can be retrieved using fpGetErrno.

sys_einval
an invalid signal was specified, or it was SIGKILL or SIGSTOP.
sys_efault
Act,OldAct point outside this process address space
sys_eintr
System call was interrupted.

See also

FpSigProcMask | Set list of blocked signals
FpSigPending | Return set of currently pending signals
FpSigSuspend | Set signal mask and suspend process till signal is received
FpKill | Send a signal to a process

Example

Program example57;

{ Program to demonstrate the SigAction function.}

{
do a kill -USR1 pid from another terminal to see what happens.
replace pid with the real pid of this program.
You can get this pid by running 'ps'.
}

uses BaseUnix;

Var
   oa,na : PSigActionRec;

Procedure DoSig(sig : cint);cdecl;

begin
   writeln('Receiving signal: ',sig);
end;

begin
   new(na);
   new(oa);
   na^.sa_Handler:=SigActionHandler(@DoSig);
   fillchar(na^.Sa_Mask,sizeof(na^.sa_mask),#0);
   na^.Sa_Flags:=0;
   {$ifdef Linux}               // Linux specific
     na^.Sa_Restorer:=Nil;
   {$endif}
   if fpSigAction(SigUsr1,na,oa)<>0 then
     begin
     writeln('Error: ',fpgeterrno,'.');
     halt(1);
     end;
   Writeln ('Send USR1 signal or press <ENTER> to exit');
   readln;
end.


FpSigAddSet

Set a signal in a signal set.

Declaration

Source position: bunxovlh.inc line 80

function FpSigAddSet(

  var nset: tsigset;

  signo: cint

):cint;

Description

FpSigAddSet adds signal Signo to the signal set nset. The function returns 0 on success.

Errors

If an invalid signal number is given, -1 is returned.

See also

FpSigEmptySet | Clear all signals from signal set.
FpSigFillSet | Set all signals in signal set.
FpSigDelSet | Remove a signal from a signal set.
FpSigIsMember | Check whether a signal appears in a signal set.


FpSigDelSet

Remove a signal from a signal set.

Declaration

Source position: bunxovlh.inc line 81

function FpSigDelSet(

  var nset: tsigset;

  signo: cint

):cint;

Description

FpSigDelSet removes signal Signo to the signal set nset. The function returns 0 on success.

Errors

If an invalid signal number is given, -1 is returned.

See also

FpSigEmptySet | Clear all signals from signal set.
FpSigFillSet | Set all signals in signal set.
FpSigAddSet | Set a signal in a signal set.
FpSigIsMember | Check whether a signal appears in a signal set.


FpsigEmptySet

Clear all signals from signal set.

Declaration

Source position: bunxovlh.inc line 78

function FpsigEmptySet(

  var nset: tsigset

):cint;

Description

FpSigEmptySet clears all signals from the signal set nset.

Errors

None. This function always returns zero.

See also

FpSigFillSet | Set all signals in signal set.
FpSigAddSet | Set a signal in a signal set.
FpSigDelSet | Remove a signal from a signal set.
FpSigIsMember | Check whether a signal appears in a signal set.


FpSigFillSet

Set all signals in signal set.

Declaration

Source position: bunxovlh.inc line 79

function FpSigFillSet(

  var nset: tsigset

):cint;

Description

FpSigFillSet sets all signals in the signal set nset.

Errors

None. This function always returns zero.

See also

FpSigEmptySet | Clear all signals from signal set.
FpSigAddSet | Set a signal in a signal set.
FpSigDelSet | Remove a signal from a signal set.
FpSigIsMember | Check whether a signal appears in a signal set.


FpSigIsMember

Check whether a signal appears in a signal set.

Declaration

Source position: bunxovlh.inc line 82

function FpSigIsMember(

  const nset: tsigset;

  signo: cint

):cint;

Description

FpSigIsMember checks whether SigNo appears in the set nset. If it is a member, then 1 is returned. If not, zero is returned.

Errors

If an invalid signal number is given, -1 is returned.

See also

FpSigEmptySet | Clear all signals from signal set.
FpSigFillSet | Set all signals in signal set.
FpSigAddSet | Set a signal in a signal set.
FpSigDelSet | Remove a signal from a signal set.


FpSignal

Install signal handler (deprecated)

Declaration

Source position: bunxovlh.inc line 51

function FpSignal(

  signum: LongInt;

  Handler: signalhandler

):signalhandler;

Description

FPSignal installs a new signal handler (specified by Handler) for signal SigNum.

This call has a subset of the functionality provided by the FpSigAction call. The return value for FpSignal is the old signal handler, or nil on error.

Errors

Extended error information can be retrieved using fpGetErrno.

SIG_ERR
An error occurred.

See also

FpSigAction | Install signal handler
FpKill | Send a signal to a process

Example

Program example58;

{ Program to demonstrate the Signal function.}

{
do a kill -USR1 pid from another terminal to see what happens.
replace pid with the real pid of this program.
You can get this pid by running 'ps'.
}

uses BaseUnix;

Procedure DoSig(sig : cint);cdecl;

begin
   writeln('Receiving signal: ',sig);
end;

begin
   if fpSignal(SigUsr1,SignalHandler(@DoSig))=signalhandler(SIG_ERR) then
     begin
     writeln('Error: ',fpGetErrno,'.');
     halt(1);
     end;
   Writeln ('Send USR1 signal or press <ENTER> to exit');
   readln;
end.


FpSigPending

Return set of currently pending signals

Declaration

Source position: bunxh.inc line 25

function FpSigPending(

  var nset: tsigset

):cint;

Description

fpSigpending allows the examination of pending signals (which have been raised while blocked.) The signal mask of pending signals is returned.

Errors

None

See also

fpSigAction | Install signal handler
fpSigProcMask | Set list of blocked signals
fpSigSuspend | Set signal mask and suspend process till signal is received
fpSignal | Install signal handler (deprecated)
fpKill | Send a signal to a process


FpSigProcMask

Set list of blocked signals

Declaration

Source position: bunxh.inc line 23

function FpSigProcMask(

  how: cint;

  nset: psigset;

  oset: psigset

):cint;

function FpSigProcMask(

  how: cint;

  nset: tsigset;

  var oset: tsigset

):cint;

Description

Changes the list of currently blocked signals. The behaviour of the call depends on How :

SIG_BLOCK
The set of blocked signals is the union of the current set and the nset argument.
SIG_UNBLOCK
The signals in nset are removed from the set of currently blocked signals.
SIG_SETMASK
The list of blocked signals is set so nset.

If oset is non-nil, then the old set is stored in it.

Errors

Errno is used to report errors.

sys_efault
oset or nset point to an adress outside the range of the process.
sys_eintr
System call was interrupted.

See also

fpSigAction | Install signal handler
fpSigPending | Return set of currently pending signals
fpSigSuspend | Set signal mask and suspend process till signal is received
fpKill | Send a signal to a process


FpSigSuspend

Set signal mask and suspend process till signal is received

Declaration

Source position: bunxh.inc line 26

function FpSigSuspend(

  const sigmask: tsigset

):cint;

Description

fpSigSuspend temporarily replaces the signal mask for the process with the one given in SigMask, and then suspends the process until a signal is received.

Errors

None

See also

fpSigAction | Install signal handler
fpSigProcMask | Set list of blocked signals
fpSigPending | Return set of currently pending signals
fpSignal | Install signal handler (deprecated)
fpKill | Send a signal to a process


FpSigTimedWait

Wait for signal, with timeout

Declaration

Source position: bunxh.inc line 28

function FpSigTimedWait(

  const sigset: tsigset;

  info: psiginfo;

  timeout: ptimespec

):cint;

Description

FpSigTimedWait will suspend the current thread and wait for one of the signals in sigset to be delivered. information on the delivered signal is placed in the location provided by info (or in info itself, if the Var variant of the call is used). If the signal is not delivered within the time limit set in timeout, then the call will return -1, and fpGetErrno will return EAGAIN.

On success, the signal number is returned.

Errors

On error, -1 is returned, and extended error information can be obtained with fpGetErrno.

See also

FpSigSuspend

Set signal mask and suspend process till signal is received


FpSleep

Suspend process for several seconds

Declaration

Source position: bunxh.inc line 44

function FpSleep(

  seconds: cuint

):cuint;

Description

FpSleep suspends the process till a time period as specified in seconds has passed, then the function returns. If the call was interrupted (e.g. by some signal) then the function may return earlier, and the return value is the remaining time till the end of the intended period.

If the function returns without error, the return value is zero.

See also

fpPause | Wait for a signal to arrive
fpAlarm | Schedule an alarm signal to be delivered
fpNanoSleep | Suspend process for a short time

Example

program example73;

{ Program to demonstrate the FpSleep function. }

uses BaseUnix;

Var
  Res : Longint;

begin
  Write('Sleep returned : ');
  Flush(Output);
  Res:=(fpSleep(10));
  Writeln(res);
  If (res<>0) then
    Writeln('Remaining seconds     : ',res);
end.


FpStat

Retrieve file information about a file descriptor.

Declaration

Source position: bunxh.inc line 81

function FpStat(

  path: PChar;

  var buf: Stat

):cint;

function FpStat(

  const path: RawByteString;

  var buf: Stat

):cint;

function FpStat(

  path: ShortString;

  var buf: Stat

):cint;

Description

FpFStat gets information about the file specified in Path, and stores it in Info, which is of type stat. The function returns zero if the call was succesfull, a nonzero return value indicates failure.

Errors

Extended error information can be retrieved using fpGetErrno.

sys_enoent
Path does not exist.

See also

FpStat | Retrieve file information about a file descriptor.
FpLStat | Return information about symbolic link. Do not follow the link

Example

program example28;

{ Program to demonstrate the FStat function. }

uses BaseUnix;

var f : text;
    i : byte;
    info : stat;

begin
  { Make a file }
  assign (f,'test.fil');
  rewrite (f);
  for i:=1 to 10 do writeln (f,'Testline # ',i);
  close (f);
  { Do the call on made file. }
  if fpstat ('test.fil',info)<>0 then
     begin
       writeln('Fstat failed. Errno : ',fpgeterrno);
       halt (1);
     end;
  writeln;
  writeln ('Result of fstat on file ''test.fil''.');
  writeln ('Inode   : ',info.st_ino);
  writeln ('Mode    : ',info.st_mode);
  writeln ('nlink   : ',info.st_nlink);
  writeln ('uid     : ',info.st_uid);
  writeln ('gid     : ',info.st_gid);
  writeln ('rdev    : ',info.st_rdev);
  writeln ('Size    : ',info.st_size);
  writeln ('Blksize : ',info.st_blksize);
  writeln ('Blocks  : ',info.st_blocks);
  writeln ('atime   : ',info.st_atime);
  writeln ('mtime   : ',info.st_mtime);
  writeln ('ctime   : ',info.st_ctime);
  { Remove file }
  erase (f);
end.


fpSymlink

Create a symbolic link

Declaration

Source position: bunxh.inc line 101

function fpSymlink(

  oldname: PChar;

  newname: PChar

):cint;

Description

SymLink makes NewName point to the file in OldName, which doesn't necessarily exist. The two files DO NOT have the same inode number. This is known as a 'soft' link.

The permissions of the link are irrelevant, as they are not used when following the link. Ownership of the file is only checked in case of removal or renaming of the link.

The function returns zero if the call was succesful, a nonzero value if the call failed.

Errors

Extended error information is returned by the FpGetErrno function.

sys_eperm
The filesystem containing oldpath and newpath does not support linking files.
sys_eaccess
Write access for the directory containing Newpath is disallowed, or one of the directories in OldPath or NewPath has no search (=execute) permission.
sys_enoent
A directory entry in OldPath or NewPath does not exist or is a symbolic link pointing to a non-existent directory.
sys_enotdir
A directory entry in OldPath or NewPath is nor a directory.
sys_enomem
Insufficient kernel memory.
sys_erofs
The files are on a read-only filesystem.
sys_eexist
NewPath already exists.
sys_eloop
OldPath or NewPath has a reference to a circular symbolic link, i.e. a symbolic link, whose expansion points to itself.
sys_enospc
The device containing NewPath has no room for another entry.

See also

FpLink | Create a hard link to a file
FpUnLink | Unlink (i.e. remove) a file.
FpReadLink | Read destination of symbolic link

Example

Program Example22;

{ Program to demonstrate the SymLink and UnLink functions. }

Uses baseunix,Unix;

Var F : Text;
    S : String;

begin
  Assign (F,'test.txt');
  Rewrite (F);
  Writeln (F,'This is written to test.txt');
  Close(f);
  { new.txt and test.txt are now the same file }
  if fpSymLink ('test.txt','new.txt')<>0 then
    writeln ('Error when symlinking !');
  { Removing test.txt still leaves new.txt
    Pointing now to a non-existent file ! }
  If fpUnlink ('test.txt')<>0 then
    Writeln ('Error when unlinking !');
  Assign (f,'new.txt');
  { This should fail, since the symbolic link
    points to a non-existent file! }
  {$i-}
  Reset (F);
  {$i+}
  If IOResult=0 then
    Writeln ('This shouldn''t happen');
 { Now remove new.txt also }
 If fpUnlink ('new.txt')<>0 then
   Writeln ('Error when unlinking !');
end.


fpS_ISBLK

Is file a block device

Declaration

Source position: bunxovlh.inc line 85

function fpS_ISBLK(

  m: TMode

):Boolean;

Description

FpS_ISBLK checks the file mode m to see whether the file is a block device file. If so it returns True.

See also

FpFStat | Retrieve file information about a file descriptor.
FpS_ISLNK | Is file a symbolic link
FpS_ISREG | Is file a regular file
FpS_ISDIR | Is file a directory
FpS_ISCHR | Is file a character device
FpS_ISFIFO | Is file a FIFO
FpS_ISSOCK | Is file a Unix socket


fpS_ISCHR

Is file a character device

Declaration

Source position: bunxovlh.inc line 84

function fpS_ISCHR(

  m: TMode

):Boolean;

Description

FpS_ISCHR checks the file mode m to see whether the file is a character device file. If so it returns True.

See also

FpFStat | Retrieve file information about a file descriptor.
FpS_ISLNK | Is file a symbolic link
FpS_ISREG | Is file a regular file
FpS_ISDIR | Is file a directory
FpS_ISBLK | Is file a block device
FpS_ISFIFO | Is file a FIFO
FpS_ISSOCK | Is file a Unix socket


fpS_ISDIR

Is file a directory

Declaration

Source position: bunxovlh.inc line 83

function fpS_ISDIR(

  m: TMode

):Boolean;

Description

fpS_ISDIR checks the file mode m to see whether the file is a directory. If so, it returns True

See also

FpFStat | Retrieve file information about a file descriptor.
FpS_ISLNK | Is file a symbolic link
FpS_ISREG | Is file a regular file
FpS_ISCHR | Is file a character device
FpS_ISBLK | Is file a block device
fpS_ISFIFO | Is file a FIFO
FpS_ISSOCK | Is file a Unix socket


fpS_ISFIFO

Is file a FIFO

Declaration

Source position: bunxovlh.inc line 87

function fpS_ISFIFO(

  m: TMode

):Boolean;

Description

FpS_ISFIFO checks the file mode m to see whether the file is a fifo (a named pipe). If so it returns True.

See also

FpFStat | Retrieve file information about a file descriptor.
FpS_ISLNK | Is file a symbolic link
FpS_ISREG | Is file a regular file
FpS_ISCHR | Is file a character device
FpS_ISBLK | Is file a block device
FpS_ISDIR | Is file a directory
FpS_ISSOCK | Is file a Unix socket


fpS_ISLNK

Is file a symbolic link

Declaration

Source position: bunxovlh.inc line 90

function fpS_ISLNK(

  m: TMode

):Boolean;

Description

FpS_ISLNK checks the file mode m to see whether the file is a symbolic link. If so it returns True

See also

FpFStat | Retrieve file information about a file descriptor.
FpS_ISFIFO | Is file a FIFO
FpS_ISREG | Is file a regular file
FpS_ISCHR | Is file a character device
FpS_ISBLK | Is file a block device
FpS_ISDIR | Is file a directory
FpS_ISSOCK | Is file a Unix socket

Example

Program Example53;

{ Program to demonstrate the S_ISLNK function. }

Uses BaseUnix,Unix;

Var Info : Stat;

begin
  if fpLStat (paramstr(1),@info)=0 then
    begin
    if fpS_ISLNK(info.st_mode) then
      Writeln ('File is a link');
    if fpS_ISREG(info.st_mode) then
      Writeln ('File is a regular file');
    if fpS_ISDIR(info.st_mode) then
      Writeln ('File is a directory');
    if fpS_ISCHR(info.st_mode) then
      Writeln ('File is a character device file');
    if fpS_ISBLK(info.st_mode) then
      Writeln ('File is a block device file');
    if fpS_ISFIFO(info.st_mode) then
      Writeln ('File is a named pipe (FIFO)');
    if fpS_ISSOCK(info.st_mode) then
      Writeln ('File is a socket');
    end;
end.


fpS_ISREG

Is file a regular file

Declaration

Source position: bunxovlh.inc line 86

function fpS_ISREG(

  m: TMode

):Boolean;

Description

FpS_ISREG checks the file mode m to see whether the file is a regular file. If so it returns True

See also

FpFStat | Retrieve file information about a file descriptor.
FpS_ISFIFO | Is file a FIFO
FpS_ISLNK | Is file a symbolic link
FpS_ISCHR | Is file a character device
FpS_ISBLK | Is file a block device
FpS_ISDIR | Is file a directory
FPS_ISSOCK | Is file a Unix socket


fpS_ISSOCK

Is file a Unix socket

Declaration

Source position: bunxovlh.inc line 91

function fpS_ISSOCK(

  m: TMode

):Boolean;

Description

FpS_ISSOCK checks the file mode m to see whether the file is a socket. If so it returns True.

See also

FpFStat | Retrieve file information about a file descriptor.
FpS_ISFIFO | Is file a FIFO
FpS_ISLNK | Is file a symbolic link
FpS_ISCHR | Is file a character device
FpS_ISBLK | Is file a block device
FpS_ISDIR | Is file a directory
FpS_ISREG | Is file a regular file


fptime

Return the current Unix time

Declaration

Source position: bunxh.inc line 93

function FpTime(

  var tloc: TTime

):TTime;

function fptime: time_t;

Description

FpTime returns the number of seconds since 00:00:00 GMT, january 1, 1970. it is adjusted to the local time zone, but not to DST. The result is also stored in tloc, if it is specified.

Errors

On error, -1 is returned. Extended error information can be retrieved using fpGetErrno.

Example

Program Example1;

{ Program to demonstrate the fptime function. }

Uses baseunix;

begin
  Write ('Secs past the start of the Epoch (00:00 1/1/1980) : ');
  Writeln (fptime);
end.


FpTimes

Return execution times for the current process

Declaration

Source position: bunxh.inc line 40

function FpTimes(

  var buffer: tms

):TClock;

Description

fpTimes stores the execution time of the current process and child processes in buffer.

The return value (on Linux) is the number of clock ticks since boot time. On error, -1 is returned, and extended error information can be retrieved with fpGetErrno.

See also

fpUTime

Set access and modification times of a file (touch).


FpUmask

Set file creation mask.

Declaration

Source position: bunxh.inc line 31

function FpUmask(

  cmask: TMode

):TMode;

Description

fpUmask changes the file creation mask for the current user to cmask. The current mask is returned.

See also

fpChmod

Change file permission bits

Example

Program Example27;

{ Program to demonstrate the Umask function. }

Uses BaseUnix;

begin
  Writeln ('Old Umask was : ',fpUmask(&111));
  WRiteln ('New Umask is  : ',&111);
end.


FpUname

Return system name.

Declaration

Source position: bunxh.inc line 70

function FpUname(

  var name: UtsName

):cint;

Description

Uname gets the name and configuration of the current Linux kernel, and returns it in the name record.

On success, 0 is returned, on error, -1 is returned.

Errors

Extended error information can be retrieved using fpGetErrno.

See also

FpUTime

Set access and modification times of a file (touch).


FpUnlink

Unlink (i.e. remove) a file.

Declaration

Source position: bunxh.inc line 77

function FpUnlink(

  path: PChar

):cint;

function FpUnlink(

  const path: RawByteString

):cint;

Description

FpUnlink decreases the link count on file Path. Path can be of type AnsiString or PChar. If the link count is zero, the file is removed from the disk.

The function returns zero if the call was succesfull, a nonzero value indicates failure.

Note: There exist a portable alterative to erase files: system.erase. Please use fpUnlink only if you are writing Unix specific code. System.erase will work on all operating systems.

For an example, see FpLink.

Errors

Extended error information can be retrieved using fpGetErrno.

sys_eaccess
You have no write access right in the directory containing Path, or you have no search permission in one of the directory components of Path.
sys_eperm
The directory containing pathname has the sticky-bit set and the process's effective uid is neither the uid of the file to be deleted nor that of the directory containing it.
sys_enoent
A component of the path doesn't exist.
sys_enotdir
A directory component of the path is not a directory.
sys_eisdir
Path refers to a directory.
sys_enomem
Insufficient kernel memory.
sys_erofs
Path is on a read-only filesystem.

See also

FpLink | Create a hard link to a file
FpSymLink | Create a symbolic link


FpUtime

Set access and modification times of a file (touch).

Declaration

Source position: bunxh.inc line 36

function FpUtime(

  path: PChar;

  times: pUtimBuf

):cint;

function FpUtime(

  const path: RawByteString;

  times: pUtimBuf

):cint;

Description

FpUtime sets the access and modification times of the file specified in Path. the times record contains 2 fields, actime, and modtime, both of type time_t (commonly a longint). They should be filled with an epoch-like time, specifying, respectively, the last access time, and the last modification time. For some filesystem (most notably, FAT), these times are the same.

The function returns zero on success, a nonzero return value indicates failure.

Errors

Extended error information can be retrieved using fpGetErrno.

sys_eaccess
One of the directories in Path has no search (=execute) permission.
sys_enoent
A directory entry in Path does not exist or is a symbolic link pointing to a non-existent directory.

Other errors may occur, but aren't documented.

See also

FpTime | Return the current Unix time
FpChown | Change owner of file
FpAccess | Check file access

Example

Program Example25;

{ Program to demonstrate the UTime function. }

Uses Dos,BaseUnix,Unix,UnixUtil;

Var utim : utimbuf;
    dow,msec,year,month,day,hour,minute,second : Word;

begin
  { Set access and modification time of executable source }
  GetTime (hour,minute,second,msec);
  GetDate (year,month,day,dow);
  utim.actime:=LocalToEpoch(year,month,day,hour,minute,second);
  utim.modtime:=utim.actime;
  if Fputime('ex25.pp',@utim)<>0 then
    writeln ('Call to UTime failed !')
  else
    begin
    Write ('Set access and modification times to : ');
    Write (Hour:2,':',minute:2,':',second,', ');
    Writeln (Day:2,'/',month:2,'/',year:4);
    end;
end.


FpWait

Wait for a child to exit.

Declaration

Source position: bunxh.inc line 67

function FpWait(

  var stat_loc: cint

):TPid;

Description

fpWait suspends the current process and waits for any child to exit or stop due to a signal. It reports the exit status of the exited child in stat_loc.

The return value of the function is the process ID of the child that exited, or -1 on error.

Errors

Extended error information can be retrieved using fpgetErrno.

See also

fpFork | Create child process
fpExecve | Execute process using environment
fpWaitPid | Wait for a process to terminate


FpWaitPid

Wait for a process to terminate

Declaration

Source position: bunxh.inc line 66

function FpWaitpid(

  pid: TPid;

  stat_loc: pcint;

  options: cint

):TPid;

function FpWaitPid(

  pid: TPid;

  var Status: cint;

  Options: cint

):TPid;

Description

fpWaitPid waits for a child process with process ID Pid to exit. The value of Pid can be one of the following:

Pid < -1
Causes fpWaitPid to wait for any child process whose process group ID equals the absolute value of pid.
Pid = -1
Causes fpWaitPid to wait for any child process.
Pid = 0
Causes fpWaitPid to wait for any child process whose process group ID equals the one of the calling process.
Pid > 0
Causes fpWaitPid to wait for the child whose process ID equals the value of Pid.

The Options parameter can be used to specify further how fpWaitPid behaves:

WNOHANG
Causes fpWaitpid to return immediately if no child hasexited.
WUNTRACED
Causes fpWaitPid to return also for children which are stopped, but whose status has not yet been reported.
__WCLONE
Causes fpWaitPid also to wait for threads created by the #rtl.linux.Clone call.

The exit status of the process that caused fpWaitPID is reported in stat_loc or Status.

Upon return, it returns the process id of the process that exited, 0 if no process exited, or -1 in case of failure.

For an example, see fpFork.

Errors

Extended error information can be retrieved using fpgetErrno.

See also

fpFork | Create child process
fpExecve | Execute process using environment
fpWait | Wait for a child to exit.


FpWrite

Write data to file descriptor

Declaration

Source position: bunxh.inc line 88

function FpWrite(

  fd: cint;

  buf: PChar;

  nbytes: TSize

):TsSize;

function FpWrite(

  fd: cint;

  const buf;

  nbytes: TSize

):TsSize;

Description

FpWrite writes at most nbytes bytes from buf to file descriptor fd.

The function returns the number of bytes actually written, or -1 if an error occurred.

Errors

Extended error information can be retrieved using fpGetErrno.

See also

FpOpen | Open file and return file descriptor
FpClose | Close file descriptor
FpRead | Read data from file descriptor
FpFTruncate | Truncate file on certain size.
FpLSeek | Set file pointer position.


FpWriteV

Vector write: Write from multiple buffers to a file descriptor

Declaration

Source position: bunxh.inc line 90

function FpWriteV(

  fd: cint;

  const iov: piovec;

  iovcnt: cint

):TsSize;

Description

FpWriteV writes data to file descriptor fd. The data is taken from iovcnt buffers described by the tiovec buffers pointed to by iov. It works like fpWrite only from multiple buffers.

Errors

On error, -1 is returned.

See also

FpReadV | Vector read: Read into multiple buffers
FpPWrite | Positional write: write to file descriptor at a certain position.
FpPRead | Positional read: read from file descriptor at a certain position.


FreeShellArgV

[Overview][Constants][Types][Procedures and functions][Index] Reference for unit 'BaseUnix' (#rtl)

FreeShellArgV (deprecated)

Free the result of a CreateShellArgV function

Declaration

Source position: genfunch.inc line 21

procedure FreeShellArgV(

  p: PPChar

);

Description

FreeShellArgV frees the memory pointed to by P, which was allocated by a call to CreateShellArgV.

Errors

None.

See also

CreateShellArgV

Create a null-terminated array of strings from a command-line string


wexitStatus

Extract the exit status from the fpWaitPID result.

Declaration

Source position: bunxovlh.inc line 94

function wexitStatus(

  Status: cint

):cint;

Description

WEXITSTATUS can be used to extract the exit status from Status, the result of the FpWaitPID call.

See also

FpWaitPID | Wait for a process to terminate
WTERMSIG | Return the signal that caused a process to exit.
WSTOPSIG | Return the exit code from the process.
WIFEXITED | Check whether the process exited normally
WIFSIGNALED | Check whether the process was exited by a signal.


wifexited

Check whether the process exited normally

Declaration

Source position: bunxovlh.inc line 93

function wifexited(

  Status: cint

):Boolean;

Description

WIFEXITED checks Status and returns True if the status indicates that the process terminated normally, i.e. was not stopped by a signal.

See also

FpWaitPID | Wait for a process to terminate
WTERMSIG | Return the signal that caused a process to exit.
WSTOPSIG | Return the exit code from the process.
WIFSIGNALED | Check whether the process was exited by a signal.
WEXITSTATUS | Extract the exit status from the fpWaitPID result.


wifsignaled

Check whether the process was exited by a signal.

Declaration

Source position: bunxovlh.inc line 96

function wifsignaled(

  Status: cint

):Boolean;

Description

WIFSIGNALED returns True if Status indicates that the process exited because it received a signal.

See also

FpWaitPID | Wait for a process to terminate
WTERMSIG | Return the signal that caused a process to exit.
WSTOPSIG | Return the exit code from the process.
WIFEXITED | Check whether the process exited normally
WEXITSTATUS | Extract the exit status from the fpWaitPID result.


wstopsig

Return the exit code from the process.

Declaration

Source position: bunxovlh.inc line 95

function wstopsig(

  Status: cint

):cint;

Description

WSTOPSIG is an alias for WEXITSTATUS.

See also

FpWaitPID | Wait for a process to terminate
WTERMSIG | Return the signal that caused a process to exit.
WIFEXITED | Check whether the process exited normally
WIFSIGNALED | Check whether the process was exited by a signal.
WEXITSTATUS | Extract the exit status from the fpWaitPID result.


wtermsig

Return the signal that caused a process to exit.

Declaration

Source position: bunxovlh.inc line 97

function wtermsig(

  Status: cint

):cint;

Description

WTERMSIG extracts from Status the signal number which caused the process to exit.

See also

FpWaitPID | Wait for a process to terminate
WSTOPSIG | Return the exit code from the process.
WIFEXITED | Check whether the process exited normally
WIFSIGNALED | Check whether the process was exited by a signal.
WEXITSTATUS | Extract the exit status from the fpWaitPID result.


getascii

Convert unicode character or string to single-byte character or string.

Declaration

Source position: charset.pp line 87

function getascii(

  c: tunicodechar;

  p: punicodemap

):string;

function getascii(

  c: tunicodechar;

  p: punicodemap;

  ABuffer: PAnsiChar;

  ABufferLen: LongInt

):LongInt;

Arguments

c | Character to translate.
p | Mapping to use

Function result

Translated character as string, or number of characters copied to buffer.

Arguments

c | Character to translate.
p | Mapping to use
ABuffer | Buffer to copy characters to.
ABufferLen | Length of buffer ABuffer

Description

getascii converts a unicode character c to one or more single-byte characters according to the map in p. The result can be a string containing up to 2 characters, or the number of characters copied to the buffer ABuffer with length ABufferLen.

Errors

If the character cannot be translated, ASCII character 63 is returned (or copied to the buffer). In the case of the buffer variant of the function, -1 is then returned. If the buffer is not large enough, -1 is returned.

See also

getunicode

Map single-byte character to unicode character.


getmap

Find a codepage map

Declaration

Source position: charset.pp line 76

function getmap(

  const s: string

):punicodemap;

function getmap(

  cp: Word

):punicodemap;

Arguments

s

Name of code page to search

Function result

Pointer to requested code page mapping.

Arguments

cp

Numerical identifier of code page to search

Description

getmap looks in the registered codepage mappings and returns the mapping for the requested codepage. The codepage can be specified using a name s or a numerical identifier cp. The search is case sensitive.

Errors

if the requested map is not found, Nil is returned.

See also

registermapping | Register mapping
registerbinarymapping | Load and register binary single-byte codepage to unicode map from file
mappingavailable | Check if a mapping is available for a specified code page.


getunicode

Map single-byte character to unicode character.

Declaration

Source position: charset.pp line 80

function getunicode(

  c: Char;

  p: punicodemap

):tunicodechar;

function getunicode(

  AAnsiStr: PAnsiChar;

  AAnsiLen: LongInt;

  AMap: punicodemap;

  ADest: tunicodestring

):LongInt;

Arguments

c | Character to translate
p | Single-byte to Unicode character map to use.

Function result

Unicode character or number of unicode characters in translated string.

Arguments

AAnsiStr | Ansi string to tranform.
AAnsiLen | Length (in bytes) of ansi string to tranform
AMap | Single-byte to Unicode character map to use.
ADest | Buffer for translated unicode string.

Description

The first form of getunicode will map a single character c to its unicode equivalent for mapping p. If no equivalent can be found, 0 is returned.

The second form of getunicode will transform a string (specified using a pointer AAnsiStr to a buffer with length AAnsiLen) to a unicode string using single byte codepage map AMap. It returns the number of unicode characters. If ADest is Nil then just the number of characters is returned. If ADest is not nil, it must point to a buffer large enough to contain the unicode string, and the converted string will be copied to it.

Errors

No checking on the validity of the buffers is done.

See also

getascii

Convert unicode character or string to single-byte character or string.


loadbinaryunicodemapping

Load binary single-byte codepage to unicode map from file or memory

Declaration

Source position: charset.pp line 68

function loadbinaryunicodemapping(

  const directory: string;

  const cpname: string

):punicodemap; overload;

function loadbinaryunicodemapping(

  const filename: string

):punicodemap; overload;

function loadbinaryunicodemapping(

  const AData: Pointer;

  const ADataLength: Integer

):punicodemap; overload;

Arguments

directory | Directory in which to search file
cpname | Code page name

Function result

Pointer to single-byte codepage to unicode map.

Arguments

filename

Filename to load

Arguments

AData | Memory block to load
ADataLength | Length of AData memory block.

Description

loadbinaryunicodemapping loads a binary description of a single-byte unicode mapping. The mapping can reside in a file, in which case the file to load can be specified using a filename filename or using a directory directory and codepage name cpname. In the latter case, a suffix consisting of _le or _be depending on the endianness of the current platform will be appended, and the filename extension is .bcm. Note that the file names may be case sensitive.

The data can also be loaded from a memory block AData with size ADataLength.

It will produce an in-memory map of the file. It returns a pointer to the map, or Nil if something went wrong. The resulting mapping can be registered using registermapping.

Errors

On error, Nil is returned.

See also

loadunicodemapping | Load textual single-byte codepage to unicode map from file
registermapping | Register mapping


loadunicodemapping

Load textual single-byte codepage to unicode map from file

Declaration

Source position: charset.pp line 67

function loadunicodemapping(

  const cpname: string;

  const f: string;

  cp: Word

):punicodemap;

Arguments

cpname | Codepage name
f | File to open and analyse
cp | Numerical code page identifier.

Function result

The single-byte to unicode map, or Nil on error.

Description

loadunicodemapping loads a text description of a single-byte unicode mapping. It will analyse the textual description in file f, and produce an in-memory map of the file. It returns a pointer to the map, or Nil if something went wrong. The unicode map name must be specified in cpName, and the numerical identifier in cp

The resulting mapping can be registered using registermapping.

Errors

On error, Nil is returned.

See also

loadbinaryunicodemapping | Load binary single-byte codepage to unicode map from file or memory
registermapping | Register mapping


mappingavailable

Check if a mapping is available for a specified code page.

Declaration

Source position: charset.pp line 78

function mappingavailable(

  const s: string

):Boolean;

function mappingavailable(

  cp: Word

):Boolean;

Arguments

s

Code page name

Function result

True if a map is available for codepage s or cp

Arguments

cp

Numerical code page identifier.

Description

mappingavailable returns True if a mapping for a specified code page (using name s or numerical identifier cp) is available, or False if it is not.

See also

registermapping | Register mapping
registerbinarymapping | Load and register binary single-byte codepage to unicode map from file
getmap | Find a codepage map


registerbinarymapping

Load and register binary single-byte codepage to unicode map from file

Declaration

Source position: charset.pp line 75

function registerbinarymapping(

  const directory: string;

  const cpname: string

):Boolean;

Arguments

directory | Directory to load mapping from.
cpname | Code page mapping to load.

Function result

True on succes, false on error.

Description

registerbinarymapping calls loadbinaryunicodemapping using directory and cpname and registers the resulting mapping, if any was succesfully loaded, using registermapping. It returns True if the operation was succesful.

Errors

On error, False is returned.

See also

loadbinaryunicodemapping | Load binary single-byte codepage to unicode map from file or memory
registermapping | Register mapping


registermapping

Register mapping

Declaration

Source position: charset.pp line 74

procedure registermapping(

  p: punicodemap

);

Arguments

p

Map to register.

Description

RegisterMapping registers mapping p in the registry of single-byte codepages. No attempt is made to avoid double registrations. In case of doubles, the last registered mapping will be used first.

See also

loadunicodemapping | Load textual single-byte codepage to unicode map from file
loadbinaryunicodemapping | Load binary single-byte codepage to unicode map from file or memory
registerbinarymapping | Load and register binary single-byte codepage to unicode map from file


ActivateClassGroup

Activates a class group

Declaration

Source position: classesh.inc line 2110

function ActivateClassGroup(

  AClass: TPersistentClass

):TPersistentClass;

Description

ActivateClassGroup activates the group of classes to which AClass belongs. The function returns the class that was last used to activate the class group.

The class registration and streaming mechanism allows to organize the classes in groups. This allows an IDE to form groups of classes, which can be enabled or disabled. It is not needed at Run-Time.

Errors

If AClass does not belong to a class group, an exception is raised.

See also

StartClassGroup | Start new class group.
GroupDescendantsWith | Add class to the group of another class.
ClassGroupOf | Returns the class group to which an instance or class belongs


BeginGlobalLoading

Not yet implemented

Declaration

Source position: classesh.inc line 2170

procedure BeginGlobalLoading;


BinToHex

Convert a binary buffer to a hexadecimal string

Declaration

Source position: classesh.inc line 2195

procedure BinToHex(

  BinValue: PChar;

  HexValue: PChar;

  BinBufSize: Integer

);

Description

BinToHex converts the byte values in BinValue to a string consisting of 2-charachter hexadecimal strings in HexValue. BufSize specifies the length of BinValue, which means that HexValue must have size 2*BufSize.

For example a buffer containing the byte values 255 and 0 will be converted to FF00.

Errors

No length checking is done, so if an invalid size is specified, an exception may follow.

See also

HexToBin

Convert a hexadecimal string to a binary buffer


Bounds

Returns a TRect structure with the bounding rect of the given location and size.

Declaration

Source position: classesh.inc line 2090

function Bounds(

  ALeft: Integer;

  ATop: Integer;

  AWidth: Integer;

  AHeight: Integer

):TRect;

Description

Bounds returns a TRect record with the given origin (ALeft,ATop) and dimensions (AWidth,AHeight) filled in. The bottom-right corner is calculated by adding AWidth to ALeft and AHeight to ATop. As a result, a rectangle with width/height set to 0 is exactly 1 pixel.

See also

Rect

Returns a TRect record with the given coordinates.


CheckSynchronize

Check whether there are any synchronize calls in the synchronize queue.

Declaration

Source position: classesh.inc line 2064

function CheckSynchronize(

  timeout: LongInt = 0

):Boolean;

Description

CheckSynchronize should be called regularly by the main application thread to handle any TThread.Synchronize calls that may be waiting for execution by the main thread. If any such calls are waiting for execution by the main thread, they are executed at once, in the order that they were scheduled.

The function returns True if any Synchronize method was executed.

TimeOut is the maximum amount of time (in milliseconds) that the CheckSynchronize routine will wait for synchronisation requests to appear in the queue.

Calling this routine more often will ensure that synchronize requests are handled faster.

This routine may not be called from any thread other than the main thread, as it will execute the waiting requests.

Threads may call the WakeMainThread to signal the main thread that the synchronisation queue contains items, and thus speed up the execution of the synchronize calls.

See also

TThread.Synchronize | Synchronizes the thread by executing the method in the main thread.
WakeMainThread | Handler which is called if a thread wants to synchronize with the main application thread.


ClassGroupOf

Returns the class group to which an instance or class belongs

Declaration

Source position: classesh.inc line 2111

function ClassGroupOf(

  AClass: TPersistentClass

):TPersistentClass;

function ClassGroupOf(

  Instance: TPersistent

):TPersistentClass;

Description

ClassGroupOf returns the class group to which AClass or Instance belongs.

Errors

The result is Nil if no matching class group is found.

See also

StartClassGroup | Start new class group.
ActivateClassGroup | Activates a class group
GroupDescendantsWith | Add class to the group of another class.


CollectionsEqual

Returns True if two collections are equal.

Declaration

Source position: classesh.inc line 2174

function CollectionsEqual(

  C1: TCollection;

  C2: TCollection

):Boolean;

function CollectionsEqual(

  C1: TCollection;

  C2: TCollection;

  Owner1: TComponent;

  Owner2: TComponent

):Boolean;

Description

CollectionsEqual is not yet implemented. It simply returns False


EndGlobalLoading

Not yet implemented.

Declaration

Source position: classesh.inc line 2172

procedure EndGlobalLoading;


ExtractStrings

Split a string in different words.

Declaration

Source position: classesh.inc line 2197

function ExtractStrings(

  Separators: TSysCharSet;

  WhiteSpace: TSysCharSet;

  Content: PChar;

  Strings: TStrings;

  AddEmptyStrings: Boolean = False

):Integer;

Description

ExtractStrings splits Content (a null-terminated string) into words, and adds the words to the Strings stringlist. The words are separated by Separators and any characters in whitespace are stripped from the strings. The space and CR/LF characters are always considered whitespace.

Errors

No length checking is performed on Content. If no null-termination character is present, an access violation may occur. Likewise, if Strings is not valid, an access violation may occur.


FindClass

Returns the class pointer of a class with given name.

Declaration

Source position: classesh.inc line 2106

function FindClass(

  const AClassName: string

):TPersistentClass;

Description

FindClass searches for the class named ClassName in the list of registered classes and returns a class pointer to the definition. If no class with the given name could be found, an exception is raised.

The GetClass function does not raise an exception when it does not find the class, but returns a Nil pointer instead.

See also

RegisterClass | Registers a class with the streaming system.
GetClass | Returns the class pointer of a class with given name.


FindGlobalComponent

Callback used when a component must be found.

Declaration

Source position: classesh.inc line 2150

function FindGlobalComponent(

  const Name: string

):TComponent;

Description

FindGlobalComponent is a callback of type TFindGlobalComponent. It can be set by the IDE when an unknown reference is found, to offer the user to redirect the link to a new component.

It is a callback used to find a component in a global scope. It is used when the streaming system needs to find a component which is not part of the component which is currently being streamed. It should return the component with name Name, or Nil if none is found.

See also

TFindGlobalComponent

Callback type to search for a component.


FindIdentToInt

Return the string to integer converter for an integer type

Declaration

Source position: classesh.inc line 2146

function FindIdentToInt(

  AIntegerType: Pointer

):TIdentToInt;

Description

FindIdentToInt returns the handler that handles the conversion of a string representation to an integer that can be used in component streaming, when IdentToInt is called.

Errors

Nil is returned if no handler is registered for the given type.


FindIntToIdent

Return the integer to string converter for an integer type

Declaration

Source position: classesh.inc line 2145

function FindIntToIdent(

  AIntegerType: Pointer

):TIntToIdent;

Description

FindIntToIdent returns the handler that handles the conversion of an integer to a string representation that can be used in component streaming, when IntToIdent is called.

Errors

Nil is returned if no handler is registered for the given type.

See also

IntToIdent | Looks up an identifier for an integer value in a identifier-to-integer map list.
TIntToIdent | Callback for converting integers to identifiers.
FindIdentToInt | Return the string to integer converter for an integer type


FindNestedComponent

Finds the component with name path starting at the indicated root component.

Declaration

Source position: classesh.inc line 2168

function FindNestedComponent(

  Root: TComponent;

  APath: string;

  CStyle: Boolean = True

):TComponent;

Description

FindNestedComponent will descend through the list of owned components (starting at Root) and will return the component whose name path matches NamePath. As a path separator the characters . (dot), - (dash) and > (greater than) can be used

See also

GlobalFixupReferences

Called to resolve unresolved references after forms are loaded.


GetClass

Returns the class pointer of a class with given name.

Declaration

Source position: classesh.inc line 2107

function GetClass(

  const AClassName: string

):TPersistentClass;

Description

GetClass searches for the class named ClassName in the list of registered classes and returns a class pointer to the definition. If no class with the given name could be found, Nil is returned.

The FindClass function will raise an exception if the does not find the class.

See also

RegisterClass | Registers a class with the streaming system.
GetClass | Returns the class pointer of a class with given name.


GetFixupInstanceNames

Returns the names of elements that need to be resolved for the root component, whose reference contains ReferenceRootName

Declaration

Source position: classesh.inc line 2162

procedure GetFixupInstanceNames(

  Root: TComponent;

  const ReferenceRootName: string;

  Names: TStrings

);

Description

GetFixupInstanceNames examines the list of unresolved references and returns the names of classes that contain unresolved references to the Root component in the list Names. The list is not cleared prior to filling it.

See also

GetFixupReferenceNames | Returns the names of elements that need to be resolved for the root component.
GlobalFixupReferences | Called to resolve unresolved references after forms are loaded.


GetFixupReferenceNames

Returns the names of elements that need to be resolved for the root component.

Declaration

Source position: classesh.inc line 2161

procedure GetFixupReferenceNames(

  Root: TComponent;

  Names: TStrings

);

Description

GetFixupReferenceNames examines the list of unresolved references and returns the names of properties that must be resolved for the component Root in the list Names. The list is not cleared prior to filling it.

See also

GetFixupInstanceNames | Returns the names of elements that need to be resolved for the root component, whose reference contains ReferenceRootName
GlobalFixupReferences | Called to resolve unresolved references after forms are loaded.


GlobalFixupReferences

Called to resolve unresolved references after forms are loaded.

Declaration

Source position: classesh.inc line 2160

procedure GlobalFixupReferences;

Description

GlobalFixupReferences runs over the list of unresolved references and tries to resolve them. This routine should under normal circumstances not be called in an application programmer's code. It is called automatically by the streaming system after a component has been instantiated and its properties read from a stream. It will attempt to resolve references to other global components.

See also

GetFixupReferenceNames | Returns the names of elements that need to be resolved for the root component.
GetFixupInstanceNames | Returns the names of elements that need to be resolved for the root component, whose reference contains ReferenceRootName


GroupDescendentsWith

Provided for Delphi compatibility

Declaration

Source position: classesh.inc line 2109

procedure GroupDescendentsWith(

  AClass: TPersistentClass;

  AClassGroup: TPersistentClass

);

Description

GroupDescendentsWith exists for Delphi compatibility, it doesn't actually do anything in Free Pascal.

See also

RegisterClasses

Registers multiple classes with the streaming system.


HexToBin

Convert a hexadecimal string to a binary buffer

Declaration

Source position: classesh.inc line 2196

function HexToBin(

  HexValue: PChar;

  BinValue: PChar;

  BinBufSize: Integer

):Integer;

Description

HexToBin scans the hexadecimal string representation in HexValue and transforms every 2 character hexadecimal number to a byte and stores it in BinValue. The buffer size is the size of the binary buffer. Scanning will stop if the size of the binary buffer is reached or when an invalid character is encountered. The return value is the number of stored bytes.

Errors

No length checking is done, so if an invalid size is specified, an exception may follow.

See also

BinToHex

Convert a binary buffer to a hexadecimal string


IdentToInt

Looks up an integer value in a integer-to-identifier map list.

Declaration

Source position: classesh.inc line 2143

function IdentToInt(

  const Ident: string;

  out Int: LongInt;

  const Map: array of TIdentMapEntry

):Boolean;

Description

IdentToInt searches Map for an entry whose Name field matches Ident and returns the corresponding integer value in Int. If a match was found, the function returns True, otherwise, False is returned.

See also

TIdentToInt | Callback for converting identifiers to integers.
TIntToIdent | Callback for converting integers to identifiers.
IntToIdent | Looks up an identifier for an integer value in a identifier-to-integer map list.
TIdentMapEntry | Record used when associating names with integer values.


InitComponentRes

Provided for Delphi compatibility only

Declaration

Source position: classesh.inc line 2153

function InitComponentRes(

  const ResName: string;

  Instance: TComponent

):Boolean;

Description

This function is provided for Delphi compatibility. It always returns false.

See also

ReadComponentRes

Read component properties from a resource in the current module


InitInheritedComponent

Initializes a component descending from RootAncestor

Declaration

Source position: classesh.inc line 2152

function InitInheritedComponent(

  Instance: TComponent;

  RootAncestor: TClass

):Boolean;

Description

InitInheritedComponent should be called from a constructor to read properties of the component Instance from the streaming system. The RootAncestor class is the root class from which Instance is a descendant. This must be one of TDatamodule, TCustomForm or TFrame.

The function returns True if the properties were successfully read from a stream or False if some error occurred.

See also

ReadComponentRes | Read component properties from a resource in the current module
ReadComponentResEx | Read component properties from a resource in the specified module
ReadComponentResFile | Read component properties from a specified resource file


IntToIdent

Looks up an identifier for an integer value in a identifier-to-integer map list.

Declaration

Source position: classesh.inc line 2144

function IntToIdent(

  Int: LongInt;

  var Ident: string;

  const Map: array of TIdentMapEntry

):Boolean;

Description

IdentToInt searches Map for an entry whose Value field matches Int and returns the corresponding identifier in Ident. If a match was found, the function returns True, otherwise, False is returned.

See also

TIdentToInt | Callback for converting identifiers to integers.
TintToIdent | Callback for converting integers to identifiers.
IdentToInt | Looks up an integer value in a integer-to-identifier map list.
TIdentMapEntry | Record used when associating names with integer values.


InvalidPoint

Check whether a point is invalid.

Declaration

Source position: classesh.inc line 2094

function InvalidPoint(

  X: Integer;

  Y: Integer

):Boolean;

function InvalidPoint(

  const At: TPoint

):Boolean;

function InvalidPoint(

  const At: TSmallPoint

):Boolean;

Description

InvalidPoint returns True if the X and Y coordinates (of the TPoint or TSmallPoint records, if one of these versions is used) are -1.

See also

TPoint | Special type to handle a fake TComponent position
TSmallPoint | Type to describe point in a small plane.
PointsEqual | Check whether two TPoint variables are equal.


LineStart

Finds the start of a line in Buffer before BufPos.

Declaration

Source position: classesh.inc line 2194

function LineStart(

  Buffer: PChar;

  BufPos: PChar

):PChar;

Description

LineStart reversely scans Buffer starting at BufPos for a linefeed character. It returns a pointer at the linefeed character.


NotifyGlobalLoading

Not yet implemented.

Declaration

Source position: classesh.inc line 2171

procedure NotifyGlobalLoading;


ObjectBinaryToText

Converts an object stream from a binary to a text format.

Declaration

Source position: classesh.inc line 2185

procedure ObjectBinaryToText(

  Input: TStream;

  Output: TStream;

  Encoding: TObjectTextEncoding

);

procedure ObjectBinaryToText(

  Input: TStream;

  Output: TStream

);

Description

ObjectBinaryToText reads an object stream in binary format from Input and writes the object stream in text format to Output. No components are instantiated during the process, this is a pure conversion routine.

See also

ObjectTextToBinary

Converts an object stream from a text to a binary format.


ObjectResourceToText

Converts an object stream from a (windows) resource to a text format.

Declaration

Source position: classesh.inc line 2189

procedure ObjectResourceToText(

  Input: TStream;

  Output: TStream

);

Description

ObjectResourceToText reads the resource header from the Input stream and then passes the streams to ObjectBinaryToText

See also

ObjectBinaryToText | Converts an object stream from a binary to a text format.
ObjectTextToResource | Converts an object stream from a text to a (windows) resource format.


ObjectTextToBinary

Converts an object stream from a text to a binary format.

Declaration

Source position: classesh.inc line 2187

procedure ObjectTextToBinary(

  Input: TStream;

  Output: TStream

);


ObjectTextToResource

Converts an object stream from a text to a (windows) resource format.

Declaration

Source position: classesh.inc line 2190

procedure ObjectTextToResource(

  Input: TStream;

  Output: TStream

);

Description

ObjectTextToResource reads an object stream in text format from Input and writes a resource stream to Output.

Note that for the current implementation of this method in Free Pascal, the output stream should support positioning. (e.g. it should not be a pipe)

See also

ObjectBinaryToText | Converts an object stream from a binary to a text format.
ObjectResourceToText | Converts an object stream from a (windows) resource to a text format.


Point

Returns a TPoint record with the given coordinates.

Declaration

Source position: classesh.inc line 2087

function Point(

  AX: Integer;

  AY: Integer

):TPoint;

Description

Point returns a TPoint record with the given coordinates AX and AY filled in.

See also

TPoint | Special type to handle a fake TComponent position
SmallPoint | Returns a TSmallPoint record with the given coordinates.
Rect | Returns a TRect record with the given coordinates.
Bounds | Returns a TRect structure with the bounding rect of the given location and size.


PointsEqual

Check whether two TPoint variables are equal.

Declaration

Source position: classesh.inc line 2092

function PointsEqual(

  const P1: TPoint;

  const P2: TPoint

):Boolean;

function PointsEqual(

  const P1: TSmallPoint;

  const P2: TSmallPoint

):Boolean;

Description

PointsEqual compares the P1 and P2 points (of type TPoint or TSmallPoint) and returns True if the X and Y coordinates of the points are equal, or False otherwise.

See also

TPoint | Special type to handle a fake TComponent position
TSmallPoint | Type to describe point in a small plane.
InvalidPoint | Check whether a point is invalid.


ReadComponentRes

Read component properties from a resource in the current module

Declaration

Source position: classesh.inc line 2154

function ReadComponentRes(

  const ResName: string;

  Instance: TComponent

):TComponent;

Description

ReadComponentRes will read the component's properties from the resource ResName in the current module (always program module). It returns Nil if the resource was not found. It returns Instance if the resource was found and successfully applied to the component.

Errors

The function may raise an exception if the stream contains wrong data.

See also

ReadComponentResEx

Read component properties from a resource in the specified module


ReadComponentResEx

Read component properties from a resource in the specified module

Declaration

Source position: classesh.inc line 2155

function ReadComponentResEx(

  HInstance: THandle;

  const ResName: string

):TComponent;

Description

ReadComponentRes will locate the resource ResName in instance HInstance (the current program, normally). It returns Nil if the resource was not found. It returns an instantiated component with all properties found in the stream, applied. This requires that the component is registered using registerclass.

Errors

The function may raise an exception if the stream contains wrong data.

See also

ReadComponentRes

Read component properties from a resource in the current module


ReadComponentResFile

Read component properties from a specified resource file

Declaration

Source position: classesh.inc line 2156

function ReadComponentResFile(

  const FileName: string;

  Instance: TComponent

):TComponent;

Description

ReadComponentResFile starts reading properties for Instance from the file FileName. It creates a filestream from FileName and then calls the TStream.ReadComponentRes method to read the state of the component from the stream.

See also

TStream.ReadComponentRes | Reads component data and resource header from a stream
WriteComponentResFile | Write component properties to a specified resource file


Rect

Returns a TRect record with the given coordinates.

Declaration

Source position: classesh.inc line 2089

function Rect(

  ALeft: Integer;

  ATop: Integer;

  ARight: Integer;

  ABottom: Integer

):TRect;

Description

Rect returns a TRect record with the given top-left (ALeft,ATop) and bottom-right (ABottom,ARight) corners filled in.

No checking is done to see whether the coordinates are valid.

See also

TRect | Descibes a rectangle
Point | Returns a TPoint record with the given coordinates.
SmallPoint | Returns a TSmallPoint record with the given coordinates.
Bounds | Returns a TRect structure with the bounding rect of the given location and size.


RedirectFixupReferences

Redirects references under the root object from OldRootName to NewRootName

Declaration

Source position: classesh.inc line 2164

procedure RedirectFixupReferences(

  Root: TComponent;

  const OldRootName: string;

  const NewRootName: string

);

Description

RedirectFixupReferences examines the list of unresolved references and replaces references to a root object named OldRootName with references to root object NewRootName.

An application programmer should never need to call RedirectFixupReferences. This function can be used by an IDE to support redirection of broken component links.

See also

RemoveFixupReferences

Removes references to rootname from the fixup list.


RegisterClass

Registers a class with the streaming system.

Declaration

Source position: classesh.inc line 2100

procedure RegisterClass(

  AClass: TPersistentClass

);

Description

RegisterClass registers the class AClass in the streaming system. After the class has been registered, it can be read from a stream when a reference to this class is encountered.

See also

RegisterClasses | Registers multiple classes with the streaming system.
RegisterClassAlias | Registers a class alias with the streaming system.
RegisterComponents | Registers components for the component palette.
UnregisterClass | Unregisters a class from the streaming system.


RegisterClassAlias

Registers a class alias with the streaming system.

Declaration

Source position: classesh.inc line 2102

procedure RegisterClassAlias(

  AClass: TPersistentClass;

  const Alias: string

);

Description

RegisterClassAlias registers a class alias in the streaming system. If a reference to a class Alias is encountered in a stream, then an instance of the class AClass will be created instead by the streaming code.

See also

RegisterClass | Registers a class with the streaming system.
RegisterClasses | Registers multiple classes with the streaming system.
RegisterComponents | Registers components for the component palette.
UnregisterClass | Unregisters a class from the streaming system.


RegisterClasses

Registers multiple classes with the streaming system.

Declaration

Source position: classesh.inc line 2101

procedure RegisterClasses(

  AClasses: array of TPersistentClass

);

Description

RegisterClasses registers the specified classes AClass in the streaming system. After the classes have been registered, they can be read from a stream when a reference to this class is encountered.

See also

RegisterClass | Registers a class with the streaming system.
RegisterClassAlias | Registers a class alias with the streaming system.
RegisterComponents | Registers components for the component palette.
UnregisterClass | Unregisters a class from the streaming system.


RegisterComponents

Registers components for the component palette.

Declaration

Source position: classesh.inc line 2116

procedure RegisterComponents(

  const Page: string;

  ComponentClasses: array of TComponentClass

);

Description

RegisterComponents registers the component on the appropriate component page. The component pages can be used by an IDE to display the known components so an application programmer may pick and use the components in his programs.

Registercomponents inserts the component class in the correct component page. If the RegisterComponentsProc procedure is set, this is called as well. Note that this behaviour is different from Delphi's behaviour where an exception will be raised if the procedural variable is not set.

See also

RegisterClass | Registers a class with the streaming system.
RegisterNoIcon | Registers components that have no icon on the component palette.


RegisterComponentsProc

Callback procedure used when handling component registration.

Declaration

Source position: classesh.inc line 2077

var RegisterComponentsProc: procedure(

  const Page: string;

  ComponentClasses: array of TComponentClass

) = ;

Description

RegisterComponentsProc can be set by an IDE to be notified when new components are being registered. Application programmers should never have to set RegisterComponentsProc

See also

RegisterNoIconProc | Callback procedure used when handling iconless component registration.
RegisterComponents | Registers components for the component palette.


RegisterFindGlobalComponentProc

Register a component searching handler

Declaration

Source position: classesh.inc line 2148

procedure RegisterFindGlobalComponentProc(

  AFindGlobalComponent: TFindGlobalComponent

);

Description

RegisterFindGlobalComponentProc registers a global component search callback AFindGlobalComponent. When FindGlobalComponent is called, then this callback will be used to search for the component.

Errors

None.

See also

FindGlobalComponent | Callback used when a component must be found.
UnRegisterFindGlobalComponentProc | Remove a previously registered component searching handler.


RegisterInitComponentHandler

Register a component initialization handler

Declaration

Source position: classesh.inc line 2158

procedure RegisterInitComponentHandler(

  ComponentClass: TComponentClass;

  Handler: TInitComponentHandler

);

Description

RegisterInitComponentHandler registers a component initialization handler Handler for the component ComponentClass. This handler will be used to initialize descendants of ComponentClass in the InitInheritedComponent call.

See also

InitInheritedComponent | Initializes a component descending from RootAncestor
TInitComponentHandler | Callback type for RegisterInitComponentHandler


RegisterIntegerConsts

Registers some integer-to-identifier mappings.

Declaration

Source position: classesh.inc line 2141

procedure RegisterIntegerConsts(

  IntegerType: Pointer;

  IdentToIntFn: TIdentToInt;

  IntToIdentFn: TIntToIdent

);

Description

RegisterIntegerConsts registers a pair of callbacks to be used when an integer of type IntegerType must be mapped to an identifier (using IntToIdentFn) or when an identifier must be mapper to an integer (using IdentToIntFn).

Component programmers can use RegisterIntegerConsts to associate a series of identifier strings with integer values for a property. A necessary condition is that the property should have a separate type declared using the type integer syntax. If a type of integer is defined in this way, an IDE can show symbolic names for the values of these properties.

The IntegerType should be a pointer to the type information of the integer type. The IntToIdentFn and IdentToIntFn are two callbacks that will be used when converting between the identifier and integer value and vice versa. The functions IdentToInt and IntToIdent can be used to implement these callback functions.

See also

TIdentToInt | Callback for converting identifiers to integers.
TIntToIdent | Callback for converting integers to identifiers.
IdentToInt | Looks up an integer value in a integer-to-identifier map list.
IntToIdent | Looks up an identifier for an integer value in a identifier-to-integer map list.


RegisterNoIcon

Registers components that have no icon on the component palette.

Declaration

Source position: classesh.inc line 2118

procedure RegisterNoIcon(

  ComponentClasses: array of TComponentClass

);

Description

RegisterNoIcon performs the same function as RegisterComponents except that it calls RegisterNoIconProc instead of RegisterComponentsProc

See also

RegisterNoIconProc | Callback procedure used when handling iconless component registration.
RegisterComponents | Registers components for the component palette.


RegisterNoIconProc

Callback procedure used when handling iconless component registration.

Declaration

Source position: classesh.inc line 2079

var RegisterNoIconProc: procedure(

  ComponentClasses: array of TComponentClass

) = ;

Description

RegisterNoIconProc can be set by an IDE to be notified when new components are being registered, and which do not need an Icon in the component palette. Application programmers should never have to set RegisterComponentsProc


RegisterNonActiveX

Register non-activex component.

Declaration

Source position: classesh.inc line 2119

procedure RegisterNonActiveX(

  ComponentClasses: array of TComponentClass;

  AxRegType: TActiveXRegType

);

Description

Not yet implemented in Free Pascal


RemoveFixupReferences

Removes references to rootname from the fixup list.

Declaration

Source position: classesh.inc line 2166

procedure RemoveFixupReferences(

  Root: TComponent;

  const RootName: string

);

Description

RemoveFixupReferences examines the list of unresolved references and removes references to a root object pointing at Root or a root component named RootName.

An application programmer should never need to call RemoveFixupReferences. This function can be used by an IDE to support removal of broken component links.

See also

RedirectFixupReferences

Redirects references under the root object from OldRootName to NewRootName


RemoveFixups

Removes Instance from the fixup list.

Declaration

Source position: classesh.inc line 2167

procedure RemoveFixups(

  Instance: TPersistent

);

Description

RemoveFixups removes all entries for component Instance from the list of unresolved references.a

See also

RedirectFixupReferences | Redirects references under the root object from OldRootName to NewRootName
RemoveFixupReferences | Removes references to rootname from the fixup list.


SmallPoint

Returns a TSmallPoint record with the given coordinates.

Declaration

Source position: classesh.inc line 2088

function SmallPoint(

  AX: SmallInt;

  AY: SmallInt

):TSmallPoint;

Description

SmallPoint returns a TSmallPoint record with the given coordinates AX and AY filled in.

See also

TSmallPoint | Type to describe point in a small plane.
Point | Returns a TPoint record with the given coordinates.
Rect | Returns a TRect record with the given coordinates.
Bounds | Returns a TRect structure with the bounding rect of the given location and size.


StartClassGroup

Start new class group.

Declaration

Source position: classesh.inc line 2108

procedure StartClassGroup(

  AClass: TPersistentClass

);

Description

StartClassGroup starts a new class group and adds AClass to it.

The class registration and streaming mechanism allows to organize the classes in groups. This allows an IDE to form groups of classes, which can be enabled or disabled. It is not needed at Run-Time.

See also

GroupDescendantsWith | Add class to the group of another class.
ActivateClassGroup | Activates a class group
ClassGroupOf | Returns the class group to which an instance or class belongs


UnRegisterClass

Unregisters a class from the streaming system.

Declaration

Source position: classesh.inc line 2103

procedure UnRegisterClass(

  AClass: TPersistentClass

);

Description

UnregisterClass removes the class AClass from the class definitions in the streaming system.

See also

UnRegisterClasses | Unregisters multiple classes from the streaming system.
UnRegisterModuleClasses | Unregisters classes registered by module.
RegisterClass | Registers a class with the streaming system.


UnRegisterClasses

Unregisters multiple classes from the streaming system.

Declaration

Source position: classesh.inc line 2104

procedure UnRegisterClasses(

  AClasses: array of TPersistentClass

);

Description

UnregisterClasses removes the classes in AClasses from the class definitions in the streaming system.


UnregisterFindGlobalComponentProc

Remove a previously registered component searching handler.

Declaration

Source position: classesh.inc line 2149

procedure UnregisterFindGlobalComponentProc(

  AFindGlobalComponent: TFindGlobalComponent

);

Description

UnRegisterFindGlobalComponentProc unregisters the previously registered global component search callback AFindGlobalComponent. After this call, when FindGlobalComponent is called, then this callback will be no longer be used to search for the component.

Errors

None.

See also

FindGlobalComponent | Callback used when a component must be found.
RegisterFindGlobalComponentProc | Register a component searching handler


UnRegisterModuleClasses

Unregisters classes registered by module.

Declaration

Source position: classesh.inc line 2105

procedure UnRegisterModuleClasses(

  Module: HMODULE

);

Description

UnRegisterModuleClasses unregisters all classes which reside in the module Module. For each registered class, the definition pointer is checked to see whether it resides in the module, and if it does, the definition is removed.

See also

UnRegisterClass | Unregisters a class from the streaming system.
UnRegisterClasses | Unregisters multiple classes from the streaming system.
RegisterClasses | Registers multiple classes with the streaming system.


WriteComponentResFile

Write component properties to a specified resource file

Declaration

Source position: classesh.inc line 2157

procedure WriteComponentResFile(

  const FileName: string;

  Instance: TComponent

);

Description

WriteComponentResFile starts writing properties of Instance to the file FileName. It creates a filestream from FileName and then calls TStream.WriteComponentRes method to write the state of the component to the stream.

See also

TStream.WriteComponentRes | Write resource header and component data to a stream
ReadComponentResFile | Read component properties from a specified resource file


CAlloc

Allocate memory based on item size and count

Declaration

Source position: cmem.pp line 54

function CAlloc(

  unitSize: PtrUInt;

  UnitCount: PtrUInt

):pointer;

Arguments

unitSize | Size of one unit.
UnitCount | Number of units.

Function result

Pointer to the newly allocated memory block.

Description

Calloc allocates memory to hold UnitCount units of size UnitSize each. The memory is one block of memory. It returns a pointer to the newly allocated memory block.

See also

Malloc | Malloc external declaration.
Free | Free a previously allocated block
Realloc | Reallocates a memory block


Free

Free a previously allocated block

Declaration

Source position: cmem.pp line 52

procedure Free(

  P: pointer

);

Arguments

P

Pointer to the memory block to be freed.

Description

Free returns the memory block pointed to by P to the system. After Free was called, the pointer P is no longer valid.

See also

Malloc | Malloc external declaration.
ReAlloc | Reallocates a memory block


Malloc

Malloc external declaration.

Declaration

Source position: cmem.pp line 51

function Malloc(

  Size: PtrUInt

):Pointer;

Arguments

Size

Requested size for the new memory block.

Function result

A pointer to the newly allocated memory block

Description

Malloc is the external declaration of the C librarys malloc call. It accepts a size parameter, and returns a pointer to a memory block of the requested size or Nil if no more memory could be allocated.

See also

Free | Free a previously allocated block
ReAlloc | Reallocates a memory block


ReAlloc

Reallocates a memory block

Declaration

Source position: cmem.pp line 53

function ReAlloc(

  P: Pointer;

  Size: PtrUInt

):pointer;

Arguments

P | Pointer to the old block
Size | New size for the memory block.

Function result

A pointer to the new memory block

Description

ReAlloc re-allocates a block of memory pointed to by p. The new block will have size Size, and as much data as was available or as much data as fits is copied from the old to the new location.

See also

Malloc | Malloc external declaration.
Free | Free a previously allocated block


AssignCrt

Assign file to CRT.

Declaration

Source position: crth.inc line 74

procedure AssignCrt(

  var F: Text

);

Description

AssignCrt Assigns a file F to the console. Everything written to the file F goes to the console instead. If the console contains a window, everything is written to the window instead.

Errors

None.

See also

Window

Create new window on screen.

Example

Program Example1;
uses Crt;

{ Program to demonstrate the AssignCrt function. }

var
  F : Text;
begin
  AssignCrt(F);
  Rewrite(F); { Don't forget to open for output! }
  WriteLn(F,'This is written to the Assigned File');
  Close(F);
end.


ClrEol

Clear from cursor position till end of line.

Declaration

Source position: crth.inc line 87

procedure ClrEol;

Description

ClrEol clears the current line, starting from the cursor position, to the end of the window. The cursor doesn't move

Errors

None.

See also

DelLine | Delete line at cursor position.
InsLine | Insert an empty line at cursor position
ClrScr | Clear current window.

Example

Program Example9;
uses Crt;

{ Program to demonstrate the ClrEol function. }
var
  I,J : integer;

begin
  For I:=1 to 15 do
    For J:=1 to 80 do
      begin
      gotoxy(j,i);
      Write(j mod 10);
      end;
  Window(5,5,75,12);
  Write('This line will be cleared from',
        ' here till the right of the window');
  GotoXY(27,WhereY);
  ReadKey;
  ClrEol;
  WriteLn;
end.


ClrScr

Clear current window.

Declaration

Source position: crth.inc line 86

procedure ClrScr;

Description

ClrScr clears the current window (using the current colors), and sets the cursor in the top left corner of the current window.

Errors

None.

See also

Window

Create new window on screen.

Example

Program Example8;
uses Crt;

{ Program to demonstrate the ClrScr function. }

begin
  Writeln('Press any key to clear the screen');
  ReadKey;
  ClrScr;
  Writeln('Have fun with the cleared screen');
end.


cursorbig

Show big cursor

Declaration

Source position: crth.inc line 102

procedure cursorbig;

Description

CursorBig makes the cursor a big rectangle. Not implemented on unixes.

Errors

None.

See also

CursorOn | Display cursor
CursorOff | Hide cursor


cursoroff

Hide cursor

Declaration

Source position: crth.inc line 101

procedure cursoroff;

Description

CursorOff switches the cursor off (i.e. the cursor is no longer visible). Not implemented on unixes.

Errors

None.

See also

CursorOn | Display cursor
CursorBig | Show big cursor


cursoron

Display cursor

Declaration

Source position: crth.inc line 100

procedure cursoron;

Description

CursorOn switches the cursor on. Not implemented on unixes.

Errors

None.

See also

CursorBig | Show big cursor
CursorOff | Hide cursor


Delay

Delay program execution.

Declaration

Source position: crth.inc line 95

procedure Delay(

  MS: Word

);

Description

Delay waits a specified number of milliseconds. The number of specified seconds is an approximation, and may be off a lot, if system load is high.

Errors

None

See also

Sound | Sound system speaker
NoSound | Stop system speaker

Example

Program Example15;
uses Crt;

{ Program to demonstrate the Delay function. }
var
  i : longint;
begin
  WriteLn('Counting Down');
  for i:=10 downto 1 do
   begin
     WriteLn(i);
     Delay(1000); {Wait one second}
   end;
  WriteLn('BOOM!!!');
end.


DelLine

Delete line at cursor position.

Declaration

Source position: crth.inc line 89

procedure DelLine;

Description

DelLine removes the current line. Lines following the current line are scrolled 1 line up, and an empty line is inserted at the bottom of the current window. The cursor doesn't move.

Errors

None.

See also

ClrEol | Clear from cursor position till end of line.
InsLine | Insert an empty line at cursor position
ClrScr | Clear current window.

Example

Program Example10;
uses Crt;

{ Program to demonstrate the InsLine function. }

begin
  ClrScr;
  WriteLn;
  WriteLn('Line 1');
  WriteLn('Line 2');
  WriteLn('Line 2');
  WriteLn('Line 3');
  WriteLn;
  WriteLn('Oops, Line 2 is listed twice,',
          ' let''s delete the line at the cursor postion');
  GotoXY(1,3);
  ReadKey;
  DelLine;
  GotoXY(1,10);
end.


GotoXY

Set cursor position on screen.

Declaration

Source position: crth.inc line 83

procedure GotoXY(

  X: tcrtcoord;

  Y: tcrtcoord

);

Description

GotoXY positions the cursor at (X,Y), X in horizontal, Y in vertical direction relative to the origin of the current window. The origin is located at (1,1), the upper-left corner of the window.

Errors

None.

See also

WhereX | Return X (horizontal) cursor position
WhereY | Return Y (vertical) cursor position
Window | Create new window on screen.

Example

Program Example6;
uses Crt;

{ Program to demonstrate the GotoXY function. }

begin
  ClrScr;
  GotoXY(10,10);
  Write('10,10');
  GotoXY(70,20);
  Write('70,20');
  GotoXY(1,22);
end.


HighVideo

Switch to highlighted text mode

Declaration

Source position: crth.inc line 93

procedure HighVideo;

Description

HighVideo switches the output to highlighted text. (It sets the high intensity bit of the video attribute)

Errors

None.

See also

TextColor | Set text color
TextBackground | Set text background
LowVideo | Switch to low intensity colors.
NormVideo | Return to normal (startup) modus

Example

Program Example14;
uses Crt;

{ Program to demonstrate the LowVideo, HighVideo, NormVideo functions. }

begin
  LowVideo;
  WriteLn('This is written with LowVideo');
  HighVideo;
  WriteLn('This is written with HighVideo');
  NormVideo;
  WriteLn('This is written with NormVideo');
end.


InsLine

Insert an empty line at cursor position

Declaration

Source position: crth.inc line 88

procedure InsLine;

Description

InsLine inserts an empty line at the current cursor position. Lines following the current line are scrolled 1 line down, causing the last line to disappear from the window. The cursor doesn't move.

Errors

None.

See also

ClrEol | Clear from cursor position till end of line.
DelLine | Delete line at cursor position.
ClrScr | Clear current window.

Example

Program Example10;
uses Crt;

{ Program to demonstrate the InsLine function. }

begin
  ClrScr;
  WriteLn;
  WriteLn('Line 1');
  WriteLn('Line 3');
  WriteLn;
  WriteLn('Oops, forgot Line 2, let''s insert at the cursor postion');
  GotoXY(1,3);
  ReadKey;
  InsLine;
  Write('Line 2');
  GotoXY(1,10);
end.


KeyPressed

Check if there is a keypress in the keybuffer

Declaration

Source position: crth.inc line 75

function KeyPressed: Boolean;

Description

Keypressed scans the keyboard buffer and sees if a key has been pressed. If this is the case, True is returned. If not, False is returned. The Shift, Alt, Ctrl keys are not reported. The key is not removed from the buffer, and can hence still be read after the KeyPressed function has been called.

Errors

None.

See also

ReadKey

Read key from keybuffer

Example

Program Example2;
uses Crt;

{ Program to demonstrate the KeyPressed function. }

begin
  WriteLn('Waiting until a key is pressed');
  repeat
  until KeyPressed;
 { The key is not Read,
   so it should also be outputted at the commandline}
end.


LowVideo

Switch to low intensity colors.

Declaration

Source position: crth.inc line 92

procedure LowVideo;

Description

LowVideo switches the output to non-highlighted text. (It clears the high intensity bit of the video attribute)

For an example, see HighVideo

Errors

None.

See also

TextColor | Set text color
TextBackground | Set text background
HighVideo | Switch to highlighted text mode
NormVideo | Return to normal (startup) modus


NormVideo

Return to normal (startup) modus

Declaration

Source position: crth.inc line 94

procedure NormVideo;

Description

NormVideo switches the output to the defaults, read at startup. (The defaults are read from the cursor position at startup)

For an example, see HighVideo

Errors

None.

See also

TextColor | Set text color
TextBackground | Set text background
LowVideo | Switch to low intensity colors.
HighVideo | Switch to highlighted text mode


NoSound

Stop system speaker

Declaration

Source position: crth.inc line 97

procedure NoSound;

Description

NoSound stops the speaker sound. This call is not supported on all operating systems.

Errors

None.

See also

Sound

Sound system speaker

Example

Program Example16;
uses Crt;

{ Program to demonstrate the Sound and NoSound function. }

var
  i : longint;
begin
  WriteLn('You will hear some tones from your speaker');
  i:=0;
  while (i<15000) do
   begin
     inc(i,500);
     Sound(i);
     Delay(100);
   end;
  WriteLn('Quiet now!');
  NoSound; {Stop noise}
end.


ReadKey

Read key from keybuffer

Declaration

Source position: crth.inc line 76

function ReadKey: Char;

Description

ReadKey reads 1 key from the keyboard buffer, and returns this. If an extended or function key has been pressed, then the zero ASCII code is returned. You can then read the scan code of the key with a second ReadKey call.

Key mappings under Linux can cause the wrong key to be reported by ReadKey, so caution is needed when using ReadKey.

Errors

None.

See also

KeyPressed

Check if there is a keypress in the keybuffer

Example

Program Example3;
uses Crt;

{ Program to demonstrate the ReadKey function. }

var
  ch : char;
begin
  writeln('Press Left/Right, Esc=Quit');
  repeat
    ch:=ReadKey;
    case ch of
     #0 : begin
            ch:=ReadKey; {Read ScanCode}
            case ch of
             #75 : WriteLn('Left');
             #77 : WriteLn('Right');
            end;
          end;
    #27 : WriteLn('ESC');
    end;
  until ch=#27 {Esc}
end.


Sound

Sound system speaker

Declaration

Source position: crth.inc line 96

procedure Sound(

  Hz: Word

);

Description

Sound sounds the speaker at a frequency of hz. Under Windows, a system sound is played and the frequency parameter is ignored. On other operating systems, this routine may not be implemented.

Errors

None.

See also

NoSound

Stop system speaker


TextBackground

Set text background

Declaration

Source position: crth.inc line 91

procedure TextBackground(

  Color: Byte

);

Description

TextBackground sets the background color to CL. CL can be one of the predefined color constants.

Errors

None.

See also

TextColor | Set text color
HighVideo | Switch to highlighted text mode
LowVideo | Switch to low intensity colors.
NormVideo | Return to normal (startup) modus

Example

Program Example13;
uses Crt;

{ Program to demonstrate the TextBackground function. }

begin
  TextColor(White);
  WriteLn('This is written in with the default background color');
  TextBackground(Green);
  WriteLn('This is written in with a Green background');
  TextBackground(Brown);
  WriteLn('This is written in with a Brown background');
  TextBackground(Black);
  WriteLn('Back with a black background');
end.


TextColor

Set text color

Declaration

Source position: crth.inc line 90

procedure TextColor(

  Color: Byte

);

Description

TextColor sets the foreground color to CL. CL can be one of the predefined color constants.

Errors

None.

See also

TextBackground | Set text background
HighVideo | Switch to highlighted text mode
LowVideo | Switch to low intensity colors.
NormVideo | Return to normal (startup) modus

Example

Program Example12;
uses Crt;

{ Program to demonstrate the TextColor function. }

begin
  WriteLn('This is written in the default color');
  TextColor(Red);
  WriteLn('This is written in Red');
  TextColor(White);
  WriteLn('This is written in White');
  TextColor(LightBlue);
  WriteLn('This is written in Light Blue');
end.


TextMode

Set screen mode.

Declaration

Source position: crth.inc line 77

procedure TextMode(

  Mode: Word

);

Description

TextMode sets the textmode of the screen (i.e. the number of lines and columns of the screen). The lower byte is use to set the VGA text mode.

This procedure is only implemented on dos.

Errors

None.

See also

Window

Create new window on screen.


WhereX

Return X (horizontal) cursor position

Declaration

Source position: crth.inc line 84

function WhereX: tcrtcoord;

Description

WhereX returns the current X-coordinate of the cursor, relative to the current window. The origin is (1,1), in the upper-left corner of the window.

Errors

None.

See also

GotoXY | Set cursor position on screen.
WhereY | Return Y (vertical) cursor position
Window | Create new window on screen.

Example

Program Example7;
uses Crt;

{ Program to demonstrate the WhereX and WhereY functions. }

begin
  Writeln('Cursor postion: X=',WhereX,' Y=',WhereY);
end.


WhereY

Return Y (vertical) cursor position

Declaration

Source position: crth.inc line 85

function WhereY: tcrtcoord;

Description

WhereY returns the current Y-coordinate of the cursor, relative to the current window. The origin is (1,1), in the upper-left corner of the window.

Errors

None.

See also

GotoXY | Set cursor position on screen.
WhereX | Return X (horizontal) cursor position
Window | Create new window on screen.

Example

Program Example7;
uses Crt;

{ Program to demonstrate the WhereX and WhereY functions. }

begin
  Writeln('Cursor postion: X=',WhereX,' Y=',WhereY);
end.


Window

Create new window on screen.

Declaration

Source position: crth.inc line 82

procedure Window(

  X1: Byte;

  Y1: Byte;

  X2: Byte;

  Y2: Byte

);

Description

Window creates a window on the screen, to which output will be sent. (X1,Y1) are the coordinates of the upper left corner of the window, (X2,Y2) are the coordinates of the bottom right corner of the window. These coordinates are relative to the entire screen, with the top left corner equal to (1,1). Further coordinate operations, except for the next Window call, are relative to the window's top left corner.

Errors

None.

See also

GotoXY | Set cursor position on screen.
WhereX | Return X (horizontal) cursor position
WhereY | Return Y (vertical) cursor position
ClrScr | Clear current window.

Example

Program Example5;
uses Crt;

{ Program to demonstrate the Window function. }

begin
  ClrScr;
  WriteLn('Creating a window from 30,10 to 50,20');
  Window(30,10,50,20);
  WriteLn('We are now writing in this small window we just created, we '+
          'can''t get outside it when writing long lines like this one');
  Write('Press any key to clear the window');
  ReadKey;
  ClrScr;
  Write('The window is cleared, press any key to restore to fullscreen');
  ReadKey;
{Full Screen is 80x25}
  Window(1,1,80,25);
  Clrscr;
  Writeln('Back in Full Screen');
end.


SetCThreadManager

Sets the thread manager to the C thread manager

Declaration

Source position: cthreads.pp line 65

procedure SetCThreadManager;

Description

SetCThreadManager actually sets the thread manager to the C thread manager. It can be called to re-set the thread manager if the thread manager was set to some other thread manager during the life-time of the program.


SetCWidestringManager

Set the Widestring manager of the system unit to the C version

Declaration

Source position: cwstring.pp line 24

procedure SetCWidestringManager;

Description

SetCWidestringManager actually sets the widestring manager record of the system unit. It is called automatically by the initialization section of the unit.


CompareDate

Compare 2 dates, disregarding the time of day

Declaration

Source position: dateutil.inc line 362

function CompareDate(

  const A: TDateTime;

  const B: TDateTime

):TValueRelationship;

Arguments

A | First date to compare
B | Second date to compare

Function result

A negative number if date A is before B, zero if they are equal, or positive if A is after B.

Description

CompareDate compares the date parts of two timestamps A and B and returns the following results:

< 0
if the day part of A is earlier than the day part of B.
0
if A and B are the on same day (times may differ) .
> 0
if the day part of A is later than the day part of B.

See also

CompareTime | Compares two times of the day, disregarding the date part.
CompareDateTime | Compare 2 dates, taking into account the time of day
SameDate | Check whether two TDateTime values have the same date part.
SameTime | Check whether two TDateTime values have the same time part.
SameDateTime | Check whether two TDateTime values have the same date and time parts.

Example

Program Example99;

{ This program demonstrates the CompareDate function }

Uses SysUtils,DateUtils;

Const
  Fmt = 'dddd dd mmmm yyyy';

Procedure Test(D1,D2 : TDateTime);

Var
  Cmp : Integer;

begin
  Write(FormatDateTime(Fmt,D1),' is ');
  Cmp:=CompareDate(D1,D2);
  If Cmp<0 then
    write('earlier than ')
  else if Cmp>0 then
    Write('later than ')
  else
    Write('equal to ');
  Writeln(FormatDateTime(Fmt,D2));
end;

Var
  D,N : TDateTime;

Begin
  D:=Today;
  N:=Now;
  Test(D,D);
  Test(N,N);
  Test(D+1,D);
  Test(D-1,D);
  Test(D+OneSecond,D);
  Test(D-OneSecond,D);
  Test(N+OneSecond,N);
  Test(N-OneSecond,N);
End.


CompareDateTime

Compare 2 dates, taking into account the time of day

Declaration

Source position: dateutil.inc line 361

function CompareDateTime(

  const A: TDateTime;

  const B: TDateTime

):TValueRelationship;

Arguments

A | First date-time to compare
B | First date-time to compare

Function result

A negative number if A is earlier than B, zero if they are equal, or positive if A is later than B.

Description

CompareDateTime compares two timestamps A and B and returns the following results:

< 0
if A is earlier in date/time than B.
0
if A and B are the same date/time .
> 0
if A is later in date/time than B.

See also

CompareTime | Compares two times of the day, disregarding the date part.
CompareDate | Compare 2 dates, disregarding the time of day
SameDate | Check whether two TDateTime values have the same date part.
SameTime | Check whether two TDateTime values have the same time part.
SameDateTime | Check whether two TDateTime values have the same date and time parts.

Example

Program Example98;

{ This program demonstrates the CompareDateTime function }

Uses SysUtils,DateUtils;

Const
  Fmt = 'dddd dd mmmm yyyy hh:nn:ss.zzz';

Procedure Test(D1,D2 : TDateTime);

Var
  Cmp : Integer;

begin
  Write(FormatDateTime(Fmt,D1),' is ');
  Cmp:=CompareDateTime(D1,D2);
  If Cmp<0 then
    write('earlier than ')
  else if Cmp>0 then
    Write('later than ')
  else
    Write('equal to ');
  Writeln(FormatDateTime(Fmt,D2));
end;

Var
  D,N : TDateTime;

Begin
  D:=Today;
  N:=Now;
  Test(D,D);
  Test(N,N);
  Test(D+1,D);
  Test(D-1,D);
  Test(D+OneSecond,D);
  Test(D-OneSecond,D);
  Test(N+OneSecond,N);
  Test(N-OneSecond,N);
End.


CompareTime

Compares two times of the day, disregarding the date part.

Declaration

Source position: dateutil.inc line 363

function CompareTime(

  const A: TDateTime;

  const B: TDateTime

):TValueRelationship;

Arguments

A | First time to compare
B | Second time to compare

Function result

A negative number if A is before B, zero if they are equal, or positive A is later than B.

Description

CompareTime compares the time parts of two timestamps A and B and returns the following results:

< 0
if the time part of A is earlier than the time part of B.
0
if A and B have the same time part (dates may differ) .
> 0
if the time part of A is later than the time part of B.

See also

CompareDateTime | Compare 2 dates, taking into account the time of day
CompareDate | Compare 2 dates, disregarding the time of day
SameDate | Check whether two TDateTime values have the same date part.
SameTime | Check whether two TDateTime values have the same time part.
SameDateTime | Check whether two TDateTime values have the same date and time parts.

Example

Program Example100;

{ This program demonstrates the CompareTime function }

Uses SysUtils,DateUtils;

Const
  Fmt = 'dddd dd mmmm yyyy hh:nn:ss.zzz';

Procedure Test(D1,D2 : TDateTime);

Var
  Cmp : Integer;

begin
  Write(FormatDateTime(Fmt,D1),' has ');
  Cmp:=CompareDateTime(D1,D2);
  If Cmp<0 then
    write('earlier time than ')
  else if Cmp>0 then
    Write('later time than ')
  else
    Write('equal time with ');
  Writeln(FormatDateTime(Fmt,D2));
end;

Var
  D,N : TDateTime;

Begin
  D:=Today;
  N:=Now;
  Test(D,D);
  Test(N,N);
  Test(N+1,N);
  Test(N-1,N);
  Test(N+OneSecond,N);
  Test(N-OneSecond,N);
End.


DateOf

Extract the date part from a DateTime indication.

Declaration

Source position: dateutil.inc line 76

function DateOf(

  const AValue: TDateTime

):TDateTime;

Arguments

AValue

Datetime to extract date from

Function result

Date part of AValue.

Description

DateOf extracts the date part from AValue and returns the result.

Since the TDateTime is actually a double with the date part encoded in the integer part, this operation corresponds to a call to Trunc.

See also

TimeOf | Extract the time part from a DateTime indication.
YearOf | Extract the year from a given date.
MonthOf | Extract the month from a given date.
DayOf | Extract the day (of month) part from a DateTime value
HourOf | Extract the hour part from a DateTime value.
MinuteOf | Extract the minute part from a DateTime value.
SecondOf | Extract the second part from a DateTime value.
MilliSecondOf | Extract the millisecond part from a DateTime value.

Example

Program Example1;

{ This program demonstrates the DateOf function }

Uses SysUtils,DateUtils;

Begin
  Writeln('Date is: ',DateTimeToStr(DateOf(Now)));
End.


DateTimeToDosDateTime

Convert TDateTime format to DOS date/time format

Declaration

Source position: dateutil.inc line 424

function DateTimeToDosDateTime(

  const AValue: TDateTime

):LongInt;

Description

DateTimeToDosDatetime takes Value, a TDateTime formatted timestamp, and recodes it to a MS-DOS encoded date/time value. This is a longint with the date/time encoded in the bits as:

0-4
Seconds divided by 2
5-10
Minutes
11-15
Hours
16-20
Day
21-24
Month
25-31
Years since 1980

See also

DosDateTimeToDateTime

Convert DOS date/time format to TDateTime format


DateTimeToJulianDate

Converts a TDateTime value to a Julian date representation

Declaration

Source position: dateutil.inc line 396

function DateTimeToJulianDate(

  const AValue: TDateTime

):Double;

Arguments

AValue

DateTime value to convert to Julian representation

Function result

Julian representation of AValue.

Description

DateTimeToJulianDate converts the AValue date/time indication to a julian (as opposed to Gregorian) date.

See also

JulianDateToDateTime | Convert a Julian date representation to a TDateTime value.
TryJulianDateToDateTime | Convert a Julian date representation to a TDateTime value.
DateTimeToModifiedJulianDate | Convert a TDateTime value to a modified Julian date representation
TryModifiedJulianDateToDateTime | Convert a modified Julian date representation to a TDateTime value.


DateTimeToMac

Convert a TDateTime timestamp to a Mac timestamp

Declaration

Source position: dateutil.inc line 416

function DateTimeToMac(

  const AValue: TDateTime

):Int64;

Description

DateTimeToMac converts the TDateTime value AValue to a valid Mac timestamp indication and returns the result.

Errors

None.

See also

UnixTimeStampToMac | Convert Unix Timestamp to a Mac Timestamp
MacToDateTime | Convert a Mac timestamp to a TDateTime timestamp
MacTimeStampToUnix | Convert a Mac timestamp to a Unix timestamp


DateTimeToModifiedJulianDate

Convert a TDateTime value to a modified Julian date representation

Declaration

Source position: dateutil.inc line 400

function DateTimeToModifiedJulianDate(

  const AValue: TDateTime

):Double;

Arguments

AValue

DateTime value to convert to Modified Julian representation

Function result

Modified Julian representation of AValue.

Description

Not yet implemented.

Errors

Currently, trying to use this function will raise an exception.

See also

DateTimeToJulianDate | Converts a TDateTime value to a Julian date representation
JulianDateToDateTime | Convert a Julian date representation to a TDateTime value.
TryJulianDateToDateTime | Convert a Julian date representation to a TDateTime value.
TryModifiedJulianDateToDateTime | Convert a modified Julian date representation to a TDateTime value.


DateTimeToUnix

Convert a TDateTime value to Unix epoch time

Declaration

Source position: dateutil.inc line 408

function DateTimeToUnix(

  const AValue: TDateTime

):Int64;

Arguments

AValue

DateTime value to convert

Function result

Unix epoch time corresponding to AValue

Description

DateTimeToUnix converts a TDateTime value to a epoch time (i.e. the number of seconds elapsed since 1/1/1970).

See also

UnixToDateTime

Convert Unix epoch time to a TDateTime value


DayOf

Extract the day (of month) part from a DateTime value

Declaration

Source position: dateutil.inc line 124

function DayOf(

  const AValue: TDateTime

):Word;

Arguments

AValue

Date to extract day of.

Function result

Day of month part of AValue.

Description

DayOf returns the day of the month part of the AValue date/time indication. It is a number between 1 and 31.

For an example, see YearOf

See also

YearOf | Extract the year from a given date.
WeekOf | Extract week (of the year) from a given date.
MonthOf | Extract the month from a given date.
HourOf | Extract the hour part from a DateTime value.
MinuteOf | Extract the minute part from a DateTime value.
SecondOf | Extract the second part from a DateTime value.
MilliSecondOf | Extract the millisecond part from a DateTime value.


DayOfTheMonth

Extract the day (of month) part of a DateTime value

Declaration

Source position: dateutil.inc line 191

function DayOfTheMonth(

  const AValue: TDateTime

):Word;

Arguments

AValue

Datetime value to extract day from.

Function result

Day in the month

Description

DayOfTheMonth returns the number of days that have passed since the start of the month till the moment indicated by AValue. This is a one-based number, i.e. the first day of the month will return 1.

For an example, see the WeekOfTheMonth function.

See also

DayOfTheYear | Extracts the day of the year from a TDateTime value
WeekOfTheMonth | Extract the week of the month (and optionally month and year) from a DateTime value
HourOfTheMonth | Calculate the number of hours passed since the start of the month.
MinuteOfTheMonth | Calculate number of minutes elapsed since the start of the month.
SecondOfTheMonth | Calculate number of seconds elapsed since the start of the month.
MilliSecondOfTheMonth | Calculate number of milliseconds elapsed since the start of the month.


DayOfTheWeek

Extracts the day of the week from a DateTime value

Declaration

Source position: dateutil.inc line 201

function DayOfTheWeek(

  const AValue: TDateTime

):Word;

Arguments

AValue

DateTime to extract the day of the week from.

Function result

Day of the week from AValue.

Description

DayOfTheWeek returns the number of days that have passed since the start of the week till the moment indicated by AValue. This is a one-based number, i.e. the first day of the week will return 1.

See also

DayOfTheYear | Extracts the day of the year from a TDateTime value
DayOfTheMonth | Extract the day (of month) part of a DateTime value
HourOfTheWeek | Calculate the number of hours elapsed since the start of the week.
MinuteOfTheWeek | Calculate the number of minutes elapsed since the start of the week
SecondOfTheWeek | Calculate the number of seconds elapsed since the start of the week
MilliSecondOfTheWeek | Calculate the number of milliseconds elapsed since the start of the week

Example

Program Example42;

{ This program demonstrates the WeekOfTheMonth function }

Uses SysUtils,DateUtils;

Var
  N : TDateTime;

Begin
  N:=Now;
  Writeln('Day of the Week         : ',DayOfTheWeek(N));
  Writeln('Hour of the Week        : ',HourOfTheWeek(N));
  Writeln('Minute of the Week      : ',MinuteOfTheWeek(N));
  Writeln('Second of the Week      : ',SecondOfTheWeek(N));
  Writeln('MilliSecond of the Week : ',
          MilliSecondOfTheWeek(N));
End.


DayOfTheYear

Extracts the day of the year from a TDateTime value

Declaration

Source position: dateutil.inc line 179

function DayOfTheYear(

  const AValue: TDateTime

):Word;

Arguments

AValue

DateTime to extract the day of the year from.

Function result

Day of the year from AValue.

Description

DayOfTheYear returns the number of days that have passed since the start of the year till the moment indicated by AValue. This is a one-based number, i.e. January 1 will return 1.

For an example, see the WeekOfTheYear function.

See also

WeekOfTheYear | Extract the week of the year (and optionally year) of a DateTime indication.
HourOfTheYear | Calculate the number of hours passed since the start of the year.
MinuteOfTheYear | Calculate the number of minutes elapsed since the start of the year
SecondOfTheYear | Calculate the number of seconds elapsed since the start of the year.
MilliSecondOfTheYear | Calculate the number of milliseconds elapsed since the start of the year.


DaysBetween

Number of whole days between two DateTime values.

Declaration

Source position: dateutil.inc line 259

function DaysBetween(

  const ANow: TDateTime;

  const AThen: TDateTime

):Integer;

Arguments

ANow | First date
AThen | Second date

Function result

Number of whole days between ANow and AThen.

Description

DaysBetween returns the number of whole days between ANow and AThen. This means the fractional part of a day (hours, minutes, etc.) is dropped.

See also

YearsBetween | Calculate the number of whole years between two DateTime values
MonthsBetween | Calculate the number of whole months between two DateTime values
WeeksBetween | Calculate the number of whole weeks between two DateTime values
HoursBetween | Calculate the number of whole hours between two DateTime values.
MinutesBetween | Calculate the number of whole minutes between two DateTime values.
SecondsBetween | Calculate the number of whole seconds between two DateTime values.
MilliSecondsBetween | Calculate the number of whole milliseconds between two DateTime values.

Example

Program Example58;

{ This program demonstrates the DaysBetween function }

Uses SysUtils,DateUtils;

Procedure Test(ANow,AThen : TDateTime);

begin
 Write('Number of days between ');
 Write(DateTimeToStr(AThen),' and ',DateTimeToStr(ANow));
 Writeln(' : ',DaysBetween(ANow,AThen));
end;

Var
  D1,D2 : TDateTime;

Begin
  D1:=Now;
  D2:=Today-23/24;
  Test(D1,D2);
  D2:=Today-1;
  Test(D1,D2);
  D2:=Today-25/24;
  Test(D1,D2);
  D2:=Today-26/24;
  Test(D1,D2);
  D2:=Today-5.4;
  Test(D1,D2);
  D2:=Today-2.5;
  Test(D1,D2);
End.


DaysInAMonth

Number of days in a month of a certain year.

Declaration

Source position: dateutil.inc line 101

function DaysInAMonth(

  const AYear: Word;

  const AMonth: Word

):Word;

Arguments

AYear | Year in which the month occurs.
AMonth | Month of which the number of days should be returned.

Function result

The number of days in month AMonth, in year AYear.

Description

DaysInYMonth returns the number of days in the month AMonth in the yearAYear. The return value takes leap years into account.

See also

WeeksInAYear | Return the number of weeks in a given year
WeeksInYear | return the number of weeks in the year, given a date
DaysInYear | Return the number of days in the year in which a date occurs.
DaysInAYear | Number of days in a particular year.
DaysInMonth | Return the number of days in the month in which a date occurs.

Example

Program Example17;

{ This program demonstrates the DaysInAMonth function }

Uses SysUtils,DateUtils;

Var
  Y,M : Word;

Begin
  For Y:=1992 to 2010 do
    For M:=1 to 12 do
      Writeln(LongMonthNames[m],' ',Y,' has ',DaysInAMonth(Y,M),' days.');
End.


DaysInAYear

Number of days in a particular year.

Declaration

Source position: dateutil.inc line 99

function DaysInAYear(

  const AYear: Word

):Word;

Arguments

AYear

Year to return the number of days from

Function result

Number of days in year AYear.

Description

DaysInAYear returns the number of weeks in the year AYear. The return value is either 365 or 366.

See also

WeeksInAYear | Return the number of weeks in a given year
WeeksInYear | return the number of weeks in the year, given a date
DaysInYear | Return the number of days in the year in which a date occurs.
DaysInMonth | Return the number of days in the month in which a date occurs.
DaysInAMonth | Number of days in a month of a certain year.

Example

Program Example15;

{ This program demonstrates the DaysInAYear function }

Uses SysUtils,DateUtils;

Var
  Y : Word;

Begin
  For Y:=1992 to 2010 do
    Writeln(Y,' has ',DaysInAYear(Y),' days.');
End.


DaysInMonth

Return the number of days in the month in which a date occurs.

Declaration

Source position: dateutil.inc line 100

function DaysInMonth(

  const AValue: TDateTime

):Word;

Arguments

AValue

Date in month of which to calculate the number of days.

Function result

Number of days in the month in which AValue occurs.

Description

DaysInMonth returns the number of days in the month in which AValue falls. The return value takes leap years into account.

See also

WeeksInAYear | Return the number of weeks in a given year
WeeksInYear | return the number of weeks in the year, given a date
DaysInYear | Return the number of days in the year in which a date occurs.
DaysInAYear | Number of days in a particular year.
DaysInAMonth | Number of days in a month of a certain year.

Example

Program Example16;

{ This program demonstrates the DaysInMonth function }

Uses SysUtils,DateUtils;

Var
  Y,M : Word;

Begin
  For Y:=1992 to 2010 do
    For M:=1 to 12 do
      Writeln(LongMonthNames[m],' ',Y,' has ',DaysInMonth(EncodeDate(Y,M,1)),' days.');
End.


DaysInYear

Return the number of days in the year in which a date occurs.

Declaration

Source position: dateutil.inc line 98

function DaysInYear(

  const AValue: TDateTime

):Word;

Arguments

AValue

Date in year of which to calculate the number of days.

Function result

Number of days in the year in which AValue occurs.

Description

daysInYear returns the number of days in the year part of AValue. The return value is either 365 or 366.

See also

WeeksInAYear | Return the number of weeks in a given year
WeeksInYear | return the number of weeks in the year, given a date
DaysInAYear | Number of days in a particular year.
DaysInMonth | Return the number of days in the month in which a date occurs.
DaysInAMonth | Number of days in a month of a certain year.

Example

Program Example14;

{ This program demonstrates the DaysInYear function }

Uses SysUtils,DateUtils;

Var
  Y : Word;

Begin
  For Y:=1992 to 2010 do
    Writeln(Y,' has ',DaysInYear(EncodeDate(Y,1,1)),' days.');
End.


DaySpan

Calculate the approximate number of days between two DateTime values.

Declaration

Source position: dateutil.inc line 274

function DaySpan(

  const ANow: TDateTime;

  const AThen: TDateTime

):Double;

Arguments

ANow | First moment in time
AThen | Second moment in time

Function result

Number (fractions included) of days between ANow and AThen

Description

DaySpan returns the number of Days between ANow and AThen, including any fractional parts of a Day.

See also

YearSpan | Calculate the approximate number of years between two DateTime values.
MonthSpan | Calculate the approximate number of months between two DateTime values.
WeekSpan | Calculate the approximate number of weeks between two DateTime values.
HourSpan | Calculate the approximate number of hours between two DateTime values.
MinuteSpan | Calculate the approximate number of minutes between two DateTime values.
SecondSpan | Calculate the approximate number of seconds between two DateTime values.
MilliSecondSpan | Calculate the approximate number of milliseconds between two DateTime values.
DaysBetween | Number of whole days between two DateTime values.

Example

Program Example66;

{ This program demonstrates the DaySpan function }

Uses SysUtils,DateUtils;

Procedure Test(ANow,AThen : TDateTime);

begin
 Write('Number of days between ');
 Write(DateTimeToStr(AThen),' and ',DateTimeToStr(ANow));
 Writeln(' : ',DaySpan(ANow,AThen));
end;

Var
  D1,D2 : TDateTime;

Begin
  D1:=Now;
  D2:=Today-23/24;
  Test(D1,D2);
  D2:=Today-1;
  Test(D1,D2);
  D2:=Today-25/24;
  Test(D1,D2);
  D2:=Today-26/24;
  Test(D1,D2);
  D2:=Today-5.4;
  Test(D1,D2);
  D2:=Today-2.5;
  Test(D1,D2);
End.


DecodeDateDay

Decode a DateTime value in year and year of day.

Declaration

Source position: dateutil.inc line 323

procedure DecodeDateDay(

  const AValue: TDateTime;

  out AYear: Word;

  out ADayOfYear: Word

);

Arguments

AValue | DateTime to decode
AYear | Returns the year part of AValue
ADayOfYear | Returns the day-of-year part of AValue

Description

DecodeDateDay decomposes the date indication in AValue and returns the various components in AYear, ADayOfYear.

See also

EncodeDateTime | Encodes a DateTime value from all its parts
EncodeDateMonthWeek | Encodes a year, month, week of month and day of week to a DateTime value
EncodeDateWeek | Encode a TDateTime value from a year, week and day of week triplet
EncodeDateDay | Encodes a year and day of year to a DateTime value
DecodeDateTime | Decode a datetime value in a date and time value
DecodeDateWeek | Decode a DateTime value in a week of year and day of week.
DecodeDateMonthWeek | Decode a DateTime value in a month, week of month and day of week

Example

Program Example83;

{ This program demonstrates the DecodeDateDay function }

Uses SysUtils,DateUtils;

Var
  Y,DoY : Word;
  TS : TDateTime;

Begin
  DecodeDateDay(Now,Y,DoY);
  TS:=EncodeDateDay(Y,DoY);
  Writeln('Today is : ',DateToStr(TS));
End.


DecodeDateMonthWeek

Decode a DateTime value in a month, week of month and day of week

Declaration

Source position: dateutil.inc line 331

procedure DecodeDateMonthWeek(

  const AValue: TDateTime;

  out AYear: Word;

  out AMonth: Word;

  out AWeekOfMonth: Word;

  out ADayOfWeek: Word

);

Arguments

AValue | DateTime to decode
AYear | Returns the year part of AValue.
AMonth | Returns the month part of AValue.
AWeekOfMonth | Returns the week of month part of AValue.
ADayOfWeek | Returns the day of week part of AValue.

Description

DecodeDateMonthWeek decomposes the date indication in AValue and returns the various components in AYear, AMonthAWeekOfMonth and ADayOfWeek.

See also

EncodeDateTime | Encodes a DateTime value from all its parts
EncodeDateMonthWeek | Encodes a year, month, week of month and day of week to a DateTime value
EncodeDateWeek | Encode a TDateTime value from a year, week and day of week triplet
EncodeDateDay | Encodes a year and day of year to a DateTime value
DecodeDateTime | Decode a datetime value in a date and time value
DecodeDateWeek | Decode a DateTime value in a week of year and day of week.
DecodeDateDay | Decode a DateTime value in year and year of day.

Example

Program Example85;

{ This program demonstrates the DecodeDateMonthWeek function }

Uses SysUtils,DateUtils;

Var
  Y,M,Wom,Dow : Word;
  TS : TDateTime;

Begin
  DecodeDateMonthWeek(Now,Y,M,WoM,DoW);
  TS:=EncodeDateMonthWeek(Y,M,WoM,Dow);
  Writeln('Today is : ',DateToStr(TS));
End.


DecodeDateTime

Decode a datetime value in a date and time value

Declaration

Source position: dateutil.inc line 305

procedure DecodeDateTime(

  const AValue: TDateTime;

  out AYear: Word;

  out AMonth: Word;

  out ADay: Word;

  out AHour: Word;

  out AMinute: Word;

  out ASecond: Word;

  out AMilliSecond: Word

);

Arguments

AValue | DateTime to decode
AYear | Returns the year part of AValue.
AMonth | Returns the month part of AValue.
ADay | Returns the day part of AValue.
AHour | Returns the hour part of AValue.
AMinute | Returns the minute part of AValue.
ASecond | Returns the second part of AValue.
AMilliSecond | Returns the millisecond part of AValue.

Description

DecodeDateTime decomposes the date/time indication in AValue and returns the various components in AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond

See also

EncodeDateTime | Encodes a DateTime value from all its parts
EncodeDateMonthWeek | Encodes a year, month, week of month and day of week to a DateTime value
EncodeDateWeek | Encode a TDateTime value from a year, week and day of week triplet
EncodeDateDay | Encodes a year and day of year to a DateTime value
DecodeDateWeek | Decode a DateTime value in a week of year and day of week.
DecodeDateDay | Decode a DateTime value in year and year of day.
DecodeDateMonthWeek | Decode a DateTime value in a month, week of month and day of week

Example

Program Example79;

{ This program demonstrates the DecodeDateTime function }

Uses SysUtils,DateUtils;

Var
  Y,Mo,D,H,Mi,S,MS : Word;
  TS : TDateTime;

Begin
  DecodeDateTime(Now,Y,Mo,D,H,Mi,S,MS);
  TS:=EncodeDateTime(Y,Mo,D,H,Mi,S,MS);
  Writeln('Now is : ',DateTimeToStr(TS));
End.


DecodeDateWeek

Decode a DateTime value in a week of year and day of week.

Declaration

Source position: dateutil.inc line 314

procedure DecodeDateWeek(

  const AValue: TDateTime;

  out AYear: Word;

  out AWeekOfYear: Word;

  out ADayOfWeek: Word

);

Arguments

AValue | DateTime to decode
AYear | Returns the year part of AValue.
AWeekOfYear | Returns the week of year part of AValue.
ADayOfWeek | Returns the day of week part of AValue.

Description

DecodeDateWeek decomposes the date indication in AValue and returns the various components in AYear, AWeekOfYear, ADayOfWeek.

See also

EncodeDateTime | Encodes a DateTime value from all its parts
EncodeDateMonthWeek | Encodes a year, month, week of month and day of week to a DateTime value
EncodeDateWeek | Encode a TDateTime value from a year, week and day of week triplet
EncodeDateDay | Encodes a year and day of year to a DateTime value
DecodeDateTime | Decode a datetime value in a date and time value
DecodeDateDay | Decode a DateTime value in year and year of day.
DecodeDateMonthWeek | Decode a DateTime value in a month, week of month and day of week

Example

Program Example81;

{ This program demonstrates the DecodeDateWeek function }

Uses SysUtils,DateUtils;

Var
  Y,W,Dow : Word;
  TS : TDateTime;

Begin
  DecodeDateWeek(Now,Y,W,Dow);
  TS:=EncodeDateWeek(Y,W,Dow);
  Writeln('Today is : ',DateToStr(TS));
End.


DecodeDayOfWeekInMonth

Decode a DateTime value in year, month, day of week parts

Declaration

Source position: dateutil.inc line 376

procedure DecodeDayOfWeekInMonth(

  const AValue: TDateTime;

  out AYear: Word;

  out AMonth: Word;

  out ANthDayOfWeek: Word;

  out ADayOfWeek: Word

);

Arguments

AValue | DateTime to decode
AYear | Returns the year part of AValue.
AMonth | Returns the month part of AValue.
ANthDayOfWeek | Returns which ADayofWeek of AValue.
ADayOfWeek | Returns the day of week part of AValue.

Description

DecodeDayOfWeekInMonth decodes the date AValue in a AYear, AMonth, ADayOfweek and ANthDayOfweek. (This is the N-th time that this weekday occurs in the month, e.g. the third saturday of the month.)

See also

NthDayOfWeek | Calculate which occurrence of weekday in the month a given day represents
EncodeDateMonthWeek | Encodes a year, month, week of month and day of week to a DateTime value
#rtl.sysutils.DayOfWeek | Returns the day of the week.
EncodeDayOfWeekInMonth | Encodes a year, month, week, day of week specification to a TDateTime value
TryEncodeDayOfWeekInMonth | Encode a year, month, week, day of week triplet to a TDateTime value

Example

Program Example105;

{ This program demonstrates the DecodeDayOfWeekInMonth function }

Uses SysUtils,DateUtils;

Var
  Y,M,NDoW,DoW : Word;
  D : TDateTime;
Begin
  DecodeDayOfWeekInMonth(Date,Y,M,NDoW,DoW);
  D:=EncodeDayOfWeekInMonth(Y,M,NDoW,DoW);
  Write(DateToStr(D),' is the ',NDow,'-th ');
  Writeln(formatdateTime('dddd',D),' of the month.');
End.


DosDateTimeToDateTime

Convert DOS date/time format to TDateTime format

Declaration

Source position: dateutil.inc line 425

function DosDateTimeToDateTime(

  AValue: LongInt

):TDateTime;

Description

DosDateTimeToDateTime takes a DOS encoded date/time AValue and recodes it as a TDateTime value.

The bit encoding of the DOS date/time is explained in the DateTimeToDosDateTime function.

See also

DateTimeToDosDateTime

Convert TDateTime format to DOS date/time format


EncodeDateDay

Encodes a year and day of year to a DateTime value

Declaration

Source position: dateutil.inc line 322

function EncodeDateDay(

  const AYear: Word;

  const ADayOfYear: Word

):TDateTime;

Arguments

AYear | Year part.
ADayOfYear | Day of the year part

Function result

DateTime value representing the date specified by AYear and ADayOfYear.

Description

EncodeDateDay encodes the values AYear and ADayOfYear to a date value and returns this value.

For an example, see DecodeDateDay.

Errors

If any of the arguments is not valid, then an EConvertError exception is raised.

See also

EncodeDateMonthWeek | Encodes a year, month, week of month and day of week to a DateTime value
DecodeDateDay | Decode a DateTime value in year and year of day.
EncodeDateTime | Encodes a DateTime value from all its parts
EncodeDateWeek | Encode a TDateTime value from a year, week and day of week triplet
TryEncodeDateTime | Encode a Year, Month, Day, Hour, minute, seconds, milliseconds tuplet to a TDateTime value
TryEncodeDateMonthWeek | Encode a year, month, week of month and day of week to a TDateTime value
TryEncodeDateWeek | Encode a year, week and day of week triplet to a TDateTime value


EncodeDateMonthWeek

Encodes a year, month, week of month and day of week to a DateTime value

Declaration

Source position: dateutil.inc line 330

function EncodeDateMonthWeek(

  const AYear: Word;

  const AMonth: Word;

  const AWeekOfMonth: Word;

  const ADayOfWeek: Word

):TDateTime;

Arguments

AYear | Year part
AMonth | Month part
AWeekOfMonth | Week of the month part
ADayOfWeek | Day of the week part

Function result

DateTime value representing the date specified by AYear, AMonth, AWeekOfMonth and ADayOfWeek.

Description

EncodeDateTime encodes the values AYearAMonth, WeekOfMonth,ADayOfWeek, to a date value and returns this value.

For an example, see DecodeDateMonthWeek.

Errors

If any of the arguments is not valid, then an EConvertError exception is raised.

See also

DecodeDateMonthWeek | Decode a DateTime value in a month, week of month and day of week
EncodeDateTime | Encodes a DateTime value from all its parts
EncodeDateWeek | Encode a TDateTime value from a year, week and day of week triplet
EncodeDateDay | Encodes a year and day of year to a DateTime value
TryEncodeDateTime | Encode a Year, Month, Day, Hour, minute, seconds, milliseconds tuplet to a TDateTime value
TryEncodeDateWeek | Encode a year, week and day of week triplet to a TDateTime value
TryEncodeDateMonthWeek | Encode a year, month, week of month and day of week to a TDateTime value
TryEncodeDateDay | Encode a year and day of year to a TDateTime value
NthDayOfWeek | Calculate which occurrence of weekday in the month a given day represents


EncodeDateTime

Encodes a DateTime value from all its parts

Declaration

Source position: dateutil.inc line 304

function EncodeDateTime(

  const AYear: Word;

  const AMonth: Word;

  const ADay: Word;

  const AHour: Word;

  const AMinute: Word;

  const ASecond: Word;

  const AMilliSecond: Word

):TDateTime;

Arguments

AYear | Year
AMonth | Month
ADay | Day of the month
AHour | Hour of the day
AMinute | Minutes
ASecond | Seconds
AMilliSecond | Milliseconds

Function result

DateTime value representing the complete timestamp

Description

EncodeDateTime encodes the values AYearAMonth, ADay,AHour, AMinute,ASecond and AMilliSecond to a date/time valueand returns this value.

For an example, see DecodeDateTime.

Errors

If any of the arguments is not valid, then an EConvertError exception is raised.

See also

DecodeDateTime | Decode a datetime value in a date and time value
EncodeDateMonthWeek | Encodes a year, month, week of month and day of week to a DateTime value
EncodeDateWeek | Encode a TDateTime value from a year, week and day of week triplet
EncodeDateDay | Encodes a year and day of year to a DateTime value
TryEncodeDateTime | Encode a Year, Month, Day, Hour, minute, seconds, milliseconds tuplet to a TDateTime value
TryEncodeDateWeek | Encode a year, week and day of week triplet to a TDateTime value
TryEncodeDateDay | Encode a year and day of year to a TDateTime value
TryEncodeDateMonthWeek | Encode a year, month, week of month and day of week to a TDateTime value


EncodeDateWeek

Encode a TDateTime value from a year, week and day of week triplet

Declaration

Source position: dateutil.inc line 312

function EncodeDateWeek(

  const AYear: Word;

  const AWeekOfYear: Word;

  const ADayOfWeek: Word

):TDateTime;

function EncodeDateWeek(

  const AYear: Word;

  const AWeekOfYear: Word

):TDateTime;

Arguments

AYear | Year part
AWeekOfYear | Week of the year part

Function result

DateTime value representing AYear, AWeekOfYear and ADayOfWeek.

Arguments

AYear | Year part
AWeekOfYear | Week of the year part

Description

EncodeDateWeek encodes the values AYear, AWeekOfYear and ADayOfWeek to a date value and returns this value.

For an example, see DecodeDateWeek.

Errors

If any of the arguments is not valid, then an EConvertError exception is raised.

See also

EncodeDateMonthWeek | Encodes a year, month, week of month and day of week to a DateTime value
DecodeDateWeek | Decode a DateTime value in a week of year and day of week.
EncodeDateTime | Encodes a DateTime value from all its parts
EncodeDateDay | Encodes a year and day of year to a DateTime value
TryEncodeDateTime | Encode a Year, Month, Day, Hour, minute, seconds, milliseconds tuplet to a TDateTime value
TryEncodeDateWeek | Encode a year, week and day of week triplet to a TDateTime value
TryEncodeDateMonthWeek | Encode a year, month, week of month and day of week to a TDateTime value


EncodeDayOfWeekInMonth

Encodes a year, month, week, day of week specification to a TDateTime value

Declaration

Source position: dateutil.inc line 378

function EncodeDayOfWeekInMonth(

  const AYear: Word;

  const AMonth: Word;

  const ANthDayOfWeek: Word;

  const ADayOfWeek: Word

):TDateTime;

Arguments

AYear | Year
AMonth | Month in the year
ANthDayOfWeek | Week in the month
ADayOfWeek | Day of the week

Function result

TDateTime value representing AYear , AMonthANthDayOfWeek .and ADayOfWeek.

Description

EncodeDayOfWeekInMonth encodes AYear, AMonth, ADayOfweek and ANthDayOfweek to a valid date stamp and returns the result.

ANthDayOfweekis the N-th time that this weekday occurs in the month, e.g. the third saturday of the month.

For an example, see DecodeDayOfWeekInMonth.

Errors

If any of the values is not in range, then an EConvertError exception will be raised.

See also

NthDayOfWeek | Calculate which occurrence of weekday in the month a given day represents
EncodeDateMonthWeek | Encodes a year, month, week of month and day of week to a DateTime value
#rtl.sysutils.DayOfWeek | Returns the day of the week.
DecodeDayOfWeekInMonth | Decode a DateTime value in year, month, day of week parts
TryEncodeDayOfWeekInMonth | Encode a year, month, week, day of week triplet to a TDateTime value


EncodeTimeInterval

Encode an interval as a TDateTime value.

Declaration

Source position: dateutil.inc line 339

function EncodeTimeInterval(

  Hour: Word;

  Minute: Word;

  Second: Word;

  MilliSecond: Word

):TDateTime;

Description

EncodeTimeInterval encodes a time interval expressed in Hour, Min, Sec, MSec as a TDateTime value and returns the value in Time.

Errors

If Min, Sec, MSec do not contain a valid time indication, then an EConvertError exception is raised.

See also

TryEncodeTimeInterval

Try to encode an interval as a TDateTime value.


EndOfADay

Calculates a DateTime value representing the end of a specified day

Declaration

Source position: dateutil.inc line 169

function EndOfADay(

  const AYear: Word;

  const AMonth: Word;

  const ADay: Word

):TDateTime; overload;

function EndOfADay(

  const AYear: Word;

  const ADayOfYear: Word

):TDateTime; overload;

Arguments

AYear | Year
AMonth | Month in the year
ADay | Day in the month

Function result

A datetime value representing the time 23:59:59.999 of the given day.

Arguments

AYear | Year
ADayOfYear | Day of the year

Description

EndOfADay returns a TDateTime value with the date/time indication of the last moment (23:59:59.999) of the day given by AYear, AMonth, ADay.

The day may also be indicated with a AYear, ADayOfYear pair.

See also

StartOfTheDay | Calculate the start of the day as a DateTime value, given a moment in the day.
StartOfADay | Return the start of a day as a DateTime value, given a day indication
StartOfTheWeek | Return the first day of the week, given a date.
StartOfAWeek | Return a day of the week, given a year, week and day in the week.
StartOfAMonth | Return first date of month, given a year/month pair.
StartOfTheMonth | Calculate the first day of the month, given a date in that month.
EndOfTheWeek | Calculate a DateTime value which represents the end of a week, given a date in that week.
EndOfAWeek | Return the last moment of day of the week, given a year and a week in the year.
EndOfTheYear | Calculate a DateTime value representing the last day of a year, given a date in that year.
EndOfAYear | Calculate a DateTime value representing the last day of a year
EndOfTheMonth | Calculate a DateTime value representing the last day of the month, given a day in that month.
EndOfAMonth | Calculate a datetime value representing the last day of the indicated month
EndOfTheDay | Calculate a datetime value that represents the end of a given day.

Example

Program Example39;

{ This program demonstrates the EndOfADay function }

Uses SysUtils,DateUtils;

Const
  Fmt = '"End of the day : "dd mmmm yyyy hh:nn:ss';

Var
  Y,M,D : Word;

Begin
  Y:=YearOf(Today);
  M:=MonthOf(Today);
  D:=DayOf(Today);
  Writeln(FormatDateTime(Fmt,EndOfADay(Y,M,D)));
  DecodeDateDay(Today,Y,D);
  Writeln(FormatDateTime(Fmt,EndOfADay(Y,D)));
End.


EndOfAMonth

Calculate a datetime value representing the last day of the indicated month

Declaration

Source position: dateutil.inc line 146

function EndOfAMonth(

  const AYear: Word;

  const AMonth: Word

):TDateTime;

Arguments

AYear | Year in which month occurs
AMonth | Month to calculate end of

Function result

DateTime value indicating the last day of AMonth in year AYear.

Description

EndOfAMonth e returns a TDateTime value with the date of the last day of the month indicated by the AYear, AMonth pair.

See also

StartOfTheMonth | Calculate the first day of the month, given a date in that month.
StartOfAMonth | Return first date of month, given a year/month pair.
EndOfTheMonth | Calculate a DateTime value representing the last day of the month, given a day in that month.
EndOfTheYear | Calculate a DateTime value representing the last day of a year, given a date in that year.
EndOfAYear | Calculate a DateTime value representing the last day of a year
StartOfAWeek | Return a day of the week, given a year, week and day in the week.
StartOfTheWeek | Return the first day of the week, given a date.

Example

Program Example31;

{ This program demonstrates the EndOfAMonth function }

Uses SysUtils,DateUtils;

Const
  Fmt = '"Last day of this month : "dd mmmm yyyy';
Var
  Y,M : Word;

Begin
  Y:=YearOf(Today);
  M:=MonthOf(Today);
  Writeln(FormatDateTime(Fmt,EndOfAMonth(Y,M)));
End.


EndOfAWeek

Return the last moment of day of the week, given a year and a week in the year.

Declaration

Source position: dateutil.inc line 157

function EndOfAWeek(

  const AYear: Word;

  const AWeekOfYear: Word;

  const ADayOfWeek: Word

):TDateTime;

function EndOfAWeek(

  const AYear: Word;

  const AWeekOfYear: Word

):TDateTime;

Arguments

ADayOfWeek

Day of the week

Description

EndOfAWeek returns a TDateTime value with the date of the last moment (23:59:59:999) on the indicated day of the week indicated by the AYear, AWeek, ADayOfWeek values.

The default value for ADayOfWeek is 7.

See also

StartOfTheWeek | Return the first day of the week, given a date.
EndOfTheWeek | Calculate a DateTime value which represents the end of a week, given a date in that week.
EndOfAWeek | Return the last moment of day of the week, given a year and a week in the year.
StartOfAMonth | Return first date of month, given a year/month pair.
EndOfTheYear | Calculate a DateTime value representing the last day of a year, given a date in that year.
EndOfAYear | Calculate a DateTime value representing the last day of a year
EndOfTheMonth | Calculate a DateTime value representing the last day of the month, given a day in that month.
EndOfAMonth | Calculate a datetime value representing the last day of the indicated month

Example

Program Example35;

{ This program demonstrates the EndOfAWeek function }

Uses SysUtils,DateUtils;

Const
  Fmt = '"Last day of this week : "dd mmmm yyyy hh:nn:ss';
  Fmt2 = '"Last-1 day of this week : "dd mmmm yyyy hh:nn:ss';

Var
  Y,W : Word;

Begin
  Y:=YearOf(Today);
  W:=WeekOf(Today);
  Writeln(FormatDateTime(Fmt,EndOfAWeek(Y,W)));
  Writeln(FormatDateTime(Fmt2,EndOfAWeek(Y,W,6)));
End.


EndOfAYear

Calculate a DateTime value representing the last day of a year

Declaration

Source position: dateutil.inc line 137

function EndOfAYear(

  const AYear: Word

):TDateTime;

Arguments

AYear

Year to calculate last day from

Function result

DateTime representing the last day of AYear.

Description

StartOfAYear returns a TDateTime value with the date of the last day of the year AYear (December 31).

See also

StartOfTheYear | Return the first day of the year, given a date in this year.
EndOfTheYear | Calculate a DateTime value representing the last day of a year, given a date in that year.
EndOfAYear | Calculate a DateTime value representing the last day of a year
EndOfTheMonth | Calculate a DateTime value representing the last day of the month, given a day in that month.
EndOfAMonth | Calculate a datetime value representing the last day of the indicated month
StartOfAWeek | Return a day of the week, given a year, week and day in the week.
StartOfTheWeek | Return the first day of the week, given a date.

Example

Program Example27;

{ This program demonstrates the EndOfAYear function }

Uses SysUtils,DateUtils;

Const
  Fmt = '"Last day of this year : "dd mmmm yyyy';

Begin
  Writeln(FormatDateTime(Fmt,EndOfAYear(YearOf(Today))));
End.


EndOfTheDay

Calculate a datetime value that represents the end of a given day.

Declaration

Source position: dateutil.inc line 166

function EndOfTheDay(

  const AValue: TDateTime

):TDateTime;

Arguments

AValue

Day to calculate the end of

Function result

A datetime value representing the time 23:59:59.999 of the day AValue.

Description

EndOfTheDay extracts the date part of AValue and returns a TDateTime value with the date/time indication of the last moment (23:59:59.999) of this day.

See also

StartOftheDay | Calculate the start of the day as a DateTime value, given a moment in the day.
StartOfADay | Return the start of a day as a DateTime value, given a day indication
StartOfTheWeek | Return the first day of the week, given a date.
StartOfAWeek | Return a day of the week, given a year, week and day in the week.
StartOfAMonth | Return first date of month, given a year/month pair.
StartOfTheMonth | Calculate the first day of the month, given a date in that month.
EndOfTheWeek | Calculate a DateTime value which represents the end of a week, given a date in that week.
EndOfAWeek | Return the last moment of day of the week, given a year and a week in the year.
EndOfTheYear | Calculate a DateTime value representing the last day of a year, given a date in that year.
EndOfAYear | Calculate a DateTime value representing the last day of a year
EndOfTheMonth | Calculate a DateTime value representing the last day of the month, given a day in that month.
EndOfAMonth | Calculate a datetime value representing the last day of the indicated month
EndOfADay | Calculates a DateTime value representing the end of a specified day

Example

Program Example37;

{ This program demonstrates the EndOfTheDay function }

Uses SysUtils,DateUtils;

Const
  Fmt = '"End of the day : "dd mmmm yyyy hh:nn:ss';

Begin
  Writeln(FormatDateTime(Fmt,EndOfTheDay(Today)));
End.


EndOfTheMonth

Calculate a DateTime value representing the last day of the month, given a day in that month.

Declaration

Source position: dateutil.inc line 144

function EndOfTheMonth(

  const AValue: TDateTime

):TDateTime;

Arguments

AValue

Day in the month of which the last day should be returned.

Function result

DateTime value representing the last day of the month in which AVAlue is a day.

Description

EndOfTheMonth extracts the year and month parts of AValue and returns a TDateTime value with the date of the first day of that year and month as the EndOfAMonth function.

See also

StartOfAMonth | Return first date of month, given a year/month pair.
StartOfTheMonth | Calculate the first day of the month, given a date in that month.
EndOfAMonth | Calculate a datetime value representing the last day of the indicated month
EndOfTheYear | Calculate a DateTime value representing the last day of a year, given a date in that year.
EndOfAYear | Calculate a DateTime value representing the last day of a year
StartOfAWeek | Return a day of the week, given a year, week and day in the week.
StartOfTheWeek | Return the first day of the week, given a date.

Example

Program Example29;

{ This program demonstrates the EndOfTheMonth function }

Uses SysUtils,DateUtils;

Const
  Fmt = '"last day of this month : "dd mmmm yyyy';

Begin
  Writeln(FormatDateTime(Fmt,EndOfTheMonth(Today)));
End.


EndOfTheWeek

Calculate a DateTime value which represents the end of a week, given a date in that week.

Declaration

Source position: dateutil.inc line 154

function EndOfTheWeek(

  const AValue: TDateTime

):TDateTime;

Arguments

AValue

Day in the week of which the last day should be calculated.

Function result

DateTime value representing the last day of the week in which AVAlue is a day.

Description

EndOfTheWeek extracts the year and week parts of AValue and returns a TDateTime value with the date of the last day of that week as the EndOfAWeek function.

See also

StartOfAWeek | Return a day of the week, given a year, week and day in the week.
StartOfTheWeek | Return the first day of the week, given a date.
EndOfAWeek | Return the last moment of day of the week, given a year and a week in the year.
StartOfAMonth | Return first date of month, given a year/month pair.
EndOfTheYear | Calculate a DateTime value representing the last day of a year, given a date in that year.
EndOfAYear | Calculate a DateTime value representing the last day of a year
EndOfTheMonth | Calculate a DateTime value representing the last day of the month, given a day in that month.
EndOfAMonth | Calculate a datetime value representing the last day of the indicated month

Example

Program Example33;

{ This program demonstrates the EndOfTheWeek function }

Uses SysUtils,DateUtils;

Const
  Fmt = '"last day of this week : "dd mmmm yyyy';

Begin
  Writeln(FormatDateTime(Fmt,EndOfTheWeek(Today)));
End.


EndOfTheYear

Calculate a DateTime value representing the last day of a year, given a date in that year.

Declaration

Source position: dateutil.inc line 135

function EndOfTheYear(

  const AValue: TDateTime

):TDateTime;

Arguments

AValue

Date in the year of which the end should be calculated

Function result

DateTime value representing the end of the year in which AValue falls.

Description

EndOfTheYear extracts the year part of AValue and returns a TDateTime value with the date of the last day of that year (December 31), as the EndOfAYear function.

See also

StartOfAYear | Return the first day of a given year.
StartOfTheYear | Return the first day of the year, given a date in this year.
EndOfTheMonth | Calculate a DateTime value representing the last day of the month, given a day in that month.
EndOfAMonth | Calculate a datetime value representing the last day of the indicated month
StartOfAWeek | Return a day of the week, given a year, week and day in the week.
StartOfTheWeek | Return the first day of the week, given a date.
EndOfAYear | Calculate a DateTime value representing the last day of a year

Example

Program Example25;

{ This program demonstrates the EndOfTheYear function }

Uses SysUtils,DateUtils;

Const
  Fmt = '"Last day of this year : "dd mmmm yyyy';

Begin
  Writeln(FormatDateTime(Fmt,EndOfTheYear(Today)));
End.


HourOf

Extract the hour part from a DateTime value.

Declaration

Source position: dateutil.inc line 125

function HourOf(

  const AValue: TDateTime

):Word;

Arguments

AValue

Date/time value to extract hour from.

Function result

Hour part of AValue.

Description

HourOf returns the hour of the day part of the AValue date/time indication. It is a number between 0 and 23.

For an example, see YearOf

See also

YearOf | Extract the year from a given date.
WeekOf | Extract week (of the year) from a given date.
MonthOf | Extract the month from a given date.
DayOf | Extract the day (of month) part from a DateTime value
MinuteOf | Extract the minute part from a DateTime value.
SecondOf | Extract the second part from a DateTime value.
MilliSecondOf | Extract the millisecond part from a DateTime value.


HourOfTheDay

Calculate the hour of a given DateTime value

Declaration

Source position: dateutil.inc line 211

function HourOfTheDay(

  const AValue: TDateTime

):Word;

Arguments

AValue

DateTime to calculate the hour of.

Function result

Hour part of AValue.

Description

HourOfTheDay returns the number of hours that have passed since the start of the day till the moment indicated by AValue. This is a zero-based number, i.e. 00:59:59 will return 0.

See also

HourOfTheYear | Calculate the number of hours passed since the start of the year.
HourOfTheMonth | Calculate the number of hours passed since the start of the month.
HourOfTheWeek | Calculate the number of hours elapsed since the start of the week.
MinuteOfTheDay | Calculate the number of minutes elapsed since the start of the day
SecondOfTheDay | Calculate the number of seconds elapsed since the start of the day
MilliSecondOfTheDay | Calculate the number of milliseconds elapsed since the start of the day

Example

Program Example43;

{ This program demonstrates the HourOfTheDay function }

Uses SysUtils,DateUtils;

Var
  N : TDateTime;

Begin
  N:=Now;
  Writeln('Hour of the Day        : ',HourOfTheDay(N));
  Writeln('Minute of the Day      : ',MinuteOfTheDay(N));
  Writeln('Second of the Day      : ',SecondOfTheDay(N));
  Writeln('MilliSecond of the Day : ',
          MilliSecondOfTheDay(N));
End.


HourOfTheMonth

Calculate the number of hours passed since the start of the month.

Declaration

Source position: dateutil.inc line 192

function HourOfTheMonth(

  const AValue: TDateTime

):Word;

Arguments

AValue

DateTime value for which to calculate the hour of the month.

Function result

Number of hours passed since the start of the month till AValue.

Description

HourOfTheMonth returns the number of hours that have passed since the start of the month till the moment indicated by AValue. This is a zero-based number, i.e. 00:59:59 on the first day of the month will return 0.

For an example, see the WeekOfTheMonth function.

See also

WeekOfTheMonth | Extract the week of the month (and optionally month and year) from a DateTime value
DayOfTheMonth | Extract the day (of month) part of a DateTime value
MinuteOfTheMonth | Calculate number of minutes elapsed since the start of the month.
SecondOfTheMonth | Calculate number of seconds elapsed since the start of the month.
MilliSecondOfTheMonth | Calculate number of milliseconds elapsed since the start of the month.


HourOfTheWeek

Calculate the number of hours elapsed since the start of the week.

Declaration

Source position: dateutil.inc line 202

function HourOfTheWeek(

  const AValue: TDateTime

):Word;

Arguments

AValue

DateTime value for which to calculate the hour of the week.

Function result

Number of hours elapsed since the start of the week till AValue.

Description

HourOfTheWeek returns the number of hours that have passed since the start of the Week till the moment indicated by AValue. This is a zero-based number, i.e. 00:59:59 on the first day of the week will return 0.

For an example, see the DayOfTheWeek function.

See also

HourOfTheYear | Calculate the number of hours passed since the start of the year.
HourOfTheMonth | Calculate the number of hours passed since the start of the month.
HourOfTheDay | Calculate the hour of a given DateTime value
DayOfTheWeek | Extracts the day of the week from a DateTime value
MinuteOfTheWeek | Calculate the number of minutes elapsed since the start of the week
SecondOfTheWeek | Calculate the number of seconds elapsed since the start of the week
MilliSecondOfTheWeek | Calculate the number of milliseconds elapsed since the start of the week


HourOfTheYear

Calculate the number of hours passed since the start of the year.

Declaration

Source position: dateutil.inc line 180

function HourOfTheYear(

  const AValue: TDateTime

):Word;

Arguments

AValue

DateTime value for which to calculate the hour of the year

Function result

Number of hours passed since the start of the year till AValue .

Description

HourOfTheYear returns the number of hours that have passed since the start of the year (January 1, 00:00:00) till the moment indicated by AValue. This is a zero-based number, i.e. January 1 00:59:59 will return 0.

For an example, see the WeekOfTheYear function.

See also

WeekOfTheYear | Extract the week of the year (and optionally year) of a DateTime indication.
DayOfTheYear | Extracts the day of the year from a TDateTime value
MinuteOfTheYear | Calculate the number of minutes elapsed since the start of the year
SecondOfTheYear | Calculate the number of seconds elapsed since the start of the year.
MilliSecondOfTheYear | Calculate the number of milliseconds elapsed since the start of the year.


HoursBetween

Calculate the number of whole hours between two DateTime values.

Declaration

Source position: dateutil.inc line 260

function HoursBetween(

  const ANow: TDateTime;

  const AThen: TDateTime

):Int64;

Arguments

ANow | First DateTime value
AThen | Second DateTime value

Function result

Number of hours between ANow and AThen

Description

HoursBetween returns the number of whole hours between ANow and AThen. This means the fractional part of an hour (minutes,seconds etc.) is dropped.

See also

YearsBetween | Calculate the number of whole years between two DateTime values
MonthsBetween | Calculate the number of whole months between two DateTime values
WeeksBetween | Calculate the number of whole weeks between two DateTime values
DaysBetween | Number of whole days between two DateTime values.
MinutesBetween | Calculate the number of whole minutes between two DateTime values.
SecondsBetween | Calculate the number of whole seconds between two DateTime values.
MilliSecondsBetween | Calculate the number of whole milliseconds between two DateTime values.

Example

Program Example59;

{ This program demonstrates the HoursBetween function }

Uses SysUtils,DateUtils;

Procedure Test(ANow,AThen : TDateTime);

begin
 Write('Number of hours between ');
 Write(DateTimeToStr(AThen),' and ',DateTimeToStr(ANow));
 Writeln(' : ',HoursBetween(ANow,AThen));
end;

Var
  D1,D2 : TDateTime;

Begin
  D1:=Now;
  D2:=D1-(59*OneMinute);
  Test(D1,D2);
  D2:=D1-(61*OneMinute);
  Test(D1,D2);
  D2:=D1-(122*OneMinute);
  Test(D1,D2);
  D2:=D1-(306*OneMinute);
  Test(D1,D2);
  D2:=D1-(5.4*OneHour);
  Test(D1,D2);
  D2:=D1-(2.5*OneHour);
  Test(D1,D2);
End.


HourSpan

Calculate the approximate number of hours between two DateTime values.

Declaration

Source position: dateutil.inc line 275

function HourSpan(

  const ANow: TDateTime;

  const AThen: TDateTime

):Double;

Arguments

ANow | First moment in time
AThen | Second moment in time

Function result

Number (fractions included) of hours between ANow and AThen

Description

HourSpan returns the number of Hours between ANow and AThen, including any fractional parts of a Hour.

See also

YearSpan | Calculate the approximate number of years between two DateTime values.
MonthSpan | Calculate the approximate number of months between two DateTime values.
WeekSpan | Calculate the approximate number of weeks between two DateTime values.
DaySpan | Calculate the approximate number of days between two DateTime values.
MinuteSpan | Calculate the approximate number of minutes between two DateTime values.
SecondSpan | Calculate the approximate number of seconds between two DateTime values.
MilliSecondSpan | Calculate the approximate number of milliseconds between two DateTime values.
HoursBetween | Calculate the number of whole hours between two DateTime values.

Example

Program Example67;

{ This program demonstrates the HourSpan function }

Uses SysUtils,DateUtils;

Procedure Test(ANow,AThen : TDateTime);

begin
 Write('Number of hours between ');
 Write(DateTimeToStr(AThen),' and ',DateTimeToStr(ANow));
 Writeln(' : ',HourSpan(ANow,AThen));
end;

Var
  D1,D2 : TDateTime;

Begin
  D1:=Now;
  D2:=D1-(59*OneMinute);
  Test(D1,D2);
  D2:=D1-(61*OneMinute);
  Test(D1,D2);
  D2:=D1-(122*OneMinute);
  Test(D1,D2);
  D2:=D1-(306*OneMinute);
  Test(D1,D2);
  D2:=D1-(5.4*OneHour);
  Test(D1,D2);
  D2:=D1-(2.5*OneHour);
  Test(D1,D2);
End.


IncDay

Increase a DateTime value with a number of days.

Declaration

Source position: dateutil.inc line 289

function IncDay(

  const AValue: TDateTime;

  const ANumberOfDays: Integer

):TDateTime;

function IncDay(

  const AValue: TDateTime

):TDateTime;

Arguments

AValue | DateTime value to which days should be added.
ANumberOfDays | Number of days to add.

Function result

DateTime representing AValue plus ANumberOfDays days.

Arguments

AValue

DateTime value to which days should be added.

Description

IncDay adds ANumberOfDays days to AValue and returns the resulting date/time.ANumberOfDays can be positive or negative.

See also

IncYear | Increase a DateTime value with a number of years.
#rtl.sysutils.IncMonth | Increases the month in a TDateTime value with a given amount.
IncWeek | Increase a DateTime value with a number of weeks.
IncHour | Increase a DateTime value with a number of hours.
IncMinute | Increase a DateTime value with a number of minutes.
IncSecond | Increase a DateTime value with a number of seconds.
IncMilliSecond | Increase a DateTime value with a number of milliseconds.

Example

Program Example74;

{ This program demonstrates the IncDay function }

Uses SysUtils,DateUtils;

Begin
  Writeln('One Day from today is ',DateToStr(IncDay(Today,1)));
  Writeln('One Day ago from today is ',DateToStr(IncDay(Today,-1)));
End.


IncHour

Increase a DateTime value with a number of hours.

Declaration

Source position: dateutil.inc line 291

function IncHour(

  const AValue: TDateTime;

  const ANumberOfHours: Int64

):TDateTime;

function IncHour(

  const AValue: TDateTime

):TDateTime;

Arguments

AValue | DateTime to which hours should be added.
ANumberOfHours | Number of hours to add

Function result

DateTime representing AValue plus ANumberOfHours hours.

Arguments

AValue

DateTime to which hours should be added.

Description

IncHour adds ANumberOfHours hours to AValue and returns the resulting date/time.ANumberOfHours can be positive or negative.

See also

IncYear | Increase a DateTime value with a number of years.
#rtl.sysutils.IncMonth | Increases the month in a TDateTime value with a given amount.
IncWeek | Increase a DateTime value with a number of weeks.
IncDay | Increase a DateTime value with a number of days.
IncMinute | Increase a DateTime value with a number of minutes.
IncSecond | Increase a DateTime value with a number of seconds.
IncMilliSecond | Increase a DateTime value with a number of milliseconds.

Example

Program Example75
;

{ This program demonstrates the IncHour function }

Uses SysUtils,DateUtils;

Begin
  Writeln('One Hour from now is ',DateTimeToStr(IncHour(Now,1)));
  Writeln('One Hour ago from now is ',DateTimeToStr(IncHour(Now,-1)));
End.


IncMilliSecond

Increase a DateTime value with a number of milliseconds.

Declaration

Source position: dateutil.inc line 297

function IncMilliSecond(

  const AValue: TDateTime;

  const ANumberOfMilliSeconds: Int64

):TDateTime;

function IncMilliSecond(

  const AValue: TDateTime

):TDateTime;

Arguments

AValue | DateTime to which milliseconds should be added.
ANumberOfMilliSeconds | Number of milliseconds to add

Function result

DateTime representing AValue plus ANumberOfMilliSeconds milliseconds.

Arguments

AValue

DateTime to which milliseconds should be added.

Description

IncMilliSecond adds ANumberOfMilliSeconds milliseconds to AValue and returns the resulting date/time.ANumberOfMilliSeconds can be positive or negative.

See also

IncYear | Increase a DateTime value with a number of years.
#rtl.sysutils.IncMonth | Increases the month in a TDateTime value with a given amount.
IncWeek | Increase a DateTime value with a number of weeks.
IncDay | Increase a DateTime value with a number of days.
IncHour | Increase a DateTime value with a number of hours.
IncSecond | Increase a DateTime value with a number of seconds.
IncMilliSecond | Increase a DateTime value with a number of milliseconds.

Example

Program Example78;

{ This program demonstrates the IncMilliSecond function }

Uses SysUtils,DateUtils;

Begin
  Writeln('One MilliSecond from now is ',TimeToStr(IncMilliSecond(Now,1)));
  Writeln('One MilliSecond ago from now is ',TimeToStr(IncMilliSecond(Now,-1)));
End.


IncMinute

Increase a DateTime value with a number of minutes.

Declaration

Source position: dateutil.inc line 293

function IncMinute(

  const AValue: TDateTime;

  const ANumberOfMinutes: Int64

):TDateTime;

function IncMinute(

  const AValue: TDateTime

):TDateTime;

Arguments

AValue | DateTime to which minutes should be added.
ANumberOfMinutes | Number of minutes to add

Function result

DateTime representing AValue plus ANumberOfMinutes minutes.

Arguments

AValue

DateTime to which minutes should be added.

Description

IncMinute adds ANumberOfMinutes minutes to AValue and returns the resulting date/time.ANumberOfMinutes can be positive or negative.

See also

IncYear | Increase a DateTime value with a number of years.
#rtl.sysutils.IncMonth | Increases the month in a TDateTime value with a given amount.
IncWeek | Increase a DateTime value with a number of weeks.
IncDay | Increase a DateTime value with a number of days.
IncHour | Increase a DateTime value with a number of hours.
IncSecond | Increase a DateTime value with a number of seconds.
IncMilliSecond | Increase a DateTime value with a number of milliseconds.

Example

Program Example76;

{ This program demonstrates the IncMinute function }

Uses SysUtils,DateUtils;

Begin
  Writeln('One Minute from now is ',TimeToStr(IncMinute(Time,1)));
  Writeln('One Minute ago from now is ',TimeToStr(IncMinute(Time,-1)));
End.


IncSecond

Increase a DateTime value with a number of seconds.

Declaration

Source position: dateutil.inc line 295

function IncSecond(

  const AValue: TDateTime;

  const ANumberOfSeconds: Int64

):TDateTime;

function IncSecond(

  const AValue: TDateTime

):TDateTime;

Arguments

AValue | DateTime to which seconds should be added.
ANumberOfSeconds | Number of seconds to add

Function result

DateTime representing AValue plus ANumberOfSeconds seconds.

Arguments

AValue

DateTime to which seconds should be added.

Description

IncSecond adds ANumberOfSeconds seconds to AValue and returns the resulting date/time.ANumberOfSeconds can be positive or negative.

See also

IncYear | Increase a DateTime value with a number of years.
#rtl.sysutils.IncMonth | Increases the month in a TDateTime value with a given amount.
IncWeek | Increase a DateTime value with a number of weeks.
IncDay | Increase a DateTime value with a number of days.
IncHour | Increase a DateTime value with a number of hours.
IncSecond | Increase a DateTime value with a number of seconds.
IncMilliSecond | Increase a DateTime value with a number of milliseconds.

Example

Program Example77;

{ This program demonstrates the IncSecond function }

Uses SysUtils,DateUtils;

Begin
  Writeln('One Second from now is ',TimeToStr(IncSecond(Time,1)));
  Writeln('One Second ago from now is ',TimeToStr(IncSecond(Time,-1)));
End.


IncWeek

Increase a DateTime value with a number of weeks.

Declaration

Source position: dateutil.inc line 287

function IncWeek(

  const AValue: TDateTime;

  const ANumberOfWeeks: Integer

):TDateTime;

function IncWeek(

  const AValue: TDateTime

):TDateTime;

Arguments

AValue | DateTime to which weeks should be added.
ANumberOfWeeks | Number of weeks to add

Function result

DateTime representing AValue plus ANumberOfWeeks weeks.

Arguments

AValue

DateTime to which weeks should be added.

Description

IncWeek adds ANumberOfWeeks weeks to AValue and returns the resulting date/time.ANumberOfWeeks can be positive or negative.

See also

IncYear | Increase a DateTime value with a number of years.
#rtl.sysutils.IncMonth | Increases the month in a TDateTime value with a given amount.
IncDay | Increase a DateTime value with a number of days.
IncHour | Increase a DateTime value with a number of hours.
IncMinute | Increase a DateTime value with a number of minutes.
IncSecond | Increase a DateTime value with a number of seconds.
IncMilliSecond | Increase a DateTime value with a number of milliseconds.

Example

Program Example73;

{ This program demonstrates the IncWeek function }

Uses SysUtils,DateUtils;

Begin
  Writeln('One Week from today is ',DateToStr(IncWeek(Today,1)));
  Writeln('One Week ago from today is ',DateToStr(IncWeek(Today,-1)));
End.


IncYear

Increase a DateTime value with a number of years.

Declaration

Source position: dateutil.inc line 284

function IncYear(

  const AValue: TDateTime;

  const ANumberOfYears: Integer

):TDateTime;

function IncYear(

  const AValue: TDateTime

):TDateTime;

Arguments

AValue | DateTime to which years should be added.
ANumberOfYears | Number of years to add

Function result

DateTime representing AValue plus ANumberOfYears years.

Arguments

AValue

DateTime to which years should be added.

Description

IncYear adds ANumberOfYears years to AValue and returns the resulting date/time. ANumberOfYears can be positive or negative.

See also

#rtl.sysutils.IncMonth | Increases the month in a TDateTime value with a given amount.
IncWeek | Increase a DateTime value with a number of weeks.
IncDay | Increase a DateTime value with a number of days.
IncHour | Increase a DateTime value with a number of hours.
IncMinute | Increase a DateTime value with a number of minutes.
IncSecond | Increase a DateTime value with a number of seconds.
IncMilliSecond | Increase a DateTime value with a number of milliseconds.

Example

Program Example71;

{ This program demonstrates the IncYear function }

Uses SysUtils,DateUtils;

Begin
  Writeln('One year from today is ',DateToStr(IncYear(Today,1)));
  Writeln('One year ago from today is ',DateToStr(IncYear(Today,-1)));
End.


InvalidDateDayError

Raise an EConvertError exception when a day is not a valid day of a year.

Declaration

Source position: dateutil.inc line 388

procedure InvalidDateDayError(

  const AYear: Word;

  const ADayOfYear: Word

);

Arguments

AYear | Year
ADayOfYear | Invalid day of the year.

Description

InvalidDateDayError raises an EConvertError exception and formats the error message with an appropriate description made up from the parts AYear and ADayOfYear.

Normally this function should not be needed, the conversion routines call it when they have received invalid arguments.

See also

InvalidDateWeekError | Raise an EConvertError with an invalid Year, WeekOfyear and DayOfWeek specification
InvalidDateTimeError | Raise an EConvertError about an invalid date-time specification.
InvalidDateMonthWeekError | Raise an EConvertError exception when a Year,Month,WeekOfMonth,DayofWeek is invalid.
InvalidDayOfWeekInMonthError | Raise an EConvertError exception when a Year,Month,NthDayofWeek,DayofWeek is invalid.


InvalidDateMonthWeekError

Raise an EConvertError exception when a Year,Month,WeekOfMonth,DayofWeek is invalid.

Declaration

Source position: dateutil.inc line 389

procedure InvalidDateMonthWeekError(

  const AYear: Word;

  const AMonth: Word;

  const AWeekOfMonth: Word;

  const ADayOfWeek: Word

);

Arguments

AYear | Year
AMonth | Month of the year
AWeekOfMonth | Week of the month
ADayOfWeek | Day of the week

Description

InvalidDateMonthWeekError raises an EConvertError exception and formats the error message with an appropriate description made up from the parts AYear, Amonth, AWeekOfMonth and ADayOfWeek.

Normally this function should not be needed, the conversion routines call it when they have received invalid arguments.

See also

InvalidDateWeekError | Raise an EConvertError with an invalid Year, WeekOfyear and DayOfWeek specification
InvalidDateTimeError | Raise an EConvertError about an invalid date-time specification.
InvalidDateDayError | Raise an EConvertError exception when a day is not a valid day of a year.
InvalidDayOfWeekInMonthError | Raise an EConvertError exception when a Year,Month,NthDayofWeek,DayofWeek is invalid.


InvalidDateTimeError

Raise an EConvertError about an invalid date-time specification.

Declaration

Source position: dateutil.inc line 385

procedure InvalidDateTimeError(

  const AYear: Word;

  const AMonth: Word;

  const ADay: Word;

  const AHour: Word;

  const AMinute: Word;

  const ASecond: Word;

  const AMilliSecond: Word;

  const ABaseDate: TDateTime

);

procedure InvalidDateTimeError(

  const AYear: Word;

  const AMonth: Word;

  const ADay: Word;

  const AHour: Word;

  const AMinute: Word;

  const ASecond: Word;

  const AMilliSecond: Word

);

Arguments

AYear | Year
AMonth | Month in the year
ADay | Day of the month
AHour | Hour of the day
AMinute | Minute of the hour
ASecond | Seconds in the minute
AMilliSecond | Milliseconds in second
ABaseDate | Base date time to use when creating the string representing the date/time. Default 0

Arguments

AYear | Year
AMonth | Month in the year
ADay | Day of the month
AHour | Hour of the day
AMinute | Minute of the hour
ASecond | Seconds in the minute
AMilliSecond | Milliseconds in second

Description

InvalidDateTimeError raises an EConvertError exception and formats the error message with an appropriate description made up from the parts AYear, AMonth, ADay,AHour, AMinute, ASecond and AMilliSecond.

Normally this function should not be needed, the conversion routines call it when they have received invalid arguments.

See also

InvalidDateWeekError | Raise an EConvertError with an invalid Year, WeekOfyear and DayOfWeek specification
InvalidDateDayError | Raise an EConvertError exception when a day is not a valid day of a year.
InvalidDateMonthWeekError | Raise an EConvertError exception when a Year,Month,WeekOfMonth,DayofWeek is invalid.
InvalidDayOfWeekInMonthError | Raise an EConvertError exception when a Year,Month,NthDayofWeek,DayofWeek is invalid.


InvalidDateWeekError

Raise an EConvertError with an invalid Year, WeekOfyear and DayOfWeek specification

Declaration

Source position: dateutil.inc line 387

procedure InvalidDateWeekError(

  const AYear: Word;

  const AWeekOfYear: Word;

  const ADayOfWeek: Word

);

Arguments

AYear | The year
AWeekOfYear | The week
ADayOfWeek | The day of theweek

Description

InvalidDateWeekError raises an EConvertError exception and formats the error message with an appropriate description made up from the parts AYear, AWeek, ADayOfWeek

Normally this function should not be needed, the conversion routines call it when they have received invalid arguments.

See also

InvalidDateTimeError | Raise an EConvertError about an invalid date-time specification.
InvalidDateDayError | Raise an EConvertError exception when a day is not a valid day of a year.
InvalidDateMonthWeekError | Raise an EConvertError exception when a Year,Month,WeekOfMonth,DayofWeek is invalid.
InvalidDayOfWeekInMonthError | Raise an EConvertError exception when a Year,Month,NthDayofWeek,DayofWeek is invalid.


InvalidDayOfWeekInMonthError

Raise an EConvertError exception when a Year,Month,NthDayofWeek,DayofWeek is invalid.

Declaration

Source position: dateutil.inc line 390

procedure InvalidDayOfWeekInMonthError(

  const AYear: Word;

  const AMonth: Word;

  const ANthDayOfWeek: Word;

  const ADayOfWeek: Word

);

Arguments

AYear | Year
AMonth | Month in the year
ANthDayOfWeek | Nth occurrence of day of week.
ADayOfWeek | Day of week.

Description

InvalidDayOfWeekInMonthError raises an EConvertError exception and formats the error message with an appropriate description made up from the parts AYear, Amonth, ANthDayOfWeek and ADayOfWeek.

Normally this function should not be needed, the conversion routines call it when they have received invalid arguments.

See also

InvalidDateWeekError | Raise an EConvertError with an invalid Year, WeekOfyear and DayOfWeek specification
InvalidDateTimeError | Raise an EConvertError about an invalid date-time specification.
InvalidDateDayError | Raise an EConvertError exception when a day is not a valid day of a year.
InvalidDateMonthWeekError | Raise an EConvertError exception when a Year,Month,WeekOfMonth,DayofWeek is invalid.


IsInLeapYear

Determine whether a date is in a leap year.

Declaration

Source position: dateutil.inc line 83

function IsInLeapYear(

  const AValue: TDateTime

):Boolean;

Arguments

AValue

Date to be checked.

Function result

True if AValue is in a leap year, False if not.

Description

IsInLeapYear returns True if the year part of AValue is leap year, or False if not.

See also

YearOf | Extract the year from a given date.
IsPM | Determine whether a time is PM or AM.
IsToday | Check whether a given date is today.
IsSameDay | Check if two date/time indications are the same day.

Example

Program Example3;

{ This program demonstrates the IsInLeapYear function }

Uses SysUtils,DateUtils;

Begin
  Writeln('Current year is leap year: ',IsInLeapYear(Date));
End.


IsPM

Determine whether a time is PM or AM.

Declaration

Source position: dateutil.inc line 84

function IsPM(

  const AValue: TDateTime

):Boolean;

Arguments

AValue

Time to check.

Function result

True if the time part of AValue is PM (afternoon).

Description

IsPM returns True if the time part of AValue is later then 12:00 (PM, or afternoon).

See also

YearOf | Extract the year from a given date.
IsInLeapYear | Determine whether a date is in a leap year.
IsToday | Check whether a given date is today.
IsSameDay | Check if two date/time indications are the same day.

Example

Program Example4;

{ This program demonstrates the IsPM function }

Uses SysUtils,DateUtils;

Begin
  Writeln('Current time is PM : ',IsPM(Now));
End.


IsSameDay

Check if two date/time indications are the same day.

Declaration

Source position: dateutil.inc line 113

function IsSameDay(

  const AValue: TDateTime;

  const ABasis: TDateTime

):Boolean;

Arguments

AValue | First date/time
ABasis | Second date/time

Function result

True if AValue and ABasis are on the same day, False otherwise..

Description

IsSameDay checks whether AValue and ABasis have the same date part, and returns True if they do, False if not.

See also

Today | Return the current date
Yesterday | Return the previous day.
Tomorrow | Return the next day
IsToday | Check whether a given date is today.

Example

Program Example21;

{ This program demonstrates the IsSameDay function }

Uses SysUtils,DateUtils;

Var
  I : Integer;
  D : TDateTime;

Begin
  For I:=1 to 3 do
    begin
    D:=Today+Random(3)-1;
    Write(FormatDateTime('dd mmmm yyyy "is today : "',D));
    Writeln(IsSameDay(D,Today));
    end;
End.


IsSameMonth

Check if 2 dates are in the same month.

Declaration

Source position: dateutil.inc line 114

function IsSameMonth(

  const Avalue: TDateTime;

  const ABasis: TDateTime

):Boolean;

Description

IsSameMonth will return True if the two dates Avalue and ABasis occur in the same year and month. (i.e. if their month and year parts match). Otherwise, False is returned.

See also

IsSameDay | Check if two date/time indications are the same day.
IsToday | Check whether a given date is today.
SameDate | Check whether two TDateTime values have the same date part.


IsToday

Check whether a given date is today.

Declaration

Source position: dateutil.inc line 112

function IsToday(

  const AValue: TDateTime

):Boolean;

Arguments

AValue

Date to check, may contain a time part.

Function result

True if AValue is today, False otherwise.

Description

IsToday returns True if AValue is today's date, and False otherwise.

See also

Today | Return the current date
Yesterday | Return the previous day.
Tomorrow | Return the next day
IsSameDay | Check if two date/time indications are the same day.

Example

Program Example20;

{ This program demonstrates the IsToday function }

Uses SysUtils,DateUtils;

Begin
  Writeln('Today     : ',IsToday(Today));
  Writeln('Tomorrow  : ',IsToday(Tomorrow));
  Writeln('Yesterday : ',IsToday(Yesterday));
End.


IsValidDate

Check whether a set of values is a valid date indication.

Declaration

Source position: dateutil.inc line 85

function IsValidDate(

  const AYear: Word;

  const AMonth: Word;

  const ADay: Word

):Boolean;

Arguments

AYear | Year value
AMonth | Month in the year
ADay | Day in the month

Function result

True if the given values form a valid date, False if not.

Description

IsValidDate returns True when the values AYear, AMonth, ADay form a valid date indication. If one of the values is not valid (e.g. the day is invalid or does not exist in that particular month), False is returned.

AYear must be in the range 1..9999 to be valid.

See also

IsValidTime | Check whether a set of values is a valid time indication.
IsValidDateTime | Check whether a set of values is a valid date and time indication.
IsValidDateDay | Check whether a given year/day of year combination is a valid date.
IsValidDateWeek | Check whether a given year/week/day of the week combination is a valid day.
IsValidDateMonthWeek | Check whether a given year/month/week/day of the week combination is a valid day

Example

Program Example5;

{ This program demonstrates the IsValidDate function }

Uses SysUtils,DateUtils;

Var
  Y,M,D : Word;

Begin
  For Y:=2000 to 2004 do
   For M:=1 to 12 do
     For D:=1 to 31 do
       If Not IsValidDate(Y,M,D) then
         Writeln(D,' is not a valid day in ',Y,'/',M);
End.


IsValidDateDay

Check whether a given year/day of year combination is a valid date.

Declaration

Source position: dateutil.inc line 88

function IsValidDateDay(

  const AYear: Word;

  const ADayOfYear: Word

):Boolean;

Arguments

AYear | Year
ADayOfYear | Day in the year

Function result

True if the given combination is a valid date, False otherwise.

Description

IsValidDateDay returns True if AYear and ADayOfYear form a valid date indication, or False otherwise.

AYear must be in the range 1..9999 to be valid.

The ADayOfYear value is checked to see whether it falls within the valid range of dates for AYear.

See also

IsValidDate | Check whether a set of values is a valid date indication.
IsValidTime | Check whether a set of values is a valid time indication.
IsValidDateTime | Check whether a set of values is a valid date and time indication.
IsValidDateWeek | Check whether a given year/week/day of the week combination is a valid day.
IsValidDateMonthWeek | Check whether a given year/month/week/day of the week combination is a valid day

Example

Program Example9;

{ This program demonstrates the IsValidDateDay function }

Uses SysUtils,DateUtils;

Var
  Y : Word;

Begin
  For Y:=1996 to 2004 do
    if  IsValidDateDay(Y,366) then
      Writeln(Y,' is a leap year');
End.


IsValidDateMonthWeek

Check whether a given year/month/week/day of the week combination is a valid day

Declaration

Source position: dateutil.inc line 90

function IsValidDateMonthWeek(

  const AYear: Word;

  const AMonth: Word;

  const AWeekOfMonth: Word;

  const ADayOfWeek: Word

):Boolean;

Arguments

AYear | Year
AMonth | Month of the year
AWeekOfMonth | Week of the month.
ADayOfWeek | Day in the week.

Function result

True if the given combination is a valid date, False otherwise.

Description

IsValidDateMonthWeek returns True if AYear, AMonthAWeekOfMonth and ADayOfWeek form a valid date indication, or False otherwise.

AYear must be in the range 1..9999 to be valid.

The AWeekOfMonth,ADayOfWeek values are checked to see whether the combination falls within the valid range of weeks for the AYear,AMonth combination.

See also

IsValidDate | Check whether a set of values is a valid date indication.
IsValidTime | Check whether a set of values is a valid time indication.
IsValidDateTime | Check whether a set of values is a valid date and time indication.
IsValidDateDay | Check whether a given year/day of year combination is a valid date.
IsValidDateWeek | Check whether a given year/week/day of the week combination is a valid day.

Example

Program Example11;

{ This program demonstrates the IsValidDateMonthWeek function }

Uses SysUtils,DateUtils;

Var
  Y,W,D : Word;
  B : Boolean;

Begin
  For Y:=2000 to 2004 do
    begin
    B:=True;
    For W:=4 to 6 do
      For D:=1 to 7 do
        If B then
          begin
          B:=IsValidDateMonthWeek(Y,12,W,D);
          If Not B then
            if (D=1) then
              Writeln('December ',Y,' has exactly ',W,' weeks.')
            else
              Writeln('December ',Y,' has ',W,' weeks and ',D-1,' days.');
          end;
    end;
End.


IsValidDateTime

Check whether a set of values is a valid date and time indication.

Declaration

Source position: dateutil.inc line 87

function IsValidDateTime(

  const AYear: Word;

  const AMonth: Word;

  const ADay: Word;

  const AHour: Word;

  const AMinute: Word;

  const ASecond: Word;

  const AMilliSecond: Word

):Boolean;

Arguments

AYear | Year value
AMonth | Month in the year
ADay | Day in the month
AHour | Hour of the day
AMinute | Minute in the hour
ASecond | Second in the minute
AMilliSecond | Milliseconds in the second

Function result

True if the given values form a valid date/time pair, False if not.

Description

IsValidTime returns True when the values AYear, AMonth, ADay, AHour, AMinute, ASecond and AMilliSecond form a valid date and time indication. If one of the values is not valid (e.g. the seconds are larger than 60), False is returned.

AYear must be in the range 1..9999 to be valid.

See also

IsValidDate | Check whether a set of values is a valid date indication.
IsValidTime | Check whether a set of values is a valid time indication.
IsValidDateDay | Check whether a given year/day of year combination is a valid date.
IsValidDateWeek | Check whether a given year/week/day of the week combination is a valid day.
IsValidDateMonthWeek | Check whether a given year/month/week/day of the week combination is a valid day

Example

Program Example7;

{ This program demonstrates the IsValidDateTime function }

Uses SysUtils,DateUtils;

Var
  Y,Mo,D : Word;
  H,M,S,MS : Word;
  I : Integer;

Begin
  For I:=1 to 10 do
    begin
    Y:=2000+Random(5);
    Mo:=Random(15);
    D:=Random(40);
    H:=Random(32);
    M:=Random(90);
    S:=Random(90);
    MS:=Random(1500);
    If Not IsValidDateTime(Y,Mo,D,H,M,S,MS) then
      Writeln(Y,'-',Mo,'-',D,' ',H,':',M,':',S,'.',MS,' is not a valid date/time.');
    end;
End.


IsValidDateWeek

Check whether a given year/week/day of the week combination is a valid day.

Declaration

Source position: dateutil.inc line 89

function IsValidDateWeek(

  const AYear: Word;

  const AWeekOfYear: Word;

  const ADayOfWeek: Word

):Boolean;

Arguments

AYear | Year
AWeekOfYear | Week in the year
ADayOfWeek | Day in the week

Function result

True if the given combination is a valid date, False otherwise.

Description

IsValidDateWeek returns True if AYear, AWeekOfYear and ADayOfWeek form a valid date indication, or False otherwise.

AYear must be in the range 1..9999 to be valid.

The ADayOfWeek,ADayOfWeek values are checked to see whether the combination falls within the valid range of weeks for AYear.

See also

IsValidDate | Check whether a set of values is a valid date indication.
IsValidTime | Check whether a set of values is a valid time indication.
IsValidDateTime | Check whether a set of values is a valid date and time indication.
IsValidDateDay | Check whether a given year/day of year combination is a valid date.
IsValidDateMonthWeek | Check whether a given year/month/week/day of the week combination is a valid day

Example

Program Example10;

{ This program demonstrates the IsValidDateWeek function }

Uses SysUtils,DateUtils;

Var
  Y,W,D : Word;
  B : Boolean;

Begin
  For Y:=2000 to 2004 do
    begin
    B:=True;
    For W:=51 to 54 do
      For D:=1 to 7 do
        If B then
          begin
          B:=IsValidDateWeek(Y,W,D);
          If Not B then
            if (D=1) then
              Writeln(Y,' has exactly ',W,' weeks.')
            else
              Writeln(Y,' has ',W,' weeks and ',D-1,' days.');
          end;
    end;
End.


IsValidTime

Check whether a set of values is a valid time indication.

Declaration

Source position: dateutil.inc line 86

function IsValidTime(

  const AHour: Word;

  const AMinute: Word;

  const ASecond: Word;

  const AMilliSecond: Word

):Boolean;

Arguments

AHour | Hour of the day.
AMinute | Minute in the hour
ASecond | Second in the minute
AMilliSecond | Milliseconds in the second

Function result

IsValidTime returns True when the values AHour, AMinute, ASecond and AMilliSecond form a valid time indication. If one of the values is not valid (e.g. the seconds are larger than 60), False is returned.


JulianDateToDateTime

Convert a Julian date representation to a TDateTime value.

Declaration

Source position: dateutil.inc line 397

function JulianDateToDateTime(

  const AValue: Double

):TDateTime;

Arguments

AValue

Date in Julian notation

Function result

Resulting TDateTime

Description

JulianDateToDateTime converts the Julian AValue date/time indication to a regular TDateTime date/time indication.

See also

DateTimeToJulianDate | Converts a TDateTime value to a Julian date representation
TryJulianDateToDateTime | Convert a Julian date representation to a TDateTime value.
DateTimeToModifiedJulianDate | Convert a TDateTime value to a modified Julian date representation
TryModifiedJulianDateToDateTime | Convert a modified Julian date representation to a TDateTime value.


LocalTimeToUniversal

Convert local time to UTC time

Declaration

Source position: dateutil.inc line 431

function LocalTimeToUniversal(

  LT: TDateTime

):TDateTime;

function LocalTimeToUniversal(

  LT: TDateTime;

  TZOffset: Integer

):TDateTime;

Description

UniversalTimeToLocal converts a local time indication to a universal time indication: it undoes the TZOffset timezone offset from the UT Universal time (UTC). If no TZOffset is specified, the local time offset as returned by GetLocalTimeOffset is used.

Note that for times in the past or in the future, or for time zones with DST, omitting the TZoffset may lead to wrong results, as the current timezone offset is used. Calculation of the correct timezone offset for a given date is very complicated, and outside the scope of this call.

See also

GetLocalTimeOffset

UniversalTimeToLocal

Convert UTC time to local time


MacTimeStampToUnix

Convert a Mac timestamp to a Unix timestamp

Declaration

Source position: dateutil.inc line 418

function MacTimeStampToUnix(

  const AValue: Int64

):Int64;

Description

MacTimeStampToUnix converts the Mac timestamp indication in AValue to a unix timestamp indication (epoch time)

Errors

None.

See also

UnixTimeStampToMac | Convert Unix Timestamp to a Mac Timestamp
DateTimeToMac | Convert a TDateTime timestamp to a Mac timestamp
MacToDateTime | Convert a Mac timestamp to a TDateTime timestamp


MacToDateTime

Convert a Mac timestamp to a TDateTime timestamp

Declaration

Source position: dateutil.inc line 417

function MacToDateTime(

  const AValue: Int64

):TDateTime;

Description

MacToDateTime converts the Mac timestamp indication in AValue to a valid TDateTime indication.

Errors

None.

See also

UnixTimeStampToMac | Convert Unix Timestamp to a Mac Timestamp
DateTimeToMac | Convert a TDateTime timestamp to a Mac timestamp
MacTimeStampToUnix | Convert a Mac timestamp to a Unix timestamp


MilliSecondOf

Extract the millisecond part from a DateTime value.

Declaration

Source position: dateutil.inc line 128

function MilliSecondOf(

  const AValue: TDateTime

):Word;

Arguments

AValue

Date/time value to extract millisecond from.

Function result

Millisecond part of AValue.

Description

MillisecondOf returns the second of the minute part of the AValue date/time indication. It is a number between 0 and 999.

For an example, see YearOf

See also

YearOf | Extract the year from a given date.
WeekOf | Extract week (of the year) from a given date.
MonthOf | Extract the month from a given date.
DayOf | Extract the day (of month) part from a DateTime value
HourOf | Extract the hour part from a DateTime value.
MinuteOf | Extract the minute part from a DateTime value.
MilliSecondOf | Extract the millisecond part from a DateTime value.


MilliSecondOfTheDay

Calculate the number of milliseconds elapsed since the start of the day

Declaration

Source position: dateutil.inc line 214

function MilliSecondOfTheDay(

  const AValue: TDateTime

):LongWord;

Arguments

AValue

Moment in the day

Function result

Number of milliseconds elapsed since the start of the day

Description

MilliSecondOfTheDay returns the number of milliseconds that have passed since the start of the Day (00:00:00.000) till the moment indicated by AValue. This is a zero-based number, i.e. 00:00:00.000 will return 0.

For an example, see the HourOfTheDay function.

See also

MilliSecondOfTheYear | Calculate the number of milliseconds elapsed since the start of the year.
MilliSecondOfTheMonth | Calculate number of milliseconds elapsed since the start of the month.
MilliSecondOfTheWeek | Calculate the number of milliseconds elapsed since the start of the week
MilliSecondOfTheHour | Calculate the number of milliseconds elapsed since the start of the hour
MilliSecondOfTheMinute | Calculate the number of milliseconds elapsed since the start of the minute
MilliSecondOfTheSecond | Calculate the number of milliseconds elapsed since the start of the second
HourOfTheDay | Calculate the hour of a given DateTime value
MinuteOfTheDay | Calculate the number of minutes elapsed since the start of the day
SecondOfTheDay | Calculate the number of seconds elapsed since the start of the day


MilliSecondOfTheHour

Calculate the number of milliseconds elapsed since the start of the hour

Declaration

Source position: dateutil.inc line 222

function MilliSecondOfTheHour(

  const AValue: TDateTime

):LongWord;

Arguments

AValue

Moment in the hour

Function result

Number of milliseconds elapsed since the start of the hour

Description

MilliSecondOfTheHour returns the number of milliseconds that have passed since the start of the Hour (HH:00:00.000) till the moment indicated by AValue. This is a zero-based number, i.e. HH:00:00.000 will return 0.

For an example, see the MinuteOfTheHour function.

See also

MilliSecondOfTheYear | Calculate the number of milliseconds elapsed since the start of the year.
MilliSecondOfTheMonth | Calculate number of milliseconds elapsed since the start of the month.
MilliSecondOfTheWeek | Calculate the number of milliseconds elapsed since the start of the week
MilliSecondOfTheDay | Calculate the number of milliseconds elapsed since the start of the day
MilliSecondOfTheMinute | Calculate the number of milliseconds elapsed since the start of the minute
MilliSecondOfTheSecond | Calculate the number of milliseconds elapsed since the start of the second
MinuteOfTheHour | Calculate the number of minutes elapsed since the start of the hour
SecondOfTheHour | Calculate the number of seconds elapsed since the start of the hour


MilliSecondOfTheMinute

Calculate the number of milliseconds elapsed since the start of the minute

Declaration

Source position: dateutil.inc line 230

function MilliSecondOfTheMinute(

  const AValue: TDateTime

):LongWord;

Arguments

AValue

Moment in the minute

Function result

Number of milliseconds elapsed since the start of the minute

Description

MilliSecondOfTheMinute returns the number of milliseconds that have passed since the start of the Minute (HH:MM:00.000) till the moment indicated by AValue. This is a zero-based number, i.e. HH:MM:00.000 will return 0.

For an example, see the SecondOfTheMinute function.

See also

MilliSecondOfTheYear | Calculate the number of milliseconds elapsed since the start of the year.
MilliSecondOfTheMonth | Calculate number of milliseconds elapsed since the start of the month.
MilliSecondOfTheWeek | Calculate the number of milliseconds elapsed since the start of the week
MilliSecondOfTheDay | Calculate the number of milliseconds elapsed since the start of the day
MilliSecondOfTheHour | Calculate the number of milliseconds elapsed since the start of the hour
MilliSecondOfTheMinute | Calculate the number of milliseconds elapsed since the start of the minute
MilliSecondOfTheSecond | Calculate the number of milliseconds elapsed since the start of the second
SecondOfTheMinute | Calculate the number of seconds elapsed since the start of the minute


MilliSecondOfTheMonth

Calculate number of milliseconds elapsed since the start of the month.

Declaration

Source position: dateutil.inc line 195

function MilliSecondOfTheMonth(

  const AValue: TDateTime

):LongWord;

Arguments

AValue

Moment in the month

Function result

Number of milliseconds elapsed since the start of the month.

Description

MilliSecondOfTheMonth returns the number of milliseconds that have passed since the start of the month (00:00:00.000) till the moment indicated by AValue. This is a zero-based number, i.e. 00:00:00.000 on the first of the month will return 0.

For an example, see the WeekOfTheMonth function.

See also

WeekOfTheMonth | Extract the week of the month (and optionally month and year) from a DateTime value
DayOfTheMonth | Extract the day (of month) part of a DateTime value
HourOfTheMonth | Calculate the number of hours passed since the start of the month.
MinuteOfTheMonth | Calculate number of minutes elapsed since the start of the month.
SecondOfTheMonth | Calculate number of seconds elapsed since the start of the month.
MilliSecondOfTheMonth | Calculate number of milliseconds elapsed since the start of the month.


MilliSecondOfTheSecond

Calculate the number of milliseconds elapsed since the start of the second

Declaration

Source position: dateutil.inc line 236

function MilliSecondOfTheSecond(

  const AValue: TDateTime

):Word;

Arguments

AValue

Moment in the second

Function result

Number of milliseconds elapsed since the start of the second

Description

MilliSecondOfTheSecond returns the number of milliseconds that have passed since the start of the second (HH:MM:SS.000) till the moment indicated by AValue. This is a zero-based number, i.e. HH:MM:SS.000 will return 0.

See also

MilliSecondOfTheYear | Calculate the number of milliseconds elapsed since the start of the year.
MilliSecondOfTheMonth | Calculate number of milliseconds elapsed since the start of the month.
MilliSecondOfTheWeek | Calculate the number of milliseconds elapsed since the start of the week
MilliSecondOfTheDay | Calculate the number of milliseconds elapsed since the start of the day
MilliSecondOfTheHour | Calculate the number of milliseconds elapsed since the start of the hour
MilliSecondOfTheMinute | Calculate the number of milliseconds elapsed since the start of the minute
SecondOfTheMinute | Calculate the number of seconds elapsed since the start of the minute

Example

Program Example46;

{ This program demonstrates the MilliSecondOfTheSecond function }

Uses SysUtils,DateUtils;

Var
  N : TDateTime;

Begin
  N:=Now;
  Writeln('MilliSecond of the Second : ',
          MilliSecondOfTheSecond(N));
End.


MilliSecondOfTheWeek

Calculate the number of milliseconds elapsed since the start of the week

Declaration

Source position: dateutil.inc line 205

function MilliSecondOfTheWeek(

  const AValue: TDateTime

):LongWord;

Arguments

AValue

Moment in the week to calculate milliseconds from.

Function result

Number of milliseconds passed since the start of the week.

Description

MilliSecondOfTheWeek returns the number of milliseconds that have passed since the start of the Week (00:00:00.000) till the moment indicated by AValue. This is a zero-based number, i.e. 00:00:00.000 on the first of the Week will return 0.

For an example, see the DayOfTheWeek function.

See also

MilliSecondOfTheYear | Calculate the number of milliseconds elapsed since the start of the year.
MilliSecondOfTheMonth | Calculate number of milliseconds elapsed since the start of the month.
MilliSecondOfTheDay | Calculate the number of milliseconds elapsed since the start of the day
MilliSecondOfTheHour | Calculate the number of milliseconds elapsed since the start of the hour
MilliSecondOfTheMinute | Calculate the number of milliseconds elapsed since the start of the minute
MilliSecondOfTheSecond | Calculate the number of milliseconds elapsed since the start of the second
DayOfTheWeek | Extracts the day of the week from a DateTime value
HourOfTheWeek | Calculate the number of hours elapsed since the start of the week.
MinuteOfTheWeek | Calculate the number of minutes elapsed since the start of the week
SecondOfTheWeek | Calculate the number of seconds elapsed since the start of the week


MilliSecondOfTheYear

Calculate the number of milliseconds elapsed since the start of the year.

Declaration

Source position: dateutil.inc line 183

function MilliSecondOfTheYear(

  const AValue: TDateTime

):Int64;

Arguments

AValue

Moment in the year

Function result

Number of seconds elapsed since the start of the year.

Description

MilliSecondOfTheYear returns the number of milliseconds that have passed since the start of the year (January 1, 00:00:00.000) till the moment indicated by AValue. This is a zero-based number, i.e. January 1 00:00:00.000 will return 0.

For an example, see the WeekOfTheYear function.

See also

WeekOfTheYear | Extract the week of the year (and optionally year) of a DateTime indication.
DayOfTheYear | Extracts the day of the year from a TDateTime value
HourOfTheYear | Calculate the number of hours passed since the start of the year.
MinuteOfTheYear | Calculate the number of minutes elapsed since the start of the year
SecondOfTheYear | Calculate the number of seconds elapsed since the start of the year.
MilliSecondOfTheYear | Calculate the number of milliseconds elapsed since the start of the year.


MilliSecondsBetween

Calculate the number of whole milliseconds between two DateTime values.

Declaration

Source position: dateutil.inc line 263

function MilliSecondsBetween(

  const ANow: TDateTime;

  const AThen: TDateTime

):Int64;

Arguments

ANow | First moment in time
AThen | Second moment in time

Function result

Number of milliseconds between ANow and AThen

Description

MillisSecondsBetween returns the number of whole milliseconds between ANow and AThen. This means a fractional part of a millisecond is dropped.

See also

YearsBetween | Calculate the number of whole years between two DateTime values
MonthsBetween | Calculate the number of whole months between two DateTime values
WeeksBetween | Calculate the number of whole weeks between two DateTime values
DaysBetween | Number of whole days between two DateTime values.
HoursBetween | Calculate the number of whole hours between two DateTime values.
MinutesBetween | Calculate the number of whole minutes between two DateTime values.
SecondsBetween | Calculate the number of whole seconds between two DateTime values.

Example

Program Example62;

{ This program demonstrates the MilliSecondsBetween function }

Uses SysUtils,DateUtils;

Procedure Test(ANow,AThen : TDateTime);

begin
 Write('Number of milliseconds between ');
 Write(TimeToStr(AThen),' and ',TimeToStr(ANow));
 Writeln(' : ',MilliSecondsBetween(ANow,AThen));
end;

Var
  D1,D2 : TDateTime;

Begin
  D1:=Now;
  D2:=D1-(0.9*OneMilliSecond);
  Test(D1,D2);
  D2:=D1-(1.0*OneMilliSecond);
  Test(D1,D2);
  D2:=D1-(1.1*OneMilliSecond);
  Test(D1,D2);
  D2:=D1-(2.5*OneMilliSecond);
  Test(D1,D2);
End.


MilliSecondSpan

Calculate the approximate number of milliseconds between two DateTime values.

Declaration

Source position: dateutil.inc line 278

function MilliSecondSpan(

  const ANow: TDateTime;

  const AThen: TDateTime

):Double;

Arguments

ANow | First moment in time
AThen | Second moment in time

Function result

Number (fractions included) of seconds between ANow and AThen

Description

MilliSecondSpan returns the number of milliseconds between ANow and AThen. Since millisecond is the smallest fraction of a TDateTime indication, the returned number will always be an integer value.

See also

YearSpan | Calculate the approximate number of years between two DateTime values.
MonthSpan | Calculate the approximate number of months between two DateTime values.
WeekSpan | Calculate the approximate number of weeks between two DateTime values.
DaySpan | Calculate the approximate number of days between two DateTime values.
HourSpan | Calculate the approximate number of hours between two DateTime values.
MinuteSpan | Calculate the approximate number of minutes between two DateTime values.
SecondSpan | Calculate the approximate number of seconds between two DateTime values.
MilliSecondsBetween | Calculate the number of whole milliseconds between two DateTime values.

Example

Program Example70;

{ This program demonstrates the MilliSecondSpan function }

Uses SysUtils,DateUtils;

Procedure Test(ANow,AThen : TDateTime);

begin
 Write('Number of milliseconds between ');
 Write(TimeToStr(AThen),' and ',TimeToStr(ANow));
 Writeln(' : ',MilliSecondSpan(ANow,AThen));
end;

Var
  D1,D2 : TDateTime;

Begin
  D1:=Now;
  D2:=D1-(0.9*OneMilliSecond);
  Test(D1,D2);
  D2:=D1-(1.0*OneMilliSecond);
  Test(D1,D2);
  D2:=D1-(1.1*OneMilliSecond);
  Test(D1,D2);
  D2:=D1-(2.5*OneMilliSecond);
  Test(D1,D2);
End.


MinuteOf

Extract the minute part from a DateTime value.

Declaration

Source position: dateutil.inc line 126

function MinuteOf(

  const AValue: TDateTime

):Word;

Arguments

AValue

Date/time value to extract minute from.

Function result

Minute part of AValue.

Description

MinuteOf returns the minute of the hour part of the AValue date/time indication. It is a number between 0 and 59.

For an example, see YearOf

See also

YearOf | Extract the year from a given date.
WeekOf | Extract week (of the year) from a given date.
MonthOf | Extract the month from a given date.
DayOf | Extract the day (of month) part from a DateTime value
HourOf | Extract the hour part from a DateTime value.
SecondOf | Extract the second part from a DateTime value.
MilliSecondOf | Extract the millisecond part from a DateTime value.


MinuteOfTheDay

Calculate the number of minutes elapsed since the start of the day

Declaration

Source position: dateutil.inc line 212

function MinuteOfTheDay(

  const AValue: TDateTime

):Word;

Arguments

AValue

Moment in the day

Function result

Number of minutes elapsed since the start of the day

Description

MinuteOfTheDay returns the number of minutes that have passed since the start of the Day (00:00:00) till the moment indicated by AValue. This is a zero-based number, i.e. 00:00:59 will return 0.

For an example, see the HourOfTheDay function.

See also

MinuteOfTheYear | Calculate the number of minutes elapsed since the start of the year
MinuteOfTheMonth | Calculate number of minutes elapsed since the start of the month.
MinuteOfTheWeek | Calculate the number of minutes elapsed since the start of the week
MinuteOfTheHour | Calculate the number of minutes elapsed since the start of the hour
HourOfTheDay | Calculate the hour of a given DateTime value
SecondOfTheDay | Calculate the number of seconds elapsed since the start of the day
MilliSecondOfTheDay | Calculate the number of milliseconds elapsed since the start of the day


MinuteOfTheHour

Calculate the number of minutes elapsed since the start of the hour

Declaration

Source position: dateutil.inc line 220

function MinuteOfTheHour(

  const AValue: TDateTime

):Word;

Arguments

AValue

Moment in the hour

Function result

Number of minutes elapsed since the start of the hour

Description

MinuteOfTheHour returns the number of minutes that have passed since the start of the Hour (HH:00:00) till the moment indicated by AValue. This is a zero-based number, i.e. HH:00:59 will return 0.

See also

MinuteOfTheYear | Calculate the number of minutes elapsed since the start of the year
MinuteOfTheMonth | Calculate number of minutes elapsed since the start of the month.
MinuteOfTheWeek | Calculate the number of minutes elapsed since the start of the week
MinuteOfTheDay | Calculate the number of minutes elapsed since the start of the day
SecondOfTheHour | Calculate the number of seconds elapsed since the start of the hour
MilliSecondOfTheHour | Calculate the number of milliseconds elapsed since the start of the hour

Example

Program Example44;

{ This program demonstrates the MinuteOfTheHour function }

Uses SysUtils,DateUtils;

Var
  N : TDateTime;

Begin
  N:=Now;
  Writeln('Minute of the Hour      : ',MinuteOfTheHour(N));
  Writeln('Second of the Hour      : ',SecondOfTheHour(N));
  Writeln('MilliSecond of the Hour : ',
          MilliSecondOfTheHour(N));
End.


MinuteOfTheMonth

Calculate number of minutes elapsed since the start of the month.

Declaration

Source position: dateutil.inc line 193

function MinuteOfTheMonth(

  const AValue: TDateTime

):Word;

Arguments

AValue

Moment in the month.

Function result

Number of minutes elapsed since the start of the month.

Description

MinuteOfTheMonth returns the number of minutes that have passed since the start of the Month (00:00:00) till the moment indicated by AValue. This is a zero-based number, i.e. 00:00:59 on the first day of the month will return 0.

For an example, see the WeekOfTheMonth function.

See also

WeekOfTheMonth | Extract the week of the month (and optionally month and year) from a DateTime value
DayOfTheMonth | Extract the day (of month) part of a DateTime value
HourOfTheMonth | Calculate the number of hours passed since the start of the month.
MinuteOfTheMonth | Calculate number of minutes elapsed since the start of the month.
SecondOfTheMonth | Calculate number of seconds elapsed since the start of the month.
MilliSecondOfTheMonth | Calculate number of milliseconds elapsed since the start of the month.


MinuteOfTheWeek

Calculate the number of minutes elapsed since the start of the week

Declaration

Source position: dateutil.inc line 203

function MinuteOfTheWeek(

  const AValue: TDateTime

):Word;

Arguments

AValue

Moment in the week.

Function result

Number of seconds elapsed since the start of the week

Description

MinuteOfTheWeek returns the number of minutes that have passed since the start of the week (00:00:00) till the moment indicated by AValue. This is a zero-based number, i.e. 00:00:59 on the first day of the week will return 0.

For an example, see the DayOfTheWeek function.

See also

MinuteOfTheYear | Calculate the number of minutes elapsed since the start of the year
MinuteOfTheMonth | Calculate number of minutes elapsed since the start of the month.
MinuteOfTheDay | Calculate the number of minutes elapsed since the start of the day
MinuteOfTheHour | Calculate the number of minutes elapsed since the start of the hour
DayOfTheWeek | Extracts the day of the week from a DateTime value
HourOfTheWeek | Calculate the number of hours elapsed since the start of the week.
SecondOfTheWeek | Calculate the number of seconds elapsed since the start of the week
MilliSecondOfTheWeek | Calculate the number of milliseconds elapsed since the start of the week


MinuteOfTheYear

Calculate the number of minutes elapsed since the start of the year

Declaration

Source position: dateutil.inc line 181

function MinuteOfTheYear(

  const AValue: TDateTime

):LongWord;

Arguments

AValue

Moment in the year.

Function result

Number of minutes elapsed since the start of the year.

Description

MinuteOfTheYear returns the number of minutes that have passed since the start of the year (January 1, 00:00:00) till the moment indicated by AValue. This is a zero-based number, i.e. January 1 00:00:59 will return 0.

For an example, see the WeekOfTheYear function.

See also

WeekOfTheYear | Extract the week of the year (and optionally year) of a DateTime indication.
DayOfTheYear | Extracts the day of the year from a TDateTime value
HourOfTheYear | Calculate the number of hours passed since the start of the year.
MinuteOfTheYear | Calculate the number of minutes elapsed since the start of the year
SecondOfTheYear | Calculate the number of seconds elapsed since the start of the year.
MilliSecondOfTheYear | Calculate the number of milliseconds elapsed since the start of the year.


MinutesBetween

Calculate the number of whole minutes between two DateTime values.

Declaration

Source position: dateutil.inc line 261

function MinutesBetween(

  const ANow: TDateTime;

  const AThen: TDateTime

):Int64;

Arguments

ANow | First moment in time
AThen | Second moment in time

Function result

Number of minutes between ANow and AThen

Description

MinutesBetween returns the number of whole minutes between ANow and AThen. This means the fractional part of a minute (seconds, milliseconds etc.) is dropped.

See also

YearsBetween | Calculate the number of whole years between two DateTime values
MonthsBetween | Calculate the number of whole months between two DateTime values
WeeksBetween | Calculate the number of whole weeks between two DateTime values
DaysBetween | Number of whole days between two DateTime values.
HoursBetween | Calculate the number of whole hours between two DateTime values.
SecondsBetween | Calculate the number of whole seconds between two DateTime values.
MilliSecondsBetween | Calculate the number of whole milliseconds between two DateTime values.

Example

Program Example60;

{ This program demonstrates the MinutesBetween function }

Uses SysUtils,DateUtils;

Procedure Test(ANow,AThen : TDateTime);

begin
 Write('Number of minutes between ');
 Write(TimeToStr(AThen),' and ',TimeToStr(ANow));
 Writeln(' : ',MinutesBetween(ANow,AThen));
end;

Var
  D1,D2 : TDateTime;

Begin
  D1:=Now;
  D2:=D1-(59*OneSecond);
  Test(D1,D2);
  D2:=D1-(61*OneSecond);
  Test(D1,D2);
  D2:=D1-(122*OneSecond);
  Test(D1,D2);
  D2:=D1-(306*OneSecond);
  Test(D1,D2);
  D2:=D1-(5.4*OneMinute);
  Test(D1,D2);
  D2:=D1-(2.5*OneMinute);
  Test(D1,D2);
End.


MinuteSpan

Calculate the approximate number of minutes between two DateTime values.

Declaration

Source position: dateutil.inc line 276

function MinuteSpan(

  const ANow: TDateTime;

  const AThen: TDateTime

):Double;

Arguments

ANow | First moment in time
AThen | Second moment in time

Function result

Number (fractions included) of minutes between ANow and AThen

Description

MinuteSpan returns the number of minutes between ANow and AThen, including any fractional parts of a minute.

See also

YearSpan | Calculate the approximate number of years between two DateTime values.
MonthSpan | Calculate the approximate number of months between two DateTime values.
WeekSpan | Calculate the approximate number of weeks between two DateTime values.
DaySpan | Calculate the approximate number of days between two DateTime values.
HourSpan | Calculate the approximate number of hours between two DateTime values.
SecondSpan | Calculate the approximate number of seconds between two DateTime values.
MilliSecondSpan | Calculate the approximate number of milliseconds between two DateTime values.
MinutesBetween | Calculate the number of whole minutes between two DateTime values.

Example

Program Example68;

{ This program demonstrates the MinuteSpan function }

Uses SysUtils,DateUtils;

Procedure Test(ANow,AThen : TDateTime);

begin
 Write('Number of minutes between ');
 Write(TimeToStr(AThen),' and ',TimeToStr(ANow));
 Writeln(' : ',MinuteSpan(ANow,AThen));
end;

Var
  D1,D2 : TDateTime;

Begin
  D1:=Now;
  D2:=D1-(59*OneSecond);
  Test(D1,D2);
  D2:=D1-(61*OneSecond);
  Test(D1,D2);
  D2:=D1-(122*OneSecond);
  Test(D1,D2);
  D2:=D1-(306*OneSecond);
  Test(D1,D2);
  D2:=D1-(5.4*OneMinute);
  Test(D1,D2);
  D2:=D1-(2.5*OneMinute);
  Test(D1,D2);
End.


ModifiedJulianDateToDateTime

Convert a modified Julian date representation to a TDateTime value.

Declaration

Source position: dateutil.inc line 401

function ModifiedJulianDateToDateTime(

  const AValue: Double

):TDateTime;

Arguments

AValue

Date to convert

Function result

AValue in modified Julian date notation.

Description

Not yet implemented.

Errors

Currently, trying to use this function will raise an exception.

See also

DateTimeToJulianDate | Converts a TDateTime value to a Julian date representation
JulianDateToDateTime | Convert a Julian date representation to a TDateTime value.
TryJulianDateToDateTime | Convert a Julian date representation to a TDateTime value.
DateTimeToModifiedJulianDate | Convert a TDateTime value to a modified Julian date representation
TryModifiedJulianDateToDateTime | Convert a modified Julian date representation to a TDateTime value.


MonthOf

Extract the month from a given date.

Declaration

Source position: dateutil.inc line 122

function MonthOf(

  const AValue: TDateTime

):Word;

Arguments

AValue

Date to extract month from.

Function result

Month part of AValue

Description

MonthOf returns the month part of the AValue date/time indication. It is a number between 1 and 12.

For an example, see YearOf

See also

YearOf | Extract the year from a given date.
DayOf | Extract the day (of month) part from a DateTime value
WeekOf | Extract week (of the year) from a given date.
HourOf | Extract the hour part from a DateTime value.
MinuteOf | Extract the minute part from a DateTime value.
SecondOf | Extract the second part from a DateTime value.
MilliSecondOf | Extract the millisecond part from a DateTime value.


MonthOfTheYear

Extract the month of a DateTime indication.

Declaration

Source position: dateutil.inc line 176

function MonthOfTheYear(

  const AValue: TDateTime

):Word;

Arguments

AValue

Date from which to extract month

Function result

The month part of AValue

Description

MonthOfTheYear extracts the month part of Avalue and returns it. It is an alias for MonthOf, and is provided for completeness only, corresponding to the other PartOfTheYear functions.

For an example, see the WeekOfTheYear function.

See also

MonthOf | Extract the month from a given date.
WeekOfTheYear | Extract the week of the year (and optionally year) of a DateTime indication.
DayOfTheYear | Extracts the day of the year from a TDateTime value
HourOfTheYear | Calculate the number of hours passed since the start of the year.
MinuteOfTheYear | Calculate the number of minutes elapsed since the start of the year
SecondOfTheYear | Calculate the number of seconds elapsed since the start of the year.
MilliSecondOfTheYear | Calculate the number of milliseconds elapsed since the start of the year.


MonthsBetween

Calculate the number of whole months between two DateTime values

Declaration

Source position: dateutil.inc line 257

function MonthsBetween(

  const ANow: TDateTime;

  const AThen: TDateTime

):Integer;

Arguments

ANow | First moment in time
AThen | Second moment in time

Function result

Number of whole months between ANow and AThen.

Description

MonthsBetween returns the number of whole months between ANow and AThen. This number is an approximation, based on an average number of days of 30.4375 per month (average over 4 years). This means the fractional part of a month is dropped.

See also

YearsBetween | Calculate the number of whole years between two DateTime values
WeeksBetween | Calculate the number of whole weeks between two DateTime values
DaysBetween | Number of whole days between two DateTime values.
HoursBetween | Calculate the number of whole hours between two DateTime values.
MinutesBetween | Calculate the number of whole minutes between two DateTime values.
SecondsBetween | Calculate the number of whole seconds between two DateTime values.
MilliSecondsBetween | Calculate the number of whole milliseconds between two DateTime values.

Example

Program Example56;

{ This program demonstrates the MonthsBetween function }

Uses SysUtils,DateUtils;

Procedure Test(ANow,AThen : TDateTime);

begin
 Write('Number of months between ');
 Write(DateToStr(AThen),' and ',DateToStr(ANow));
 Writeln(' : ',MonthsBetween(ANow,AThen));
end;

Var
  D1,D2 : TDateTime;

Begin
  D1:=Today;
  D2:=Today-364;
  Test(D1,D2);
  D2:=Today-365;
  Test(D1,D2);
  D2:=Today-366;
  Test(D1,D2);
  D2:=Today-390;
  Test(D1,D2);
  D2:=Today-368;
  Test(D1,D2);
  D2:=Today-1000;
  Test(D1,D2);
End.


MonthSpan

Calculate the approximate number of months between two DateTime values.

Declaration

Source position: dateutil.inc line 272

function MonthSpan(

  const ANow: TDateTime;

  const AThen: TDateTime

):Double;

Arguments

ANow | First moment in time
AThen | Second moment in time

Function result

Number (fractions included) of months between ANow and AThen

Description

MonthSpan returns the number of month between ANow and AThen, including any fractional parts of a month. This number is an approximation, based on an average number of days of 30.4375 per month (average over 4 years).

See also

YearSpan | Calculate the approximate number of years between two DateTime values.
WeekSpan | Calculate the approximate number of weeks between two DateTime values.
DaySpan | Calculate the approximate number of days between two DateTime values.
HourSpan | Calculate the approximate number of hours between two DateTime values.
MinuteSpan | Calculate the approximate number of minutes between two DateTime values.
SecondSpan | Calculate the approximate number of seconds between two DateTime values.
MilliSecondSpan | Calculate the approximate number of milliseconds between two DateTime values.
MonthsBetween | Calculate the number of whole months between two DateTime values

Example

Program Example64;

{ This program demonstrates the MonthSpan function }

Uses SysUtils,DateUtils;

Procedure Test(ANow,AThen : TDateTime);

begin
 Write('Number of months between ');
 Write(DateToStr(AThen),' and ',DateToStr(ANow));
 Writeln(' : ',MonthSpan(ANow,AThen));
end;

Var
  D1,D2 : TDateTime;

Begin
  D1:=Today;
  D2:=Today-364;
  Test(D1,D2);
  D2:=Today-365;
  Test(D1,D2);
  D2:=Today-366;
  Test(D1,D2);
  D2:=Today-390;
  Test(D1,D2);
  D2:=Today-368;
  Test(D1,D2);
  D2:=Today-1000;
  Test(D1,D2);
End.


NthDayOfWeek

Calculate which occurrence of weekday in the month a given day represents

Declaration

Source position: dateutil.inc line 374

function NthDayOfWeek(

  const AValue: TDateTime

):Word;

Arguments

AValue

Date to check.

Function result

Occurrence of weekday in the month of AValue.

Description

NthDayOfWeek returns the occurrence of the weekday of AValue in the month. This is the N-th time that this weekday occurs in the month (e.g. the third saturday of the month).

See also

EncodeDateMonthWeek | Encodes a year, month, week of month and day of week to a DateTime value
#rtl.sysutils.DayOfWeek | Returns the day of the week.
DecodeDayOfWeekInMonth | Decode a DateTime value in year, month, day of week parts
EncodeDayOfWeekInMonth | Encodes a year, month, week, day of week specification to a TDateTime value
TryEncodeDayOfWeekInMonth | Encode a year, month, week, day of week triplet to a TDateTime value

Example

Program Example104;

{ This program demonstrates the NthDayOfWeek function }

Uses SysUtils,DateUtils;

Begin
  Write('Today is the ',NthDayOfWeek(Today),'-th ');
  Writeln(formatdateTime('dddd',Today),' of the month.');
End.


PeriodBetween

Return the period (in years, months, days) between two dates

Declaration

Source position: dateutil.inc line 264

procedure PeriodBetween(

  const ANow: TDateTime;

  const AThen: TDateTime;

  out Years: Word;

  out months: Word;

  out days: Word

);

Description

PeriodBetween returns the timespan between 2 dates (ANow and AThen), expressed as a number of years, months and days in the parameters Years, months and days. Only complete years, months and days are reported.

If ANow is before AThen, their values are reversed so the result is always positive.

See also

YearsBetween | Calculate the number of whole years between two DateTime values
MonthsBetween | Calculate the number of whole months between two DateTime values
WeeksBetween | Calculate the number of whole weeks between two DateTime values
DaysBetween | Number of whole days between two DateTime values.


PreviousDayOfWeek

Given a day of the week, return the previous day of the week.

Declaration

Source position: dateutil.inc line 115

function PreviousDayOfWeek(

  DayOfWeek: Word

):Word;

Arguments

DayOfWeek

Day of the week.

Function result

The day of the week prior to DayOfWeek

Description

PreviousDayOfWeek returns the previous day of the week. If the current day is the first day of the week (1) then the last day will be returned (7).

Remark: Note that the days of the week are in ISO notation, i.e. 1-based.

See also

Yesterday

Return the previous day.

Example

Program Example22;

{ This program demonstrates the PreviousDayOfWeek function }

Uses SysUtils,DateUtils;

Var
  D : Word;

Begin
  For D:=1 to 7 do
    Writeln('Previous day of ',D,' is : ',PreviousDayOfWeek(D));
End.


RecodeDate

Replace date part of a TDateTime value with another date.

Declaration

Source position: dateutil.inc line 352

function RecodeDate(

  const AValue: TDateTime;

  const AYear: Word;

  const AMonth: Word;

  const ADay: Word

):TDateTime;

Arguments

AValue | Date/time to recode
AYear | Year to replace in AValue
AMonth | Month to replace in AValue
ADay | Day to replace in AValue

Function result

AValue with replaced date.

Description

RecodeDate replaces the date part of the timestamp AValue with the date specified in AYear, AMonth, ADay. All other parts (the time part) of the date/time stamp are left untouched.

Errors

If one of the AYear, AMonth, ADay values is not within a valid range then an EConvertError exception is raised.

See also

RecodeYear | Replace year part of a TDateTime value with another year.
RecodeMonth | Replace month part of a TDateTime value with another month.
RecodeDay | Replace day part of a TDateTime value with another day.
RecodeHour | Replace hours part of a TDateTime value with another hour.
RecodeMinute | Replace minutse part of a TDateTime value with another minute.
RecodeSecond | Replace seconds part of a TDateTime value with another second.
RecodeDate | Replace date part of a TDateTime value with another date.
RecodeTime | Replace time part of a TDateTime value with another time.
RecodeDateTime | Replace selected parts of a TDateTime value with other values

Example

Program Example94;

{ This program demonstrates the RecodeDate function }

Uses SysUtils,DateUtils;

Const
  Fmt = 'dddd dd mmmm yyyy hh:nn:ss';

Var
  S : AnsiString;

Begin
  S:=FormatDateTime(Fmt,RecodeDate(Now,2001,1,1));
  Writeln('This moment on the first of the millenium : ',S);
End.


RecodeDateTime

Replace selected parts of a TDateTime value with other values

Declaration

Source position: dateutil.inc line 354

function RecodeDateTime(

  const AValue: TDateTime;

  const AYear: Word;

  const AMonth: Word;

  const ADay: Word;

  const AHour: Word;

  const AMinute: Word;

  const ASecond: Word;

  const AMilliSecond: Word

):TDateTime;

Arguments

AValue | Date/time to recode
AYear | New value for year part
AMonth | New value for month part
ADay | New value for day part
AHour | New value for hour part
AMinute | New value for minute part
ASecond | New value for second part
AMilliSecond | New value for millisecond part

Function result

AValue with replaced parts

Description

RecodeDateTime replaces selected parts of the timestamp AValue with the date/time values specified in AYear, AMonth, ADay, AHour, AMinute, ASecond and AMilliSecond. If any of these values equals the pre-defined constant RecodeLeaveFieldAsIs, then the corresponding part of the date/time stamp is left untouched.

Errors

If one of the values AYear, AMonth, ADay, AHour, AMinute, ASecondAMilliSecond is not within a valid range (RecodeLeaveFieldAsIs excepted) then an EConvertError exception is raised.

See also

RecodeYear | Replace year part of a TDateTime value with another year.
RecodeMonth | Replace month part of a TDateTime value with another month.
RecodeDay | Replace day part of a TDateTime value with another day.
RecodeHour | Replace hours part of a TDateTime value with another hour.
RecodeMinute | Replace minutse part of a TDateTime value with another minute.
RecodeSecond | Replace seconds part of a TDateTime value with another second.
RecodeMilliSecond | Replace milliseconds part of a TDateTime value with another millisecond.
RecodeDate | Replace date part of a TDateTime value with another date.
RecodeTime | Replace time part of a TDateTime value with another time.
TryRecodeDateTime | Replace selected parts of a TDateTime value with other values

Example

Program Example96;

{ This program demonstrates the RecodeDateTime function }

Uses SysUtils,DateUtils;

Const
  Fmt = 'dddd dd mmmm yyyy hh:nn:ss';

Var
  S : AnsiString;
  D : TDateTime ;

Begin
  D:=Now;
  D:=RecodeDateTime(D,2000,2,RecodeLeaveFieldAsIs,0,0,0,0);
  S:=FormatDateTime(Fmt,D);
  Writeln('This moment in februari 2000 : ',S);
End.


RecodeDay

Replace day part of a TDateTime value with another day.

Declaration

Source position: dateutil.inc line 347

function RecodeDay(

  const AValue: TDateTime;

  const ADay: Word

):TDateTime;

Arguments

AValue | Date to recode
ADay | Day to replace in AValue

Function result

AValue with replaced day.

Description

RecodeDay replaces the Day part of the timestamp AValue with ADay. All other parts of the date/time stamp are left untouched.

Errors

If the ADay value is not within a valid range (1 till the number of days in the month) then an EConvertError exception is raised.

See also

RecodeYear | Replace year part of a TDateTime value with another year.
RecodeMonth | Replace month part of a TDateTime value with another month.
RecodeHour | Replace hours part of a TDateTime value with another hour.
RecodeMinute | Replace minutse part of a TDateTime value with another minute.
RecodeSecond | Replace seconds part of a TDateTime value with another second.
RecodeMilliSecond | Replace milliseconds part of a TDateTime value with another millisecond.
RecodeDate | Replace date part of a TDateTime value with another date.
RecodeTime | Replace time part of a TDateTime value with another time.
RecodeDateTime | Replace selected parts of a TDateTime value with other values

Example

Program Example89;

{ This program demonstrates the RecodeDay function }

Uses SysUtils,DateUtils;

Const
  Fmt = 'dddd dd mmmm yyyy hh:nn:ss';

Var
  S : AnsiString;

Begin
  S:=FormatDateTime(Fmt,RecodeDay(Now,1));
  Writeln('This moment on the first of the month : ',S);
End.


RecodeHour

Replace hours part of a TDateTime value with another hour.

Declaration

Source position: dateutil.inc line 348

function RecodeHour(

  const AValue: TDateTime;

  const AHour: Word

):TDateTime;

Arguments

AValue | Date/time to recode
AHour | Hour to replace in AValue

Function result

AValue with replaced hour.

Description

RecodeHour replaces the Hour part of the timestamp AValue with AHour. All other parts of the date/time stamp are left untouched.

Errors

If the AHour value is not within a valid range (0..23) then an EConvertError exception is raised.

See also

RecodeYear | Replace year part of a TDateTime value with another year.
RecodeMonth | Replace month part of a TDateTime value with another month.
RecodeDay | Replace day part of a TDateTime value with another day.
RecodeMinute | Replace minutse part of a TDateTime value with another minute.
RecodeSecond | Replace seconds part of a TDateTime value with another second.
RecodeMilliSecond | Replace milliseconds part of a TDateTime value with another millisecond.
RecodeDate | Replace date part of a TDateTime value with another date.
RecodeTime | Replace time part of a TDateTime value with another time.
RecodeDateTime | Replace selected parts of a TDateTime value with other values

Example

Program Example90;

{ This program demonstrates the RecodeHour function }

Uses SysUtils,DateUtils;

Const
  Fmt = 'dddd dd mmmm yyyy hh:nn:ss';

Var
  S : AnsiString;

Begin
  S:=FormatDateTime(Fmt,RecodeHour(Now,0));
  Writeln('Today, in the first hour : ',S);
End.


RecodeMilliSecond

Replace milliseconds part of a TDateTime value with another millisecond.

Declaration

Source position: dateutil.inc line 351

function RecodeMilliSecond(

  const AValue: TDateTime;

  const AMilliSecond: Word

):TDateTime;

Arguments

AValue | Date/time to recode
AMilliSecond | Millisecond to replace in AValue

Function result

AValue with replaced millisecond.

Description

RecodeMilliSecond replaces the millisecond part of the timestamp AValue with AMilliSecond. All other parts of the date/time stamp are left untouched.

Errors

If the AMilliSecond value is not within a valid range (0..999) then an EConvertError exception is raised.

See also

RecodeYear | Replace year part of a TDateTime value with another year.
RecodeMonth | Replace month part of a TDateTime value with another month.
RecodeDay | Replace day part of a TDateTime value with another day.
RecodeHour | Replace hours part of a TDateTime value with another hour.
RecodeMinute | Replace minutse part of a TDateTime value with another minute.
RecodeSecond | Replace seconds part of a TDateTime value with another second.
RecodeDate | Replace date part of a TDateTime value with another date.
RecodeTime | Replace time part of a TDateTime value with another time.
RecodeDateTime | Replace selected parts of a TDateTime value with other values

Example

Program Example93;

{ This program demonstrates the RecodeMilliSecond function }

Uses SysUtils,DateUtils;

Const
  Fmt = 'dddd dd mmmm yyyy hh:nn:ss.zzz';

Var
  S : AnsiString;

Begin
  S:=FormatDateTime(Fmt,RecodeMilliSecond(Now,0));
  Writeln('This moment, milliseconds stripped : ',S);
End.


RecodeMinute

Replace minutse part of a TDateTime value with another minute.

Declaration

Source position: dateutil.inc line 349

function RecodeMinute(

  const AValue: TDateTime;

  const AMinute: Word

):TDateTime;

Arguments

AValue | Date/time to recode
AMinute | Minute to replace in AValue

Function result

AValue with replaced minute.

Description

RecodeMinute replaces the Minute part of the timestamp AValue with AMinute. All other parts of the date/time stamp are left untouched.

Errors

If the AMinute value is not within a valid range (0..59) then an EConvertError exception is raised.

See also

RecodeYear | Replace year part of a TDateTime value with another year.
RecodeMonth | Replace month part of a TDateTime value with another month.
RecodeDay | Replace day part of a TDateTime value with another day.
RecodeHour | Replace hours part of a TDateTime value with another hour.
RecodeSecond | Replace seconds part of a TDateTime value with another second.
RecodeMilliSecond | Replace milliseconds part of a TDateTime value with another millisecond.
RecodeDate | Replace date part of a TDateTime value with another date.
RecodeTime | Replace time part of a TDateTime value with another time.
RecodeDateTime | Replace selected parts of a TDateTime value with other values

Example

Program Example91;

{ This program demonstrates the RecodeMinute function }

Uses SysUtils,DateUtils;

Const
  Fmt = 'dddd dd mmmm yyyy hh:nn:ss';

Var
  S : AnsiString;

Begin
  S:=FormatDateTime(Fmt,RecodeMinute(Now,0));
  Writeln('This moment in the first minute of the hour: ',S);
End.


RecodeMonth

Replace month part of a TDateTime value with another month.

Declaration

Source position: dateutil.inc line 346

function RecodeMonth(

  const AValue: TDateTime;

  const AMonth: Word

):TDateTime;

Arguments

AValue | Date to recode
AMonth | Month to replace in AValue

Function result

AValue with replaced month.

Description

RecodeMonth replaces the Month part of the timestamp AValue with AMonth. All other parts of the date/time stamp are left untouched.

Errors

If the AMonth value is not within a valid range (1..12) then an EConvertError exception is raised.

See also

RecodeYear | Replace year part of a TDateTime value with another year.
RecodeDay | Replace day part of a TDateTime value with another day.
RecodeHour | Replace hours part of a TDateTime value with another hour.
RecodeMinute | Replace minutse part of a TDateTime value with another minute.
RecodeSecond | Replace seconds part of a TDateTime value with another second.
RecodeMilliSecond | Replace milliseconds part of a TDateTime value with another millisecond.
RecodeDate | Replace date part of a TDateTime value with another date.
RecodeTime | Replace time part of a TDateTime value with another time.
RecodeDateTime | Replace selected parts of a TDateTime value with other values

Example

Program Example88;

{ This program demonstrates the RecodeMonth function }

Uses SysUtils,DateUtils;

Const
  Fmt = 'dddd dd mmmm yyyy hh:nn:ss';

Var
  S : AnsiString;

Begin
  S:=FormatDateTime(Fmt,RecodeMonth(Now,5));
  Writeln('This moment in May : ',S);
End.


RecodeSecond

Replace seconds part of a TDateTime value with another second.

Declaration

Source position: dateutil.inc line 350

function RecodeSecond(

  const AValue: TDateTime;

  const ASecond: Word

):TDateTime;

Arguments

AValue | Date/time to recode
ASecond | Second to replace in AValue

Function result

AValue with replaced second.

Description

RecodeSecond replaces the Second part of the timestamp AValue with ASecond. All other parts of the date/time stamp are left untouched.

Errors

If the ASecond value is not within a valid range (0..59) then an EConvertError exception is raised.

See also

RecodeYear | Replace year part of a TDateTime value with another year.
RecodeMonth | Replace month part of a TDateTime value with another month.
RecodeDay | Replace day part of a TDateTime value with another day.
RecodeHour | Replace hours part of a TDateTime value with another hour.
RecodeMinute | Replace minutse part of a TDateTime value with another minute.
RecodeMilliSecond | Replace milliseconds part of a TDateTime value with another millisecond.
RecodeDate | Replace date part of a TDateTime value with another date.
RecodeTime | Replace time part of a TDateTime value with another time.
RecodeDateTime | Replace selected parts of a TDateTime value with other values

Example

Program Example92;

{ This program demonstrates the RecodeSecond function }

Uses SysUtils,DateUtils;

Const
  Fmt = 'dddd dd mmmm yyyy hh:nn:ss';

Var
  S : AnsiString;

Begin
  S:=FormatDateTime(Fmt,RecodeSecond(Now,0));
  Writeln('This moment, seconds stripped : ',S);
End.


RecodeTime

Replace time part of a TDateTime value with another time.

Declaration

Source position: dateutil.inc line 353

function RecodeTime(

  const AValue: TDateTime;

  const AHour: Word;

  const AMinute: Word;

  const ASecond: Word;

  const AMilliSecond: Word

):TDateTime;

Arguments

AValue | Date/time to recode
AHour | Hour to replace in AValue
AMinute | Minute to replace in AValue
ASecond | Second to replace in AValue
AMilliSecond | Millisecond to replace in AValue

Function result

AValue with replaced time.

Description

RecodeTime replaces the time part of the timestamp AValue with the date specified in AHour, AMinute, ASecond and AMilliSecond. All other parts (the date part) of the date/time stamp are left untouched.

Errors

If one of the values AHour, AMinute, ASecondAMilliSecond is not within a valid range then an EConvertError exception is raised.

See also

RecodeYear | Replace year part of a TDateTime value with another year.
RecodeMonth | Replace month part of a TDateTime value with another month.
RecodeDay | Replace day part of a TDateTime value with another day.
RecodeHour | Replace hours part of a TDateTime value with another hour.
RecodeMinute | Replace minutse part of a TDateTime value with another minute.
RecodeSecond | Replace seconds part of a TDateTime value with another second.
RecodeMilliSecond | Replace milliseconds part of a TDateTime value with another millisecond.
RecodeDate | Replace date part of a TDateTime value with another date.
RecodeDateTime | Replace selected parts of a TDateTime value with other values

Example

Program Example95;

{ This program demonstrates the RecodeTime function }

Uses SysUtils,DateUtils;

Const
  Fmt = 'dddd dd mmmm yyyy hh:nn:ss';

Var
  S : AnsiString;

Begin
  S:=FormatDateTime(Fmt,RecodeTime(Now,8,0,0,0));
  Writeln('Today, 8 AM : ',S);
End.


RecodeYear

Replace year part of a TDateTime value with another year.

Declaration

Source position: dateutil.inc line 345

function RecodeYear(

  const AValue: TDateTime;

  const AYear: Word

):TDateTime;

Arguments

AValue | Date to recode
AYear | Year to replace in AValue

Function result

AValue with replaced year.

Description

RecodeYear replaces the year part of the timestamp AValue with AYear. All other parts of the date/time stamp are left untouched.

Errors

If the AYear value is not within a valid range (1..9999) then an EConvertError exception is raised.

See also

RecodeMonth | Replace month part of a TDateTime value with another month.
RecodeDay | Replace day part of a TDateTime value with another day.
RecodeHour | Replace hours part of a TDateTime value with another hour.
RecodeMinute | Replace minutse part of a TDateTime value with another minute.
RecodeSecond | Replace seconds part of a TDateTime value with another second.
RecodeMilliSecond | Replace milliseconds part of a TDateTime value with another millisecond.
RecodeDate | Replace date part of a TDateTime value with another date.
RecodeTime | Replace time part of a TDateTime value with another time.
RecodeDateTime | Replace selected parts of a TDateTime value with other values

Example

Program Example87;

{ This program demonstrates the RecodeYear function }

Uses SysUtils,DateUtils;

Const
  Fmt = 'dddd dd mmmm yyyy hh:nn:ss';

Var
  S : AnsiString;

Begin
  S:=FormatDateTime(Fmt,RecodeYear(Now,1999));
  Writeln('This moment in 1999 : ',S);
End.


SameDate

Check whether two TDateTime values have the same date part.

Declaration

Source position: dateutil.inc line 365

function SameDate(

  const A: TDateTime;

  const B: TDateTime

):Boolean;

Arguments

A | First DateTime value
B | Second DateTime value

Function result

True if A and B have the same time part, False if not

Description

SameDate compares the date parts of two timestamps A and B and returns True if they are equal, False if they are not.

The function simply checks whether CompareDate returns zero.

See also

CompareDateTime | Compare 2 dates, taking into account the time of day
CompareDate | Compare 2 dates, disregarding the time of day
CompareTime | Compares two times of the day, disregarding the date part.
SameDateTime | Check whether two TDateTime values have the same date and time parts.
SameTime | Check whether two TDateTime values have the same time part.

Example

Program Example102;

{ This program demonstrates the SameDate function }

Uses SysUtils,DateUtils;

Const
  Fmt = 'dddd dd mmmm yyyy hh:nn:ss.zzz';

Procedure Test(D1,D2 : TDateTime);

begin
  Write(FormatDateTime(Fmt,D1),' is the same date as ');
  Writeln(FormatDateTime(Fmt,D2),' : ',SameDate(D1,D2));
end;

Var
  D,N : TDateTime;

Begin
  D:=Today;
  N:=Now;
  Test(D,D);
  Test(N,N);
  Test(N+1,N);
  Test(N-1,N);
  Test(N+OneSecond,N);
  Test(N-OneSecond,N);
End.


SameDateTime

Check whether two TDateTime values have the same date and time parts.

Declaration

Source position: dateutil.inc line 364

function SameDateTime(

  const A: TDateTime;

  const B: TDateTime

):Boolean;

Arguments

A | First DateTime value
B | Second DateTime value

Function result

True if A and B have the same date and time parts, False if not.

Description

SameDateTime compares the date/time parts of two timestamps A and B and returns True if they are equal, False if they are not.

The function simply checks whether CompareDateTime returns zero.

See also

CompareDateTime | Compare 2 dates, taking into account the time of day
CompareDate | Compare 2 dates, disregarding the time of day
CompareTime | Compares two times of the day, disregarding the date part.
SameDate | Check whether two TDateTime values have the same date part.
SameTime | Check whether two TDateTime values have the same time part.

Example

Program Example101;

{ This program demonstrates the SameDateTime function }

Uses SysUtils,DateUtils;

Const
  Fmt = 'dddd dd mmmm yyyy hh:nn:ss.zzz';

Procedure Test(D1,D2 : TDateTime);

begin
  Write(FormatDateTime(Fmt,D1),' is the same datetime as ');
  Writeln(FormatDateTime(Fmt,D2),' : ',SameDateTime(D1,D2));
end;

Var
  D,N : TDateTime;

Begin
  D:=Today;
  N:=Now;
  Test(D,D);
  Test(N,N);
  Test(N+1,N);
  Test(N-1,N);
  Test(N+OneSecond,N);
  Test(N-OneSecond,N);
End.


SameTime

Check whether two TDateTime values have the same time part.

Declaration

Source position: dateutil.inc line 366

function SameTime(

  const A: TDateTime;

  const B: TDateTime

):Boolean;

Arguments

A | First DateTime value
B | Second DateTime value

Function result

True if A and B have the same time part, False if not.

Description

SameTime compares the time parts of two timestamps A and B and returns True if they are equal, False if they are not.

The function simply checks whether CompareTime returns zero.

See also

CompareDateTime | Compare 2 dates, taking into account the time of day
CompareDate | Compare 2 dates, disregarding the time of day
CompareTime | Compares two times of the day, disregarding the date part.
SameDateTime | Check whether two TDateTime values have the same date and time parts.
SameDate | Check whether two TDateTime values have the same date part.

Example

Program Example102;

{ This program demonstrates the SameTime function }

Uses SysUtils,DateUtils;

Const
  Fmt = 'dddd dd mmmm yyyy hh:nn:ss.zzz';

Procedure Test(D1,D2 : TDateTime);

begin
  Write(FormatDateTime(Fmt,D1),' is the same time as ');
  Writeln(FormatDateTime(Fmt,D2),' : ',SameTime(D1,D2));
end;

Var
  D,N : TDateTime;

Begin
  D:=Today;
  N:=Now;
  Test(D,D);
  Test(N,N);
  Test(N+1,N);
  Test(N-1,N);
  Test(N+OneSecond,N);
  Test(N-OneSecond,N);
End.


ScanDateTime

Scans a string for a DateTime pattern and returns the date/time

Declaration

Source position: dateutil.inc line 436

function ScanDateTime(

  const Pattern: string;

  const s: string;

  const fmt: TFormatSettings;

  startpos: Integer = 1

):TDateTime; overload;

function ScanDateTime(

  const Pattern: string;

  const s: string;

  startpos: Integer = 1

):TDateTime; overload;

Description

ScanDateTime scans string S for the date/time pattern Pattern, starting at position StartPos (default 1). Optionally, the format settings fmt can be specified.

In effect, this function does the opposite of what FormatDateTime does. The Pattern variable must contain a valid date/time pattern: note that not all possible formatdatetime patterns can be recognized, e.g., hn cannot be detected properly.

Errors

In case of an error, a EConvertError exception is raised.

See also

FormatDateTime

Return a string representation of a TDateTime value with a given format.


SecondOf

Extract the second part from a DateTime value.

Declaration

Source position: dateutil.inc line 127

function SecondOf(

  const AValue: TDateTime

):Word;

Arguments

AValue

Date/time value to extract second from.

Function result

Second part of AValue.

Description

SecondOf returns the second of the minute part of the AValue date/time indication. It is a number between 0 and 59.

For an example, see YearOf

See also

YearOf | Extract the year from a given date.
WeekOf | Extract week (of the year) from a given date.
MonthOf | Extract the month from a given date.
DayOf | Extract the day (of month) part from a DateTime value
HourOf | Extract the hour part from a DateTime value.
MinuteOf | Extract the minute part from a DateTime value.
MilliSecondOf | Extract the millisecond part from a DateTime value.


SecondOfTheDay

Calculate the number of seconds elapsed since the start of the day

Declaration

Source position: dateutil.inc line 213

function SecondOfTheDay(

  const AValue: TDateTime

):LongWord;

Arguments

AValue

Moment in the day

Function result

Number of seconds elapsed since the start of the day

Description

SecondOfTheDay returns the number of seconds that have passed since the start of the Day (00:00:00) till the moment indicated by AValue. This is a zero-based number, i.e. 00:00:00.999 return 0.

For an example, see the HourOfTheDay function.

See also

SecondOfTheYear | Calculate the number of seconds elapsed since the start of the year.
SecondOfTheMonth | Calculate number of seconds elapsed since the start of the month.
SecondOfTheWeek | Calculate the number of seconds elapsed since the start of the week
SecondOfTheHour | Calculate the number of seconds elapsed since the start of the hour
SecondOfTheMinute | Calculate the number of seconds elapsed since the start of the minute
HourOfTheDay | Calculate the hour of a given DateTime value
MinuteOfTheDay | Calculate the number of minutes elapsed since the start of the day
MilliSecondOfTheDay | Calculate the number of milliseconds elapsed since the start of the day


SecondOfTheHour

Calculate the number of seconds elapsed since the start of the hour

Declaration

Source position: dateutil.inc line 221

function SecondOfTheHour(

  const AValue: TDateTime

):Word;

Arguments

AValue

Moment in the hour

Function result

Number of seconds elapsed since the start of the hour

Description

SecondOfTheHour returns the number of seconds that have passed since the start of the Hour (HH:00:00) till the moment indicated by AValue. This is a zero-based number, i.e. HH:00:00.999 return 0.

For an example, see the MinuteOfTheHour function.

See also

SecondOfTheYear | Calculate the number of seconds elapsed since the start of the year.
SecondOfTheMonth | Calculate number of seconds elapsed since the start of the month.
SecondOfTheWeek | Calculate the number of seconds elapsed since the start of the week
SecondOfTheDay | Calculate the number of seconds elapsed since the start of the day
SecondOfTheMinute | Calculate the number of seconds elapsed since the start of the minute
MinuteOfTheHour | Calculate the number of minutes elapsed since the start of the hour
MilliSecondOfTheHour | Calculate the number of milliseconds elapsed since the start of the hour


SecondOfTheMinute

Calculate the number of seconds elapsed since the start of the minute

Declaration

Source position: dateutil.inc line 229

function SecondOfTheMinute(

  const AValue: TDateTime

):Word;

Arguments

AValue

Moment in the minute

Function result

Number of seconds elapsed since the start of the minute

Description

SecondOfTheMinute returns the number of seconds that have passed since the start of the minute (HH:MM:00) till the moment indicated by AValue. This is a zero-based number, i.e. HH:MM:00.999 return 0.

See also

SecondOfTheYear | Calculate the number of seconds elapsed since the start of the year.
SecondOfTheMonth | Calculate number of seconds elapsed since the start of the month.
SecondOfTheWeek | Calculate the number of seconds elapsed since the start of the week
SecondOfTheDay | Calculate the number of seconds elapsed since the start of the day
SecondOfTheHour | Calculate the number of seconds elapsed since the start of the hour
MilliSecondOfTheMinute | Calculate the number of milliseconds elapsed since the start of the minute

Example

Program Example45;

{ This program demonstrates the SecondOfTheMinute function }

Uses SysUtils,DateUtils;

Var
  N : TDateTime;

Begin
  N:=Now;
  Writeln('Second of the Minute      : ',SecondOfTheMinute(N));
  Writeln('MilliSecond of the Minute : ',
          MilliSecondOfTheMinute(N));
End.


SecondOfTheMonth

Calculate number of seconds elapsed since the start of the month.

Declaration

Source position: dateutil.inc line 194

function SecondOfTheMonth(

  const AValue: TDateTime

):LongWord;

Arguments

AValue

Moment in the month.

Function result

Number of seconds elapsed since the start of the month.

Description

SecondOfTheMonth returns the number of seconds that have passed since the start of the month (00:00:00) till the moment indicated by AValue. This is a zero-based number, i.e. 00:00:00.999 on the first day of the month will return 0.

For an example, see the WeekOfTheMonth function.

See also

WeekOfTheMonth | Extract the week of the month (and optionally month and year) from a DateTime value
DayOfTheMonth | Extract the day (of month) part of a DateTime value
HourOfTheMonth | Calculate the number of hours passed since the start of the month.
MinuteOfTheMonth | Calculate number of minutes elapsed since the start of the month.
MilliSecondOfTheMonth | Calculate number of milliseconds elapsed since the start of the month.


SecondOfTheWeek

Calculate the number of seconds elapsed since the start of the week

Declaration

Source position: dateutil.inc line 204

function SecondOfTheWeek(

  const AValue: TDateTime

):LongWord;

Arguments

AValue

Moment in the week

Function result

Number of seconds elapsed since the start of the week

Description

SecondOfTheWeek returns the number of seconds that have passed since the start of the week (00:00:00) till the moment indicated by AValue. This is a zero-based number, i.e. 00:00:00.999 on the first day of the week will return 0.

For an example, see the DayOfTheWeek function.

See also

SecondOfTheYear | Calculate the number of seconds elapsed since the start of the year.
SecondOfTheMonth | Calculate number of seconds elapsed since the start of the month.
SecondOfTheDay | Calculate the number of seconds elapsed since the start of the day
SecondOfTheHour | Calculate the number of seconds elapsed since the start of the hour
SecondOfTheMinute | Calculate the number of seconds elapsed since the start of the minute
DayOfTheWeek | Extracts the day of the week from a DateTime value
HourOfTheWeek | Calculate the number of hours elapsed since the start of the week.
MinuteOfTheWeek | Calculate the number of minutes elapsed since the start of the week
MilliSecondOfTheWeek | Calculate the number of milliseconds elapsed since the start of the week


SecondOfTheYear

Calculate the number of seconds elapsed since the start of the year.

Declaration

Source position: dateutil.inc line 182

function SecondOfTheYear(

  const AValue: TDateTime

):LongWord;

Arguments

AValue

Moment in the year

Function result

Number of seconds elapsed since the start of the year.

Description

SecondOfTheYear returns the number of seconds that have passed since the start of the year (January 1, 00:00:00) till the moment indicated by AValue. This is a zero-based number, i.e. January 1 00:00:00.999 will return 0.

For an example, see the WeekOfTheYear function.

See also

WeekOfTheYear | Extract the week of the year (and optionally year) of a DateTime indication.
DayOfTheYear | Extracts the day of the year from a TDateTime value
HourOfTheYear | Calculate the number of hours passed since the start of the year.
MinuteOfTheYear | Calculate the number of minutes elapsed since the start of the year
SecondOfTheYear | Calculate the number of seconds elapsed since the start of the year.
MilliSecondOfTheYear | Calculate the number of milliseconds elapsed since the start of the year.


SecondsBetween

Calculate the number of whole seconds between two DateTime values.

Declaration

Source position: dateutil.inc line 262

function SecondsBetween(

  const ANow: TDateTime;

  const AThen: TDateTime

):Int64;

Arguments

ANow | First moment in time
AThen | Second moment in time

Function result

Number of seconds between ANow and AThen

Description

SecondsBetween returns the number of whole seconds between ANow and AThen. This means the fractional part of a second (milliseconds etc.) is dropped.

See also

YearsBetween | Calculate the number of whole years between two DateTime values
MonthsBetween | Calculate the number of whole months between two DateTime values
WeeksBetween | Calculate the number of whole weeks between two DateTime values
DaysBetween | Number of whole days between two DateTime values.
HoursBetween | Calculate the number of whole hours between two DateTime values.
MinutesBetween | Calculate the number of whole minutes between two DateTime values.
MilliSecondsBetween | Calculate the number of whole milliseconds between two DateTime values.

Example

Program Example61;

{ This program demonstrates the SecondsBetween function }

Uses SysUtils,DateUtils;

Procedure Test(ANow,AThen : TDateTime);

begin
 Write('Number of seconds between ');
 Write(TimeToStr(AThen),' and ',TimeToStr(ANow));
 Writeln(' : ',SecondsBetween(ANow,AThen));
end;

Var
  D1,D2 : TDateTime;

Begin
  D1:=Now;
  D2:=D1-(999*OneMilliSecond);
  Test(D1,D2);
  D2:=D1-(1001*OneMilliSecond);
  Test(D1,D2);
  D2:=D1-(2001*OneMilliSecond);
  Test(D1,D2);
  D2:=D1-(5001*OneMilliSecond);
  Test(D1,D2);
  D2:=D1-(5.4*OneSecond);
  Test(D1,D2);
  D2:=D1-(2.5*OneSecond);
  Test(D1,D2);
End.


SecondSpan

Calculate the approximate number of seconds between two DateTime values.

Declaration

Source position: dateutil.inc line 277

function SecondSpan(

  const ANow: TDateTime;

  const AThen: TDateTime

):Double;

Arguments

ANow | First moment in time
AThen | Second moment in time

Function result

Number (fractions included) of seconds between ANow and AThen

Description

SecondSpan returns the number of seconds between ANow and AThen, including any fractional parts of a second.

See also

YearSpan | Calculate the approximate number of years between two DateTime values.
MonthSpan | Calculate the approximate number of months between two DateTime values.
WeekSpan | Calculate the approximate number of weeks between two DateTime values.
DaySpan | Calculate the approximate number of days between two DateTime values.
HourSpan | Calculate the approximate number of hours between two DateTime values.
MinuteSpan | Calculate the approximate number of minutes between two DateTime values.
MilliSecondSpan | Calculate the approximate number of milliseconds between two DateTime values.
SecondsBetween | Calculate the number of whole seconds between two DateTime values.

Example

Program Example69;

{ This program demonstrates the SecondSpan function }

Uses SysUtils,DateUtils;

Procedure Test(ANow,AThen : TDateTime);

begin
 Write('Number of seconds between ');
 Write(TimeToStr(AThen),' and ',TimeToStr(ANow));
 Writeln(' : ',SecondSpan(ANow,AThen));
end;

Var
  D1,D2 : TDateTime;

Begin
  D1:=Now;
  D2:=D1-(999*OneMilliSecond);
  Test(D1,D2);
  D2:=D1-(1001*OneMilliSecond);
  Test(D1,D2);
  D2:=D1-(2001*OneMilliSecond);
  Test(D1,D2);
  D2:=D1-(5001*OneMilliSecond);
  Test(D1,D2);
  D2:=D1-(5.4*OneSecond);
  Test(D1,D2);
  D2:=D1-(2.5*OneSecond);
  Test(D1,D2);
End.


StartOfADay

Return the start of a day as a DateTime value, given a day indication

Declaration

Source position: dateutil.inc line 167

function StartOfADay(

  const AYear: Word;

  const AMonth: Word;

  const ADay: Word

):TDateTime; overload;

function StartOfADay(

  const AYear: Word;

  const ADayOfYear: Word

):TDateTime; overload;

Arguments

AYear | Year
AMonth | Month in the year
ADay | Day in the month.

Function result

Start of the given day as DateTime

Arguments

AYear | Year
ADayOfYear | Day in the year.

Description

StartOfADay returns a TDateTime value with the date/time indication of the start (0:0:0.000) of the day given by AYear, AMonth, ADay.

The day may also be indicated with a AYear, ADayOfYear pair.

See also

StartOfTheDay | Calculate the start of the day as a DateTime value, given a moment in the day.
StartOfTheWeek | Return the first day of the week, given a date.
StartOfAWeek | Return a day of the week, given a year, week and day in the week.
StartOfAMonth | Return first date of month, given a year/month pair.
StartOfTheMonth | Calculate the first day of the month, given a date in that month.
EndOfTheWeek | Calculate a DateTime value which represents the end of a week, given a date in that week.
EndOfAWeek | Return the last moment of day of the week, given a year and a week in the year.
EndOfTheYear | Calculate a DateTime value representing the last day of a year, given a date in that year.
EndOfAYear | Calculate a DateTime value representing the last day of a year
EndOfTheMonth | Calculate a DateTime value representing the last day of the month, given a day in that month.
EndOfAMonth | Calculate a datetime value representing the last day of the indicated month
EndOfTheDay | Calculate a datetime value that represents the end of a given day.
EndOfADay | Calculates a DateTime value representing the end of a specified day

Example

Program Example38;

{ This program demonstrates the StartOfADay function }

Uses SysUtils,DateUtils;

Const
  Fmt = '"Start of the day : "dd mmmm yyyy hh:nn:ss';

Var
  Y,M,D : Word;

Begin
  Y:=YearOf(Today);
  M:=MonthOf(Today);
  D:=DayOf(Today);
  Writeln(FormatDateTime(Fmt,StartOfADay(Y,M,D)));
  DecodeDateDay(Today,Y,D);
  Writeln(FormatDateTime(Fmt,StartOfADay(Y,D)));
End.


StartOfAMonth

Return first date of month, given a year/month pair.

Declaration

Source position: dateutil.inc line 145

function StartOfAMonth(

  const AYear: Word;

  const AMonth: Word

):TDateTime;

Arguments

AYear | A year.
AMonth | Month in the year.

Function result

First day of the month AMonth in AYear

Description

StartOfAMonth e returns a TDateTime value with the date of the first day of the month indicated by the AYear, AMonth pair.

See also

StartOfTheMonth | Calculate the first day of the month, given a date in that month.
EndOfTheMonth | Calculate a DateTime value representing the last day of the month, given a day in that month.
EndOfAMonth | Calculate a datetime value representing the last day of the indicated month
EndOfTheYear | Calculate a DateTime value representing the last day of a year, given a date in that year.
EndOfAYear | Calculate a DateTime value representing the last day of a year
StartOfAWeek | Return a day of the week, given a year, week and day in the week.
StartOfTheWeek | Return the first day of the week, given a date.

Example

Program Example30;

{ This program demonstrates the StartOfAMonth function }

Uses SysUtils,DateUtils;

Const
  Fmt = '"First day of this month : "dd mmmm yyyy';
Var
  Y,M : Word;

Begin
  Y:=YearOf(Today);
  M:=MonthOf(Today);
  Writeln(FormatDateTime(Fmt,StartOfAMonth(Y,M)));
End.


StartOfAWeek

Return a day of the week, given a year, week and day in the week.

Declaration

Source position: dateutil.inc line 155

function StartOfAWeek(

  const AYear: Word;

  const AWeekOfYear: Word;

  const ADayOfWeek: Word

):TDateTime;

function StartOfAWeek(

  const AYear: Word;

  const AWeekOfYear: Word

):TDateTime;

Arguments

AYear | Year
AWeekOfYear | Week in the year
ADayOfWeek | Day in the week (default 1)

Function result

First day of the given week, in TDateTime format.

Arguments

AYear | Year
AWeekOfYear | Week in the year

Description

StartOfAWeek returns a TDateTime value with the date of the indicated day of the week indicated by the AYear, AWeek, ADayOfWeek values.

The default value for ADayOfWeek is 1.

See also

StartOfTheWeek | Return the first day of the week, given a date.
EndOfTheWeek | Calculate a DateTime value which represents the end of a week, given a date in that week.
EndOfAWeek | Return the last moment of day of the week, given a year and a week in the year.
StartOfAMonth | Return first date of month, given a year/month pair.
EndOfTheYear | Calculate a DateTime value representing the last day of a year, given a date in that year.
EndOfAYear | Calculate a DateTime value representing the last day of a year
EndOfTheMonth | Calculate a DateTime value representing the last day of the month, given a day in that month.
EndOfAMonth | Calculate a datetime value representing the last day of the indicated month

Example

Program Example34;

{ This program demonstrates the StartOfAWeek function }

Uses SysUtils,DateUtils;

Const
  Fmt = '"First day of this week : "dd mmmm yyyy hh:nn:ss';
  Fmt2 = '"Second day of this week : "dd mmmm yyyy hh:nn:ss';

Var
  Y,W : Word;

Begin
  Y:=YearOf(Today);
  W:=WeekOf(Today);
  Writeln(FormatDateTime(Fmt,StartOfAWeek(Y,W)));
  Writeln(FormatDateTime(Fmt2,StartOfAWeek(Y,W,2)));
End.


StartOfAYear

Return the first day of a given year.

Declaration

Source position: dateutil.inc line 136

function StartOfAYear(

  const AYear: Word

):TDateTime;

Arguments

AYear

Year to get first date from.

Function result

First day of AYear as a TDateTime

Description

StartOfAYear returns a TDateTime value with the date of the first day of the year AYear (January 1).

See also

StartOfTheYear | Return the first day of the year, given a date in this year.
EndOfTheYear | Calculate a DateTime value representing the last day of a year, given a date in that year.
EndOfAYear | Calculate a DateTime value representing the last day of a year
EndOfTheMonth | Calculate a DateTime value representing the last day of the month, given a day in that month.
EndOfAMonth | Calculate a datetime value representing the last day of the indicated month
StartOfAWeek | Return a day of the week, given a year, week and day in the week.
StartOfTheWeek | Return the first day of the week, given a date.

Example

Program Example26;

{ This program demonstrates the StartOfAYear function }

Uses SysUtils,DateUtils;

Const
  Fmt = '"First day of this year : "dd mmmm yyyy';

Begin
  Writeln(FormatDateTime(Fmt,StartOfAYear(YearOf(Today))));
End.


StartOfTheDay

Calculate the start of the day as a DateTime value, given a moment in the day.

Declaration

Source position: dateutil.inc line 165

function StartOfTheDay(

  const AValue: TDateTime

):TDateTime;

Arguments

AValue

DateTime from which to calculate start of the day.

Function result

Start of the day (00:00) as DateTime value

Description

StartOfTheDay extracts the date part of AValue and returns a TDateTime value with the date/time indication of the start (0:0:0.000) of this day.

See also

StartOfADay | Return the start of a day as a DateTime value, given a day indication
StartOfTheWeek | Return the first day of the week, given a date.
StartOfAWeek | Return a day of the week, given a year, week and day in the week.
StartOfAMonth | Return first date of month, given a year/month pair.
StartOfTheMonth | Calculate the first day of the month, given a date in that month.
EndOfTheWeek | Calculate a DateTime value which represents the end of a week, given a date in that week.
EndOfAWeek | Return the last moment of day of the week, given a year and a week in the year.
EndOfTheYear | Calculate a DateTime value representing the last day of a year, given a date in that year.
EndOfAYear | Calculate a DateTime value representing the last day of a year
EndOfTheMonth | Calculate a DateTime value representing the last day of the month, given a day in that month.
EndOfAMonth | Calculate a datetime value representing the last day of the indicated month
EndOftheDay | Calculate a datetime value that represents the end of a given day.
EndOfADay | Calculates a DateTime value representing the end of a specified day

Example

Program Example36;

{ This program demonstrates the StartOfTheDay function }

Uses SysUtils,DateUtils;

Const
  Fmt = '"Start of the day : "dd mmmm yyyy hh:nn:ss';

Begin
  Writeln(FormatDateTime(Fmt,StartOfTheDay(Today)));
End.


StartOfTheMonth

Calculate the first day of the month, given a date in that month.

Declaration

Source position: dateutil.inc line 143

function StartOfTheMonth(

  const AValue: TDateTime

):TDateTime;

Arguments

AValue

Date to return first of month from

Function result

First day of month as a TDateTime value.

Description

StartOfTheMonth extracts the year and month parts of AValue and returns a TDateTime value with the date of the first day of that year and month as the StartOfAMonth function.

See also

StartOfAMonth | Return first date of month, given a year/month pair.
EndOfTheYear | Calculate a DateTime value representing the last day of a year, given a date in that year.
EndOfAYear | Calculate a DateTime value representing the last day of a year
EndOfTheMonth | Calculate a DateTime value representing the last day of the month, given a day in that month.
EndOfAMonth | Calculate a datetime value representing the last day of the indicated month
StartOfAWeek | Return a day of the week, given a year, week and day in the week.
StartOfTheWeek | Return the first day of the week, given a date.

Example

Program Example28;

{ This program demonstrates the StartOfTheMonth function }

Uses SysUtils,DateUtils;

Const
  Fmt = '"First day of this month : "dd mmmm yyyy';

Begin
  Writeln(FormatDateTime(Fmt,StartOfTheMonth(Today)));
End.


StartOfTheWeek

Return the first day of the week, given a date.

Declaration

Source position: dateutil.inc line 153

function StartOfTheWeek(

  const AValue: TDateTime

):TDateTime;

Arguments

AValue

Day in the week.

Function result

First day of the week, in TDateTime format.

Description

StartOfTheWeek extracts the year and week parts of AValue and returns a TDateTime value with the date of the first day of that week as the StartOfAWeek function.

See also

StartOfAWeek | Return a day of the week, given a year, week and day in the week.
EndOfTheWeek | Calculate a DateTime value which represents the end of a week, given a date in that week.
EndOfAWeek | Return the last moment of day of the week, given a year and a week in the year.
StartOfAMonth | Return first date of month, given a year/month pair.
EndOfTheYear | Calculate a DateTime value representing the last day of a year, given a date in that year.
EndOfAYear | Calculate a DateTime value representing the last day of a year
EndOfTheMonth | Calculate a DateTime value representing the last day of the month, given a day in that month.
EndOfAMonth | Calculate a datetime value representing the last day of the indicated month

Example

Program Example32;

{ This program demonstrates the StartOfTheWeek function }

Uses SysUtils,DateUtils;

Const
  Fmt = '"First day of this week : "dd mmmm yyyy';

Begin
  Writeln(FormatDateTime(Fmt,StartOfTheWeek(Today)));
End.


StartOfTheYear

Return the first day of the year, given a date in this year.

Declaration

Source position: dateutil.inc line 134

function StartOfTheYear(

  const AValue: TDateTime

):TDateTime;

Arguments

AValue

Date in year of which to return the start

Function result

First day of the year as a TDateTime value.

Description

StartOfTheYear extracts the year part of AValue and returns a TDateTime value with the date of the first day of that year (January 1), as the StartOfAYear function.

See also

StartOfAYear | Return the first day of a given year.
EndOfTheYear | Calculate a DateTime value representing the last day of a year, given a date in that year.
EndOfAYear | Calculate a DateTime value representing the last day of a year

Example

Program Example24;

{ This program demonstrates the StartOfTheYear function }

Uses SysUtils,DateUtils;

Const
  Fmt = '"First day of this year : "dd mmmm yyyy';

Begin
  Writeln(FormatDateTime(Fmt,StartOfTheYear(Today)));
End.


TimeOf

Extract the time part from a DateTime indication.

Declaration

Source position: dateutil.inc line 77

function TimeOf(

  const AValue: TDateTime

):TDateTime;

Arguments

AValue

Datetime to extract time from

Function result

Time part of AValue.

Description

TimeOf extracts the time part from AValue and returns the result.

Since the TDateTime is actually a double with the time part encoded in the fractional part, this operation corresponds to a call to Frac.

See also

DateOf | Extract the date part from a DateTime indication.
YearOf | Extract the year from a given date.
MonthOf | Extract the month from a given date.
DayOf | Extract the day (of month) part from a DateTime value
HourOf | Extract the hour part from a DateTime value.
MinuteOf | Extract the minute part from a DateTime value.
SecondOf | Extract the second part from a DateTime value.
MilliSecondOf | Extract the millisecond part from a DateTime value.

Example

Program Example2;

{ This program demonstrates the TimeOf function }

Uses SysUtils,DateUtils;

Begin
  Writeln('Time is : ',TimeToStr(TimeOf(Now)));
End.


Today

Return the current date

Declaration

Source position: dateutil.inc line 109

function Today: TDateTime;

Function result

Current day as TDateTime.

Description

Today is an alias for the Date function in the sysutils unit.

For an example, see Yesterday

See also

Date | Return the current date.
Yesterday | Return the previous day.
Tomorrow | Return the next day


Tomorrow

Return the next day

Declaration

Source position: dateutil.inc line 111

function Tomorrow: TDateTime;

Function result

Next day as TDateTime.

Description

Tomorrow returns tomorrow's date. Tomorrow is determined from the system clock, i.e. it is Today +1.

See also

Today | Return the current date
Yesterday | Return the previous day.

Example

Program Example19;

{ This program demonstrates the Tomorrow function }

Uses SysUtils,DateUtils;

Begin
  Writeln(FormatDateTime('"Today is" dd mmmm yyyy',Today));
  Writeln(FormatDateTime('"Tomorrow will be" dd mmmm yyyy',Tomorrow));
End.


TryEncodeDateDay

Encode a year and day of year to a TDateTime value

Declaration

Source position: dateutil.inc line 324

function TryEncodeDateDay(

  const AYear: Word;

  const ADayOfYear: Word;

  out AValue: TDateTime

):Boolean;

Arguments

AYear | Year
ADayOfYear | Day in the year
AValue | Encoded TDateTime value.

Function result

True if the encoding was succesful, False if not.

Description

TryEncodeDateDay encodes the values AYear and ADayOfYear to a date value and returns this value in AValue.

If the encoding was succcesful, True is returned. False is returned if any of the arguments is not valid.

See also

EncodeDateDay | Encodes a year and day of year to a DateTime value
EncodeDateTime | Encodes a DateTime value from all its parts
EncodeDateMonthWeek | Encodes a year, month, week of month and day of week to a DateTime value
EncodeDateWeek | Encode a TDateTime value from a year, week and day of week triplet
TryEncodeDateTime | Encode a Year, Month, Day, Hour, minute, seconds, milliseconds tuplet to a TDateTime value
TryEncodeDateMonthWeek | Encode a year, month, week of month and day of week to a TDateTime value
TryEncodeDateWeek | Encode a year, week and day of week triplet to a TDateTime value

Example

Program Example84;

{ This program demonstrates the TryEncodeDateDay function }

Uses SysUtils,DateUtils;

Var
  Y,DoY : Word;
  TS : TDateTime;

Begin
  DecodeDateDay(Now,Y,DoY);
  If TryEncodeDateDay(Y,DoY,TS) then
    Writeln('Today is : ',DateToStr(TS))
  else
    Writeln('Wrong year/day of year indication');
End.


TryEncodeDateMonthWeek

Encode a year, month, week of month and day of week to a TDateTime value

Declaration

Source position: dateutil.inc line 332

function TryEncodeDateMonthWeek(

  const AYear: Word;

  const AMonth: Word;

  const AWeekOfMonth: Word;

  const ADayOfWeek: Word;

  out AValue: TDateTime

):Boolean;

Arguments

AYear | Year
AMonth | Month in the year
AWeekOfMonth | Week in the month
ADayOfWeek | Day in the week
AValue | Encoded TDateTime value

Function result

True if the encoding was succesful, False if not.

Description

TryEncodeDateTime encodes the values AYearAMonth, WeekOfMonth,ADayOfWeek, to a date value and returns this value in AValue.

If the encoding was succesful, True is returned, False if any of the arguments is not valid.

See also

DecodeDateMonthWeek | Decode a DateTime value in a month, week of month and day of week
EncodeDateTime | Encodes a DateTime value from all its parts
EncodeDateWeek | Encode a TDateTime value from a year, week and day of week triplet
EncodeDateDay | Encodes a year and day of year to a DateTime value
EncodeDateMonthWeek | Encodes a year, month, week of month and day of week to a DateTime value
TryEncodeDateTime | Encode a Year, Month, Day, Hour, minute, seconds, milliseconds tuplet to a TDateTime value
TryEncodeDateWeek | Encode a year, week and day of week triplet to a TDateTime value
TryEncodeDateDay | Encode a year and day of year to a TDateTime value
NthDayOfWeek | Calculate which occurrence of weekday in the month a given day represents

Example

Program Example86;

{ This program demonstrates the TryEncodeDateMonthWeek function }

Uses SysUtils,DateUtils;

Var
  Y,M,Wom,Dow : Word;
  TS : TDateTime;

Begin
  DecodeDateMonthWeek(Now,Y,M,WoM,DoW);
  If TryEncodeDateMonthWeek(Y,M,WoM,Dow,TS) then
    Writeln('Today is : ',DateToStr(TS))
  else
    Writeln('Invalid year/month/week/dow indication');
End.


TryEncodeDateTime

Encode a Year, Month, Day, Hour, minute, seconds, milliseconds tuplet to a TDateTime value

Declaration

Source position: dateutil.inc line 306

function TryEncodeDateTime(

  const AYear: Word;

  const AMonth: Word;

  const ADay: Word;

  const AHour: Word;

  const AMinute: Word;

  const ASecond: Word;

  const AMilliSecond: Word;

  out AValue: TDateTime

):Boolean;

Arguments

AYear | Year
AMonth | Month in year
ADay | Day in month
AHour | Hour of the day
AMinute | Minutes in the hour
ASecond | Seconds in the minute
AMilliSecond | Millisecond in the second
AValue | Encoded TDateTime value.

Function result

True if the encoding was succesful

Description

EncodeDateTime encodes the values AYearAMonth, ADay,AHour, AMinute,ASecond and AMilliSecond to a date/time valueand returns this value in AValue.

If the date was encoded succesfully, True is returned, False is returned if one of the arguments is not valid.

See also

EncodeDateTime | Encodes a DateTime value from all its parts
EncodeDateMonthWeek | Encodes a year, month, week of month and day of week to a DateTime value
EncodeDateWeek | Encode a TDateTime value from a year, week and day of week triplet
EncodeDateDay | Encodes a year and day of year to a DateTime value
TryEncodeDateDay | Encode a year and day of year to a TDateTime value
TryEncodeDateWeek | Encode a year, week and day of week triplet to a TDateTime value
TryEncodeDateMonthWeek | Encode a year, month, week of month and day of week to a TDateTime value

Example

Program Example79;

{ This program demonstrates the TryEncodeDateTime function }

Uses SysUtils,DateUtils;

Var
  Y,Mo,D,H,Mi,S,MS : Word;
  TS : TDateTime;

Begin
  DecodeDateTime(Now,Y,Mo,D,H,Mi,S,MS);
  If TryEncodeDateTime(Y,Mo,D,H,Mi,S,MS,TS) then
    Writeln('Now is : ',DateTimeToStr(TS))
  else
    Writeln('Wrong date/time indication');
End.


TryEncodeDateWeek

Encode a year, week and day of week triplet to a TDateTime value

Declaration

Source position: dateutil.inc line 315

function TryEncodeDateWeek(

  const AYear: Word;

  const AWeekOfYear: Word;

  out AValue: TDateTime;

  const ADayOfWeek: Word

):Boolean;

function TryEncodeDateWeek(

  const AYear: Word;

  const AWeekOfYear: Word;

  out AValue: TDateTime

):Boolean;

Arguments

AYear | Year
AWeekOfYear | Week in the year
AValue | Encoded TDateTime value
ADayOfWeek | Day of the week (default 1).

Function result

True if the encoding was succeful, False otherwise.

Arguments

AYear | Year
AWeekOfYear | Week in the year
AValue | Encoded TDateTime value

Description

TryEncodeDateWeek encodes the values AYear, AWeekOfYear and ADayOfWeek to a date value and returns this value in AValue.

If the encoding was succcesful, True is returned. False is returned if any of the arguments is not valid.

See also

EncodeDateMonthWeek | Encodes a year, month, week of month and day of week to a DateTime value
EncodeDateWeek | Encode a TDateTime value from a year, week and day of week triplet
EncodeDateTime | Encodes a DateTime value from all its parts
EncodeDateDay | Encodes a year and day of year to a DateTime value
TryEncodeDateTime | Encode a Year, Month, Day, Hour, minute, seconds, milliseconds tuplet to a TDateTime value
TryEncodeDateMonthWeek | Encode a year, month, week of month and day of week to a TDateTime value
TryEncodeDateDay | Encode a year and day of year to a TDateTime value

Example

Program Example82;

{ This program demonstrates the TryEncodeDateWeek function }

Uses SysUtils,DateUtils;

Var
  Y,W,Dow : Word;
  TS : TDateTime;

Begin
  DecodeDateWeek(Now,Y,W,Dow);
  If TryEncodeDateWeek(Y,W,TS,Dow) then
    Writeln('Today is : ',DateToStr(TS))
  else
    Writeln('Invalid date/week indication');
End.


TryEncodeDayOfWeekInMonth

Encode a year, month, week, day of week triplet to a TDateTime value

Declaration

Source position: dateutil.inc line 379

function TryEncodeDayOfWeekInMonth(

  const AYear: Word;

  const AMonth: Word;

  const ANthDayOfWeek: Word;

  const ADayOfWeek: Word;

  out AValue: TDateTime

):Boolean;

Arguments

AYear | Year
AMonth | Month in year
ANthDayOfWeek | Day of week occurrence
ADayOfWeek | Day of week
AValue | Resulting TDateTime value

Function result

True if the encoding was succesful, False if not.

Description

EncodeDayOfWeekInMonth encodes AYear, AMonth, ADayOfweek and ANthDayOfweek to a valid date stamp and returns the result in AValue.

ANthDayOfweekis the N-th time that this weekday occurs in the month, e.g. the third saturday of the month.

The function returns True if the encoding was succesful, False if any of the values is not in range.

See also

NthDayOfWeek | Calculate which occurrence of weekday in the month a given day represents
EncodeDateMonthWeek | Encodes a year, month, week of month and day of week to a DateTime value
#rtl.sysutils.DayOfWeek | Returns the day of the week.
DecodeDayOfWeekInMonth | Decode a DateTime value in year, month, day of week parts
EncodeDayOfWeekInMonth | Encodes a year, month, week, day of week specification to a TDateTime value

Example

Program Example105;

{ This program demonstrates the DecodeDayOfWeekInMonth function }

Uses SysUtils,DateUtils;

Var
  Y,M,NDoW,DoW : Word;
  D : TDateTime;
Begin
  DecodeDayOfWeekInMonth(Date,Y,M,NDoW,DoW);
  If TryEncodeDayOfWeekInMonth(Y,M,NDoW,DoW,D) then
    begin
    Write(DateToStr(D),' is the ',NDow,'-th ');
    Writeln(formatdateTime('dddd',D),' of the month.');
    end
  else
    Writeln('Invalid year/month/NthDayOfweek combination');
End.


TryEncodeTimeInterval

Try to encode an interval as a TDateTime value.

Declaration

Source position: dateutil.inc line 338

function TryEncodeTimeInterval(

  Hour: Word;

  Min: Word;

  Sec: Word;

  MSec: Word;

  out Time: TDateTime

):Boolean;

Description

TryEncodeTimeInterval encodes a time interval expressed in Hour, Min, Sec, MSec as a TDateTime value and returns the value in Time. It returns True if Min, Sec, MSec contain valid time values (i.e. less than 60, 60 resp. MSec). The number of hours may be larger than 24.

See also

EncodeTimeInterval

Encode an interval as a TDateTime value.


TryJulianDateToDateTime

Convert a Julian date representation to a TDateTime value.

Declaration

Source position: dateutil.inc line 398

function TryJulianDateToDateTime(

  const AValue: Double;

  out ADateTime: TDateTime

):Boolean;

Arguments

AValue | Date in Julian notation
ADateTime | Resulting TDateTime equivalent

Function result

True if the conversion was succesful, False if not.

Description

Try to convert a Julian date to a regular TDateTime date/time representation.

See also

DateTimeToJulianDate | Converts a TDateTime value to a Julian date representation
JulianDateToDateTime | Convert a Julian date representation to a TDateTime value.
DateTimeToModifiedJulianDate | Convert a TDateTime value to a modified Julian date representation
TryModifiedJulianDateToDateTime | Convert a modified Julian date representation to a TDateTime value.


TryModifiedJulianDateToDateTime

Convert a modified Julian date representation to a TDateTime value.

Declaration

Source position: dateutil.inc line 402

function TryModifiedJulianDateToDateTime(

  const AValue: Double;

  out ADateTime: TDateTime

):Boolean;

Arguments

AValue | Modified Julian date to convert
ADateTime | AValue as a TDateTime value.

Function result

True if the conversion was succesful, False if not.

Description

Not yet implemented.

Errors

Currently, trying to use this function will raise an exception.

See also

DateTimeToJulianDate | Converts a TDateTime value to a Julian date representation
JulianDateToDateTime | Convert a Julian date representation to a TDateTime value.
TryJulianDateToDateTime | Convert a Julian date representation to a TDateTime value.
DateTimeToModifiedJulianDate | Convert a TDateTime value to a modified Julian date representation
ModifiedJulianDateToDateTime | Convert a modified Julian date representation to a TDateTime value.


TryRecodeDateTime

Replace selected parts of a TDateTime value with other values

Declaration

Source position: dateutil.inc line 355

function TryRecodeDateTime(

  const AValue: TDateTime;

  const AYear: Word;

  const AMonth: Word;

  const ADay: Word;

  const AHour: Word;

  const AMinute: Word;

  const ASecond: Word;

  const AMilliSecond: Word;

  out AResult: TDateTime

):Boolean;

Arguments

AValue | Date/time to recode
AYear | New value for year part
AMonth | New value for month part
ADay | New value for day part
AHour | New value for hour part
AMinute | New value for minute part
ASecond | New value for second part
AMilliSecond | New value for millisecond part
AResult | Recoded AValue.

Function result

True if the recoding was succesful, False if not.

Description

TryRecodeDateTime replaces selected parts of the timestamp AValue with the date/time values specified in AYear, AMonth, ADay, AHour, AMinute, ASecond and AMilliSecond. If any of these values equals the pre-defined constant RecodeLeaveFieldAsIs, then the corresponding part of the date/time stamp is left untouched.

The resulting date/time is returned in AValue.

The function returns True if the encoding was succesful. It returns False if one of the values AYear, AMonth, ADay, AHour, AMinute, ASecondAMilliSecond is not within a valid range.

See also

RecodeYear | Replace year part of a TDateTime value with another year.
RecodeMonth | Replace month part of a TDateTime value with another month.
RecodeDay | Replace day part of a TDateTime value with another day.
RecodeHour | Replace hours part of a TDateTime value with another hour.
RecodeMinute | Replace minutse part of a TDateTime value with another minute.
RecodeSecond | Replace seconds part of a TDateTime value with another second.
RecodeMilliSecond | Replace milliseconds part of a TDateTime value with another millisecond.
RecodeDate | Replace date part of a TDateTime value with another date.
RecodeTime | Replace time part of a TDateTime value with another time.
RecodeDateTime | Replace selected parts of a TDateTime value with other values

Example

Program Example97;

{ This program demonstrates the TryRecodeDateTime function }

Uses SysUtils,DateUtils;

Const
  Fmt = 'dddd dd mmmm yyyy hh:nn:ss';

Var
  S : AnsiString;
  D : TDateTime ;

Begin
  If TryRecodeDateTime(Now,2000,2,RecodeLeaveFieldAsIs,0,0,0,0,D) then
    begin
    S:=FormatDateTime(Fmt,D);
    Writeln('This moment in februari 2000 : ',S);
    end
  else
    Writeln('This moment did/does not exist in februari 2000');
End.


UniversalTimeToLocal

Convert UTC time to local time

Declaration

Source position: dateutil.inc line 429

function UniversalTimeToLocal(

  UT: TDateTime

):TDateTime;

function UniversalTimeToLocal(

  UT: TDateTime;

  TZOffset: Integer

):TDateTime;

Description

UniversalTimeToLocal converts a universal time indication to a local time: it applies the TZOffset timezone offset to the UT Universal time (UTC). If no TZOffset is specified, the local time offset as returned by GetLocalTimeOffset is used.

Note that for times in the past or in the future, or for timezones with DST, omitting the TZoffset may lead to wrong results, as the current timezone offset is used. Calculation of the correct timezone offset for a given date is very complicated, and outside the scope of this call.

See also

GetLocalTimeOffset

LocalTimeToUniversal

Convert local time to UTC time


UnixTimeStampToMac

Convert Unix Timestamp to a Mac Timestamp

Declaration

Source position: dateutil.inc line 410

function UnixTimeStampToMac(

  const AValue: Int64

):Int64;

Description

UnixTimeStampToMac converts the unix epoch time in AValue to a valid Mac timestamp indication and returns the result.

Errors

None.

See also

DateTimeToMac | Convert a TDateTime timestamp to a Mac timestamp
MacToDateTime | Convert a Mac timestamp to a TDateTime timestamp
MacTimeStampToUnix | Convert a Mac timestamp to a Unix timestamp


UnixToDateTime

Convert Unix epoch time to a TDateTime value

Declaration

Source position: dateutil.inc line 409

function UnixToDateTime(

  const AValue: Int64

):TDateTime;

Arguments

AValue

Date to convert.

Function result

AValue as a TDateTime value.

Description

UnixToDateTime converts epoch time (seconds elapsed since 1/1/1970) to a TDateTime value.

See also

DateTimeToUnix

Convert a TDateTime value to Unix epoch time


WeekOf

Extract week (of the year) from a given date.

Declaration

Source position: dateutil.inc line 123

function WeekOf(

  const AValue: TDateTime

):Word;

Arguments

AValue

Date to extract week from.

Function result

Week part of AValue.

Description

WeekOf returns the week-of-the-year part of the AValue date/time indication. It is a number between 1 and 53.

For an example, see YearOf

See also

YearOf | Extract the year from a given date.
DayOf | Extract the day (of month) part from a DateTime value
MonthOf | Extract the month from a given date.
HourOf | Extract the hour part from a DateTime value.
MinuteOf | Extract the minute part from a DateTime value.
SecondOf | Extract the second part from a DateTime value.
MilliSecondOf | Extract the millisecond part from a DateTime value.


WeekOfTheMonth

Extract the week of the month (and optionally month and year) from a DateTime value

Declaration

Source position: dateutil.inc line 189

function WeekOfTheMonth(

  const AValue: TDateTime

):Word; overload;

function WeekOfTheMonth(

  const AValue: TDateTime;

  out AYear: Word;

  out AMonth: Word

):Word; overload;

Arguments

AValue

Datetime value of which to calculate the week, month and year.

Function result

Week of the month

Arguments

AValue | Datetime value of which to calculate the week, month and year.
AYear | Year part of AValue
AMonth | Month part of AValue

Description

WeekOfTheMonth extracts the week of the month from Avalue and returns it, and optionally returns the year and month as well (in AYear, AMonth respectively).

Remark: Note that weeks are numbered from 1 using the ISO 8601 standard, and the day of the week as well. This means that the year and month may not be the same as the year part of the date, since the week may start in the previous year as the first week of the year is the week with at least 4 days in it.

See also

WeekOfTheYear | Extract the week of the year (and optionally year) of a DateTime indication.
DayOfTheMonth | Extract the day (of month) part of a DateTime value
HourOfTheMonth | Calculate the number of hours passed since the start of the month.
MinuteOfTheMonth | Calculate number of minutes elapsed since the start of the month.
SecondOfTheMonth | Calculate number of seconds elapsed since the start of the month.
MilliSecondOfTheMonth | Calculate number of milliseconds elapsed since the start of the month.

Example

Program Example41;

{ This program demonstrates the WeekOfTheMonth function }

Uses SysUtils,DateUtils;

Var
  N : TDateTime;

Begin
  N:=Now;
  Writeln('Week of the Month        : ',WeekOfTheMonth(N));
  Writeln('Day of the Month         : ',DayOfTheMonth(N));
  Writeln('Hour of the Month        : ',HourOfTheMonth(N));
  Writeln('Minute of the Month      : ',MinuteOfTheMonth(N));
  Writeln('Second of the Month      : ',SecondOfTheMonth(N));
  Writeln('MilliSecond of the Month : ',
          MilliSecondOfTheMonth(N));
End.


WeekOfTheYear

Extract the week of the year (and optionally year) of a DateTime indication.

Declaration

Source position: dateutil.inc line 177

function WeekOfTheYear(

  const AValue: TDateTime

):Word; overload;

function WeekOfTheYear(

  const AValue: TDateTime;

  out AYear: Word

):Word; overload;

Arguments

AValue

Date from which to extract week.

Function result

Week of the year in which Avalue falls.

Arguments

AValue | Date from which to extract week.
AYear | Year part of AValue

Description

WeekOfTheYear extracts the week of the year from Avalue and returns it, and optionally returns the year as well. It returns the same value as WeekOf.

Remark: Note that weeks are numbered from 1 using the ISO 8601 standard, and the day of the week as well. This means that the year may not be the same as the year part of the date, since the week may start in the previous year as the first week of the year is the week with at least 4 days in it.

See also

WeekOf | Extract week (of the year) from a given date.
MonthOfTheYear | Extract the month of a DateTime indication.
DayOfTheYear | Extracts the day of the year from a TDateTime value
HourOfTheYear | Calculate the number of hours passed since the start of the year.
MinuteOfTheYear | Calculate the number of minutes elapsed since the start of the year
SecondOfTheYear | Calculate the number of seconds elapsed since the start of the year.
MilliSecondOfTheYear | Calculate the number of milliseconds elapsed since the start of the year.

Example

Program Example40;

{ This program demonstrates the WeekOfTheYear function }

Uses SysUtils,DateUtils;

Var
  N : TDateTime;

Begin
  N:=Now;
  Writeln('Month of the year       : ',MonthOfTheYear(N));
  Writeln('Week of the year        : ',WeekOfTheYear(N));
  Writeln('Day of the year         : ',DayOfTheYear(N));
  Writeln('Hour of the year        : ',HourOfTheYear(N));
  Writeln('Minute of the year      : ',MinuteOfTheYear(N));
  Writeln('Second of the year      : ',SecondOfTheYear(N));
  Writeln('MilliSecond of the year : ',
          MilliSecondOfTheYear(N));
End.


WeeksBetween

Calculate the number of whole weeks between two DateTime values

Declaration

Source position: dateutil.inc line 258

function WeeksBetween(

  const ANow: TDateTime;

  const AThen: TDateTime

):Integer;

Arguments

ANow | First moment in time
AThen | Second moment in time

Function result

Number of whole weeks between ANow and AThen.

Description

WeeksBetween returns the number of whole weeks between ANow and AThen. This means the fractional part of a Week is dropped.

See also

YearsBetween | Calculate the number of whole years between two DateTime values
MonthsBetween | Calculate the number of whole months between two DateTime values
DaysBetween | Number of whole days between two DateTime values.
HoursBetween | Calculate the number of whole hours between two DateTime values.
MinutesBetween | Calculate the number of whole minutes between two DateTime values.
SecondsBetween | Calculate the number of whole seconds between two DateTime values.
MilliSecondsBetween | Calculate the number of whole milliseconds between two DateTime values.

Example

Program Example57;

{ This program demonstrates the WeeksBetween function }

Uses SysUtils,DateUtils;

Procedure Test(ANow,AThen : TDateTime);

begin
 Write('Number of weeks between ');
 Write(DateToStr(AThen),' and ',DateToStr(ANow));
 Writeln(' : ',WeeksBetween(ANow,AThen));
end;

Var
  D1,D2 : TDateTime;

Begin
  D1:=Today;
  D2:=Today-7;
  Test(D1,D2);
  D2:=Today-8;
  Test(D1,D2);
  D2:=Today-14;
  Test(D1,D2);
  D2:=Today-35;
  Test(D1,D2);
  D2:=Today-36;
  Test(D1,D2);
  D2:=Today-17;
  Test(D1,D2);
End.


WeeksInAYear

Return the number of weeks in a given year

Declaration

Source position: dateutil.inc line 97

function WeeksInAYear(

  const AYear: Word

):Word;

Arguments

AYear

A (valid) year.

Function result

Number of weeks in AYear

Description

WeeksInAYear returns the number of weeks in the year AYear. The return value is either 52 or 53.

Remark: The first week of the year is determined according to the ISO 8601 standard: It is the first week that has at least 4 days in it, i.e. it includes a thursday.

See also

WeeksInYear | return the number of weeks in the year, given a date
DaysInYear | Return the number of days in the year in which a date occurs.
DaysInAYear | Number of days in a particular year.
DaysInMonth | Return the number of days in the month in which a date occurs.
DaysInAMonth | Number of days in a month of a certain year.

Example

Program Example13;

{ This program demonstrates the WeeksInAYear function }

Uses SysUtils,DateUtils;

Var
  Y : Word;

Begin
  For Y:=1992 to 2010 do
    Writeln(Y,' has ',WeeksInAYear(Y),' weeks.');
End.


WeeksInYear

return the number of weeks in the year, given a date

Declaration

Source position: dateutil.inc line 96

function WeeksInYear(

  const AValue: TDateTime

):Word;

Arguments

AValue

Day in the year.

Function result

Number of weeks.

Description

WeeksInYear returns the number of weeks in the year part of AValue. The return value is either 52 or 53.

Remark: The first week of the year is determined according to the ISO 8601 standard: It is the first week that has at least 4 days in it, i.e. it includes a thursday.

See also

WeeksInAYear | Return the number of weeks in a given year
DaysInYear | Return the number of days in the year in which a date occurs.
DaysInAYear | Number of days in a particular year.
DaysInMonth | Return the number of days in the month in which a date occurs.
DaysInAMonth | Number of days in a month of a certain year.

Example

Program Example12;

{ This program demonstrates the WeeksInYear function }

Uses SysUtils,DateUtils;

Var
  Y : Word;

Begin
  For Y:=1992 to 2010 do
    Writeln(Y,' has ',WeeksInYear(EncodeDate(Y,2,1)),' weeks.');
End.


WeekSpan

Calculate the approximate number of weeks between two DateTime values.

Declaration

Source position: dateutil.inc line 273

function WeekSpan(

  const ANow: TDateTime;

  const AThen: TDateTime

):Double;

Arguments

ANow | First moment in time
AThen | Second moment in time

Function result

Number (fractions included) of weeks between ANow and AThen

Description

WeekSpan returns the number of weeks between ANow and AThen, including any fractional parts of a week.

See also

YearSpan | Calculate the approximate number of years between two DateTime values.
MonthSpan | Calculate the approximate number of months between two DateTime values.
DaySpan | Calculate the approximate number of days between two DateTime values.
HourSpan | Calculate the approximate number of hours between two DateTime values.
MinuteSpan | Calculate the approximate number of minutes between two DateTime values.
SecondSpan | Calculate the approximate number of seconds between two DateTime values.
MilliSecondSpan | Calculate the approximate number of milliseconds between two DateTime values.
WeeksBetween | Calculate the number of whole weeks between two DateTime values

Example

Program Example57;

{ This program demonstrates the WeekSpan function }

Uses SysUtils,DateUtils;

Procedure Test(ANow,AThen : TDateTime);

begin
 Write('Number of weeks between ');
 Write(DateToStr(AThen),' and ',DateToStr(ANow));
 Writeln(' : ',WeekSpan(ANow,AThen));
end;

Var
  D1,D2 : TDateTime;

Begin
  D1:=Today;
  D2:=Today-7;
  Test(D1,D2);
  D2:=Today-8;
  Test(D1,D2);
  D2:=Today-14;
  Test(D1,D2);
  D2:=Today-35;
  Test(D1,D2);
  D2:=Today-36;
  Test(D1,D2);
  D2:=Today-17;
  Test(D1,D2);
End.


WithinPastDays

Check whether two datetimes are only a number of days apart

Declaration

Source position: dateutil.inc line 246

function WithinPastDays(

  const ANow: TDateTime;

  const AThen: TDateTime;

  const ADays: Integer

):Boolean;

Arguments

ANow | First moment in time
AThen | Second moment in time
ADays | Number of days to check

Function result

True if ANow and Athen are only ADays apart, false otherwise

Description

WithinPastDays compares the timestamps ANow and AThen and returns True if the difference between them is at most ADays days apart, or False if they are further apart.

Remark: Since this function uses the DaysBetween function to calculate the difference in days, this means that fractional days do not count, and the fractional part is simply dropped, so for two dates actually 2 and a half days apart, the result will also be True

See also

WithinPastYears | Check whether two datetimes are only a number of years apart
WithinPastMonths | Check whether two datetimes are only a number of months apart
WithinPastWeeks | Check whether two datetimes are only a number of weeks apart
WithinPastHours | Check whether two datetimes are only a number of hours apart
WithinPastMinutes | Check whether two datetimes are only a number of minutes apart
WithinPastSeconds | Check whether two datetimes are only a number of seconds apart
WithinPastMilliSeconds | Check whether two datetimes are only a number of milliseconds apart

Example

Program Example50;

{ This program demonstrates the WithinPastDays function }

Uses SysUtils,DateUtils;

Procedure Test(ANow,AThen : TDateTime; ADays : Integer);

begin
 Write(DateTimeToStr(AThen),' and ',DateTimeToStr(ANow));
 Write(' are within ',ADays,' days: ');
 Writeln(WithinPastDays(ANow,AThen,ADays));
end;

Var
  D1,D2 : TDateTime;

Begin
  D1:=Now;
  D2:=Today-23/24;
  Test(D1,D2,1);
  D2:=Today-1;
  Test(D1,D2,1);
  D2:=Today-25/24;
  Test(D1,D2,1);
  D2:=Today-26/24;
  Test(D1,D2,5);
  D2:=Today-5.4;
  Test(D1,D2,5);
  D2:=Today-2.5;
  Test(D1,D2,1);
  Test(D1,D2,2);
  Test(D1,D2,3);
End.


WithinPastHours

Check whether two datetimes are only a number of hours apart

Declaration

Source position: dateutil.inc line 247

function WithinPastHours(

  const ANow: TDateTime;

  const AThen: TDateTime;

  const AHours: Int64

):Boolean;

Arguments

ANow | First moment in time
AThen | Second moment in time
AHours | Number of hours to check

Function result

True if ANow and Athen are only AHours apart, false otherwise

Description

WithinPastHours compares the timestamps ANow and AThen and returns True if the difference between them is at most AHours hours apart, or False if they are further apart.

Remark: Since this function uses the HoursBetween function to calculate the difference in Hours, this means that fractional hours do not count, and the fractional part is simply dropped, so for two dates actually 2 and a half hours apart, the result will also be True

See also

WithinPastYears | Check whether two datetimes are only a number of years apart
WithinPastMonths | Check whether two datetimes are only a number of months apart
WithinPastWeeks | Check whether two datetimes are only a number of weeks apart
WithinPastDays | Check whether two datetimes are only a number of days apart
WithinPastMinutes | Check whether two datetimes are only a number of minutes apart
WithinPastSeconds | Check whether two datetimes are only a number of seconds apart
WithinPastMilliSeconds | Check whether two datetimes are only a number of milliseconds apart

Example

Program Example51;

{ This program demonstrates the WithinPastHours function }

Uses SysUtils,DateUtils;

Procedure Test(ANow,AThen : TDateTime; AHours : Integer);

begin
 Write(DateTimeToStr(AThen),' and ',DateTimeToStr(ANow));
 Write(' are within ',AHours,' hours: ');
 Writeln(WithinPastHours(ANow,AThen,AHours));
end;

Var
  D1,D2 : TDateTime;

Begin
  D1:=Now;
  D2:=D1-(59*OneMinute);
  Test(D1,D2,1);
  D2:=D1-(61*OneMinute);
  Test(D1,D2,1);
  D2:=D1-(122*OneMinute);
  Test(D1,D2,1);
  D2:=D1-(306*OneMinute);
  Test(D1,D2,5);
  D2:=D1-(5.4*OneHour);
  Test(D1,D2,5);
  D2:=D1-(2.5*OneHour);
  Test(D1,D2,1);
  Test(D1,D2,2);
  Test(D1,D2,3);
End.


WithinPastMilliSeconds

Check whether two datetimes are only a number of milliseconds apart

Declaration

Source position: dateutil.inc line 250

function WithinPastMilliSeconds(

  const ANow: TDateTime;

  const AThen: TDateTime;

  const AMilliSeconds: Int64

):Boolean;

Arguments

ANow | First moment in time
AThen | Second moment in time
AMilliSeconds | Number of milliseconds to check

Function result

True if ANow and Athen are only AMilliSeconds apart, false otherwise

Description

WithinPastMilliSeconds compares the timestamps ANow and AThen and returns True if the difference between them is at most AMilliSeconds milliseconds apart, or False if they are further apart.

Remark: Since this function uses the MilliSecondsBetween function to calculate the difference in milliseconds, this means that fractional milliseconds do not count, and the fractional part is simply dropped, so for two dates actually 2 and a half milliseconds apart, the result will also be True

See also

WithinPastYears | Check whether two datetimes are only a number of years apart
WithinPastMonths | Check whether two datetimes are only a number of months apart
WithinPastWeeks | Check whether two datetimes are only a number of weeks apart
WithinPastDays | Check whether two datetimes are only a number of days apart
WithinPastHours | Check whether two datetimes are only a number of hours apart
WithinPastMinutes | Check whether two datetimes are only a number of minutes apart
WithinPastSeconds | Check whether two datetimes are only a number of seconds apart

Example

Program Example54;

{ This program demonstrates the WithinPastMilliSeconds function }

Uses SysUtils,DateUtils;

Procedure Test(ANow,AThen : TDateTime; AMilliSeconds : Integer);

begin
 Write(TimeToStr(AThen),' and ',TimeToStr(ANow));
 Write(' are within ',AMilliSeconds,' milliseconds: ');
 Writeln(WithinPastMilliSeconds(ANow,AThen,AMilliSeconds));
end;

Var
  D1,D2 : TDateTime;

Begin
  D1:=Now;
  D2:=D1-(0.9*OneMilliSecond);
  Test(D1,D2,1);
  D2:=D1-(1.0*OneMilliSecond);
  Test(D1,D2,1);
  D2:=D1-(1.1*OneMilliSecond);
  Test(D1,D2,1);
  D2:=D1-(2.5*OneMilliSecond);
  Test(D1,D2,1);
  Test(D1,D2,2);
  Test(D1,D2,3);
End.


WithinPastMinutes

Check whether two datetimes are only a number of minutes apart

Declaration

Source position: dateutil.inc line 248

function WithinPastMinutes(

  const ANow: TDateTime;

  const AThen: TDateTime;

  const AMinutes: Int64

):Boolean;

Arguments

ANow | First moment in time
AThen | Second moment in time
AMinutes | Number of minutes to check

Function result

True if ANow and Athen are only AMinutes apart, false otherwise

Description

WithinPastMinutes compares the timestamps ANow and AThen and returns True if the difference between them is at most AMinutes minutes apart, or False if they are further apart.

Remark: Since this function uses the MinutesBetween function to calculate the difference in Minutes, this means that fractional minutes do not count, and the fractional part is simply dropped, so for two dates actually 2 and a half minutes apart, the result will also be True

See also

WithinPastYears | Check whether two datetimes are only a number of years apart
WithinPastMonths | Check whether two datetimes are only a number of months apart
WithinPastWeeks | Check whether two datetimes are only a number of weeks apart
WithinPastDays | Check whether two datetimes are only a number of days apart
WithinPastHours | Check whether two datetimes are only a number of hours apart
WithinPastSeconds | Check whether two datetimes are only a number of seconds apart
WithinPastMilliSeconds | Check whether two datetimes are only a number of milliseconds apart

Example

Program Example52;

{ This program demonstrates the WithinPastMinutes function }

Uses SysUtils,DateUtils;

Procedure Test(ANow,AThen : TDateTime; AMinutes : Integer);

begin
 Write(DateTimeToStr(AThen),' and ',DateTimeToStr(ANow));
 Write(' are within ',AMinutes,' Minutes: ');
 Writeln(WithinPastMinutes(ANow,AThen,AMinutes));
end;

Var
  D1,D2 : TDateTime;

Begin
  D1:=Now;
  D2:=D1-(59*OneSecond);
  Test(D1,D2,1);
  D2:=D1-(61*OneSecond);
  Test(D1,D2,1);
  D2:=D1-(122*OneSecond);
  Test(D1,D2,1);
  D2:=D1-(306*OneSecond);
  Test(D1,D2,5);
  D2:=D1-(5.4*OneMinute);
  Test(D1,D2,5);
  D2:=D1-(2.5*OneMinute);
  Test(D1,D2,1);
  Test(D1,D2,2);
  Test(D1,D2,3);
End.


WithinPastMonths

Check whether two datetimes are only a number of months apart

Declaration

Source position: dateutil.inc line 244

function WithinPastMonths(

  const ANow: TDateTime;

  const AThen: TDateTime;

  const AMonths: Integer

):Boolean;

Arguments

ANow | First moment in time
AThen | Second moment in time
AMonths | Number of months to check

Function result

True if ANow and Athen are only AMonths apart, false otherwise

Description

WithinPastMonths compares the timestamps ANow and AThen and returns True if the difference between them is at most AMonths months apart, or False if they are further apart.

Remark: Since this function uses the MonthsBetween function to calculate the difference in Months, this means that fractional months do not count, and the fractional part is simply dropped, so for two dates actually 2 and a half months apart, the result will also be True

See also

WithinPastYears | Check whether two datetimes are only a number of years apart
WithinPastWeeks | Check whether two datetimes are only a number of weeks apart
WithinPastDays | Check whether two datetimes are only a number of days apart
WithinPastHours | Check whether two datetimes are only a number of hours apart
WithinPastMinutes | Check whether two datetimes are only a number of minutes apart
WithinPastSeconds | Check whether two datetimes are only a number of seconds apart
WithinPastMilliSeconds | Check whether two datetimes are only a number of milliseconds apart

Example

Program Example48;

{ This program demonstrates the WithinPastMonths function }

Uses SysUtils,DateUtils;

Procedure Test(ANow,AThen : TDateTime; AMonths : Integer);

begin
 Write(DateToStr(AThen),' and ',DateToStr(ANow));
 Write(' are within ',AMonths,' months: ');
 Writeln(WithinPastMonths(ANow,AThen,AMonths));
end;

Var
  D1,D2 : TDateTime;

Begin
  D1:=Today;
  D2:=Today-364;
  Test(D1,D2,12);
  D2:=Today-365;
  Test(D1,D2,12);
  D2:=Today-366;
  Test(D1,D2,12);
  D2:=Today-390;
  Test(D1,D2,12);
  D2:=Today-368;
  Test(D1,D2,11);
  D2:=Today-1000;
  Test(D1,D2,31);
  Test(D1,D2,32);
  Test(D1,D2,33);
End.


WithinPastSeconds

Check whether two datetimes are only a number of seconds apart

Declaration

Source position: dateutil.inc line 249

function WithinPastSeconds(

  const ANow: TDateTime;

  const AThen: TDateTime;

  const ASeconds: Int64

):Boolean;

Arguments

ANow | First moment in time
AThen | Second moment in time
ASeconds | Number of seconds to check

Function result

True if ANow and Athen are only ASeconds apart, false otherwise

Description

WithinPastSeconds compares the timestamps ANow and AThen and returns True if the difference between them is at most ASeconds seconds apart, or False if they are further apart.

Remark: Since this function uses the SecondsBetween function to calculate the difference in seconds, this means that fractional seconds do not count, and the fractional part is simply dropped, so for two dates actually 2 and a half seconds apart, the result will also be True

See also

WithinPastYears | Check whether two datetimes are only a number of years apart
WithinPastMonths | Check whether two datetimes are only a number of months apart
WithinPastWeeks | Check whether two datetimes are only a number of weeks apart
WithinPastDays | Check whether two datetimes are only a number of days apart
WithinPastHours | Check whether two datetimes are only a number of hours apart
WithinPastMinutes | Check whether two datetimes are only a number of minutes apart
WithinPastMilliSeconds | Check whether two datetimes are only a number of milliseconds apart

Example

Program Example53;

{ This program demonstrates the WithinPastSeconds function }

Uses SysUtils,DateUtils;

Procedure Test(ANow,AThen : TDateTime; ASeconds : Integer);

begin
 Write(DateTimeToStr(AThen),' and ',DateTimeToStr(ANow));
 Write(' are within ',ASeconds,' seconds: ');
 Writeln(WithinPastSeconds(ANow,AThen,ASeconds));
end;

Var
  D1,D2 : TDateTime;

Begin
  D1:=Now;
  D2:=D1-(999*OneMilliSecond);
  Test(D1,D2,1);
  D2:=D1-(1001*OneMilliSecond);
  Test(D1,D2,1);
  D2:=D1-(2001*OneMilliSecond);
  Test(D1,D2,1);
  D2:=D1-(5001*OneMilliSecond);
  Test(D1,D2,5);
  D2:=D1-(5.4*OneSecond);
  Test(D1,D2,5);
  D2:=D1-(2.5*OneSecond);
  Test(D1,D2,1);
  Test(D1,D2,2);
  Test(D1,D2,3);
End.


WithinPastWeeks

Check whether two datetimes are only a number of weeks apart

Declaration

Source position: dateutil.inc line 245

function WithinPastWeeks(

  const ANow: TDateTime;

  const AThen: TDateTime;

  const AWeeks: Integer

):Boolean;

Arguments

ANow | First moment in time
AThen | Second moment in time
AWeeks | Number of weeks to check

Function result

True if ANow and Athen are only AWeeks apart, false otherwise

Description

WithinPastWeeks compares the timestamps ANow and AThen and returns True if the difference between them is at most AWeeks weeks apart, or False if they are further apart.

Remark: Since this function uses the WeeksBetween function to calculate the difference in Weeks, this means that fractional Weeks do not count, and the fractional part is simply dropped, so for two dates actually 2 and a half weeks apart, the result will also be True

See also

WithinPastYears | Check whether two datetimes are only a number of years apart
WithinPastMonths | Check whether two datetimes are only a number of months apart
WithinPastDays | Check whether two datetimes are only a number of days apart
WithinPastHours | Check whether two datetimes are only a number of hours apart
WithinPastMinutes | Check whether two datetimes are only a number of minutes apart
WithinPastSeconds | Check whether two datetimes are only a number of seconds apart
WithinPastMilliSeconds | Check whether two datetimes are only a number of milliseconds apart

Example

Program Example49;

{ This program demonstrates the WithinPastWeeks function }

Uses SysUtils,DateUtils;

Procedure Test(ANow,AThen : TDateTime; AWeeks : Integer);

begin
 Write(DateToStr(AThen),' and ',DateToStr(ANow));
 Write(' are within ',AWeeks,' weeks: ');
 Writeln(WithinPastWeeks(ANow,AThen,AWeeks));
end;

Var
  D1,D2 : TDateTime;

Begin
  D1:=Today;
  D2:=Today-7;
  Test(D1,D2,1);
  D2:=Today-8;
  Test(D1,D2,1);
  D2:=Today-14;
  Test(D1,D2,1);
  D2:=Today-35;
  Test(D1,D2,5);
  D2:=Today-36;
  Test(D1,D2,5);
  D2:=Today-17;
  Test(D1,D2,1);
  Test(D1,D2,2);
  Test(D1,D2,3);
End.


WithinPastYears

Check whether two datetimes are only a number of years apart

Declaration

Source position: dateutil.inc line 243

function WithinPastYears(

  const ANow: TDateTime;

  const AThen: TDateTime;

  const AYears: Integer

):Boolean;

Arguments

ANow | First moment in time
AThen | Second moment in time
AYears | Number of years to check

Function result

True if ANow and Athen are only AYears apart, false otherwise

Description

WithinPastYears compares the timestamps ANow and AThen and returns True if the difference between them is at most AYears years apart, or False if they are further apart.

Remark: Since this function uses the YearsBetween function to calculate the difference in years, this means that fractional years do not count, and the fractional part is simply dropped, so for two dates actually 2 and a half years apart, the result will also be True

See also

WithinPastMonths | Check whether two datetimes are only a number of months apart
WithinPastWeeks | Check whether two datetimes are only a number of weeks apart
WithinPastDays | Check whether two datetimes are only a number of days apart
WithinPastHours | Check whether two datetimes are only a number of hours apart
WithinPastMinutes | Check whether two datetimes are only a number of minutes apart
WithinPastSeconds | Check whether two datetimes are only a number of seconds apart
WithinPastMilliSeconds | Check whether two datetimes are only a number of milliseconds apart

Example

Program Example47;

{ This program demonstrates the WithinPastYears function }

Uses SysUtils,DateUtils;

Procedure Test(ANow,AThen : TDateTime; AYears : Integer);

begin
 Write(DateToStr(AThen),' and ',DateToStr(ANow));
 Write(' are within ',AYears,' years: ');
 Writeln(WithinPastYears(ANow,AThen,AYears));
end;

Var
  D1,D2 : TDateTime;

Begin
  D1:=Today;
  D2:=Today-364;
  Test(D1,D2,1);
  D2:=Today-365;
  Test(D1,D2,1);
  D2:=Today-366;
  Test(D1,D2,1);
  D2:=Today-390;
  Test(D1,D2,1);
  D2:=Today-368;
  Test(D1,D2,1);
  D2:=Today-1000;
  Test(D1,D2,1);
  Test(D1,D2,2);
  Test(D1,D2,3);
End.


YearOf

Extract the year from a given date.

Declaration

Source position: dateutil.inc line 121

function YearOf(

  const AValue: TDateTime

):Word;

Arguments

AValue

Date to extract year from.

Function result

Year part of AValue

Description

YearOf returns the year part of the AValue date/time indication. It is a number between 1 and 9999.

See also

MonthOf | Extract the month from a given date.
DayOf | Extract the day (of month) part from a DateTime value
WeekOf | Extract week (of the year) from a given date.
HourOf | Extract the hour part from a DateTime value.
MinuteOf | Extract the minute part from a DateTime value.
SecondOf | Extract the second part from a DateTime value.
MilliSecondOf | Extract the millisecond part from a DateTime value.

Example

Program Example23;

{ This program demonstrates the YearOf function }

Uses SysUtils,DateUtils;

Var
  D : TDateTime;

Begin
  D:=Now;
  Writeln('Year        : ',YearOf(D));
  Writeln('Month       : ',MonthOf(D));
  Writeln('Day         : ',DayOf(D));
  Writeln('Week        : ',WeekOf(D));
  Writeln('Hour        : ',HourOf(D));
  Writeln('Minute      : ',MinuteOf(D));
  Writeln('Second      : ',SecondOf(D));
  Writeln('MilliSecond : ',MilliSecondOf(D));
End.


YearsBetween

Calculate the number of whole years between two DateTime values

Declaration

Source position: dateutil.inc line 256

function YearsBetween(

  const ANow: TDateTime;

  const AThen: TDateTime

):Integer;

Arguments

ANow | First moment in time
AThen | Second moment in time

Function result

Number of whole years between ANow and AThen.

Description

YearsBetween returns the number of whole years between ANow and AThen. This number is an approximation, based on an average number of days of 365.25 per year (average over 4 years). This means the fractional part of a year is dropped.

See also

MonthsBetween | Calculate the number of whole months between two DateTime values
WeeksBetween | Calculate the number of whole weeks between two DateTime values
DaysBetween | Number of whole days between two DateTime values.
HoursBetween | Calculate the number of whole hours between two DateTime values.
MinutesBetween | Calculate the number of whole minutes between two DateTime values.
SecondsBetween | Calculate the number of whole seconds between two DateTime values.
MilliSecondsBetween | Calculate the number of whole milliseconds between two DateTime values.
YearSpan | Calculate the approximate number of years between two DateTime values.

Example

Program Example55;

{ This program demonstrates the YearsBetween function }

Uses SysUtils,DateUtils;

Procedure Test(ANow,AThen : TDateTime);

begin
 Write('Number of years between ');
 Write(DateToStr(AThen),' and ',DateToStr(ANow));
 Writeln(' : ',YearsBetween(ANow,AThen));
end;

Var
  D1,D2 : TDateTime;

Begin
  D1:=Today;
  D2:=Today-364;
  Test(D1,D2);
  D2:=Today-365;
  Test(D1,D2);
  D2:=Today-366;
  Test(D1,D2);
  D2:=Today-390;
  Test(D1,D2);
  D2:=Today-368;
  Test(D1,D2);
  D2:=Today-1000;
  Test(D1,D2);
End.


YearSpan

Calculate the approximate number of years between two DateTime values.

Declaration

Source position: dateutil.inc line 271

function YearSpan(

  const ANow: TDateTime;

  const AThen: TDateTime

):Double;

Arguments

ANow | First moment in time
AThen | Second moment in time

Function result

Number (fractions included) of years between ANow and AThen

Description

YearSpan returns the number of years between ANow and AThen, including any fractional parts of a year. This number is an approximation, based on an average number of days of 365.25 per year (average over 4 years).

See also

MonthSpan | Calculate the approximate number of months between two DateTime values.
WeekSpan | Calculate the approximate number of weeks between two DateTime values.
DaySpan | Calculate the approximate number of days between two DateTime values.
HourSpan | Calculate the approximate number of hours between two DateTime values.
MinuteSpan | Calculate the approximate number of minutes between two DateTime values.
SecondSpan | Calculate the approximate number of seconds between two DateTime values.
MilliSecondSpan | Calculate the approximate number of milliseconds between two DateTime values.
YearsBetween | Calculate the number of whole years between two DateTime values

Example

Program Example63;

{ This program demonstrates the YearSpan function }

Uses SysUtils,DateUtils;

Procedure Test(ANow,AThen : TDateTime);

begin
 Write('Number of years between ');
 Write(DateToStr(AThen),' and ',DateToStr(ANow));
 Writeln(' : ',YearSpan(ANow,AThen));
end;

Var
  D1,D2 : TDateTime;

Begin
  D1:=Today;
  D2:=Today-364;
  Test(D1,D2);
  D2:=Today-365;
  Test(D1,D2);
  D2:=Today-366;
  Test(D1,D2);
  D2:=Today-390;
  Test(D1,D2);
  D2:=Today-368;
  Test(D1,D2);
  D2:=Today-1000;
  Test(D1,D2);
End.


Yesterday

Return the previous day.

Declaration

Source position: dateutil.inc line 110

function Yesterday: TDateTime;

Function result

Previous day as TDateTime.

Description

Yesterday returns yesterday's date. Yesterday is determined from the system clock, i.e. it is Today -1.

See also

Today | Return the current date
Tomorrow | Return the next day

Example

Program Example18;

{ This program demonstrates the Yesterday function }

Uses SysUtils,DateUtils;

Begin
  Writeln(FormatDateTime('"Today is " dd mmmm yyyy',Today));
  Writeln(FormatDateTime('"Yesterday was " dd mmmm yyyy',Yesterday));
End.


AddDisk

[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'Dos' (#rtl)

AddDisk (platform)

Add disk definition to list if drives (Unix only)

Declaration

Source position: dos.pp line 55

function AddDisk(

  const path: string

):Byte;

Description

AddDisk adds a filename S to the internal list of disks. It is implemented for systems which do not use DOS type drive letters. This list is used to determine which disks to use in the DiskFree and DiskSize calls. The DiskFree and DiskSize functions need a file on the specified drive, since this is required for the statfs system call. The names are added sequentially. The Dos initialization code presets the first three disks to:

  • '.' for the current drive,
  • '/fd0/.' for the first floppy-drive (Linux only).
  • '/fd1/.' for the second floppy-drive (Linux only).
  • '/' for the first hard disk.

The first call to AddDisk will therefore add a name for the second harddisk, The second call for the third drive, and so on until 23 drives have been added (corresponding to drives 'D:' to 'Z:')

Errors

None

See also

DiskFree | Get free size on Disk.
DiskSize | Get total size of disk.


DiskFree

Get free size on Disk.

Declaration

Source position: dosh.inc line 98

function DiskFree(

  drive: Byte

):Int64;

Description

DiskFree returns the number of free bytes on a disk. The parameter Drive indicates which disk should be checked. This parameter is 1 for floppy a:, 2 for floppy b:, etc. A value of 0 returns the free space on the current drive.

Remark: For Unices: The diskfree and disksize functions need a file on the specified drive, since this is required for the statfs system call. These filenames are set in the initialization of the Dos unit, and have been preset to :
  • '.' for the current drive,
  • '/fd0/.' for the first floppy-drive (Linux only).
  • '/fd1/.' for the second floppy-drive (Linux only).
  • '/' for the first hard disk.

There is room for 1-26 drives. You can add a drive with the AddDisk procedure. These settings can be coded in dos.pp, in the initialization part.

Errors

-1 when a failure occurs, or an invalid drive number is given.

See also

DiskSize | Get total size of disk.
AddDisk | Add disk definition to list if drives (Unix only)

Example

Program Example6;
uses Dos;

{ Program to demonstrate the DiskSize and DiskFree function. }

begin
  WriteLn('This partition size has ',DiskSize(0),' bytes');
  WriteLn('Currently ',DiskFree(0),' bytes are free');
end.


DiskSize

Get total size of disk.

Declaration

Source position: dosh.inc line 99

function DiskSize(

  drive: Byte

):Int64;

Description

DiskSize returns the total size (in bytes) of a disk. The parameter Drive indicates which disk should be checked. This parameter is 1 for floppy a:, 2 for floppy b:, etc. A value of 0 returns the size of the current drive.

Remark: For Unix only: The diskfree and disksize functions need a file on the specified drive, since this is required for the statfs system call. These filenames are set in the initialization of the Dos unit, and have been preset to :
  • '.' for the current drive,
  • '/fd0/.' for the first floppy-drive (Linux only).
  • '/fd1/.' for the second floppy-drive (Linux only).
  • '/' for the first hard disk.

There is room for 1-26 drives. You can add a drive with the AddDisk procedure. These settings can be coded in dos.pp, in the initialization part.

For an example, see DiskFree.

Errors

-1 when a failure occurs, or an invalid drive number is given.

See also

DiskFree | Get free size on Disk.
AddDisk | Add disk definition to list if drives (Unix only)


DosExitCode

Exit code of last executed program.

Declaration

Source position: dosh.inc line 95

function DosExitCode: Word;

Description

DosExitCode contains (in the low byte) the exit-code of a program executed with the Exec call.

Errors

None.

See also

Exec

Execute another program, and wait for it to finish.

Example

Program Example5;
uses Dos;

{ Program to demonstrate the Exec and DosExitCode function. }

begin
{$IFDEF Unix}
  WriteLn('Executing /bin/ls -la');
  Exec('/bin/ls','-la');
{$ELSE}
  WriteLn('Executing Dir');
  Exec(GetEnv('COMSPEC'),'/C dir');
{$ENDIF}
  WriteLn('Program returned with ExitCode ',Lo(DosExitCode));
end.


DosVersion

Current OS version

Declaration

Source position: dosh.inc line 85

function DosVersion: Word;

Description

DosVersion returns the operating system or kernel version. The low byte contains the major version number, while the high byte contains the minor version number.

Remark: On systems where versions consists of more then two numbers, only the first two numbers will be returned. For example Linux version 2.1.76 will give you DosVersion 2.1. Some operating systems, such as FreeBSD, do not have system calls to return the kernel version, in that case a value of 0 will be returned.

Errors

None.

Example

Program Example1;
uses Dos;

{ Program to demonstrate the DosVersion function. }

var
  OS      : string[32];
  Version : word;
begin
{$IFDEF LINUX}
  OS:='Linux';
{$ENDIF}
{$ifdef FreeBSD}
  OS:='FreeBSD';
{$endif}
{$ifdef NetBSD}
  OS:='NetBSD';
{$endif}
{$ifdef Solaris}
  OS:='Solaris';
{$endif}
{$ifdef QNX}
  OS:='QNX';
{$endif}

{$IFDEF DOS}
  OS:='Dos';
{$ENDIF}
  Version:=DosVersion;
  WriteLn('Current ',OS,' version is ',Lo(Version),'.',Hi(Version));
end.


DTToUnixDate

[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'Dos' (#rtl)

DTToUnixDate (platform)

Convert a DateTime to Unix timestamp

Declaration

Source position: dos.pp line 52

function DTToUnixDate(

  DT: DateTime

):LongInt;

Description

DTToUnixDate converts the DateTime value in DT to a Unix timestamp. It is an internal function, implemented on Unix platforms, and should not be used.

Errors

None.

See also

UnixDateToDT | Convert a Unix timestamp to a DateTime record
PackTime | Pack DateTime value to a packed-time format.
UnpackTime | Unpack packed file time to a DateTime value
GetTime | Return the current time
SetTime | Set system time


EnvCount

Return the number of environment variables

Declaration

Source position: dosh.inc line 114

function EnvCount: LongInt;

Description

EnvCount returns the number of environment variables.

Errors

None.

See also

EnvStr | Return environment variable by index
GetEnv | Get environment variable by name.


EnvStr

Return environment variable by index

Declaration

Source position: dosh.inc line 115

function EnvStr(

  Index: LongInt

):string;

Description

EnvStr returns the Index-th Name=Value pair from the list of environment variables. The index of the first pair is zero.

Errors

The length is limited to 255 characters.

See also

EnvCount | Return the number of environment variables
GetEnv | Get environment variable by name.

Example

Program Example13;
uses Dos;

{ Program to demonstrate the EnvCount and EnvStr function. }

var
  i : Longint;
begin
  WriteLn('Current Environment is:');
  for i:=1 to EnvCount do
   WriteLn(EnvStr(i));
end.


Exec

Execute another program, and wait for it to finish.

Declaration

Source position: dosh.inc line 94

procedure Exec(

  const path: PathStr;

  const comline: ComStr

);

Description

Exec executes the program in Path, with the options given by ComLine. The program name should not appear again in ComLine, it is specified in Path. Comline contains only the parameters that are passed to the program.

After the program has terminated, the procedure returns. The Exit value of the program can be consulted with the DosExitCode function.

For an example, see DosExitCode

Errors

Errors are reported in DosError.

See also

DosExitCode

Exit code of last executed program.


FExpand

Expand a relative path to an absolute path

Declaration

Source position: dosh.inc line 108

function FExpand(

  const path: PathStr

):PathStr;

Description

FExpand takes its argument and expands it to a complete filename, i.e. a filename starting from the root directory of the current drive, prepended with the drive-letter or volume name (when supported).

Remark: On case sensitive file systems (such as Unix and Linux), the resulting name is left as it is, otherwise it is converted to uppercase.

Errors

FSplit

Example

Program Example11;
uses Dos;

{ Program to demonstrate the FExpand function. }

begin
  WriteLn('Expanded Name of this program is ',FExpand(ParamStr(0)));
end.


FindClose

Dispose resources allocated by a FindFirst/FindNext sequence.

Declaration

Source position: dosh.inc line 102

procedure FindClose(

  var f: SearchRec

);

Description

FindClose frees any resources associated with the search record F.

This call is needed to free any internal resources allocated by the FindFirst or FindNext calls.

The Unix implementation of the Dos unit therefore keeps a table of open directories, and when the table is full, closes one of the directories, and reopens another. This system is adequate but slow if you use a lot of searchrecs.

So, to speed up the findfirst/findnext system, the FindClose call was implemented. When you don't need a searchrec any more, you can tell this to the Dos unit by issuing a FindClose call. The directory which is kept open for this searchrec is then closed, and the table slot freed.

Remark: It is recommended to use the Linux call Glob when looking for files on Linux.

Errors

Errors are reported in DosError.

See also

FindFirst | Start search for one or more files.
FindNext | Find next matching file after FindFirst


FindFirst

Start search for one or more files.

Declaration

Source position: dosh.inc line 100

procedure FindFirst(

  const path: PathStr;

  attr: Word;

  var f: SearchRec

);

Description

FindFirst searches the file specified in Path. Normal files, as well as all special files which have the attributes specified in Attr will be returned.

It returns a SearchRec record for further searching in F. Path can contain the wildcard characters ? (matches any single character) and * (matches 0 ore more arbitrary characters). In this case FindFirst will return the first file which matches the specified criteria. If DosError is different from zero, no file(s) matching the criteria was(were) found.

Remark: On the EMX target, you cannot issue two different FindFirst calls. That is, you must close any previous search operation with FindClose before starting a new one. Failure to do so will end in a Run-Time Error 6 (Invalid file handle)

Errors

Errors are reported in DosError.

See also

FindNext | Find next matching file after FindFirst
FindClose | Dispose resources allocated by a FindFirst/FindNext sequence.

Example

Program Example7;
uses Dos;

{ Program to demonstrate the FindFirst and FindNext function. }

var
  Dir : SearchRec;
begin
  FindFirst('*.*',archive,Dir);
  WriteLn('FileName'+Space(32),'FileSize':9);
  while (DosError=0) do
   begin
     Writeln(Dir.Name+Space(40-Length(Dir.Name)),Dir.Size:9);
     FindNext(Dir);
   end;
  FindClose(Dir);
end.


FindNext

Find next matching file after FindFirst

Declaration

Source position: dosh.inc line 101

procedure FindNext(

  var f: SearchRec

);

Description

FindNext takes as an argument a SearchRec from a previous FindNext call, or a FindFirst call, and tries to find another file which matches the criteria, specified in the FindFirst call. If DosError is different from zero, no more files matching the criteria were found.

For an example, see FindFirst.

Errors

DosError is used to report errors.

See also

FindFirst | Start search for one or more files.
FindClose | Dispose resources allocated by a FindFirst/FindNext sequence.


FSearch

Search a file in searchpath

Declaration

Source position: dosh.inc line 107

function FSearch(

  path: PathStr;

  dirlist: string

):PathStr;

Description

FSearch searches the file Path in all directories listed in DirList. The full name of the found file is returned. DirList must be a list of directories, separated by semi-colons. When no file is found, an empty string is returned.

Remark: On Unix systems, DirList can also be separated by colons, as is customary on those environments.

Errors

None.

See also

FExpand

Expand a relative path to an absolute path

Example

program Example10;

uses Dos;

{ Program to demonstrate the FSearch function. }

var s:pathstr;

begin
  s:=FSearch(ParamStr(1),GetEnv('PATH'));
  if s='' then
    WriteLn(ParamStr(1),' not Found in PATH')
  else
    Writeln(ParamStr(1),' Found in PATH at ',s);
end.


FSplit

Split a full-path filename in parts.

Declaration

Source position: dosh.inc line 109

procedure FSplit(

  path: PathStr;

  var dir: DirStr;

  var name: NameStr;

  var ext: ExtStr

);

Description

FSplit splits a full file name into 3 parts : A Path, a Name and an extension (in ext.) The extension is taken to be all letters after the last dot (.). For Dos, however, an exception is made when LFNSupport=False, then the extension is defined as all characters after the first dot.

Errors

None.

See also

FSearch

Search a file in searchpath

Example

program Example12;

uses Dos;

{ Program to demonstrate the FSplit function. }

var dir:dirstr;
    name:namestr;
    ext:extstr;

begin
  FSplit(ParamStr(1),dir,name,ext);
  WriteLn('Splitted ',ParamStr(1),' in:');
  WriteLn('Path     : ',dir);
  WriteLn('Name     : ',name);
  WriteLn('Extension: ',ext);
end.


GetCBreak

Get control-Break flag

Declaration

Source position: dosh.inc line 121

procedure GetCBreak(

  var breakvalue: Boolean

);

Description

GetCBreak gets the status of CTRL-Break checking under Dos and Amiga. When BreakValue is false, then Dos only checks for the CTRL-Break key-press when I/O is performed. When it is set to True, then a check is done at every system call.

Remark: Under non-Dos and non-Amiga operating systems, BreakValue always returns True.

Errors

None

See also

SetCBreak

Set Control-Break flag status


GetDate

Get the current date

Declaration

Source position: dosh.inc line 86

procedure GetDate(

  var year: Word;

  var month: Word;

  var mday: Word;

  var wday: Word

);

Description

GetDate returns the system's date. Year is a number in the range 1980..2099.mday is the day of the month, wday is the day of the week, starting with Sunday as day 0.

Errors

None.

See also

GetTime | Return the current time
SetDate | Set system date

Example

Program Example2;
uses Dos;

{ Program to demonstrate the GetDate function. }

const
  DayStr:array[0..6] of string[3]=('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
  MonthStr:array[1..12] of string[3]=('Jan','Feb','Mar','Apr','May','Jun',
                                      'Jul','Aug','Sep','Oct','Nov','Dec');
var
  Year,Month,Day,WDay : word;
begin
  GetDate(Year,Month,Day,WDay);
  WriteLn('Current date');
  WriteLn(DayStr[WDay],', ',Day,' ',MonthStr[Month],' ',Year,'.');
end.


GetEnv

Get environment variable by name.

Declaration

Source position: dosh.inc line 116

function GetEnv(

  envvar: string

):string;

Description

Getenv returns the value of the environment variable EnvVar. When there is no environment variable EnvVar defined, an empty string is returned.

Remark: Under some operating systems (such as Unix), case is important when looking for EnvVar.

Errors

None.

See also

EnvCount | Return the number of environment variables
EnvStr | Return environment variable by index

Example

Program Example14;
uses Dos;

{ Program to demonstrate the GetEnv function. }

begin
  WriteLn('Current PATH is ',GetEnv('PATH'));
end.


GetFAttr

Get file attributes

Declaration

Source position: dosh.inc line 105

procedure GetFAttr(

  var f;

  var attr: Word

);

Description

GetFAttr returns the file attributes of the file-variable f. F can be a untyped or typed file, or of type Text. f must have been assigned, but not opened. The attributes can be examined with the following constants :

  • ReadOnly
  • Hidden
  • SysFile
  • VolumeId
  • Directory
  • Archive

Under Linux, supported attributes are:

  • Directory
  • ReadOnly if the current process doesn't have access to the file.
  • Hidden for files whose name starts with a dot ('.').

Errors

Errors are reported in DosError

See also

SetFAttr

Set file attributes

Example

Program Example8;
uses Dos;

{ Program to demonstrate the GetFAttr function. }

var
  Attr : Word;
  f    : File;
begin
  Assign(f,ParamStr(1));
  GetFAttr(f,Attr);
  WriteLn('File ',ParamStr(1),' has attribute ',Attr);
  if (Attr and archive)<>0 then WriteLn('- Archive');
  if (Attr and directory)<>0 then WriteLn('- Directory');
  if (Attr and readonly)<>0 then WriteLn('- Read-Only');
  if (Attr and sysfile)<>0 then WriteLn('- System');
  if (Attr and hidden)<>0 then WriteLn('- Hidden');
end.


GetFTime

Get file last modification time.

Declaration

Source position: dosh.inc line 106

procedure GetFTime(

  var f;

  var time: LongInt

);

Description

GetFTime returns the modification time of a file. This time is encoded and must be decoded with UnPackTime. F must be a file type, which has been assigned, and opened.

Errors

Errors are reported in DosError

See also

SetFTime | Set file modification time.
PackTime | Pack DateTime value to a packed-time format.
UnPackTime | Unpack packed file time to a DateTime value

Example

Program Example9;
uses Dos;

{ Program to demonstrate the GetFTime function. }

Function L0(w:word):string;
var
  s : string;
begin
  Str(w,s);
  if w<10 then
   L0:='0'+s
  else
   L0:=s;
end;

var
  f    : File;
  Time : Longint;
  DT   : DateTime;
begin
  if Paramcount>0 then
    Assign(f,ParamStr(1))
  else
    Assign(f,'ex9.pp' );
  Reset(f);
  GetFTime(f,Time);
  Close(f);
  UnPackTime(Time,DT);
  Write ('File ',ParamStr(1),' is last modified on ');
  Writeln (L0(DT.Month),'-',L0(DT.Day),'-',DT.Year,
           ' at ',L0(DT.Hour),':',L0(DT.Min));
end.


GetIntVec

Get interrupt vector

Declaration

Source position: dosh.inc line 128

procedure GetIntVec(

  intno: Byte;

  var vector: pointer

);

Description

GetIntVec returns the address of interrupt vector IntNo.

Remark: This call does nothing, it is present for compatibility only. Modern systems do not allow low level access to the hardware.

Errors

None.

See also

SetIntVec

Set interrupt vector


GetLongName

Get the long filename of a DOS 8.3 filename.

Declaration

Source position: dosh.inc line 111

function GetLongName(

  var p: string

):Boolean;

Description

This function is only implemented in the GO32V2 and Win32 versions of Free Pascal.

GetLongName changes the filename p to a long filename if the API call to do this is successful. The resulting string is the long file name corresponding to the short filename p.

The function returns True if the API call was successful, False otherwise.

This function should only be necessary when using the DOS extender under Windows 95 and higher.

Errors

If the API call was not succesfull, False is returned.

See also

GetShortName

Get the short (8.3) filename of a long filename.


GetMsCount

Number of milliseconds since a starting point.

Declaration

Source position: dosh.inc line 133

function GetMsCount: Int64;

Description

GetMSCount returns a number of milliseconds elapsed since a certain moment in time. This moment in time is implementation dependent. This function is used for timing purposes: Substracting the results of 2 subsequent calls to this function returns the number of milliseconds elapsed between the two calls.

This call is not very reliable, it is recommended to use some system specific calls for timings.

See also

GetTime

Return the current time


GetShortName

Get the short (8.3) filename of a long filename.

Declaration

Source position: dosh.inc line 110

function GetShortName(

  var p: string

):Boolean;

Description

This function is only implemented in the GO32V2 and Win32 versions of Free Pascal.

GetShortName changes the filename p to a short filename if the API call to do this is successful. The resulting string is the short file name corresponding to the long filename p.

The function returns True if the API call was successful, False otherwise.

This function should only be necessary when using the DOS extender under Windows 95 and higher.

Errors

If the API call was not successful, False is returned.

See also

GetLongName

Get the long filename of a DOS 8.3 filename.


GetTime

Return the current time

Declaration

Source position: dosh.inc line 87

procedure GetTime(

  var hour: Word;

  var minute: Word;

  var second: Word;

  var sec100: Word

);

Description

GetTime returns the system's time. Hour is a on a 24-hour time scale. sec100 is in hundredth of a second.

Remark: Certain operating systems (such as Amiga), always set the sec100 field to zero.

Errors

None.

See also

GetDate | Get the current date
SetTime | Set system time

Example

Program Example3;
uses Dos;

{ Program to demonstrate the GetTime function. }

Function L0(w:word):string;
var
  s : string;
begin
  Str(w,s);
  if w<10 then
   L0:='0'+s
  else
   L0:=s;
end;

var
  Hour,Min,Sec,HSec : word;
begin
  GetTime(Hour,Min,Sec,HSec);
  WriteLn('Current time');
  WriteLn(L0(Hour),':',L0(Min),':',L0(Sec));
end.


GetVerify

Get verify flag

Declaration

Source position: dosh.inc line 123

procedure GetVerify(

  var verify: Boolean

);

Description

GetVerify returns the status of the verify flag under Dos. When Verify is True, then Dos checks data which are written to disk, by reading them after writing. If Verify is False, then data written to disk are not verified.

Remark: Under non-Dos systems (excluding EMX applications running under vanilla DOS), Verify is always True.

Errors

None.

See also

SetVerify

Set verify flag


Intr

Execute interrupt

Declaration

Source position: dosh.inc line 80

procedure Intr(

  intno: Byte;

  var regs: Registers

);

Description

Intr executes a software interrupt number IntNo (must be between 0 and 255), with processor registers set to Regs. After the interrupt call returned, the processor registers are saved in Regs.

Remark: Under non-Dos operating systems, this call does nothing.

Errors

None.

See also

MSDos

Execute MS-DOS system call


Keep

Terminate and stay resident.

Declaration

Source position: dosh.inc line 130

procedure Keep(

  exitcode: Word

);

Description

Keep terminates the program, but stays in memory. This is used for TSR (Terminate Stay Resident) programs which catch some interrupt. ExitCode is the same parameter as the Halt function takes.

Remark: This call does nothing, it is present for compatibility only.

Errors

None.


MSDos

Execute MS-DOS system call

Declaration

Source position: dosh.inc line 81

procedure MSDos(

  var regs: Registers

);

Description

MSDos executes an operating system call. This is the same as doing a Intr call with the interrupt number for an os call.

Remark: Under non-Dos operating systems, this call does nothing. On DOS systems, this calls interrupt $21.

Errors

None.

See also

Intr

Execute interrupt


PackTime

Pack DateTime value to a packed-time format.

Declaration

Source position: dosh.inc line 91

procedure PackTime(

  var t: DateTime;

  var p: LongInt

);

Description

UnPackTime converts the date and time specified in T to a packed-time format which can be fed to SetFTime.

Errors

None.

See also

SetFTime | Set file modification time.
FindFirst | Start search for one or more files.
FindNext | Find next matching file after FindFirst
UnPackTime | Unpack packed file time to a DateTime value

Example

Program Example4;
uses Dos;

{ Program to demonstrate the PackTime and UnPackTime functions. }

var
  DT   : DateTime;
  Time : longint;
begin
  with DT do
   begin
     Year:=2008;
     Month:=11;
     Day:=11;
     Hour:=11;
     Min:=11;
     Sec:=11;
   end;
  PackTime(DT,Time);
  WriteLn('Packed Time : ',Time);
  UnPackTime(Time,DT);
  WriteLn('Unpacked Again:');
  with DT do
   begin
     WriteLn('Year  ',Year);
     WriteLn('Month ',Month);
     WriteLn('Day   ',Day);
     WriteLn('Hour  ',Hour);
     WriteLn('Min   ',Min);
     WriteLn('Sec   ',Sec);
   end;
end.


SetCBreak

Set Control-Break flag status

Declaration

Source position: dosh.inc line 122

procedure SetCBreak(

  breakvalue: Boolean

);

Description

SetCBreak sets the status of CTRL-Break checking. When BreakValue is false, then Dos only checks for the CTRL-Break key-press when I/O is performed. When it is set to True, then a check is done at every system call.

Remark: Under non-Dos and non-Amiga operating systems, this call does nothing.

Errors

None.

See also

GetCBreak

Get control-Break flag


SetDate

Set system date

Declaration

Source position: dosh.inc line 88

procedure SetDate(

  year: Word;

  month: Word;

  day: Word

);

Description

SetDate sets the system's internal date. Year is a number between 1980 and 2099.

Remark: On a Unix machine, there must be root privileges, otherwise this routine will do nothing. On other Unix systems, this call currently does nothing.

Errors

None.

See also

GetDate | Get the current date
SetTime | Set system time


SetFAttr

Set file attributes

Declaration

Source position: dosh.inc line 119

procedure SetFAttr(

  var f;

  attr: Word

);

Description

SetFAttr sets the file attributes of the file-variable F. F can be a untyped or typed file, or of type Text. F must have been assigned, but not opened. The attributes can be a sum of the following constants:

  • ReadOnly
  • Hidden
  • SysFile
  • VolumeId
  • Directory
  • Archive
Remark: Under Unix like systems (such as Linux and BeOS) the call exists, but is not implemented, i.e. it does nothing.

Errors

Errors are reported in DosError.

See also

GetFAttr

Get file attributes


SetFTime

Set file modification time.

Declaration

Source position: dosh.inc line 120

procedure SetFTime(

  var f;

  time: LongInt

);

Description

SetFTime sets the modification time of a file, this time is encoded and must be encoded with PackTime. F must be a file type, which has been assigned, and opened.

Remark: Under Unix like systems (such as Linux and BeOS) the call exists, but is not implemented, i.e. it does nothing.

Errors

Errors are reported in DosError

See also

GetFTime | Get file last modification time.
PackTime | Pack DateTime value to a packed-time format.
UnPackTime | Unpack packed file time to a DateTime value


SetIntVec

Set interrupt vector

Declaration

Source position: dosh.inc line 129

procedure SetIntVec(

  intno: Byte;

  vector: pointer

);

Description

SetIntVec sets interrupt vector IntNo to Vector. Vector should point to an interrupt procedure.

Remark: This call does nothing, it is present for compatibility only.

Errors

None.

See also

GetIntVec

Get interrupt vector


SetTime

Set system time

Declaration

Source position: dosh.inc line 89

procedure SetTime(

  hour: Word;

  minute: Word;

  second: Word;

  sec100: Word

);

Description

SetTime sets the system's internal clock. The Hour parameter is on a 24-hour time scale.

Remark: On a Linux machine, there must be root privileges, otherwise this routine will do nothing. On other Unix systems, this call currently does nothing.

Errors

None.

See also

GetTime | Return the current time
SetDate | Set system date


SetVerify

Set verify flag

Declaration

Source position: dosh.inc line 124

procedure SetVerify(

  verify: Boolean

);

Description

SetVerify sets the status of the verify flag under Dos. When Verify is True, then Dos checks data which are written to disk, by reading them after writing. If Verify is False, then data written to disk are not verified.

Remark: Under non-Dos operating systems (excluding EMX applications running under vanilla Dos), Verify is always True.

Errors

None.

See also

SetVerify

Set verify flag


SwapVectors

Swap interrupt vectors

Declaration

Source position: dosh.inc line 127

procedure SwapVectors;

Description

SwapVectors swaps the contents of the internal table of interrupt vectors with the current contents of the interrupt vectors. This is called typically in before and after an Exec call.

Remark: Under certain operating systems, this routine may be implemented as an empty stub.

Errors

None.

See also

Exec | Execute another program, and wait for it to finish.
SetIntVec | Set interrupt vector


UnixDateToDt

[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'Dos' (#rtl)

UnixDateToDt (platform)

Convert a Unix timestamp to a DateTime record

Declaration

Source position: dos.pp line 51

procedure UnixDateToDt(

  SecsPast: LongInt;

  var Dt: DateTime

);

Description

DTToUnixDate converts the Unix timestamp value in SecsPast to a DateTime representation in DT. It is an internal function, implemented on Unix platforms, and should not be used.

Errors

None.

See also

DTToUnixDate | Convert a DateTime to Unix timestamp
PackTime | Pack DateTime value to a packed-time format.
UnpackTime | Unpack packed file time to a DateTime value
GetTime | Return the current time
SetTime | Set system time


UnpackTime

Unpack packed file time to a DateTime value

Declaration

Source position: dosh.inc line 90

procedure UnpackTime(

  p: LongInt;

  var t: DateTime

);

Description

UnPackTime converts the file-modification time in p to a DateTime record. The file-modification time can be returned by GetFTime, FindFirst or FindNext calls.

For an example, see PackTime.

Errors

None.

See also

GetFTime | Get file last modification time.
FindFirst | Start search for one or more files.
FindNext | Find next matching file after FindFirst
PackTime | Pack DateTime value to a packed-time format.


weekday

[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'Dos' (#rtl)

weekday (platform)

Return the day of the week

Declaration

Source position: dos.pp line 50

function weekday(

  y: LongInt;

  m: LongInt;

  d: LongInt

):LongInt;

Description

WeekDay returns the day of the week on which the day Y/M/D falls. Sunday is represented by 0, Saturday is 6.

Errors

On error, -1 is returned.

See also

PackTime | Pack DateTime value to a packed-time format.
UnpackTime | Unpack packed file time to a DateTime value
GetTime | Return the current time
SetTime | Set system time


dxe_load

Load DXE file in memory

Declaration

Source position: dxeload.pp line 22

function dxe_load(

  filename: string

):pointer;

Description

dxe_load loads the contents of the file filename into memory. It performs the necessary relocations in the object code, and returns then a pointer to the entry point of the code.

For an example, see the emu387 unit in the RTL.

Errors

If an error occurs during the load or relocations, Nil is returned.


FreeLibrary

For compatibility with Delphi/Windows: Unload a library

Declaration

Source position: dynlibs.pas line 57

function FreeLibrary(

  Lib: TLibHandle

):Boolean;

Description

FreeLibrary provides the same functionality as UnloadLibrary, and is provided for compatibility with Delphi.

See also

UnloadLibrary

Unload a previously loaded library


GetLoadErrorStr

Return a textual description of the last load error

Declaration

Source position: dynlibs.pas line 53

function GetLoadErrorStr: string;

Description

GetLoadErrorStr returns a textual description of the last library loading or unloading error. No other system calls may be made between the load call and the call of GetLoadErrorStr

See also

LoadLibrary

Load a dynamic library and return a handle to it.


GetProcAddress

For compatibility with Delphi/Windows: Get the address of a procedure

Declaration

Source position: dynlibs.pas line 58

function GetProcAddress(

  Lib: TLibHandle;

  const ProcName: AnsiString

):Pointer;

Description

GetProcAddress provides the same functionality as GetProcedureAddress, and is provided for compatibility with Delphi.

See also

GetProcedureAddress

Get the address of a procedure or symbol in a dynamic library.


GetProcedureAddress

Get the address of a procedure or symbol in a dynamic library.

Declaration

Source position: dynlibs.pas line 50

function GetProcedureAddress(

  Lib: TLibHandle;

  const ProcName: AnsiString

):Pointer;

function GetProcedureAddress(

  Lib: TLibHandle;

  Ordinal: TOrdinalEntry

):Pointer;

Description

GetProcedureAddress returns a pointer to the location in memory of the symbol ProcName or ordinal value Ordinal in the dynamically loaded library specified by it's handle lib. If the symbol cannot be found or the handle is invalid, Nil is returned.

On Windows, only an exported procedure or function can be searched this way. On Unix platforms the location of any exported symbol can be retrieved this way.

Only windows and OS/2 support getting the address of a function using an ordinal value.

Errors

If the symbol cannot be found, Nil is returned.

See also

LoadLibrary | Load a dynamic library and return a handle to it.
UnLoadLibrary | Unload a previously loaded library


LoadLibrary

Load a dynamic library and return a handle to it.

Declaration

Source position: dynlibs.pas line 46

function LoadLibrary(

  const Name: RawByteString

):TLibHandle;

function LoadLibrary(

  const Name: UnicodeString

):TLibHandle;

Description

LoadLibrary loads a dynamic library in file Name and returns a handle to it. If the library cannot be loaded, NilHandle is returned.

No assumptions should be made about the location of the loaded library if a relative pathname is specified. The behaviour is dependent on the platform. Therefore it is best to specify an absolute pathname if possible.

Errors

On error, NilHandle is returned.

See also

UnloadLibrary | Unload a previously loaded library
GetProcedureAddress | Get the address of a procedure or symbol in a dynamic library.


SafeLoadLibrary

Saves the control word and loads a library

Declaration

Source position: dynlibs.pas line 45

function SafeLoadLibrary(

  const Name: RawByteString

):TLibHandle;

function SafeLoadLibrary(

  const Name: UnicodeString

):TLibHandle;

Description

SafeLoadLibary saves the FPU control word, and calls LoadLibrary with library name Name. After that function has returned, the FPU control word is saved again. (only on Intel i386 CPUS).

See also

LoadLibrary

Load a dynamic library and return a handle to it.


UnloadLibrary

Unload a previously loaded library

Declaration

Source position: dynlibs.pas line 52

function UnloadLibrary(

  Lib: TLibHandle

):Boolean;

Description

UnloadLibrary unloads a previously loaded library (specified by the handle lib). The call returns True if succesful, False otherwisa.

Errors

On error, False is returned.

See also

LoadLibrary | Load a dynamic library and return a handle to it.
GetProcedureAddress | Get the address of a procedure or symbol in a dynamic library.


npxsetup

Set up coprocessor emulation.

Declaration

Source position: emu387.pp line 18

procedure npxsetup(

  prog_name: string

);

Description

npxsetup checks whether a coprocessor is found. If not, it loads the file wmemu387.dxe into memory and initializes the code in it.

If the environment variable 387 is set to N, then the emulation will be loaded, even if there is a coprocessor present. If the variable doesn't exist, or is set to any other value, the unit will try to detect the presence of a coprocessor unit.

The function searches the file wmemu387.dxe in the following way:

  1. If the environment variable EMU387 is set, then it is assumed to point at the wmemu387.dxe file.
  2. if the environment variable EMU387 does not exist, then the function will take the path part of prog_name and look in that directory for the file wmemu387.dxe.

It should never be necessary to call this function, because the initialization code of the unit contains a call to the function with as an argument paramstr(0). This means that you should deliver the file wmemu387.dxe together with your program.

Errors

If there is an error, an error message is printed to standard error, and the program is halted, since any floating-point code is bound to fail anyhow.


PError

Print error on standard error routput

Declaration

Source position: errors.pp line 23

procedure PError(

  const s: string;

  Errno: cint

);

Arguments

s | Short message to print before error number
Errno | Error number to print, followed by corresponding error text

Description

PError will print the error message S followed by the errNo and the result for StrError(errNo) for ErrNo on standard output.

Errors

None.

See also

StrError

Convert an error code to a string


StrError

Convert an error code to a string

Declaration

Source position: errors.pp line 22

function StrError(

  err: cint

):string;

Arguments

err

Error code to return string from

Function result

Error message corresponding to error code Err

Description

StrError will convert the error code err to a string.

Errors

If the error code is unknown or out of bounds, an 'Unknown error (err)' string will be returned.

See also

PError

Print error on standard error routput


CloseExeFile

Close a previously opened file.

Declaration

Source position: exeinfo.pp line 53

function CloseExeFile(

  var e: TExeFile

):Boolean;

Arguments

e

Executable to be closed

Function result

True if the file was closed succesfully, False if not.

Description

CloseExeFile closes an executable file image previously opened with OpenExeFile, and represented by e.

The function returns True if the file was closed succesfully, or False if something went wrong.

Errors

In case of an error, False is returned.

See also

OpenExeFile

Open an executable file


FindExeSection

Find a section in the binary image.

Declaration

Source position: exeinfo.pp line 52

function FindExeSection(

  var e: TExeFile;

  const secname: string;

  var secofs: LongInt;

  var seclen: LongInt

):Boolean;

Arguments

e | Record representing the opened executable image
secname | Name of section that must be found
secofs | Offset of the section in the binary image.
seclen | Length of the section in bytes.

Function result

True if the section was found, False if not

Description

FindExeSection examines the binary that was opened with OpenExeFile (represented by e) and searches for the section named secname. If found, the section offset is returned in secofs and the section length (in bytes) is returned in seclen.

The function returns True if the section was found, False if not.

See also

OpenExeFile

Open an executable file


GetModuleByAddr

Return the module name by address

Declaration

Source position: exeinfo.pp line 56

procedure GetModuleByAddr(

  addr: pointer;

  var baseaddr: pointer;

  var filename: string

);

Arguments

addr | Address to examine
baseaddr | Base address at which module is loaded.
filename | FileName of the module at address addr.

Description

GetModuleByAddr returns the name of the module that contains address addr. If succesful, it returns True and returns the filename in FileName and the base address at which it is loaded in BaseAddr.


OpenExeFile

Open an executable file

Declaration

Source position: exeinfo.pp line 51

function OpenExeFile(

  var e: TExeFile;

  const fn: string

):Boolean;

Arguments

e | Record to be used in other calls in this unit.
fn | Name of file to be opened.

Function result

True if the file was opened succesfully, false otherwise.

Description

OpenExeFile opens the executable file fn and initializes the structure e for subsequent calls to routines in the exeinfo unit.

The function returns True if the file was opened succesfully, false otherwise.

See also

FindExeSection | Find a section in the binary image.
CloseExeFile | Close a previously opened file.
ReadDebugLink | Read the location of a debug info filename


ReadDebugLink

Read the location of a debug info filename

Declaration

Source position: exeinfo.pp line 54

function ReadDebugLink(

  var e: TExeFile;

  var dbgfn: string

):Boolean;

Arguments

e | Handle on the open application binary.
dbgfn | Name of the file with the debug information.

Function result

True if the file with debug information was found, False if not.

Description

ReadDebugLink examines the .gnu_debuglink section to see if the debug information is stored in an external file. If so, then the name of the file with the debug information is returned in the dbgfn parameter.

The function returns false if there is no external debug information file, or if the file with debug information does not exist. It is searched next to the binary file or in the current directory.

See also

OpenExeFile | Open an executable file
CloseExeFile | Close a previously opened file.


GetActiveCollation

Return the currently active collation for the current thread

Declaration

Source position: fpwidestring.pp line 13

function GetActiveCollation: PUCA_DataBook;

Function result

The currently active collation for this thread

Description

GetActiveCollation returns the currently active collation, for the current thread, as set using the SetActiveCollation function.

New threads get DefaultCollationName as the active collation name. The collation can be changed per thread using the SetActiveCollation function.

Errors

None.

See also

SetActiveCollation | Set the active collation for the current thread.
DefaultCollationName | Default collation for new threads.


SetActiveCollation

Set the active collation for the current thread.

Declaration

Source position: fpwidestring.pp line 11

function SetActiveCollation(

  const AName: TCollationName

):Boolean;

function SetActiveCollation(

  const ACollation: PUCA_DataBook

):Boolean;

Arguments

AName

Name with which the collation was registered

Function result

True if the collation was succesfully set

Arguments

ACollation

Actual collation data to set as active collation

Description

SetActiveCollation sets the collation used in the current thread of the application. This can be done using the name of the collation (AName) as registered or in the unicodedata unit or using the actual collation data (ACollation).

Errors

If the collation AName was not found, or ACollation is nil, then False is returned.

See also

GetActiveCollation | Return the currently active collation for the current thread
DefaultCollationName | Default collation for new threads.


GetLongOpts

Return next long option.

Declaration

Source position: getopts.pp line 46

function GetLongOpts(

  ShortOpts: string;

  LongOpts: POption;

  var Longind: LongInt

):Char;

Description

Returns the next option found on the command-line, taking into account long options as well. If no more options are found, returns EndOfOptions. If the option requires an argument, it is returned in the OptArg variable.

if any of the option definitions in LongOpts array has the Flag pointer set, then the return value is the null character (#0 or char(0)) and the actual option letter is written in the location pointed to by Flag.

ShortOptions is a string containing all possible one-letter options. (see Getopt for its description and use) LongOpts is a pointer to the first element of an array of Option records, the last of which needs a name of zero length.

The function tries to match the names even partially (i.e. --app will match e.g. the append option), but will report an error in case of ambiguity.

If the option needs an argument, set Has_arg to Required_argument (1), if the option optionally has an argument, set Has_arg to Optional_argument (2). If the option needs no argument, set Has_arg to zero.

Required arguments can be specified in two ways :

  1. Pasted to the option : --option=value
  2. As a separate argument : --option value

Optional arguments can only be specified through the first method.

Errors

see Getopt.

See also

Getopt

Get next short option.


GetOpt

Get next short option.

Declaration

Source position: getopts.pp line 45

function GetOpt(

  ShortOpts: string

):Char;

Description

Returns the next option found on the command-line. If no more options are found, returns EndOfOptions. If the option requires an argument, it is returned in the OptArg variable.

ShortOptions is a string containing all possible one-letter options. If a letter is followed by a colon (:), then that option needs an argument. If a letter is followed by 2 colons, the option has an optional argument. If the first character of shortoptions is a '+' then options following a non-option are regarded as non-options (standard Unix behavior). If it is a '-', then all non-options are treated as arguments of a option with character #0. This is useful for applications that require their options in the exact order as they appear on the command-line. If the first character of shortoptions is none of the above, options and non-options are permuted, so all non-options are behind all options. This allows options and non-options to be in random order on the command line.

Errors

Errors are reported through giving back a '?' character. OptOpt then gives the character which caused the error. If OptErr is True then getopt prints an error-message to stdout.

See also

GetLongOpts

Return next long option.

Example

program testopt;

{ Program to depmonstrate the getopts function. }

{
  Valid calls to this program are
  optex --verbose --add me --delete you
  optex --append --create child
  optex -ab -c me -d you
  and so on
}
uses getopts;

var c : char;
    optionindex : Longint;
    theopts : array[1..7] of TOption;

begin
  with theopts[1] do
   begin
    name:='add';
    has_arg:=1;
    flag:=nil;
    value:=#0;
  end;
  with theopts[2] do
   begin
    name:='append';
    has_arg:=0;
    flag:=nil;
    value:=#0;
  end;
  with theopts[3] do
   begin
    name:='delete';
    has_arg:=1;
    flag:=nil;
    value:=#0;
  end;
  with theopts[4] do
   begin
    name:='verbose';
    has_arg:=0;
    flag:=nil;
    value:=#0;
  end;
  with theopts[5] do
   begin
    name:='create';
    has_arg:=1;
    flag:=nil;
    value:='c'
  end;
  with theopts[6] do
   begin
    name:='file';
    has_arg:=1;
    flag:=nil;
    value:=#0;
  end;
  with theopts[7] do
   begin
    name:='';
    has_arg:=0;
    flag:=nil;
  end;
  c:=#0;
  repeat
    c:=getlongopts('abc:d:012',@theopts[1],optionindex);
    case c of
      '1','2','3','4','5','6','7','8','9' :
        begin
        writeln ('Got optind : ',c)
        end;
      #0 : begin
           write ('Long option : ',theopts[optionindex].name);
           if theopts[optionindex].has_arg>0 then
             writeln (' With value  : ',optarg)
           else
             writeln
           end;
      'a' : writeln ('Option a.');
      'b' : writeln ('Option b.');
      'c' : writeln ('Option c : ', optarg);
      'd' : writeln ('Option d : ', optarg);
      '?',':' : writeln ('Error with opt : ',optopt);
   end; { case }
 until c=endofoptions;
 if optind<=paramcount then
    begin
    write ('Non options : ');
    while optind<=paramcount do
      begin
      write (paramstr(optind),' ');
      inc(optind)
      end;
    writeln
    end
end.


allocate_ldt_descriptors

Allocate a number of descriptors

Declaration

Source position: go32.pp line 87

function allocate_ldt_descriptors(

  count: Word

):Word;

Description

Allocates a number of new descriptors.

Parameters:

count:\
specifies the number of requested unique descriptors.

Return value: The base selector.

Remark: Notes: The descriptors allocated must be initialized by the application with other function calls. This function returns descriptors with a limit and size value set to zero. If more than one descriptor was requested, the function returns a base selector referencing the first of a contiguous array of descriptors. The selector values for subsequent descriptors in the array can be calculated by adding the value returned by the get_next_selector_increment_value function.

Errors

Check the int31error variable.

See also

free_ldt_descriptor | Free a descriptor
get_next_selector_increment_value | Return selector increment value
segment_to_descriptor | Map segment address to descriptor
create_code_segment_alias_descriptor | Create new descriptor from existing descriptor
set_segment_limit | Set descriptor limit
set_segment_base_address | Set descriptor's base address

Example

{
This example demonstrates the usage of descriptors and the effects of
changing its limit and base address.

In more detail, the program fills the region described by an
allocated descriptor in text screen memory with various characters.
Before doing this it saves the entire screen contents to the heap and
restores it afterwards.

Some additional background:

The text screen of a VGA card has it's address space at $B800:0;
screen memory is organized in a linear fashion, e.g. the second line
comes directly after the first, where each cell occupies 2 bytes of
memory (1 byte character data, 1 byte attributes). It is 32 kb in
size.

Hence the offset of a single memory cell from its origin is:

        Y * columns * 2 + X * 2

where X and Y mark the point and columns is the number of character
cells per line
}
{$mode delphi}
uses
        crt,
        go32;

const
        { screen x and y dimensions }
        maxx = 80;
        maxy = 25;
        { bytes used for every character cell }
        bytespercell = 2;
        { screen size in bytes }
        screensize = maxx * maxy * bytespercell;

        { the linear address of $B800:0 }
        linB8000 = $B800 * 16;

type
        string80 = string[80];

var
        { holds the old screen contents }
        text_save : array[0..screensize-1] of byte;
        { old cursor x and y coordinates }
        text_oldx, text_oldy : Word;

        { selector to the text mode screen }
        text_sel : Word;

{ prints a status message on the first line of the screen and then
waits for a keypress }
procedure status(s : string80);
begin
     gotoxy(1, 1); clreol; write(s); readkey;
end;

{ writes some descriptor info on the last 2 lines }
procedure selinfo(sel : Word);
begin
     gotoxy(1, 24);
     clreol; writeln('Descriptor base address : $',
        hexstr(get_segment_base_address(sel), 8));
     clreol; write('Descriptor limit : ', get_segment_limit(sel));
end;

{ returns a 2 byte character cell, which includes character data
and its color attributes }
function makechar(ch : char; color : byte) : Word;
begin
     result := byte(ch) or (color shl 8);
end;

begin
     { save original screen contents to variable, this time by using
     seg_move() and the dosmemselector variable }
     seg_move(dosmemselector, linB8000, get_ds, longint(@text_save),
        screensize);
     { additionally we have to save the old screen cursor
     coordinates }
     text_oldx := wherex; text_oldy := wherey;
     { clear the whole screen }
     seg_fillword(dosmemselector, linB8000, screensize div 2,
        makechar(' ', Black or (Black shl 4)));
     { output message }
     status('Creating selector ''text_sel'' to a part of ' +
        'text screen memory');
     { allocate descriptor }
     text_sel := allocate_ldt_descriptors(1);
     { set its base address to the linear address of the text screen
     + the byte size of one line (=maxx * bytespercell * 1) }
     set_segment_base_address(text_sel,
        linB8000 + bytespercell * maxx * 1);
     { the limit is set to the screensize reduced by one (a must be)
     and the number of lines we don't want to have touched (first
     line + lower 2 lines) }
     set_segment_limit(text_sel, screensize - 1 - bytespercell *
        maxx * 3);
     { write descriptor info  }
     selinfo(text_sel);

     status('and clearing entire memory selected by ''text_sel''' +
        ' descriptor');
     { fill the entire selected memory with single characters }
     seg_fillword(text_sel, 0, (get_segment_limit(text_sel)+1) div 2,
        makechar(' ', LightBlue shl 4));

     status('Notice that only the memory described by the ' +
        'descriptor changed, nothing else');

     status('Now reducing it''s limit and base and setting it''s ' +
        'described memory');
     { set the base address of the descriptor (increase it by the
     byte size of one line) }
     set_segment_base_address(text_sel,
        get_segment_base_address(text_sel) + bytespercell * maxx);
     { decrease the limit by byte size of 2 lines (1 line because
        base address changed, one line on the lower end) }
     set_segment_limit(text_sel,
        get_segment_limit(text_sel) - bytespercell * maxx * 2);
     { write descriptor info  }
     selinfo(text_sel);
     status('Notice that the base addr increased by one line but ' +
        'the limit decreased by 2 lines');
     status('This should give you the hint that the limit is ' +
        'relative to the base');
     { fill the descriptor area }
     seg_fillword(text_sel, 0, (get_segment_limit(text_sel)+1) div 2,
        makechar(#176, LightMagenta or Brown shl 4));

     status('Now let''s get crazy and copy 10 lines of data from ' +
        'the previously saved screen');
     { copy memory from the data segment to screen }
     seg_move(get_ds, longint(@text_save), text_sel,
        maxx * bytespercell * 2, maxx * bytespercell * 10);

     status('At last freeing the descriptor and restoring the old ' +
        ' screen contents..');
     status('I hope this little program may give you some hints ' +
        'on working with descriptors');
     { free the descriptor so that it can be used for things }
     free_ldt_descriptor(text_sel);
     { restore old state  }
     seg_move(get_ds, longint(@text_save), dosmemselector,
        linB8000, screensize);
     gotoxy(text_oldx, text_oldy);
end.


allocate_memory_block

Allocate a block of linear memory

Declaration

Source position: go32.pp line 147

function allocate_memory_block(

  size: LongInt

):LongInt;

Description

Allocates a block of linear memory.

Parameters:

size:
Size of requested linear memory block in bytes.

Returned values: blockhandle - the memory handle to this memory block. Linear address of the requested memory.

Remark: warning According to my DPMI docs this function is not implemented correctly. Normally you should also get a blockhandle to this block after successful operation. This handle can then be used to free the memory block afterwards or use this handle for other purposes. Since the function isn't implemented correctly, and doesn't return a blockhandle, the block can't be deallocated and is hence unusuable ! This function doesn't allocate any descriptors for this block, it's the applications resposibility to allocate and initialize for accessing this memory.

Errors

Check the int31error variable.

See also

free_memory_block

Free allocated memory block


copyfromdos

Copy data from DOS to heap

Declaration

Source position: go32.pp line 176

procedure copyfromdos(

  var addr;

  len: LongInt

);

Description

Copies data from the pre-allocated dos memory transfer buffer to the heap.

Parameters:

addr
data to copy to.
len
number of bytes to copy to heap.

Notes: Can only be used in conjunction with the dos memory transfer buffer.

Errors

Check the int31error variable.

See also

tb_size | Return DOS transfer memory buffer size
transfer_buffer | Return offset of DOS transfer buffer
copytodos | Copy data from heap to DOS memory


copytodos

Copy data from heap to DOS memory

Declaration

Source position: go32.pp line 175

procedure copytodos(

  var addr;

  len: LongInt

);

Description

Copies data from heap to the pre-allocated dos memory buffer.

Parameters:

addr
data to copy from.
len
number of bytes to copy to dos memory buffer.

Notes: This function fails if you try to copy more bytes than the transfer buffer is in size. It can only be used in conjunction with the transfer buffer.

Errors

Check the int31error variable.

See also

tb_size | Return DOS transfer memory buffer size
transfer_buffer | Return offset of DOS transfer buffer
copyfromdos | Copy data from DOS to heap


create_code_segment_alias_descriptor

Create new descriptor from existing descriptor

Declaration

Source position: go32.pp line 95

function create_code_segment_alias_descriptor(

  seg: Word

):Word;

Description

Creates a new descriptor that has the same base and limit as the specified descriptor.

Parameters:

seg
Descriptor.

Return values: The data selector (alias).

Notes: In effect, the function returns a copy of the descriptor. The descriptor alias returned by this function will not track changes to the original descriptor. In other words, if an alias is created with this function, and the base or limit of the original segment is then changed, the two descriptors will no longer map the same memory.

Errors

Check the int31error variable.

See also

allocate_ldt_descriptors | Allocate a number of descriptors
set_segment_limit | Set descriptor limit
set_segment_base_address | Set descriptor's base address


disable

Disable hardware interrupts

Declaration

Source position: go32.pp line 159

procedure disable;

Description

Disables all hardware interrupts by execution a CLI instruction.

Errors

None.

See also

enable

Enable hardware interrupts


dpmi_dosmemfillchar

Fill DOS memory with a character

Declaration

Source position: go32.pp line 181

procedure dpmi_dosmemfillchar(

  seg: Word;

  ofs: Word;

  count: LongInt;

  c: Char

);

Description

dpmi_dosmemfillchar fills the DOS memory reagion indicated by seg,ofs with count characters c.

See also

dpmi_dosmemput | Move data from DPMI memory to DOS memory.
dpmi_dosmemget | Move data from DOS memory to DPMI memory
dpmi_dosmemmove | Move DOS memory
dpmi_dosmemfillword | Fill DOS memory with a word value


dpmi_dosmemfillword

Fill DOS memory with a word value

Declaration

Source position: go32.pp line 182

procedure dpmi_dosmemfillword(

  seg: Word;

  ofs: Word;

  count: LongInt;

  w: Word

);

Description

dpmi_dosmemfillword fills the DOS memory reagion indicated by seg,ofs with count words W.

See also

dpmi_dosmemput | Move data from DPMI memory to DOS memory.
dpmi_dosmemget | Move data from DOS memory to DPMI memory
dpmi_dosmemfillchar | Fill DOS memory with a character
dpmi_dosmemmove | Move DOS memory


dpmi_dosmemget

Move data from DOS memory to DPMI memory

Declaration

Source position: go32.pp line 179

procedure dpmi_dosmemget(

  seg: Word;

  ofs: Word;

  var data;

  count: LongInt

);

Description

dpmi_dosmemput moves count bytes of data from the DOS memory location indicated by seg and ofs to DPMI memory indicated by data.

See also

dpmi_dosmemput | Move data from DPMI memory to DOS memory.
dpmi_dosmemmove | Move DOS memory
dpmi_dosmemfillchar | Fill DOS memory with a character
dpmi_dosmemfillword | Fill DOS memory with a word value


dpmi_dosmemmove

Move DOS memory

Declaration

Source position: go32.pp line 180

procedure dpmi_dosmemmove(

  sseg: Word;

  sofs: Word;

  dseg: Word;

  dofs: Word;

  count: LongInt

);

Description

dpmi_dosmemmove moves count bytes from DOS memory sseg,sofs to dseg,dofs.

See also

dpmi_dosmemput | Move data from DPMI memory to DOS memory.
dpmi_dosmemget | Move data from DOS memory to DPMI memory
dpmi_dosmemfillchar | Fill DOS memory with a character
dpmi_dosmemfillword | Fill DOS memory with a word value


dpmi_dosmemput

Move data from DPMI memory to DOS memory.

Declaration

Source position: go32.pp line 178

procedure dpmi_dosmemput(

  seg: Word;

  ofs: Word;

  var data;

  count: LongInt

);

Description

dpmi_dosmemput moves count bytes of data from data to the DOS memory location indicated by seg and ofs.

See also

dpmi_dosmemget | Move data from DOS memory to DPMI memory
dpmi_dosmemmove | Move DOS memory
dpmi_dosmemfillchar | Fill DOS memory with a character
dpmi_dosmemfillword | Fill DOS memory with a word value


enable

Enable hardware interrupts

Declaration

Source position: go32.pp line 160

procedure enable;

Description

Enables all hardware interrupts by executing a STI instruction.

Errors

None.

See also

disable

Disable hardware interrupts


free_ldt_descriptor

Free a descriptor

Declaration

Source position: go32.pp line 88

function free_ldt_descriptor(

  d: Word

):Boolean;

Description

Frees a previously allocated descriptor.

Parameters:

des
The descriptor to be freed.

Return value: True if successful, False otherwise. Notes: After this call this selector is invalid and must not be used for any memory operations anymore. Each descriptor allocated with allocate_ldt_descriptors must be freed individually with this function, even if it was previously allocated as a part of a contiguous array of descriptors.

For an example, see allocate_ldt_descriptors.

Errors

Check the int31error variable.

See also

allocate_ldt_descriptors | Allocate a number of descriptors
get_next_selector_increment_value | Return selector increment value


free_linear_addr_mapping

? No description available

Declaration

Source position: go32.pp line 97

function free_linear_addr_mapping(

  linear_addr: DWord

):Boolean;


free_memory_block

Free allocated memory block

Declaration

Source position: go32.pp line 148

function free_memory_block(

  blockhandle: LongInt

):Boolean;

Description

Frees a previously allocated memory block.

Parameters:

blockhandle
the handle to the memory area to free.

Return value: True if successful, false otherwise. Notes: Frees memory that was previously allocated with allocate_memory_block . This function doesn't free any descriptors mapped to this block, it's the application's responsibility.

Errors

Check int31error variable.

See also

allocate_memory_block

Allocate a block of linear memory


free_rm_callback

Release real mode callback.

Declaration

Source position: go32.pp line 140

function free_rm_callback(

  var intaddr: tseginfo

):Boolean;

Description

Releases a real mode callback address that was previously allocated with the get_rm_callback function.

Parameters:

intaddr
real mode address buffer returned by get_rm_callback .

Return values: True if successful, False if not

For an example, see get_rm_callback.

Errors

Check the int31error variable.

See also

set_rm_interrupt | Set real mode interrupt handler
get_rm_callback | Return real mode callback


get_cs

Get CS selector

Declaration

Source position: go32.pp line 142

function get_cs: Word;

Description

Returns the cs selector.

Return value: The content of the cs segment register.

For an example, see set_pm_interrupt.

Errors

None.

See also

get_ds | Get DS Selector
get_ss | Return SS selector


get_descriptor_access_right

Get descriptor's access rights

Declaration

Source position: go32.pp line 99

function get_descriptor_access_right(

  d: Word

):LongInt;

Description

Gets the access rights of a descriptor.

Parameters:

d
selector to descriptor.

Return value: Access rights bit field.

Errors

Check the int31error variable.

See also

set_descriptor_access_right

Set access rights to memory descriptor


get_dpmi_version

Return DPMI information

Declaration

Source position: go32.pp line 105

function get_dpmi_version(

  var version: tdpmiversioninfo

):Boolean;

Description

get_dpmi_version returns version information (Int $31 Function $0400) in Version and returns True if the information was retrieved successfully, false if the call failed.

Errors

The call returns false if the information could not be retrieved.

See also

tdpmiversioninfo

Structure describing DPMI version


get_ds

Get DS Selector

Declaration

Source position: go32.pp line 143

function get_ds: Word;

Description

Returns the ds selector.

Return values: The content of the ds segment register.

Errors

None.

See also

get_cs | Get CS selector
get_ss | Return SS selector


get_exception_handler

Return current exception handler

Declaration

Source position: go32.pp line 136

function get_exception_handler(

  e: Byte;

  var intaddr: tseginfo

):Boolean;

Description

get_exception_handler returns the exception handler for exception E in intaddr. It returns True if the call was successful, False if not.

See also

set_exception_handler | Set exception handler
get_pm_exception_handler | Get protected mode exception handler


get_linear_addr

Convert physical to linear address

Declaration

Source position: go32.pp line 96

function get_linear_addr(

  phys_addr: DWord;

  size: LongInt

):DWord;

Description

Converts a physical address into a linear address.

Parameters:

phys_addr
physical address of device.
size
Size of region to map in bytes.

Return value: Linear address that can be used to access the physical memory. Notes: It's the applications resposibility to allocate and set up a descriptor for access to the memory. This function shouldn't be used to map real mode addresses.

Errors

Check the int31error variable.

See also

allocate_ldt_descriptors | Allocate a number of descriptors
set_segment_limit | Set descriptor limit
set_segment_base_address | Set descriptor's base address


get_meminfo

Return information on the available memory

Declaration

Source position: go32.pp line 131

function get_meminfo(

  var meminfo: tmeminfo

):Boolean;

Description

Returns information about the amount of available physical memory, linear address space, and disk space for page swapping.

Parameters:

meminfo
buffer to fill memory information into.

Return values: Due to an implementation bug this function always returns False, but it always succeeds.

Remark: Notes: Only the first field of the returned structure is guaranteed to contain a valid value. Any fields that are not supported by the DPMI host will be set by the host to -1 (0FFFFFFFFH) to indicate that the information is not available. The size of the pages used by the DPMI host can be obtained with the get_page_size function.

Errors

Check the int31error variable.

See also

get_page_size

Return the page size

Example

{ Shows how to obtain memory information via get_meminfo();

notice the checks if any of the returned information is invalid (-1)
}

uses
        go32;

var
        meminfo : tmeminfo;

begin
        get_meminfo(meminfo);
        if (int31error <> 0)  then begin
                Writeln('Error getting DPMI memory information... Halting');
                Writeln('DPMI error number : ', int31error);
        end else begin
                with meminfo do begin
                        Writeln('Largest available free block : ',
                                available_memory div 1024, ' kbytes');
                        if (available_pages <> -1) then
                                Writeln('Maximum available unlocked pages : ',
                                        available_pages);
                        if (available_lockable_pages <> -1) then
                                Writeln('Maximum lockable available pages : ',
                                        available_lockable_pages);
                        if (linear_space <> -1) then
                                Writeln('Linear address space size : ',
                                        linear_space*get_page_size div 1024, ' kbytes');
                        if (unlocked_pages <> -1) then
                                Writeln('Total number of unlocked pages : ',
                                        unlocked_pages);
                        if (available_physical_pages <> -1) then
                                Writeln('Total number of free pages : ',
                                        available_physical_pages);
                        if (total_physical_pages <> -1) then
                                Writeln('Total number of physical pages : ',
                                        total_physical_pages);
                        if (free_linear_space <> -1) then
                                Writeln('Free linear address space : ',
                                        free_linear_space*get_page_size div 1024,
                                        ' kbytes');
                        if (max_pages_in_paging_file <> -1) then
                                Writeln('Maximum size of paging file : ',
                                        max_pages_in_paging_file*get_page_size div 1024,
                                        ' kbytes');
                end;
        end;
end.


get_next_selector_increment_value

Return selector increment value

Declaration

Source position: go32.pp line 90

function get_next_selector_increment_value: Word;

Description

Returns the selector increment value when allocating multiple subsequent descriptors via allocate_ldt_descriptors.

Return value: Selector increment value.

Remark: Notes: Because allocate_ldt_descriptors only returns the selector for the first descriptor and so the value returned by this function can be used to calculate the selectors for subsequent descriptors in the array.

Errors

Check the int31error variable.

See also

allocate_ldt_descriptors | Allocate a number of descriptors
free_ldt_descriptor | Free a descriptor


get_page_attributes

? No description available

Declaration

Source position: go32.pp line 102

function get_page_attributes(

  handle: DWord;

  offset: DWord;

  pagecount: DWord;

  buf: pointer

):Boolean;


get_page_size

Return the page size

Declaration

Source position: go32.pp line 100

function get_page_size: LongInt;

Description

Returns the size of a single memory page.

Return value: Size of a single page in bytes.

Remark: The returned size is typically 4096 bytes.

For an example, see get_meminfo.

Errors

Check the int31error variable.

See also

get_meminfo

Return information on the available memory


get_pm_exception_handler

Get protected mode exception handler

Declaration

Source position: go32.pp line 138

function get_pm_exception_handler(

  e: Byte;

  var intaddr: tseginfo

):Boolean;

Description

get_pm_exception_handler returns the protected mode exception handler for exception E in intaddr. It returns True if the call was successful, False if not.

See also

get_exception_handler | Return current exception handler
set_pm_exception_handler | Set protected mode exception handler


get_pm_interrupt

Return protected mode interrupt handler

Declaration

Source position: go32.pp line 132

function get_pm_interrupt(

  vector: Byte;

  var intaddr: tseginfo

):Boolean;

Description

Returns the address of a current protected mode interrupt handler.

Parameters:

vector
interrupt handler number you want the address to.
intaddr
buffer to store address.

Return values: True if successful, False if not.

Remark: The returned address is a protected mode selector:offset address.

For an example, see set_pm_interrupt.

Errors

Check the int31error variable.

See also

set_pm_interrupt | Set protected mode interrupt handler
set_rm_interrupt | Set real mode interrupt handler
get_rm_interrupt | Get real mode interrupt vector


get_rm_callback

Return real mode callback

Declaration

Source position: go32.pp line 141

function get_rm_callback(

  pm_func: pointer;

  const reg: trealregs;

  var rmcb: tseginfo

):Boolean;

Description

Returns a unique real mode segment:offset address, known as a "real mode callback," that will transfer control from real mode to a protected mode procedure.

Parameters:

pm_func
pointer to the protected mode callback function.
reg
supplied registers structure.
rmcb
buffer to real mode address of callback function.

Return values: True if successful, otherwise False.

Remark: Callback addresses obtained with this function can be passed by a protected mode program for example to an interrupt handler, device driver, or TSR, so that the real mode program can call procedures within the protected mode program or notify the protected mode program of an event. The contents of the supplied regs structure is not valid after function call, but only at the time of the actual callback.

Errors

Check the int31error variable.

See also

free_rm_callback

Release real mode callback.

Example

{ This program tries to give an example how to install a callback
procedure with the help of the GO32 unit.

It installs a callback which is supplied by any Microsoft compatible
mouse driver; at a specified mouse action this routine is called.
This callback must provide the services explained in the docs. The
main callback has to be in assembly, because it isn't possible to do
these services with pascal alone. But is written as general as
possible to provide maximum re-usability for other applications and
hence it simply calls a normal pascal user procedure in addition to
some initialization and callback service code, so you don't need to
hassle around with it too much.

Notes to this user procedure :
*) it should not last too long to execute it
*) ALL data and code touched in this proc MUST be locked BEFORE it is
called the first time

Used software interrupt calls (rough descriptions, only what's used):

Int 33h 0000h - Microsoft Mouse driver : Reset mouse
Input : AX = 0000h
Return : AX = FFFFh if successful
         BX = number of buttons (if FFFFh then mouse has 2 buttons)

Int 33h 0001h - Microsoft Mouse driver : Show mouse cursor
Input : AX = 0001h
Return : Mouse cursor shown on screen

Int 33h 0002h - Microsoft mouse driver : Hide mouse cursor
Input : AX = 0002h
Return : Hides mouse cursor again

 Int 33h 000Ch - Microsoft mouse driver : Install user callback
Input : AX = 000Ch
        CX = bit mask which tells the mouse driver at which actions
        the callback should be called, i.e. if button pressed, mouse
        moved etc.
        (In this example it's set to 7Fh so that the callback is
        called on every action)
        ES:EDX = pointer to callback procedure to call
 Note : The registers structure supplied to the callback contains
        valid mouse data when the handler is called.
  BX = button state information
  CX = mouse X coordinates
  DX = mouse Y coordinates
For more detailed information consult any mouse reference or
interrupt list.
}
{$CALLING REGISTER}
{$ASMMODE ATT}
{$MODE FPC}

uses
        crt,
        go32;

const
        { the mouse interrupt number }
        mouseint = $33;

var
        { supplied register structure to the callback }
        mouse_regs    : trealregs; external name '___v2prt0_rmcb_regs';
        { real mode 48 bit pointer to the callback }
        mouse_seginfo : tseginfo;

var
        { number of mouse buttons }
        mouse_numbuttons : longint;

        { bit mask for the action which triggered the callback }
        mouse_action : word;
        { current mouse x and y coordinates }
        mouse_x, mouse_y : Word;
        { button state }
        mouse_b : Word;

        { is an additional user procedure installed }
        userproc_installed : Longbool;
        { length of additional user procedure }
        userproc_length : Longint;
        { pointer to user proc }
        userproc_proc : pointer;

{ callback control handler, calls a user procedure if installed }

{ callback control handler, calls a user procedure if installed }
procedure callback_handler; assembler;
asm
   pushw %ds
   pushl %eax
   movw %es, %ax
   movw %ax, %ds

   { give control to user procedure if installed }
   cmpl $0, USERPROC_INSTALLED
   je .LNoCallback
   pushal
   movw DOSmemSELECTOR, %ax
   movw %ax, %fs  { set fs for FPC }
   call *USERPROC_PROC
   popal
.LNoCallback:

   popl %eax
   popw %ds

   pushl %eax
   movl (%esi), %eax
   movl %eax, %es: 42(%edi) { adjust stack }
   addw $4, %es:46(%edi)
   popl %eax
   iret
end;
{ This dummy is used to obtain the length of the callback control
function. It has to be right after the callback_handler() function.
}
procedure mouse_dummy; begin end;

{ This is the supplied user procedure. In this case we simply
transform the virtual 640x200 mouse coordinate system to a 80x25
text mode coordinate system }
procedure textuserproc;
begin
        { the mouse_regs record contains the real mode registers now }
        mouse_b := mouse_regs.bx;
        mouse_x := (mouse_regs.cx shr 3) + 1;
        mouse_y := (mouse_regs.dx shr 3) + 1;
end;

{ Description : Installs the mouse callback control handler and
handles all necessary mouse related initialization.
  Input : userproc - pointer to a user procedure, nil if none
          userproclen - length of user procedure
}
procedure install_mouse(userproc : pointer; userproclen : longint);
var r : trealregs;
begin
        { mouse driver reset }
        r.eax := $0; realintr(mouseint, r);
        if (r.eax <> $FFFF) then begin
                Writeln('No Microsoft compatible mouse found');
                Writeln('A Microsoft compatible mouse driver is necessary ',
                        'to run this example');
                halt;
        end;
        { obtain number of mouse buttons }
        if (r.bx = $ffff) then mouse_numbuttons := 2
        else mouse_numbuttons := r.bx;
        Writeln(mouse_numbuttons, ' button Microsoft compatible mouse ',
                ' found.');
        { check for additional user procedure, and install it if
        available }
        if (userproc <> nil) then begin
                userproc_proc := userproc;
                userproc_installed := true;
                userproc_length := userproclen;
                { lock code for user procedure }
                lock_code(userproc_proc, userproc_length);
        end else begin
                { clear variables }
                userproc_proc := nil;
                userproc_length := 0;
                userproc_installed := false;
        end;
        { lock code & data which is touched in the callback handler }
        lock_data(mouse_x, sizeof(mouse_x));
        lock_data(mouse_y, sizeof(mouse_y));
        lock_data(mouse_b, sizeof(mouse_b));
        lock_data(mouse_action, sizeof(mouse_action));

        lock_data(userproc_installed, sizeof(userproc_installed));
        lock_data(userproc_proc, sizeof(userproc_proc));

        lock_data(mouse_regs, sizeof(mouse_regs));
        lock_data(mouse_seginfo, sizeof(mouse_seginfo));
        lock_code(@callback_handler,
                longint(@mouse_dummy)-longint(@callback_handler));
        { allocate callback (supply registers structure) }
        get_rm_callback(@callback_handler, mouse_regs, mouse_seginfo);
        { install callback }
        r.eax := $0c; r.ecx := $7f;
        r.edx := longint(mouse_seginfo.offset);
        r.es := mouse_seginfo.segment;
        realintr(mouseint, r);
        { show mouse cursor }
        r.eax := $01;
        realintr(mouseint, r);
end;

procedure remove_mouse;
var
        r : trealregs;
begin
        { hide mouse cursor }
        r.eax := $02; realintr(mouseint, r);
        { remove callback handler }
        r.eax := $0c; r.ecx := 0; r.edx := 0; r.es := 0;
        realintr(mouseint, r);
        { free callback }
        free_rm_callback(mouse_seginfo);
        { check if additional userproc is installed, and clean up if
        needed }
        if (userproc_installed) then begin
                unlock_code(userproc_proc, userproc_length);
                userproc_proc := nil;
                userproc_length := 0;
                userproc_installed := false;
        end;
        { unlock used code & data }
        unlock_data(mouse_x, sizeof(mouse_x));
        unlock_data(mouse_y, sizeof(mouse_y));
        unlock_data(mouse_b, sizeof(mouse_b));
        unlock_data(mouse_action, sizeof(mouse_action));

        unlock_data(userproc_proc, sizeof(userproc_proc));
        unlock_data(userproc_installed, sizeof(userproc_installed));

        unlock_data(mouse_regs, sizeof(mouse_regs));
        unlock_data(mouse_seginfo, sizeof(mouse_seginfo));
        unlock_code(@callback_handler,
                longint(@mouse_dummy)-longint(@callback_handler));
        fillchar(mouse_seginfo, sizeof(mouse_seginfo), 0);
end;

begin
        install_mouse(@textuserproc, 400);
        Writeln('Press any key to exit...');
        while (not keypressed) do begin
                { write mouse state info }
                gotoxy(1, wherey);
                write('MouseX : ', mouse_x:2, ' MouseY : ', mouse_y:2,
                        ' Buttons : ', mouse_b:2);
        end;
        remove_mouse;
end.


get_rm_interrupt

Get real mode interrupt vector

Declaration

Source position: go32.pp line 134

function get_rm_interrupt(

  vector: Byte;

  var intaddr: tseginfo

):Boolean;

Description

Returns the contents of the current machine's real mode interrupt vector for the specified interrupt.

Parameters:

vector
interrupt vector number.
intaddr
buffer to store real mode segment:offset address.

Return values: True if successful, False otherwise.

Remark: The returned address is a real mode segment address, which isn't valid in protected mode.

Errors

Check the int31error variable.

See also

set_rm_interrupt | Set real mode interrupt handler
set_pm_interrupt | Set protected mode interrupt handler
get_pm_interrupt | Return protected mode interrupt handler


get_run_mode

Return current run mode

Declaration

Source position: go32.pp line 169

function get_run_mode: Word;

Description

Returns the current mode your application runs with.

Return values: One of the constants used by this function.

Errors

None.

See also

get_run_mode

Return current run mode

Example

{ Simply write a message according to the current environment }

uses
        go32;

begin
        { depending on the detected environment we simply write
        another message Note: in go32v2 this will always be rm_dpmi. }

        case (get_run_mode) of
                rm_unknown :
                        Writeln('Unknown environment found');
                rm_raw     :
                        Writeln('You are currently running in raw mode ',
                                '(without HIMEM)');
                rm_xms     :
                        Writeln('You are currently using HIMEM.SYS only');
                rm_vcpi    :
                        Writeln('VCPI server detected. You''re using HIMEM and ',
                                'EMM386');
                rm_dpmi    :
                        Writeln('DPMI detected. You''re using a DPMI host like ',
                                'a windows DOS box or CWSDPMI');
        end;
end.


get_segment_base_address

Return base address from descriptor table

Declaration

Source position: go32.pp line 91

function get_segment_base_address(

  d: Word

):LongInt;

Description

Returns the 32-bit linear base address from the descriptor table for the specified segment.

Parameters:

d
selector of the descriptor you want the base address of.

Return values: Linear base address of specified descriptor.

For an example, see allocate_ldt_descriptors.

Errors

Check the int31error variable.

See also

allocate_ldt_descriptors | Allocate a number of descriptors
set_segment_base_address | Set descriptor's base address
allocate_ldt_descriptors | Allocate a number of descriptors
set_segment_limit | Set descriptor limit
get_segment_limit | Return segment limite from descriptor


get_segment_limit

Return segment limite from descriptor

Declaration

Source position: go32.pp line 98

function get_segment_limit(

  d: Word

):DWord;

Description

Returns a descriptors segment limit.

Parameters:

d
selector.

Return value: Limit of the descriptor in bytes.

Errors

Returns zero if descriptor is invalid.

See also

allocate_ldt_descriptors | Allocate a number of descriptors
set_segment_limit | Set descriptor limit
set_segment_base_address | Set descriptor's base address
get_segment_base_address | Return base address from descriptor table


get_ss

Return SS selector

Declaration

Source position: go32.pp line 144

function get_ss: Word;

Description

Returns the ss selector.

Return values: The content of the ss segment register.

Errors

None.

See also

get_ds | Get DS Selector
get_cs | Get CS selector


global_dos_alloc

Allocate DOS real mode memory

Declaration

Source position: go32.pp line 108

function global_dos_alloc(

  bytes: LongInt

):LongInt;

Description

Allocates a block of dos real mode memory.

Parameters:

bytes
size of requested real mode memory.

Return values: The low word of the returned value contains the selector to the allocated dos memory block, the high word the corresponding real mode segment value. The offset value is always zero. This function allocates memory from dos memory pool, i.e. memory below the 1 MB boundary that is controlled by dos. Such memory blocks are typically used to exchange data with real mode programs, TSRs, or device drivers. The function returns both the real mode segment base address of the block and one descriptor that can be used by protected mode applications to access the block. This function should only used for temporary buffers to get real mode information (e.g. interrupts that need a data structure in ES:(E)DI), because every single block needs an unique selector. The returned selector should only be freed by a global_dos_free call.

Errors

Check the int31error variable.

See also

global_dos_free

Free DOS memory block

Example

{ This program demonstrates the usage of DOS real mode memory by
executing a software interrupt which needs a buffer to store data
into. Because these interrupts are real mode funcs, the buffer must
be located in real mode memory space (first MB of memory). Such
memory can only be allocated by the global_dos_alloc() and
global_dos_free() functions of the GO32 unit.

In more detail this program tries to detect a VESA 2.0 BIOS
extension of your graphics card and outputs its version.

Here's the necessary interrupt call description:

  Int 10h 4f00h : VESA BIOS extension installation check
  Input : AX = 4F00h
          ES:DI = pointer to 512 byte information buffer
  Output : AX = 004Fh if successful
           ES:DI = pointer to filled buffer

  Buffer structure : (relevant to this example)

           must be 'VESA' in the first 4 chars of the buffer to be
           valid VBE version in the next word

  Note : to request VBE 2.0 information, the first 4 bytes of the
        buffer must contain 'VBE2' prior to the interrupt call.

        (this makes the problem a bit tougher; we first have to copy the
        buffer with the 'VBE2' id to dos memory...)
}

uses
        go32;

{The following 2 functions are wrappers to the GO32
global_dos_alloc() and global_dos_free() functions to simplify their
usage }

{ Function : dosalloc }
{ Input    : size of a real mode location }
{ Output   : selector and segment of a real mode location }
procedure dosalloc(var selector : word;
        var segment : word; size : longint);
var
        res : longint;
begin
        { try to allocate real mode memory  }
        res := global_dos_alloc(size);
        { the lower 16 bits of the result contain the selector to the
        allocated memory block }
        selector := word(res);
        { the upper 16 bits contain the real mode segment address of
        this block; the offset is always 0, so we don't need to return
        this }
        segment := word(res shr 16);
end;

{ Function    : dosfree }
{ Input       : selector of a real mode block }
{ Output      : none }
{ Description : de-allocates a previously allocated real mode
memory}
procedure dosfree(selector : word);
begin
        { call the GO32 function with the selector }
        global_dos_free(selector);
end;

type
        VBEInfoBuf = packed record
                { contains 'VESA' if successful }
                Signature : array[0..3] of char;
                Version : Word;
                { pad to 512 bytes length }
                reserved : array[0..505] of byte;
        end;

var
        { selector to our real mode buffer }
        selector,
        { real mode segment address of buffer }
        segment : Word;

        { register structure to issue a software interrupt }
        r : trealregs;
        infobuf : VBEInfoBuf;

begin
        { first we reset the registers and infobuf variable }
        fillchar(r, sizeof(r), 0);
        fillchar(infobuf, sizeof(VBEInfoBuf), 0);
        { allocate real mode memory }
        dosalloc(selector, segment, sizeof(VBEInfoBuf));
        { check if an error occurred during allocation }
        if (int31error<>0) then begin
                Writeln('Error while allocating real mode memory, halting');
                halt;
        end;
        { request VBE 2.0 information, fill out information buffer }
        infobuf.Signature := 'VBE2';
        { copy buffer to the allocated real mode memory }
        dosmemput(segment, 0, infobuf, sizeof(infobuf));
        { issue the interrupt; remember : DI = 0 }
        r.ax := $4f00; r.es := segment;
        realintr($10, r);
        { copy buffer to our infobuf variable again }
        dosmemget(segment, 0, infobuf, sizeof(infobuf));
        { free allocated real mode memory, because we don't need it
        anymore }
        dosfree(selector);
        { check if interrupt call was successful }
        if (r.ax <> $4f) then begin
                { write message and exit, because the infobuf doesn't contain
                any useful data we could tell the user }
                Writeln('VBE BIOS extension not available, function call ',
                        'failed');
                halt;
        end;
        { check if buffer is valid }
        if (infobuf.signature[0] = 'V') and
                (infobuf.signature[1] = 'E') and
                (infobuf.signature[2] = 'S') and
                (infobuf.signature[3] = 'A') then begin
                Writeln('VBE version ', hi(infobuf.version), '.',
                        lo(infobuf.version), ' detected');
        end;
end.


global_dos_free

Free DOS memory block

Declaration

Source position: go32.pp line 109

function global_dos_free(

  selector: Word

):Boolean;

Description

Frees a previously allocated dos memory block.

Parameters:

selector
selector to the dos memory block.

Return value: True if successful, False otherwise.

Remark: The descriptor allocated for the memory block is automatically freed and hence invalid for further use. This function should only be used for memory allocated by global_dos_alloc.

For an example, see global_dos_alloc.

Errors

Check the int31error variable.

See also

global_dos_alloc

Allocate DOS real mode memory


inportb

Read byte from I/O port

Declaration

Source position: go32.pp line 162

function inportb(

  port: Word

):Byte;

Description

Reads 1 byte from the selected I/O port.

Parameters:

port
the I/O port number which is read.

Return values: Current I/O port value.

Errors

None.

See also

outportb | Write byte to I/O port
inportw | Read word from I/O port
inportl | Read longint from I/O port


inportl

Read longint from I/O port

Declaration

Source position: go32.pp line 164

function inportl(

  port: Word

):LongInt;

Description

Reads 1 longint from the selected I/O port.

Parameters:

port
the I/O port number which is read.

Return values: Current I/O port value.

Errors

None.

See also

outportb | Write byte to I/O port
inportb | Read byte from I/O port
inportw | Read word from I/O port


inportw

Read word from I/O port

Declaration

Source position: go32.pp line 163

function inportw(

  port: Word

):Word;

Description

Reads 1 word from the selected I/O port.

Parameters:

port
the I/O port number which is read.

Return values: Current I/O port value.

Errors

None.

See also

outportw | Write word to I/O port
inportb | Read byte from I/O port
inportl | Read longint from I/O port


lock_code

Lock code memory range

Declaration

Source position: go32.pp line 153

function lock_code(

  functionaddr: pointer;

  size: LongInt

):Boolean;

Description

Locks a memory range which is in the code segment selector.

Parameters:

functionaddr
address of the function to be locked.
size
size in bytes to be locked.

Return values: True if successful, False otherwise.

For an example, see get_rm_callback.

Errors

Check the int31error variable.

See also

lock_linear_region | Lock linear memory region
lock_data | Lock data memory range
unlock_linear_region | Unlock linear memory region
unlock_data | Unlock data segment
unlock_code | Unlock code segment


lock_data

Lock data memory range

Declaration

Source position: go32.pp line 152

function lock_data(

  var data;

  size: LongInt

):Boolean;

Description

Locks a memory range which resides in the data segment selector.

Parameters:

data
address of data to be locked.
size
length of data to be locked.

Return values: True if successful, False otherwise.

For an example, see get_rm_callback.

Errors

Check the int31error variable.

See also

lock_linear_region | Lock linear memory region
lock_code | Lock code memory range
unlock_linear_region | Unlock linear memory region
unlock_data | Unlock data segment
unlock_code | Unlock code segment


lock_linear_region

Lock linear memory region

Declaration

Source position: go32.pp line 151

function lock_linear_region(

  linearaddr: LongInt;

  size: LongInt

):Boolean;

Description

Locks a memory region to prevent swapping of it.

Parameters:

linearaddr
the linear address of the memory are to be locked.
size
size in bytes to be locked.

Return value: True if successful, False otherwise.

Errors

Check the int31error variable.

See also

lock_data | Lock data memory range
lock_code | Lock code memory range
unlock_linear_region | Unlock linear memory region
unlock_data | Unlock data segment
unlock_code | Unlock code segment


map_device_in_memory_block

Map a device into program's memory space

Declaration

Source position: go32.pp line 101

function map_device_in_memory_block(

  handle: DWord;

  offset: DWord;

  pagecount: DWord;

  device: DWord

):Boolean;

Description

map_device_in_memory_block allows to map a device in memory. This function is a direct call of the extender. For more information about it's arguments, see the extender documentation.


outportb

Write byte to I/O port

Declaration

Source position: go32.pp line 166

procedure outportb(

  port: Word;

  data: Byte

);

Description

Sends 1 byte of data to the specified I/O port.

Parameters:

port
the I/O port number to send data to.
data
value sent to I/O port.

Return values: None.

Errors

None.

See also

inportb | Read byte from I/O port
outportl | Write longint to I/O port
outportw | Write word to I/O port

Example

{ This example demonstrates the use of the outport functions.

It simply turns the PC's internal speaker on for 50 ms and off again
}
uses
        crt,
        go32;

begin
        { turn on speaker }
        outportb($61, $ff);
        { wait a little bit }
        delay(50);
        { turn it off again }
        outportb($61, $0);
end.


outportl

Write longint to I/O port

Declaration

Source position: go32.pp line 168

procedure outportl(

  port: Word;

  data: LongInt

);

Description

Sends 1 longint of data to the specified I/O port.

Parameters:

port
the I/O port number to send data to.
data
value sent to I/O port.

Return values: None.

For an example, see outportb.

Errors

None.

See also

inportl | Read longint from I/O port
outportw | Write word to I/O port
outportb | Write byte to I/O port


outportw

Write word to I/O port

Declaration

Source position: go32.pp line 167

procedure outportw(

  port: Word;

  data: Word

);

Description

Sends 1 word of data to the specified I/O port.

Parameters:

port
the I/O port number to send data to.
data
value sent to I/O port.

Return values: None.

For an example, see outportb.

Errors

None.

See also

inportw | Read word from I/O port
outportl | Write longint to I/O port
outportb | Write byte to I/O port


realintr

Simulate interrupt

Declaration

Source position: go32.pp line 104

function realintr(

  intnr: Word;

  var regs: trealregs

):Boolean;

Description

Simulates an interrupt in real mode.

Parameters:

intnr
interrupt number to issue in real mode.
regs
registers data structure.

Return values: The supplied registers data structure contains the values that were returned by the real mode interrupt. True if successful, False if not.

Remark: The function transfers control to the address specified by the real mode interrupt vector of intnr. The real mode handler must return by executing an IRET.

Errors

Check the int31error variable.

Example

{ This example demonstrates the use of the flag constants in
conjunction with an interrupt call

In detail it checks if APM (advanced power management) is
available.

Int 15h 5300h - APM specification : Installation check
Input : AX = 5300h
        BX = device id of system BIOS (= 0000h)
Return : Carry clear if successful
        AH = major version (BCD)
        AL = minor version (BCD)
}

uses
        go32;

var
        r : trealregs;

begin
        { set register values and issue real mode interrupt call }
        r.ax := $5300;
        r.bx := 0;
        realintr($15, r);
        { check if carry clear and write a suited message }
        if ((r.flags and carryflag)=0) then begin
                Writeln('APM v', (r.ah and $f), '.',
                        (r.al shr 4), (r.al and $f), ' detected');
        end else
                Writeln('APM not present');
end.


request_linear_region

Request linear address region.

Declaration

Source position: go32.pp line 149

function request_linear_region(

  linearaddr: LongInt;

  size: LongInt;

  var blockhandle: LongInt

):Boolean;

Description

request_linear_region requests a linear range of addresses of size Size, starting at linearaddr. If successful, True is returned, and a handle to the address region is returned in blockhandle.

Errors

On error, False is returned.


segment_to_descriptor

Map segment address to descriptor

Declaration

Source position: go32.pp line 89

function segment_to_descriptor(

  seg: Word

):Word;

Description

Maps a real mode segment (paragraph) address onto an descriptor that can be used by a protected mode program to access the same memory.

Parameters:

seg
the real mode segment you want the descriptor to.

Return values: Descriptor to real mode segment address.

Remark: The returned descriptors limit will be set to 64 kB. Multiple calls to this function with the same segment address will return the same selector. Descriptors created by this function can never be modified or freed. Programs which need to examine various real mode addresses using the same selector should use the function allocate_ldt_descriptors and change the base address as necessary.

For an example, see seg_fillchar.

Errors

Check the int31error variable.

See also

allocate_ldt_descriptors | Allocate a number of descriptors
free_ldt_descriptor | Free a descriptor
set_segment_base_address | Set descriptor's base address


seg_fillchar

Fill segment with byte value

Declaration

Source position: go32.pp line 124

procedure seg_fillchar(

  seg: Word;

  ofs: LongInt;

  count: LongInt;

  c: Char

);

Description

Sets a memory area to a specific value.

Parameters:

seg
selector to memory area.
ofs
offset to memory.
count
number of bytes to set.
c
byte data which is set.

Return values: None.

Notes: No range check is done in any way.

Errors

None.

See also

seg_move | Move data between 2 locations
seg_fillword | Fill segment with word value
dosmemfillchar | Fill a region of DOS memory with a specific byte-sized value
dosmemfillword | Fill a region of DOS memory with a specific word-sized value
dosmemget | Copy data from DOS memory to the heap.
dosmemput | Copy data from the heap to DOS real mode memory
dosmemmove | Move data between 2 DOS real mode memory locations

Example

{This example demonstrates the use of the segment_to_descriptor()
function.

It switches to VGA mode 13h (320x200x256 color), creates a selector
to the memory (based at $A000:0000), clears this memory with color
15 (white) and waits until the enter key is pressed }

uses go32;

var
        vgasel : Word;
        r : trealregs;

begin
        { set VGA mode 13h }
        r.eax := $13; realintr($10, r);
        { allocate descriptor to VGA memory quickly; it could be done
        with allocate_ldt_descriptors() too, but we would have to
        initialize it by ourselves... unlike segment_to_descriptor()
        which automatically sets the limit and the base address
        correctly }
        vgasel := segment_to_descriptor($A000);
        { simply fill the screen memory with color 15 }
        seg_fillchar(vgasel, 0, 64000, #15);
        { wait for a return press }
        readln;
        { back to text mode }
        r.eax := $3; realintr($10, r);
        { don't deallocate vgasel, that can't be done }
end.


seg_fillword

Fill segment with word value

Declaration

Source position: go32.pp line 125

procedure seg_fillword(

  seg: Word;

  ofs: LongInt;

  count: LongInt;

  w: Word

);

Description

Sets a memory area to a specific value.

Parameters:

seg
selector to memory area.
ofs
offset to memory.
count
number of words to set.
w
word data which is set.

Return values: None.

Notes: No range check is done in any way.

For an example, see allocate_ldt_descriptors.

Errors

None.

See also

seg_move | Move data between 2 locations
seg_fillchar | Fill segment with byte value
dosmemfillchar | Fill a region of DOS memory with a specific byte-sized value
dosmemfillword | Fill a region of DOS memory with a specific word-sized value
dosmemget | Copy data from DOS memory to the heap.
dosmemput | Copy data from the heap to DOS real mode memory
dosmemmove | Move data between 2 DOS real mode memory locations


seg_move

Move data between 2 locations

Declaration

Source position: go32.pp line 121

procedure seg_move(

  sseg: Word;

  source: LongInt;

  dseg: Word;

  dest: LongInt;

  count: LongInt

);

Description

Copies data between two memory locations.

Parameters:

sseg
source selector.
source
source offset.
dseg
destination selector.
dest
destination offset.
count
size in bytes to copy.

Return values: None.

Remark: Overlapping is only checked if the source selector is equal to the destination selector. No range check is done.

For an example, see allocate_ldt_descriptors.

Errors

None.

See also

seg_fillchar | Fill segment with byte value
seg_fillword | Fill segment with word value
dosmemfillchar | Fill a region of DOS memory with a specific byte-sized value
dosmemfillword | Fill a region of DOS memory with a specific word-sized value
dosmemget | Copy data from DOS memory to the heap.
dosmemput | Copy data from the heap to DOS real mode memory
dosmemmove | Move data between 2 DOS real mode memory locations


set_descriptor_access_right

Set access rights to memory descriptor

Declaration

Source position: go32.pp line 94

function set_descriptor_access_right(

  d: Word;

  w: Word

):Boolean;

Description

set_descriptor_access_right sets the access rights for descriptor d to w


set_exception_handler

Set exception handler

Declaration

Source position: go32.pp line 137

function set_exception_handler(

  e: Byte;

  const intaddr: tseginfo

):Boolean;

Description

set_exception_handler sets the exception handler for exception E to intaddr. It returns True if the call was successful, False if not.

See also

get_exception_handler | Return current exception handler
set_pm_exception_handler | Set protected mode exception handler


set_page_attributes

? No description available

Declaration

Source position: go32.pp line 103

function set_page_attributes(

  handle: DWord;

  offset: DWord;

  pagecount: DWord;

  buf: pointer

):Boolean;


set_pm_exception_handler

Set protected mode exception handler

Declaration

Source position: go32.pp line 139

function set_pm_exception_handler(

  e: Byte;

  const intaddr: tseginfo

):Boolean;

Description

set_pm_exception_handler sets the protected mode exception handler for exception E to intaddr. It returns True if the call was successful, False if not.

See also

set_exception_handler | Set exception handler
get_pm_exception_handler | Get protected mode exception handler


set_pm_interrupt

Set protected mode interrupt handler

Declaration

Source position: go32.pp line 133

function set_pm_interrupt(

  vector: Byte;

  const intaddr: tseginfo

):Boolean;

Description

Sets the address of the protected mode handler for an interrupt.

Parameters:

vector
number of protected mode interrupt to set.
intaddr
selector:offset address to the interrupt vector.

Return values: True if successful, False otherwise.

Remark: The address supplied must be a valid selector:offset protected mode address.

Errors

Check the int31error variable.

See also

get_pm_interrupt | Return protected mode interrupt handler
set_rm_interrupt | Set real mode interrupt handler
get_rm_interrupt | Get real mode interrupt vector

Example

{ This example shows how to redirect a software interrupt by
changing the protected mode handler of the DPMI host.

In more detail it hooks interrupt 1Ch which is called every
time the timer interrupt (int 08) is executed. This is the
preferred way to hook the timer, because int 1Ch is a software
interrupt which doesn't need so much initialization stuff
compared to hooking a hardware interrupt.
}

uses
        crt,
        go32;

const
        { interrupt number we want to hook }
        int1c = $1c;

var
        { 48 bit pointer to old interrupt handler }
        oldint1c : tseginfo;
        { 48 bit pointer to new interrupt handler }
        newint1c : tseginfo;

        { increased every time the interrupt is called  }
        int1c_counter : Longint;

        { the current data selector }
        int1c_ds : Word; external name '___v2prt0_ds_alias';

{ the actual handler code }
procedure int1c_handler; assembler;
asm
   cli
{ save all registers }
   pushw %ds
   pushw %ax
{ prepare segment registers for FPC procedure }
   movw %cs:int1c_ds, %ax
   movw %ax, %ds
{ simply increase the counter by one }
   incl int1c_counter
{ restore registers }
   popw %ax
   popw %ds
   sti
   iret
end;

var i : Longint;

begin
     { insert right handler data into new handler variable }
     newint1c.offset := @int1c_handler;
     newint1c.segment := get_cs;
     { get the old handler }
     get_pm_interrupt(int1c, oldint1c);
     Writeln('-- Press any key to exit --');
     { set new handler }
     set_pm_interrupt(int1c, newint1c);
     { write the number of interrupts occurred }
     while (not keypressed) do begin
           gotoxy(1, wherey);
           write('Number of interrupts occurred : ', int1c_counter);
     end;
     { restore old handler }
     set_pm_interrupt(int1c, oldint1c);
end.


set_rm_interrupt

Set real mode interrupt handler

Declaration

Source position: go32.pp line 135

function set_rm_interrupt(

  vector: Byte;

  const intaddr: tseginfo

):Boolean;

Description

Sets a real mode interrupt handler.

Parameters:

vector
the interrupt vector number to set.
intaddr
address of new interrupt vector.

Return values: True if successful, otherwise False.

Remark: The address supplied MUST be a real mode segment address, not a selector:offset address. So the interrupt handler must either reside in dos memory (below 1 Mb boundary) or the application must allocate a real mode callback address with get_rm_callback.

Errors

Check the int31error variable.

See also

get_rm_interrupt | Get real mode interrupt vector
set_pm_interrupt | Set protected mode interrupt handler
get_pm_interrupt | Return protected mode interrupt handler
get_rm_callback | Return real mode callback


set_segment_base_address

Set descriptor's base address

Declaration

Source position: go32.pp line 92

function set_segment_base_address(

  d: Word;

  s: DWord

):Boolean;

Description

Sets the 32-bit linear base address of a descriptor.

Parameters:

d
selector.
s
new base address of the descriptor.

Errors

Check the int31error variable.

See also

allocate_ldt_descriptors | Allocate a number of descriptors
get_segment_base_address | Return base address from descriptor table
allocate_ldt_descriptors | Allocate a number of descriptors
set_segment_limit | Set descriptor limit
get_segment_base_address | Return base address from descriptor table
get_segment_limit | Return segment limite from descriptor


set_segment_limit

Set descriptor limit

Declaration

Source position: go32.pp line 93

function set_segment_limit(

  d: Word;

  s: DWord

):Boolean;

Description

Sets the limit of a descriptor.

Parameters:

d
selector.
s
new limit of the descriptor.

Return values: Returns True if successful, else False.

Remark: The new limit specified must be the byte length of the segment - 1. Segment limits bigger than or equal to 1MB must be page aligned, they must have the lower 12 bits set.

For an example, see allocate_ldt_descriptors.

Errors

Check the int31error variable.

See also

allocate_ldt_descriptors | Allocate a number of descriptors
set_segment_base_address | Set descriptor's base address
get_segment_limit | Return segment limite from descriptor
set_segment_limit | Set descriptor limit


tb_offset

Return DOS transfer buffer offset

Declaration

Source position: go32.pp line 173

function tb_offset: LongInt;

Description

tb_offset returns the DOS transfer buffer segment.

See also

transfer_buffer | Return offset of DOS transfer buffer
tb_segment | Return DOS transfer buffer segment
tb_size | Return DOS transfer memory buffer size


tb_segment

Return DOS transfer buffer segment

Declaration

Source position: go32.pp line 172

function tb_segment: LongInt;

Description

tb_segment returns the DOS transfer buffer segment.

See also

transfer_buffer | Return offset of DOS transfer buffer
tb_offset | Return DOS transfer buffer offset
tb_size | Return DOS transfer memory buffer size


tb_size

Return DOS transfer memory buffer size

Declaration

Source position: go32.pp line 174

function tb_size: LongInt;

Description

Returns the size of the pre-allocated dos memory buffer.

Return values: The size of the pre-allocated dos memory buffer. This block always seems to be 16k in size, but don't rely on this.

Errors

None.

See also

transfer_buffer | Return offset of DOS transfer buffer
copyfromdos | Copy data from DOS to heap
copytodos | Copy data from heap to DOS memory


transfer_buffer

Return offset of DOS transfer buffer

Declaration

Source position: go32.pp line 171

function transfer_buffer: LongInt;

Description

transfer_buffer returns the offset of the transfer buffer.

Errors

None.

See also

tb_size

Return DOS transfer memory buffer size


unlock_code

Unlock code segment

Declaration

Source position: go32.pp line 156

function unlock_code(

  functionaddr: pointer;

  size: LongInt

):Boolean;

Description

Unlocks a memory range which resides in the code segment selector.

Parameters:

functionaddr
address of function to be unlocked.
size
size bytes to be unlocked.

Return value: True if successful, False otherwise.

For an example, see get_rm_callback.

Errors

Check the int31error variable.

See also

unlock_linear_region | Unlock linear memory region
unlock_data | Unlock data segment
lock_linear_region | Lock linear memory region
lock_data | Lock data memory range
lock_code | Lock code memory range


unlock_data

Unlock data segment

Declaration

Source position: go32.pp line 155

function unlock_data(

  var data;

  size: LongInt

):Boolean;

Description

Unlocks a memory range which resides in the data segment selector.

Parameters:

data
address of memory to be unlocked.
size
size bytes to be unlocked.

Return values: True if successful, False otherwise.

For an example, see get_rm_callback.

Errors

Check the int31error variable.

See also

unlock_linear_region | Unlock linear memory region
unlock_code | Unlock code segment
lock_linear_region | Lock linear memory region
lock_data | Lock data memory range
lock_code | Lock code memory range


unlock_linear_region

Unlock linear memory region

Declaration

Source position: go32.pp line 154

function unlock_linear_region(

  linearaddr: LongInt;

  size: LongInt

):Boolean;

Description

Unlocks a previously locked linear region range to allow it to be swapped out again if needed.

Parameters:

linearaddr
linear address of the memory to be unlocked.
size
size bytes to be unlocked.

Return values: True if successful, False otherwise.

Errors

Check the int31error variable.

See also

unlock_data | Unlock data segment
unlock_code | Unlock code segment
lock_linear_region | Lock linear memory region
lock_data | Lock data memory range
lock_code | Lock code memory range


Gpm_AnyDouble

Check whether event has double click event.

Declaration

Source position: gpm.pp line 160

function Gpm_AnyDouble(

  EventType: LongInt

):Boolean;

Description

Gpm_AnyDouble returns True if EventType contains the GPM_DOUBLE flag, False otherwise.

Errors

None.

See also

Gpm_StrictSingle | Check whether event contains only a single-click event.
Gpm_AnySingle | Check whether event has a single click event.
Gpm_StrictDouble | Check whether event contains only a double-click event.
Gpm_StrictTriple | Check whether event contains only a triple-click event.
Gpm_AnyTriple | Check whether event has a triple click event.


Gpm_AnySingle

Check whether event has a single click event.

Declaration

Source position: gpm.pp line 158

function Gpm_AnySingle(

  EventType: LongInt

):Boolean;

Description

Gpm_AnySingle returns True if EventType contains the GPM_SINGLE flag, False otherwise.

Errors

None.

See also

Gpm_StrictSingle | Check whether event contains only a single-click event.
Gpm_AnyDouble | Check whether event has double click event.
Gpm_StrictDouble | Check whether event contains only a double-click event.
Gpm_StrictTriple | Check whether event contains only a triple-click event.
Gpm_AnyTriple | Check whether event has a triple click event.


Gpm_AnyTriple

Check whether event has a triple click event.

Declaration

Source position: gpm.pp line 162

function Gpm_AnyTriple(

  EventType: LongInt

):Boolean;

Description

Gpm_AnySingle returns True if EventType contains the GPM_TRIPLE flag, False otherwise.

Errors

None.

See also

Gpm_StrictSingle | Check whether event contains only a single-click event.
Gpm_AnyDouble | Check whether event has double click event.
Gpm_StrictDouble | Check whether event contains only a double-click event.
Gpm_StrictTriple | Check whether event contains only a triple-click event.
Gpm_AnySingle | Check whether event has a single click event.


gpm_close

Close connection to GPM server.

Declaration

Source position: gpm.pp line 186

function gpm_close: LongInt;

Description

Gpm_Close closes the current connection, and pops the connection stack; this means that the previous connection becomes active again.

The function returns -1 if the current connection is not the last one, and it returns 0 if the current connection is the last one.

for an example, see Gpm_GetEvent.

Errors

None.

See also

Gpm_Open

Open connection to GPM server.


gpm_fitvalues

Change coordinates to fit physical screen.

Declaration

Source position: gpm.pp line 192

function gpm_fitvalues(

  var x: LongInt;

  var y: LongInt

):LongInt;

Description

Gpm_fitValues changes x and y so they fit in the visible screen. The actual mouse pointer is not affected by this function.

Errors

None.

See also

Gpm_FitValuesM

Change coordinates to fit margin.


gpm_fitvaluesM

Change coordinates to fit margin.

Declaration

Source position: gpm.pp line 191

function gpm_fitvaluesM(

  var x: LongInt;

  var y: LongInt;

  margin: LongInt

):LongInt;

Description

Gpm_FitValuesM changes x and y so they fit in the margin indicated by margin. If margin is -1, then the values are fitted to the screen. The actual mouse pointer is not affected by this function.

Errors

None.

See also

Gpm_FitValues

Change coordinates to fit physical screen.


gpm_getevent

Get event from event queue.

Declaration

Source position: gpm.pp line 187

function gpm_getevent(

  var event: Tgpm_event

):LongInt;

Description

Gpm_GetEvent Reads an event from the file descriptor gpm_fd. This file is only for internal use and should never be called by a client application.

It returns 1 on succes, and -1 on failue.

Errors

On error, -1 is returned.

See also

Gpm_GetSnapshot

Return servers' current image of mouse state.

Example

program gpmex;

{
  Example program to demonstrate the use of the gpm unit.
}

uses gpm;

var
  connect : TGPMConnect;
  event : tgpmevent;

begin
  connect.EventMask:=GPM_MOVE or GPM_DRAG or GPM_DOWN or GPM_UP;
  connect.DefaultMask:=0;
  connect.MinMod:=0;
  connect.MaxMod:=0;
  if Gpm_Open(connect,0)=-1 then
    begin
    Writeln('No mouse handler present.');
    Halt(1);
    end;
  Writeln('Click right button to end.');
  Repeat
    gpm_getevent(Event);
    With Event do
      begin
        Write('Pos = (',X,',',Y,') Buttons : (');
        if (buttons and Gpm_b_left)<>0 then
          write('left ');
        if (buttons and Gpm_b_right)<>0 then
          write('right ');
        if (buttons and Gpm_b_middle)<>0 then
          Write('middle ');
        Write(') Event : ');
        Case EventType and $F of
          GPM_MOVE: write('Move');
          GPM_DRAG: write('Drag');
          GPM_DOWN: write('Down');
          GPM_UP: write('Up');
        end;
        Writeln;
      end;
  Until (Event.Buttons and gpm_b_right)<>0;
  gpm_close;
end.


gpm_getsnapshot

Return servers' current image of mouse state.

Declaration

Source position: gpm.pp line 199

function gpm_getsnapshot(

  eptr: Pgpmevent

):LongInt;

function gpm_getsnapshot(

  var eptr: Tgpmevent

):LongInt;

Description

Gpm_GetSnapshot returns the picture that the server has of the current situation in Event. This call will not read the current situation from the mouse file descriptor, but returns a buffered version.

The function returns the number of mouse buttons, or -1 if this information is not available.

Errors

None.

See also

Gpm_GetEvent

Get event from event queue.


gpm_lowerroi

Lower a region of interest in the stack.

Declaration

Source position: gpm.pp line 197

function gpm_lowerroi(

  which: Pgpm_roi;

  after: Pgpm_roi

):Pgpm_roi;

Description

Gpm_LowerRoi lowers the region of interest which after after. If after is Nil, the region of interest is moved to the bottom of the stack.

The return value is the new top of the region-of-interest stack.

Errors

None.

See also

Gpm_RaiseRoi | Raise region of interest in the stack.
Gpm_PopRoi | Pop region of interest from the stack.
Gpm_PushRoi | Push region of interest on the stack.


gpm_open

Open connection to GPM server.

Declaration

Source position: gpm.pp line 185

function gpm_open(

  var conn: Tgpm_connect;

  flag: LongInt

):LongInt;

Description

Gpm_Open opens a new connection to the mouse server. The connection is described by the fields of the conn record of type TGPMConnect.

if Flag is 0, then the application only receives events that come from its own terminal device. If it is negative it will receive all events. If the value is positive then it is considered a console number to which to connect.

The return value is -1 on error, or the file descriptor used to communicate with the client. Under an X-Term the return value is -2.

for an example, see Gpm_GetEvent.

Errors

On Error, the return value is -1.

See also

Gpm_Open

Open connection to GPM server.


gpm_poproi

Pop region of interest from the stack.

Declaration

Source position: gpm.pp line 195

function gpm_poproi(

  which: Pgpm_roi

):Pgpm_roi;

Description

Gpm_PopRoi pops the topmost region of interest from the stack. It returns the next element on the stack, or Nil if the current element was the last one.

Errors

None.

See also

Gpm_RaiseRoi | Raise region of interest in the stack.
Gpm_LowerRoi | Lower a region of interest in the stack.
Gpm_PushRoi | Push region of interest on the stack.


gpm_pushroi

Push region of interest on the stack.

Declaration

Source position: gpm.pp line 193

function gpm_pushroi(

  x1: LongInt;

  y1: LongInt;

  x2: LongInt;

  y2: LongInt;

  mask: LongInt;

  fun: TGpmHandler;

  xtradata: pointer

):Pgpm_roi;

Description

Gpm_PushRoi puts a new region of interest on the stack. The region of interest is defined by a rectangle described by the corners (X1,Y1) and (X2,Y2).

The mask describes which events the handler {fun} will handle; ExtraData will be put in the xtradata field of the {TGPM_Roi} record passed to the fun handler.

Errors

None.

See also

Gpm_RaiseRoi | Raise region of interest in the stack.
Gpm_PopRoi | Pop region of interest from the stack.
Gpm_LowerRoi | Lower a region of interest in the stack.


gpm_raiseroi

Raise region of interest in the stack.

Declaration

Source position: gpm.pp line 196

function gpm_raiseroi(

  which: Pgpm_roi;

  before: Pgpm_roi

):Pgpm_roi;

Description

Gpm_RaiseRoi raises the region of interest which till it is on top of region before. If before is nil then the region is put on top of the stack. The returned value is the top of the stack.

Errors

None.

See also

Gpm_PushRoi | Push region of interest on the stack.
Gpm_PopRoi | Pop region of interest from the stack.
Gpm_LowerRoi | Lower a region of interest in the stack.


gpm_repeat

Check for presence of mouse event.

Declaration

Source position: gpm.pp line 190

function gpm_repeat(

  millisec: LongInt

):LongInt;

Description

Gpm_Repeat returns 1 of no mouse event arrives in the next millisec miiliseconds, it returns 0 otherwise.

Errors

None.

See also

Gpm_GetEvent

Get event from event queue.


Gpm_StrictDouble

Check whether event contains only a double-click event.

Declaration

Source position: gpm.pp line 159

function Gpm_StrictDouble(

  EventType: LongInt

):Boolean;

Description

Gpm_StrictDouble returns true if EventType contains only a doubleclick event, False otherwise.

Errors

None.

See also

Gpm_StrictSingle | Check whether event contains only a single-click event.
Gpm_AnyTriple | Check whether event has a triple click event.
Gpm_AnyDouble | Check whether event has double click event.
Gpm_StrictTriple | Check whether event contains only a triple-click event.
Gpm_AnySingle | Check whether event has a single click event.


Gpm_StrictSingle

Check whether event contains only a single-click event.

Declaration

Source position: gpm.pp line 157

function Gpm_StrictSingle(

  EventType: LongInt

):Boolean;

Description

Gpm_StrictDouble returns True if EventType contains only a singleclick event, False otherwise.

Errors

None.

See also

Gpm_AnyTriple | Check whether event has a triple click event.
Gpm_StrictDouble | Check whether event contains only a double-click event.
Gpm_AnyDouble | Check whether event has double click event.
Gpm_StrictTriple | Check whether event contains only a triple-click event.
Gpm_AnySingle | Check whether event has a single click event.


Gpm_StrictTriple

Check whether event contains only a triple-click event.

Declaration

Source position: gpm.pp line 161

function Gpm_StrictTriple(

  EventType: LongInt

):Boolean;

Description

Gpm_StrictTriple returns true if EventType contains only a triple click event, False otherwise.

Errors

None.

See also

Gpm_AnyTriple | Check whether event has a triple click event.
Gpm_StrictDouble | Check whether event contains only a double-click event.
Gpm_AnyDouble | Check whether event has double click event.
Gpm_StrictSingle | Check whether event contains only a single-click event.
Gpm_AnySingle | Check whether event has a single click event.


Arc

Draw part of a circle

Declaration

Source position: graphh.inc line 798

procedure Arc(

  X: SmallInt;

  Y: SmallInt;

  StAngle: Word;

  EndAngle: Word;

  Radius: Word

);

Description

Arc draws part of a circle with center at (X,Y), radius radius, starting from angle start, stopping at angle stop. These angles are measured counterclockwise.

Errors

None.

See also

Circle | Draw a complete circle
Ellipse | Draw an ellipse
GetArcCoords | Return coordinates of last drawn arc or ellipse.
PieSlice | Draw a pie-slice
Sector | Draw and fill a sector of an ellipse


ArcCoordsType

Describe the last arc which was drawn on screen

Declaration

Source position: graphh.inc line 478

type ArcCoordsType = record
x: SmallInt; | Center X coordinate
y: SmallInt; | Center Y coordinate
xstart: SmallInt; | Drawing segment start X coordinate
ystart: SmallInt; | Drawing segment start Y coordinate
xend: SmallInt; | Drawing segment end X coordinate
yend: SmallInt; | Drawing segment end Y coordinate
end;


Bar

Draw filled rectangle

Declaration

Source position: graphh.inc line 784

procedure Bar(

  x1: SmallInt;

  y1: SmallInt;

  x2: SmallInt;

  y2: SmallInt

);

Description

Draws a rectangle with corners at (X1,Y1) and (X2,Y2) and fills it with the current color and fill-style.

Errors

None.

See also

Bar3D | Draw filled 3-dimensional rectangle
Rectangle | Draw a rectangle on the screen.


Bar3D

Draw filled 3-dimensional rectangle

Declaration

Source position: graphh.inc line 785

procedure Bar3D(

  x1: SmallInt;

  y1: SmallInt;

  x2: SmallInt;

  y2: SmallInt;

  depth: Word;

  top: Boolean

);

Description

Bar3d draws a 3-dimensional Bar with corners at (X1,Y1) and (X2,Y2) and fills it with the current color and fill-style. Depth specifies the number of pixels used to show the depth of the bar.

If Top is true; then a 3-dimensional top is drawn.

Errors

None.

See also

Bar | Draw filled rectangle
Rectangle | Draw a rectangle on the screen.


ClearDevice

Clear the complete screen

Declaration

Source position: graphh.inc line 752

procedure ClearDevice;

Description

Clears the graphical screen (with the current background color), and sets the pointer at (0,0).

Errors

None.

See also

ClearViewPort | Clear the current viewport
SetBkColor | Set background drawing color


Closegraph

Close graphical system.

Declaration

Source position: graphh.inc line 736

procedure Closegraph;

Description

Closes the graphical system, and restores the screen modus which was active before the graphical modus was activated.

Errors

None.

See also

InitGraph

Initialize grpahical system


DetectGraph

Detect correct graphical driver to use

Declaration

Source position: graphh.inc line 759

procedure DetectGraph(

  var GraphDriver: SmallInt;

  var GraphMode: SmallInt

);

Description

DetectGraph checks the hardware in the PC and determines the driver and screen-modus to be used. These are returned in Driver and Modus, and can be fed to InitGraph. See the InitGraph for a list of drivers and modi.

Errors

None.

See also

InitGraph

Initialize grpahical system


DrawPoly

Draw a polygone

Declaration

Source position: graphh.inc line 787

procedure DrawPoly(

  NumPoints: Word;

  var polypoints

);

Description

DrawPoly draws a polygone with NumberOfPoints corner points, using the current color and line-style. PolyPoints is an array of type PointType.

Errors

None.

See also

Bar | Draw filled rectangle
Bar3D | Draw filled 3-dimensional rectangle
Rectangle | Draw a rectangle on the screen.


Ellipse

Draw an ellipse

Declaration

Source position: graphh.inc line 802

procedure Ellipse(

  X: SmallInt;

  Y: SmallInt;

  stAngle: Word;

  EndAngle: Word;

  XRadius: Word;

  YRadius: Word

);

Description

Ellipse draws part of an ellipse with center at (X,Y). XRadius and Yradius are the horizontal and vertical radii of the ellipse. Start and Stop are the starting and stopping angles of the part of the ellipse. They are measured counterclockwise from the X-axis (3 o'clock is equal to 0 degrees). Only positive angles can be specified.

Errors

None.

See also

Arc | Draw part of a circle
Circle | Draw a complete circle
FillEllipse | Draw and fill an ellipse


ellipseproc

Standard ellipse drawing routine prototype.

Declaration

Source position: graphh.inc line 551

type ellipseproc = procedure(

  X: SmallInt;

  Y: SmallInt;

  XRadius: Word;

  YRadius: Word;

  stAngle: Word;

  EndAngle: Word;

  fp: patternlineproc

);


FillEllipse

Draw and fill an ellipse

Declaration

Source position: graphh.inc line 800

procedure FillEllipse(

  X: SmallInt;

  Y: SmallInt;

  XRadius: Word;

  YRadius: Word

);

Description

Ellipse draws an ellipse with center at (X,Y). XRadius and Yradius are the horizontal and vertical radii of the ellipse. The ellipse is filled with the current color and fill-style.

Errors

None.

See also

Arc | Draw part of a circle
Circle | Draw a complete circle
GetArcCoords | Return coordinates of last drawn arc or ellipse.
PieSlice | Draw a pie-slice
Sector | Draw and fill a sector of an ellipse


FillPoly

Draw, close and fill a polygone

Declaration

Source position: graphh.inc line 786

procedure FillPoly(

  NumPoints: Word;

  var PolyPoints

);

Description

FillPoly draws a polygone with NumberOfPoints corner points and fills it using the current color and line-style. PolyPoints is an array of type PointType.

Errors

None.

See also

Bar | Draw filled rectangle
Bar3D | Draw filled 3-dimensional rectangle
Rectangle | Draw a rectangle on the screen.


FloodFill

Fill an area with a given color

Declaration

Source position: graphh.inc line 790

procedure FloodFill(

  x: SmallInt;

  y: SmallInt;

  Border: Word

);

Description

Fills the area containing the point (X,Y), bounded by the color BorderColor.

Errors

None

See also

SetColor | Set foreground drawing color
SetBkColor | Set background drawing color


GetArcCoords

Return coordinates of last drawn arc or ellipse.

Declaration

Source position: graphh.inc line 795

procedure GetArcCoords(

  var ArcCoords: ArcCoordsType

);

Description

GetArcCoords returns the coordinates of the latest Arc or Ellipse call.

Errors

None.

See also

Arc | Draw part of a circle
Ellipse | Draw an ellipse


GetAspectRatio

Return screen resolution

Declaration

Source position: graphh.inc line 793

procedure GetAspectRatio(

  var Xasp: Word;

  var Yasp: Word

);

Description

GetAspectRatio determines the effective resolution of the screen. The aspect ration can then be calculated as Xasp/Yasp.

Errors

None.

See also

InitGraph | Initialize grpahical system
SetAspectRatio | Set aspect ration of the screen


GetColor

Return current drawing color

Declaration

Source position: graphh.inc line 772

function GetColor: Word;

Description

GetColor returns the current drawing color (the palette entry).

Errors

None.

See also

GetColor | Return current drawing color
SetBkColor | Set background drawing color


GetDefaultPalette

Return default palette

Declaration

Source position: graphh.inc line 779

procedure GetDefaultPalette(

  var Palette: PaletteType

);

Description

GetDefaultPalette returns the current palette in Palette.

Errors

None.

See also

GetColor | Return current drawing color
GetBkColor | Return current background color


GetDirectVideo

Determine whether direct video mode is active.

Declaration

Source position: graphh.inc line 769

function GetDirectVideo: Boolean;


GetDriverName

Return current driver name

Declaration

Source position: graphh.inc line 764

function GetDriverName: string;

Description

GetDriverName returns a string containing the name of the current driver.

Errors

None.

See also

GetModeName | Return description a modus
InitGraph | Initialize grpahical system


GetFillPattern

Return current fill pattern

Declaration

Source position: graphh.inc line 756

procedure GetFillPattern(

  var FillPattern: FillPatternType

);

Description

GetFillPattern returns an array with the current fill-pattern in FillPattern

Errors

None

See also

SetFillPattern

Set drawing fill pattern


GetFillSettings

Return current fill settings

Declaration

Source position: graphh.inc line 755

procedure GetFillSettings(

  var Fillinfo: FillSettingsType

);

Description

GetFillSettings returns the current fill-settings in FillInfo

Errors

None.

See also

SetFillPattern

Set drawing fill pattern


GetGraphMode

Get current graphical modus

Declaration

Source position: graphh.inc line 745

function GetGraphMode: SmallInt;

Description

GetGraphMode returns the current graphical modus

Errors

None.

See also

InitGraph

Initialize grpahical system


GetLineSettings

Get current line drawing settings

Declaration

Source position: graphh.inc line 757

procedure GetLineSettings(

  var ActiveLineInfo: LineSettingsType

);

Description

GetLineSettings returns the current Line settings in LineInfo

Errors

None.

See also

SetLineStyle

Set line drawing style


GetMaxColor

return maximum number of colors

Declaration

Source position: graphh.inc line 774

function GetMaxColor: Word;

Description

GetMaxColor returns the maximum color-number which can be set with SetColor. Contrary to Turbo Pascal, this color isn't always guaranteed to be white (for instance in 256+ color modes).

Errors

None.

See also

SetColor | Set foreground drawing color
GetPaletteSize | Return maximal number of entries in current palette


GetMaxMode

Return biggest mode for the current driver

Declaration

Source position: graphh.inc line 746

function GetMaxMode: SmallInt;

Description

GetMaxMode returns the highest modus for the current driver.

Errors

None.

See also

InitGraph

Initialize grpahical system


GetMaxX

Return maximal X coordinate

Declaration

Source position: graphh.inc line 739

function GetMaxX: SmallInt;

Description

GetMaxX returns the maximum horizontal screen length

Errors

None.

See also

GetMaxY

Return maximal Y coordinate


GetMaxY

Return maximal Y coordinate

Declaration

Source position: graphh.inc line 740

function GetMaxY: SmallInt;

Description

GetMaxY returns the maximum number of screen lines

Errors

None.

See also

GetMaxY

Return maximal Y coordinate


GetModeName

Return description a modus

Declaration

Source position: graphh.inc line 743

function GetModeName(

  ModeNumber: SmallInt

):string;

Description

GetModeName Returns a string with the name of modus Modus

Errors

None.

See also

GetDriverName | Return current driver name
InitGraph | Initialize grpahical system


GetModeRange

Return lowest and highest modus of current driver

Declaration

Source position: graphh.inc line 748

procedure GetModeRange(

  GraphDriver: SmallInt;

  var LoMode: SmallInt;

  var HiMode: SmallInt

);

Description

GetModeRange returns the Lowest and Highest modus of the currently installed driver. If no modes are supported for this driver, HiModus will be -1.

Errors

None.

See also

InitGraph

Initialize grpahical system


GetPalette

Return current palette

Declaration

Source position: graphh.inc line 777

procedure GetPalette(

  var Palette: PaletteType

);

Description

GetPalette returns in Palette the current palette.

Errors

None.

See also

GetPaletteSize | Return maximal number of entries in current palette
SetPalette | Set palette entry using color constant


GetPaletteSize

Return maximal number of entries in current palette

Declaration

Source position: graphh.inc line 778

function GetPaletteSize: SmallInt;

Description

GetPaletteSize returns the maximum number of entries in the current palette.

Errors

None.

See also

GetPalette | Return current palette
SetPalette | Set palette entry using color constant


GetTextSettings

Return current text style

Declaration

Source position: graphh.inc line 808

procedure GetTextSettings(

  var TextInfo: TextSettingsType

);

Description

GetTextSettings returns the current text style settings : The font, direction, size and placement as set with SetTextStyle and SetTextJustify

Errors

None.

See also

SetTextStyle | Set text style
SetTextJustify | Set text placement style


GetViewSettings

Return current viewport

Declaration

Source position: graphh.inc line 753

procedure GetViewSettings(

  var viewport: ViewPortType

);

Description

GetViewSettings returns the current viewport and clipping settings in ViewPort.

Errors

None.

See also

SetViewPort

Set the graphical drawing window


GetX

Return current cursor X position

Declaration

Source position: graphh.inc line 749

function GetX: SmallInt;

Description

GetX returns the X-coordinate of the current position of the graphical pointer

Errors

None.

See also

GetY

Return current cursor Y position


GetY

Return current cursor Y position

Declaration

Source position: graphh.inc line 750

function GetY: SmallInt;

Description

GetY returns the Y-coordinate of the current position of the graphical pointer

Errors

None.

See also

GetX

Return current cursor X position


GraphDefaults

Reset graphical mode to defaults

Declaration

Source position: graphh.inc line 751

procedure GraphDefaults;

Description

GraphDefaults resets all settings for viewport, palette, foreground and background pattern, line-style and pattern, filling style, filling color and pattern, font, text-placement and text size.

Errors

None.

See also

SetViewPort | Set the graphical drawing window
SetFillStyle | Set drawing fill style
SetColor | Set foreground drawing color
SetBkColor | Set background drawing color
SetLineStyle | Set line drawing style


GraphErrorMsg

Return a description of an error

Declaration

Source position: graphh.inc line 738

function GraphErrorMsg(

  ErrorCode: SmallInt

):string;

Description

GraphErrorMsg returns a string describing the error Errorcode. This string can be used to let the user know what went wrong.

Errors

None.

See also

GraphResult

Result of last graphical operation


GraphResult

Result of last graphical operation

Declaration

Source position: graphh.inc line 742

function GraphResult: SmallInt;

Description

GraphResult returns an error-code for the last graphical operation. If the returned value is zero, all went well. A value different from zero means an error has occurred. besides all operations which draw something on the screen, the following procedures also can produce a GraphResult different from zero:

  • InstallUserFont
  • SetLineStyle
  • SetWriteMode
  • SetFillStyle
  • SetTextJustify
  • SetGraphMode
  • SetTextStyle

Errors

None.

See also

GraphErrorMsg

Return a description of an error


InitGraph

Initialize grpahical system

Declaration

Source position: graphh.inc line 758

procedure InitGraph(

  var GraphDriver: SmallInt;

  var GraphMode: SmallInt;

  const PathToDriver: string

);

Description

InitGraph initializes the graph package. GraphDriver has two valid values: GraphDriver=0 which performs an auto detect and initializes the highest possible mode with the most colors. 1024x768x64K is the highest possible resolution supported by the driver, if you need a higher resolution, you must edit MODES.PPI. If you need another mode, then set GraphDriver to a value different from zero and graphmode to the mode you wish (VESA modes where 640x480x256 is 101h etc.). PathToDriver is only needed, if you use the BGI fonts from Borland. Free Pascal does not offer BGI fonts like Borland, these must be obtained separately.

Example code:

var
   gd,gm : integer;
   PathToDriver : string;
begin
   gd:=detect; { highest possible resolution }
   gm:=0; { not needed, auto detection }
   PathToDriver:='C:\PP\BGI'; { path to BGI fonts,
                                drivers aren't needed }
   InitGraph(gd,gm,PathToDriver);
   if GraphResult<>grok then
     halt; ..... { whatever you need }
   CloseGraph; { restores the old graphics mode }
end.

Errors

None.

See also

Modes | A word about mode selection
DetectGraph | Detect correct graphical driver to use
CloseGraph | Close graphical system.
GraphResult | Result of last graphical operation


InstallUserDriver

Install a user driver

Declaration

Source position: graphh.inc line 760

function InstallUserDriver(

  Name: string;

  AutoDetectPtr: Pointer

):SmallInt;

Description

InstallUserDriver adds the device-driver DriverPath to the list of .BGI drivers. AutoDetectPtr is a pointer to a possible auto-detect function.

Errors

None.

See also

InitGraph | Initialize grpahical system
InstallUserFont | Install a user-defined font


InstallUserFont

Install a user-defined font

Declaration

Source position: graphh.inc line 806

function InstallUserFont(

  const FontFileName: string

):SmallInt;

Description

InstallUserFont adds the font in FontPath to the list of fonts of the .BGI system.

Errors

None.

See also

InitGraph | Initialize grpahical system
InstallUserDriver | Install a user driver


LineRel

Draw a line starting from current position in given direction

Declaration

Source position: graphh.inc line 788

procedure LineRel(

  Dx: SmallInt;

  Dy: SmallInt

);

Description

LineRel draws a line starting from the current pointer position to the point(DX,DY), relative to the current position, in the current line style and color. The Current Position is set to the endpoint of the line.

Errors

None.

See also

Line | Draw a line between 2 points
LineTo | Draw a line starting from current position to a given point


LineTo

Draw a line starting from current position to a given point

Declaration

Source position: graphh.inc line 789

procedure LineTo(

  X: SmallInt;

  Y: SmallInt

);

Description

LineTo draws a line starting from the current pointer position to the point(DX,DY), relative to the current position, in the current line style and color. The Current position is set to the end of the line.

Errors

None.

See also

LineRel | Draw a line starting from current position in given direction
Line | Draw a line between 2 points


MoveRel

Move cursor relative to current position

Declaration

Source position: graphh.inc line 765

procedure MoveRel(

  Dx: SmallInt;

  Dy: SmallInt

);

Description

MoveRel moves the pointer to the point (DX,DY), relative to the current pointer position

Errors

None.

See also

MoveTo

Move cursor to absolute position.


MoveTo

Move cursor to absolute position.

Declaration

Source position: graphh.inc line 766

procedure MoveTo(

  X: SmallInt;

  Y: SmallInt

);

Description

MoveTo moves the pointer to the point (X,Y).

Errors

None.

See also

MoveRel

Move cursor relative to current position


OutText

Write text on the screen at the current location.

Declaration

Source position: graphh.inc line 815

procedure OutText(

  const TextString: string

);

Description

OutText puts TextString on the screen, at the current pointer position, using the current font and text settings. The current position is moved to the end of the text.

Errors

None.

See also

OutTextXY

Write text on the screen on given position


OutTextXY

Write text on the screen on given position

Declaration

Source position: graphh.inc line 665

var OutTextXY: OutTextXYProc = ;

Description

OutText puts TextString on the screen, at position (X,Y), using the current font and text settings. The current position is moved to the end of the text.

Errors

None.

See also

OutText

Write text on the screen at the current location.


OutTextXYProc

This routine prototype is a hook for OutTextXY

Declaration

Source position: graphh.inc line 588

type OutTextXYProc = procedure(

  x: SmallInt;

  y: SmallInt;

  const TextString: string

);


PieSlice

Draw a pie-slice

Declaration

Source position: graphh.inc line 799

procedure PieSlice(

  X: SmallInt;

  Y: SmallInt;

  stangle: SmallInt;

  endAngle: SmallInt;

  Radius: Word

);

Description

PieSlice draws and fills a sector of a circle with center (X,Y) and radius Radius, starting at angle Start and ending at angle Stop.

Errors

None.

See also

Arc | Draw part of a circle
Circle | Draw a complete circle
Sector | Draw and fill a sector of an ellipse


queryadapterinfo

Function called to retrieve the current video adapter settings.

Declaration

Source position: graphh.inc line 734

function queryadapterinfo: PModeInfo;


Rectangle

Draw a rectangle on the screen.

Declaration

Source position: graphh.inc line 783

procedure Rectangle(

  x1: SmallInt;

  y1: SmallInt;

  x2: SmallInt;

  y2: SmallInt

);

Description

Draws a rectangle with corners at (X1,Y1) and (X2,Y2), using the current color and style.

Errors

None.

See also

Bar | Draw filled rectangle
Bar3D | Draw filled 3-dimensional rectangle


RegisterBGIDriver

Register a new BGI driver.

Declaration

Source position: graphh.inc line 761

function RegisterBGIDriver(

  driver: pointer

):SmallInt;

Description

Registers a user-defined BGI driver

Errors

None.

See also

InstallUserDriver | Install a user driver
RegisterBGIFont | Register a new BGI font


RegisterBGIfont

Register a new BGI font

Declaration

Source position: graphh.inc line 807

function RegisterBGIfont(

  font: pointer

):SmallInt;

Description

Registers a user-defined BGI driver

Errors

None.

See also

InstallUserFont | Install a user-defined font
RegisterBGIDriver | Register a new BGI driver.


RestoreCrtMode

Restore text screen

Declaration

Source position: graphh.inc line 747

procedure RestoreCrtMode;

Description

Restores the screen modus which was active before the graphical modus was started.

To get back to the graph mode you were last in, you can use SetGraphMode(GetGraphMode)

Errors

None.

See also

InitGraph

Initialize grpahical system


Sector

Draw and fill a sector of an ellipse

Declaration

Source position: graphh.inc line 801

procedure Sector(

  x: SmallInt;

  y: SmallInt;

  StAngle: Word;

  EndAngle: Word;

  XRadius: Word;

  YRadius: Word

);

Description

Sector draws and fills a sector of an ellipse with center (X,Y) and radii XRadius and YRadius, starting at angle Start and ending at angle Stop.

Errors

None.

See also

Arc | Draw part of a circle
Circle | Draw a complete circle
PieSlice | Draw a pie-slice


SetAspectRatio

Set aspect ration of the screen

Declaration

Source position: graphh.inc line 794

procedure SetAspectRatio(

  Xasp: Word;

  Yasp: Word

);

Description

Sets the aspect ratio of the current screen to Xasp/Yasp.

Errors

None

See also

InitGraph | Initialize grpahical system
GetAspectRatio | Return screen resolution


SetColor

Set foreground drawing color

Declaration

Source position: graphh.inc line 773

procedure SetColor(

  Color: Word

);

Description

Sets the foreground color to Color.

Errors

None.

See also

GetColor | Return current drawing color
SetBkColor | Set background drawing color
SetWriteMode | Specify binary operation to perform when drawing on screen


SetDirectVideo

Attempt to enter direct video mode.

Declaration

Source position: graphh.inc line 768

procedure SetDirectVideo(

  DirectAccess: Boolean

);

Description

SetDirectVideo attempts to enter direct video mode. In that mode, everything is drawn straight in the video buffer.


SetFillPattern

Set drawing fill pattern

Declaration

Source position: graphh.inc line 763

procedure SetFillPattern(

  Pattern: FillPatternType;

  Color: Word

);

Description

SetFillPattern sets the current fill-pattern to FillPattern, and the filling color to Color The pattern is an 8x8 raster, corresponding to the 64 bits in FillPattern.

Errors

None

See also

GetFillPattern | Return current fill pattern
SetFillStyle | Set drawing fill style
SetWriteMode | Specify binary operation to perform when drawing on screen


SetFillStyle

Set drawing fill style

Declaration

Source position: graphh.inc line 762

procedure SetFillStyle(

  Pattern: Word;

  Color: Word

);

Description

SetFillStyle sets the filling pattern and color to one of the predefined filling patterns. Pattern can be one of the following predefined constants :

EmptyFill
Uses backgroundcolor.
SolidFill
Uses filling color
LineFill
Fills with horizontal lines.
ltSlashFill
Fills with lines from left-under to top-right.
SlashFill
Idem as previous, thick lines.
BkSlashFill
Fills with thick lines from left-Top to bottom-right.
LtBkSlashFill
Idem as previous, normal lines.
HatchFill
Fills with a hatch-like pattern.
XHatchFill
Fills with a hatch pattern, rotated 45 degrees.
InterLeaveFill
WideDotFill
Fills with dots, wide spacing.
CloseDotFill
Fills with dots, narrow spacing.
UserFill
Fills with a user-defined pattern.

Errors

None.

See also

SetFillPattern | Set drawing fill pattern
SetWriteMode | Specify binary operation to perform when drawing on screen


SetGraphMode

Set graphical mode

Declaration

Source position: graphh.inc line 744

procedure SetGraphMode(

  Mode: SmallInt

);

Description

SetGraphMode sets the graphical mode and clears the screen.

Errors

None.

See also

InitGraph

Initialize grpahical system


SetLineStyle

Set line drawing style

Declaration

Source position: graphh.inc line 737

procedure SetLineStyle(

  LineStyle: Word;

  Pattern: Word;

  Thickness: Word

);

Description

SetLineStyle sets the drawing style for lines. You can specify a LineStyle which is one of the following pre-defined constants:

Solidln
draws a solid line.
Dottedln
Draws a dotted line.
Centerln
draws a non-broken centered line.
Dashedln
draws a dashed line.
UserBitln
Draws a User-defined bit pattern.

If UserBitln is specified then Pattern contains the bit pattern. In all another cases, Pattern is ignored. The parameter Width indicates how thick the line should be. You can specify one of the following pre-defined constants:

NormWidth
Normal line width
ThickWidth
Double line width

Errors

None.

See also

GetLineSettings | Get current line drawing settings
SetWriteMode | Specify binary operation to perform when drawing on screen


SetPalette

Set palette entry using color constant

Declaration

Source position: graphh.inc line 776

procedure SetPalette(

  ColorNum: Word;

  Color: ShortInt

);

Description

SetPalette changes the ColorNr-th entry in the palette to NewColor

Errors

None.

See also

SetAllPalette | Specify a complete new palette
SetRGBPalette | Set palette entry using RGB value


SetTextJustify

Set text placement style

Declaration

Source position: graphh.inc line 811

procedure SetTextJustify(

  horiz: Word;

  vert: Word

);

Description

SetTextJustify controls the placement of new text, relative to the (graphical) cursor position. Horizontal controls horizontal placement, and can be one of the following pre-defined constants:

LeftText
Text is set left of the pointer.
CenterText
Text is set centered horizontally on the pointer.
RightText
Text is set to the right of the pointer.

Vertical controls the vertical placement of the text, relative to the (graphical) cursor position. Its value can be one of the following pre-defined constants :

BottomText
Text is placed under the pointer.
CenterText
Text is placed centered vertically on the pointer.
TopText
Text is placed above the pointer.

Errors

None.

See also

OutText | Write text on the screen at the current location.
OutTextXY | Write text on the screen on given position


SetTextStyle

Set text style

Declaration

Source position: graphh.inc line 812

procedure SetTextStyle(

  font: Word;

  direction: Word;

  charsize: Word

);

Description

SetTextStyle controls the style of text to be put on the screen. pre-defined constants for Font are:

DefaultFont
The default font
TriplexFont
A special font
SmallFont
A smaller font
SansSerifFont
A sans-serif font (like Arial)
GothicFont
A gothic font
ScriptFont
A script font
SimpleFont
A simple font
TSCRFont
Terminal screen font
LCOMFont
?
EuroFont
?
BoldFont
A bold typeface font

Pre-defined constants for Direction are :

HorizDir
Write horizontal
VertDir
Write vertical

Errors

None.

See also

GetTextSettings

Return current text style


SetUserCharSize

Set user character size for vector font

Declaration

Source position: graphh.inc line 813

procedure SetUserCharSize(

  Multx: Word;

  Divx: Word;

  Multy: Word;

  Divy: Word

);

Description

Sets the width and height of vector-fonts. The horizontal size is given by Xasp1/Xasp2, and the vertical size by Yasp1/Yasp2.

Errors

None.

See also

SetTextStyle

Set text style


SetViewPort

Set the graphical drawing window

Declaration

Source position: graphh.inc line 741

procedure SetViewPort(

  X1: SmallInt;

  Y1: SmallInt;

  X2: SmallInt;

  Y2: SmallInt;

  Clip: Boolean

);

Description

Sets the current graphical viewport (window) to the rectangle defined by the top-left corner (X1,Y1) and the bottom-right corner (X2,Y2). If Clip is true, anything drawn outside the viewport (window) will be clipped (i.e. not drawn). Coordinates specified after this call are relative to the top-left corner of the viewport.

Errors

None.

See also

GetViewSettings

Return current viewport


SetWriteMode

Specify binary operation to perform when drawing on screen

Declaration

Source position: graphh.inc line 754

procedure SetWriteMode(

  WriteMode: SmallInt

);

Description

SetWriteMode controls the drawing of lines on the screen. It controls the binary operation used when drawing lines on the screen. Mode can be one of the following pre-defined constants:

CopyPut
Draw as specified using current bitmask and color
XORPut
Draw XOR-ing current bitmask and color

Errors

None.

See also

SetColor | Set foreground drawing color
SetBkColor | Set background drawing color
SetLineStyle | Set line drawing style
SetFillStyle | Set drawing fill style


TextHeight

Return height (in pixels) of the given string

Declaration

Source position: graphh.inc line 809

function TextHeight(

  const TextString: string

):Word;

Description

TextHeight returns the height (in pixels) of the string S in the current font and text-size.

Errors

None.

See also

TextWidth

Return width (in pixels) of the given string


TextWidth

Return width (in pixels) of the given string

Declaration

Source position: graphh.inc line 810

function TextWidth(

  const TextString: string

):Word;

Description

TextHeight returns the width (in pixels) of the string S in the current font and text-size.

Errors

None.

See also

TextHeight

Return height (in pixels) of the given string


CheckPointer

Check if a pointer is in the address range of the application

Declaration

Source position: heaptrc.pp line 53

procedure CheckPointer(

  p: pointer

);

Description

CheckPointer checks if the pointer is in the address range of the application, more specifically, if it is in the heap. if not, it prints an error and stops the program with aruntime error 204.


DumpHeap

Dump memory usage report to stderr.

Declaration

Source position: heaptrc.pp line 32

procedure DumpHeap;

procedure DumpHeap(

  SkipIfNoLeaks: Boolean

);

Description

DumpHeap dumps to standard output a summary of memory usage. It is called automatically by the heaptrc unit when your program exits (by installing an exit procedure), but it can be called at any time.

Errors

None.


SetHeapExtraInfo

Store extra information in blocks.

Declaration

Source position: heaptrc.pp line 47

procedure SetHeapExtraInfo(

  size: PtrUInt;

  fillproc: tFillExtraInfoProc;

  displayproc: tdisplayextrainfoProc

);

Description

You can use SetHeapExtraInfo to store extra info in the blocks that the heaptrc unit reserves when tracing getmem calls. Size indicates the size (in bytes) that the trace mechanism should reserve for your extra information. For each call to getmem, FillProc will be called, and passed a pointer to the memory reserved.

When dumping the memory summary, the extra info is shown by calling displayproc and passing it the memory location which was filled by fillproc. It should write the information in readable form to the text file provided in the call to displayproc

Errors

You can only call SetHeapExtraInfo if no memroy has been allocated yet. If memory was already allocated prior to the call to SetHeapExtraInfo, then an error will be displayed on standard error output, and a DumpHeap is executed.

See also

DumpHeap | Dump memory usage report to stderr.
SetHeapTraceOutput | Specify filename for heap trace output.

Example

Program heapex;

{ Program used to demonstrate the usage of heaptrc unit }

Uses heaptrc;

Var P1 : ^Longint;
    P2 : Pointer;
    I : longint;
    Marker : Longint;

Procedure SetMarker (P : pointer);

Type PLongint = ^Longint;

begin
  PLongint(P)^:=Marker;
end;

Procedure  Part1;

begin
  // Blocks allocated here are marked with $FFAAFFAA = -5570646
  Marker := $FFAAFFAA;
  New(P1);
  New(P1);
  Dispose(P1);
  For I:=1 to 10 do
    begin
    GetMem (P2,128);
    If (I mod 2) = 0 Then FreeMem(P2,128);
    end;
  GetMem(P2,128);
end;

Procedure  Part2;

begin
  // Blocks allocated here are marked with $FAFAFAFA = -84215046
  Marker := $FAFAFAFA;
  New(P1);
  New(P1);
  Dispose(P1);
  For I:=1 to 10 do
    begin
    GetMem (P2,128);
    If (I mod 2) = 0 Then FreeMem(P2,128);
    end;
  GetMem(P2,128);
end;

begin
 SetExtraInfo(SizeOf(Marker),@SetMarker);
 Writeln ('Part 1');
 part1;
 Writeln('Part 2');
 part2;
end.


SetHeapTraceOutput

Specify filename for heap trace output.

Declaration

Source position: heaptrc.pp line 50

procedure SetHeapTraceOutput(

  const name: string

); overload;

procedure SetHeapTraceOutput(

  var ATextOutput: Text

); overload;

Description

SetHeapTraceOutput sets the filename into which heap trace info will be written. By default information is written to standard output, this function allows you to redirect the information to a file with full filename name.

Errors

If the file cannot be written to, errors will occur when writing the trace.

See also

SetHeapExtraInfo

Store extra information in blocks.


AddSequence

Declaration

Source position: keyboard.pp line 47

procedure AddSequence(

  const St: string;

  AChar: Byte;

  AScan: Byte

);


AddSpecialSequence

[Overview][Constants][Types][Procedures and functions][Index] Reference for unit 'keyboard' (#rtl)

AddSpecialSequence (platform)

Add a handler for a special key sequence

Declaration

Source position: keyboard.pp line 51

function AddSpecialSequence(

  const St: string;

  Proc: Tprocedure

):PTreeElement;

Description

AddSpecialSequence adds a sequence of key combinations to the keyboard handler. When the key combination specified in st is encountered, then Proc will be executed. The function returns the element in the special key sequence handling tree which handles st.

See also

AddSequence


DoneKeyboard

Deactivate keyboard driver.

Declaration

Source position: keybrdh.inc line 145

procedure DoneKeyboard;

Description

DoneKeyboard de-initializes the keyboard interface if the keyboard driver is active. If the keyboard driver is not active, the function does nothing.

This will cause the keyboard driver to clear up any allocated memory, or restores the console or terminal the program was running in to its initial state before the call to InitKeyBoard. This function should be called on program exit. Failing to do so may leave the terminal or console window in an unusable state. Its exact action depends on the platform on which the program is running.

On Unix the default keyboard driver restores the line ending of system.output to #10.

For an example, see most other functions.

Errors

None.

See also

InitKeyBoard

Initialize the keyboard driver.


FindSequence

Declaration

Source position: keyboard.pp line 48

function FindSequence(

  const St: string;

  var AChar: Byte;

  var Ascan: Byte

):Boolean;


FunctionKeyName

Return string representation of a function key code.

Declaration

Source position: keybrdh.inc line 198

function FunctionKeyName(

  KeyCode: Word

):string;

Description

FunctionKeyName returns a string representation of the function key with code KeyCode. This can be an actual function key, or one of the cursor movement keys.

Errors

In case KeyCode does not contain a function code, the SUnknownFunctionKey string is returned, appended with the KeyCode.

See also

ShiftStateToString | Return description of key event shift state
KeyEventToString | Return a string describing the key event.

Example

Program Example8;

{ Program to demonstrate the FunctionKeyName function. }

Uses keyboard;

Var
  K : TkeyEvent;

begin
  InitKeyboard;
  Writeln('Press function keys, press "q" to end.');
  Repeat
    K:=GetKeyEvent;
    K:=TranslateKeyEvent(K);
    If IsFunctionKey(k) then
      begin
      Write('Got function key : ');
      Writeln(FunctionKeyName(TkeyRecord(K).KeyCode));
      end;
  Until (GetKeyEventChar(K)='q');
  DoneKeyboard;
end.


GetKeyboardDriver

Return the current keyboard driver record.

Declaration

Source position: keybrdh.inc line 192

procedure GetKeyboardDriver(

  var Driver: TKeyboardDriver

);

Description

GetKeyBoardDriver returns in Driver the currently active keyboard driver. This function can be used to enhance an existing keyboarddriver.

For more information on getting and setting the keyboard driver kbddriver.

Errors

None.

See also

SetKeyboardDriver

Set a new keyboard driver.


GetKeyEvent

Get the next raw key event, wait if needed.

Declaration

Source position: keybrdh.inc line 148

function GetKeyEvent: TKeyEvent;

Description

GetKeyEvent returns the last keyevent if it is available, or waits for one if none is available. A non-blocking version is available in PollKeyEvent.

The returned key is encoded as a TKeyEvent type variable, and is normally the physical key scan code, (the scan code is driver dependent) which can be translated with one of the translation functions TranslateKeyEvent or TranslateKeyEventUniCode. See the types section for a description of how the key is described.

Errors

If no key became available (e.g. when the driver does not support it), 0 is returned.

See also

PutKeyEvent | Put a key event in the event queue.
PollKeyEvent | Get next key event, but does not wait.
TranslateKeyEvent | Translate raw event to ascii key event
TranslateKeyEventUniCode | Translate raw event to UNICode key event

Example

program example1;

{ This program demonstrates the GetKeyEvent function }

uses keyboard;

Var
  K : TKeyEvent;

begin
  InitKeyBoard;
  Writeln('Press keys, press "q" to end.');
  Repeat
    K:=GetKeyEvent;
    K:=TranslateKeyEvent(K);
    Write('Got key event with ');
    Case GetKeyEventFlags(K) of
      kbASCII    : Writeln('ASCII key');
      kbUniCode  : Writeln('Unicode key');
      kbFnKey    : Writeln('Function key');
      kbPhys     : Writeln('Physical key');
      kbReleased : Writeln('Released key event');
    end;
    Writeln('Got key : ',KeyEventToString(K));
  Until (GetKeyEventChar(K)='q');
  DoneKeyBoard;
end.


GetKeyEventChar

Get the character key part of a key event.

Declaration

Source position: keybrdh.inc line 171

function GetKeyEventChar(

  KeyEvent: TKeyEvent

):Char;

Description

GetKeyEventChar returns the charcode part of the given KeyEvent, if it contains a translated character key keycode. The charcode is simply the ascii code of the character key that was pressed.

It returns the null character if the key was not a character key, but e.g. a function key.

For an example, see GetKeyEvent

Errors

None.

See also

GetKeyEventUniCode | Return the unicode key event.
GetKeyEventShiftState | Return the current state of the shift keys.
GetKeyEventFlags | Extract the flags from a key event.
GetKeyEventCode | Translate function key part of a key event code.
GetKeyEvent | Get the next raw key event, wait if needed.


GetKeyEventCode

Translate function key part of a key event code.

Declaration

Source position: keybrdh.inc line 179

function GetKeyEventCode(

  KeyEvent: TKeyEvent

):Word;

Description

GetKeyEventCode returns the translated function keycode part of the given KeyEvent, if it contains a translated function key.

If the key pressed was not a function key, the null character is returned.

Errors

None.

See also

GetKeyEventUniCode | Return the unicode key event.
GetKeyEventShiftState | Return the current state of the shift keys.
GetKeyEventFlags | Extract the flags from a key event.
GetKeyEventChar | Get the character key part of a key event.
GetKeyEvent | Get the next raw key event, wait if needed.

Example

Program Example2;

{ Program to demonstrate the GetKeyEventCode function. }

Uses keyboard;

Var
  K : TKeyEvent;

begin
  InitKeyBoard;
  Writeln('Press function keys, or press "q" to end.');
  Repeat
    K:=GetKeyEvent;
    K:=TranslateKeyEvent(K);
    If (GetKeyEventFlags(K)<>KbfnKey) then
      Writeln('Not a function key')
    else
      begin
      Write('Got key (',GetKeyEventCode(K));
      Writeln(') : ',KeyEventToString(K));
      end;
  Until (GetKeyEventChar(K)='q');
  DoneKeyboard;
end.


GetKeyEventFlags

Extract the flags from a key event.

Declaration

Source position: keybrdh.inc line 168

function GetKeyEventFlags(

  KeyEvent: TKeyEvent

):Byte;

Description

GetKeyEventFlags returns the flags part of the given KeyEvent.

For an example, see GetKeyEvent

Errors

None.

See also

GetKeyEventUniCode | Return the unicode key event.
GetKeyEventShiftState | Return the current state of the shift keys.
GetKeyEventCode | Translate function key part of a key event code.
GetKeyEventChar | Get the character key part of a key event.
GetKeyEvent | Get the next raw key event, wait if needed.


GetKeyEventShiftState

Return the current state of the shift keys.

Declaration

Source position: keybrdh.inc line 183

function GetKeyEventShiftState(

  KeyEvent: TKeyEvent

):Byte;

Description

GetKeyEventShiftState returns the shift-state values of the given KeyEvent. This can be used to detect which of the modifier keys Shift, Alt or Ctrl were pressed. If none were pressed, zero is returned.

Note that this function does not always return expected results; In a unix X-Term, the modifier keys do not always work.

Errors

None.

See also

GetKeyEventUniCode | Return the unicode key event.
GetKeyEventFlags | Extract the flags from a key event.
GetKeyEventCode | Translate function key part of a key event code.
GetKeyEventChar | Get the character key part of a key event.
GetKeyEvent | Get the next raw key event, wait if needed.

Example

Program Example3;

{ Program to demonstrate the GetKeyEventShiftState function. }

Uses keyboard;

Var
  K : TKeyEvent;
  S : Byte;

begin
  InitKeyBoard;
  Write('Press keys combined with CTRL/SHIFT/ALT');
  Writeln(', or press "q" to end.');
  Repeat
    K:=GetKeyEvent;
    K:=TranslateKeyEvent(K);
    S:=GetKeyEventShiftState(K);
    If (S=0) then
      Writeln('No special keys pressed')
    else
      begin
      Writeln('Detected special keys : ',ShiftStateToString(K,False));
      Writeln('Got key : ',KeyEventToString(K));
      end;
  Until (GetKeyEventChar(K)='q');
  DoneKeyboard;
end.


GetKeyEventUniCode

Return the unicode key event.

Declaration

Source position: keybrdh.inc line 175

function GetKeyEventUniCode(

  KeyEvent: TKeyEvent

):Word;

Description

GetKeyEventUniCode returns the unicode part of the given KeyEvent if it contains a translated unicode character.

Errors

None.

See also

GetKeyEventShiftState | Return the current state of the shift keys.
GetKeyEventFlags | Extract the flags from a key event.
GetKeyEventCode | Translate function key part of a key event code.
GetKeyEventChar | Get the character key part of a key event.
GetKeyEvent | Get the next raw key event, wait if needed.


InitKeyboard

Initialize the keyboard driver.

Declaration

Source position: keybrdh.inc line 140

procedure InitKeyboard;

Description

InitKeyboard initializes the keyboard driver. If the driver is already active, it does nothing. When the driver is initialized, it will do everything necessary to ensure the functioning of the keyboard, including allocating memory, initializing the terminal etc.

This function should be called once, before using any of the keyboard functions. When it is called, the DoneKeyboard function should also be called before exiting the program or changing the keyboard driver with SetKeyboardDriver.

On Unix, the default keyboard driver sets terminal in raw mode. In raw mode the line feed behaves as an actual linefeed, i.e. the cursor is moved down one line. while the x coordinate does not change. To compensate, the default keyboard sets driver line ending of system.output to #13#10.

For an example, see most other functions.

Errors

None.

See also

DoneKeyboard | Deactivate keyboard driver.
SetKeyboardDriver | Set a new keyboard driver.


IsFunctionKey

Check whether a given event is a function key event.

Declaration

Source position: keybrdh.inc line 186

function IsFunctionKey(

  KeyEvent: TKeyEvent

):Boolean;

Description

IsFunctionKey returns True if the given key event in KeyEvent was a function key or not.

Errors

None.

See also

GetKeyEvent

Get the next raw key event, wait if needed.

Example

program example1;

{ This program demonstrates the GetKeyEvent function }

uses keyboard;

Var
  K : TKeyEvent;

begin
  InitKeyBoard;
  Writeln('Press keys, press "q" to end.');
  Repeat
    K:=GetKeyEvent;
    K:=TranslateKeyEvent(K);
    If IsFunctionKey(K) then
      Writeln('Got function key : ',KeyEventToString(K))
    else
      Writeln('not a function key.');
  Until (GetKeyEventChar(K)='q');
  DoneKeyBoard;
end.


KeyEventToString

Return a string describing the key event.

Declaration

Source position: keybrdh.inc line 200

function KeyEventToString(

  KeyEvent: TKeyEvent

):string;

Description

KeyEventToString translates the key event in KeyEvent to a human-readable description of the pressed key. It will use the constants described in the constants section to do so.

For an example, see most other functions.

Errors

If an unknown key is passed, the scancode is returned, prefixed with the SScanCode string.

See also

FunctionKeyName | Return string representation of a function key code.
ShiftStateToString | Return description of key event shift state


KeyPressed

Check event queue for key press

Declaration

Source position: keyboard.pp line 46

function KeyPressed: Boolean;

Description

KeyPressed checks the keyboard event queue to see whether a key event is present, and returns True if a key event is available. This function simply calls PollKeyEvent and checks for a valid result.

Errors

None.

See also

PollKeyEvent | Get next key event, but does not wait.
GetKeyEvent | Get the next raw key event, wait if needed.


PollKeyEvent

Get next key event, but does not wait.

Declaration

Source position: keybrdh.inc line 155

function PollKeyEvent: TKeyEvent;

Description

PollKeyEvent checks whether a key event is available, and returns it if one is found. If no event is pending, it returns 0.

Note that this does not remove the key from the pending keys. The key should still be retrieved from the pending key events list with the GetKeyEvent function.

Errors

None.

See also

PutKeyEvent | Put a key event in the event queue.
GetKeyEvent | Get the next raw key event, wait if needed.

Example

program example4;

{ This program demonstrates the PollKeyEvent function }

uses keyboard;

Var
  K : TKeyEvent;

begin
  InitKeyBoard;
  Writeln('Press keys, press "q" to end.');
  Repeat
    K:=PollKeyEvent;
    If k<>0 then
      begin
      K:=GetKeyEvent;
      K:=TranslateKeyEvent(K);
      writeln;
      Writeln('Got key : ',KeyEventToString(K));
      end
    else
      write('.');
  Until (GetKeyEventChar(K)='q');
  DoneKeyBoard;
end.


PollShiftStateEvent

Check current shift state.

Declaration

Source position: keybrdh.inc line 159

function PollShiftStateEvent: TKeyEvent;

Description

PollShiftStateEvent returns the current shiftstate in a keyevent. This will return 0 if there is no key event pending.

Errors

None.

See also

PollKeyEvent | Get next key event, but does not wait.
GetKeyEvent | Get the next raw key event, wait if needed.

Example

program example6;

{ This program demonstrates the PollShiftStateEvent function }

uses keyboard;

Var
  K : TKeyEvent;

begin
  InitKeyBoard;
  Writeln('Press keys, press "q" to end.');
  Repeat
    K:=PollKeyEvent;
    If k<>0 then
      begin
      K:=PollShiftStateEvent;
      Writeln('Got shift state : ',ShiftStateToString(K,False));
      // Consume the key.
      K:=GetKeyEvent;
      K:=TranslateKeyEvent(K);
      end
{    else
      write('.')};
  Until (GetKeyEventChar(K)='q');
  DoneKeyBoard;
end.


PutKeyEvent

Put a key event in the event queue.

Declaration

Source position: keybrdh.inc line 151

procedure PutKeyEvent(

  KeyEvent: TKeyEvent

);

Description

PutKeyEvent adds the given KeyEvent to the input queue. Please note that depending on the implementation this can hold only one value, i.e. when calling PutKeyEvent multiple times, only the last pushed key will be remembered.

Errors

None

See also

PollKeyEvent | Get next key event, but does not wait.
GetKeyEvent | Get the next raw key event, wait if needed.

Example

program example5;

{ This program demonstrates the PutKeyEvent function }

uses keyboard;

Var
  K,k2 : TKeyEvent;

begin
  InitKeyBoard;
  Writeln('Press keys, press "q" to end.');
  K2:=0;
  Repeat
    K:=GetKeyEvent;
    If k<>0 then
      begin
      if (k2 mod 2)=0 then
        K2:=K+1
      else
        K2:=0;
      K:=TranslateKeyEvent(K);
      Writeln('Got key : ',KeyEventToString(K));
      if (K2<>0) then
        begin
        PutKeyEvent(k2);
        K2:=TranslateKeyEVent(K2);
        Writeln('Put key : ',KeyEventToString(K2))
        end
      end
  Until (GetKeyEventChar(K)='q');
  DoneKeyBoard;
end.


RawReadKey

Declaration

Source position: keyboard.pp line 44

function RawReadKey: Char;


RawReadString

Declaration

Source position: keyboard.pp line 45

function RawReadString: string;


RestoreStartMode

Declaration

Source position: keyboard.pp line 49

procedure RestoreStartMode;


SetKeyboardDriver

Set a new keyboard driver.

Declaration

Source position: keybrdh.inc line 189

function SetKeyboardDriver(

  const Driver: TKeyboardDriver

):Boolean;

Description

SetKeyBoardDriver sets the keyboard driver to Driver, if the current keyboard driver is not yet initialized. If the current keyboard driver is initialized, then SetKeyboardDriver does nothing. Before setting the driver, the currently active driver should be disabled with a call to DoneKeyboard.

The function returns True if the driver was set, False if not.

For more information on setting the keyboard driver, see kbddriver.

Errors

None.

See also

GetKeyboardDriver | Return the current keyboard driver record.
DoneKeyboard | Deactivate keyboard driver.


ShiftStateToString

Return description of key event shift state

Declaration

Source position: keybrdh.inc line 195

function ShiftStateToString(

  KeyEvent: TKeyEvent;

  UseLeftRight: Boolean

):string;

Description

ShiftStateToString returns a string description of the shift state of the key event KeyEvent. This can be an empty string.

The shift state is described using the strings in the SShift constant.

For an example, see PollShiftStateEvent.

Errors

None.

See also

FunctionKeyName | Return string representation of a function key code.
KeyEventToString | Return a string describing the key event.


TranslateKeyEvent

Translate raw event to ascii key event

Declaration

Source position: keybrdh.inc line 162

function TranslateKeyEvent(

  KeyEvent: TKeyEvent

):TKeyEvent;

Description

TranslateKeyEvent performs ASCII translation of the KeyEvent. It translates a physical key to a function key if the key is a function key, and translates the physical key to the ordinal of the ascii character if there is an equivalent character key.

For an example, see GetKeyEvent

Errors

None.

See also

TranslateKeyEventUniCode

Translate raw event to UNICode key event


TranslateKeyEventUniCode

Translate raw event to UNICode key event

Declaration

Source position: keybrdh.inc line 165

function TranslateKeyEventUniCode(

  KeyEvent: TKeyEvent

):TKeyEvent;

Description

TranslateKeyEventUniCode performs Unicode translation of the KeyEvent. It is not yet implemented for all platforms.

Errors

If the function is not yet implemented, then the ErrorCode of the system unit will be set to errKbdNotImplemented

See also

TranslateKeyEvent

Translate raw event to ascii key event


CloseStabs

Close stabs info file descriptor

Declaration

Source position: lineinfo.pp line 33

procedure CloseStabs;

Description

CloseStabs will close the file descriptor that was used to read STABS debug information. This is useful if AllowReuseOfLineInfoData is used to cache STABS information.

Errors

None.

See also

AllowReuseOfLineInfoData

Speed up LineInfo reading by reusing already-read information


GetLineInfo

Return source line information about an address.

Declaration

Source position: lineinfo.pp line 31

function GetLineInfo(

  addr: PtrUInt;

  var func: string;

  var source: string;

  var line: LongInt

):Boolean;

Arguments

addr | Address to examine
func | Name of function in which Addr resides.
source | Source file in which Addr was implemented.
line | Line number on which Addr was implemented.

Function result

True if the line information was found, False if not.

Description

GetLineInfo returns source line information about the address addr. It searches this information in the stabs debugging information found in the binary: If the file was compiled without debug information, nothing will be returned. Upon succesful retrieval of the debug information, True is returned, and the func parameter is filled with the name of the function in which the address is located. The source parameter contains the name of the file in which the function was implemented, and line contains the line number in the source file for addr.

Errors

If no debug information is found, False is returned.


StabBackTraceStr

Get a backtrace from an address

Declaration

Source position: lineinfo.pp line 32

function StabBackTraceStr(

  addr: CodePointer

):string;

Description

StabBackTraceStr returns a backtrace from a memory address Addr.

This is the actual callback for the backtrace handler System.BackTraceStrFunc.

Errors

None.

See also

GetLineInfo

Return source line information about an address.


capget

Return the capabilities for the indicated thread

Declaration

Source position: linux.pp line 294

function capget(

  header: Puser_cap_header;

  data: Puser_cap_data

):cint;

Description

capget returns the capabilities of the indicated thread in header. The thread is identified by the process ID, or -1 for all caller (and child) process ID's.

Refer to the Linux man pages (7 capabilities) for more info.

Errors

On success, zero is returned, on error -1 is returned, and fperrno is set to the error.

See also

capset

Set the capabilities for the indicated thread


capset

Set the capabilities for the indicated thread

Declaration

Source position: linux.pp line 296

function capset(

  header: Puser_cap_header;

  data: Puser_cap_data

):cint;

Description

capget sets the capabilities of the indicated thread in header. The thread is identified by the process ID, or -1 for all caller (and child) process ID's.

Refer to the Linux man pages (7 capabilities) for more info.

Errors

On success, zero is returned, on error -1 is returned, and fperrno is set to the error.

See also

capget

Return the capabilities for the indicated thread


clock_getres

Get clock resolution

Declaration

Source position: linux.pp line 458

function clock_getres(

  clk_id: clockid_t;

  res: ptimespec

):cint;

Description

clock_getres returns the resolution of the clock specified in clk_id in the res structure. It can be Nil. if the clock exists and the resolution can be retrieved, 0 is returned.

Errors

On Error, -1 is returned. fpgeterrno can be used to get more detailed error information.

See also

clock_gettime | Get the time of a clock
clock_settime | Set the time of a clock


clock_gettime

Get the time of a clock

Declaration

Source position: linux.pp line 459

function clock_gettime(

  clk_id: clockid_t;

  tp: ptimespec

):cint;

Description

clock_gettime returns the current time of the clock specified in clk_id in the tp structure. If the clock exists and the time can be retrieved, 0 is returned.

Errors

On Error, -1 is returned. fpgeterrno can be used to get more detailed error information.

See also

clock_getres | Get clock resolution
clock_settime | Set the time of a clock


clock_settime

Set the time of a clock

Declaration

Source position: linux.pp line 460

function clock_settime(

  clk_id: clockid_t;

  tp: ptimespec

):cint;

Description

clock_settime sets the current time of the clock specified in clk_id. The time is specified in the tp structure. If the clock exists and the time can be retrieved, 0 is returned. The resolution is truncated to the resolution supported by the specified clock. Note that not all clocks can be set.

Errors

On Error, -1 is returned. fpgeterrno can be used to get more detailed error information.

See also

clock_getres | Get clock resolution
clock_gettime | Get the time of a clock


clone

Clone current process (create new thread)

Declaration

Source position: linux.pp line 217

function clone(

  func: TCloneFunc;

  sp: pointer;

  flags: LongInt;

  args: pointer

):LongInt;

Description

Clone creates a child process which is a copy of the parent process, just like FpFork does. In difference with Fork, however, the child process shares some parts of it's execution context with its parent, so it is suitable for the implementation of threads: many instances of a program that share the same memory.

When the child process is created, it starts executing the function Func, and passes it Args. The return value of Func is either the explicit return value of the function, or the exit code of the child process.

The sp pointer points to the memory reserved as stack space for the child process. This address should be the top of the memory block to be used as stack.

The Flags determine the behaviour of the Clone call. The low byte of the Flags contains the number of the signal that will be sent to the parent when the child dies. This may be bitwise OR'ed with the following constants:

CLONE_VM
Parent and child share the same memory space, including memory (un)mapped with subsequent mmap calls.
CLONE_FS
Parent and child have the same view of the filesystem; the chroot, chdir and umask calls affect both processes.
CLONE_FILES
the file descriptor table of parent and child is shared.
CLONE_SIGHAND
the parent and child share the same table of signal handlers. The signal masks are different, though.
CLONE_PID
PArent and child have the same process ID.

Clone returns the process ID in the parent process, and -1 if an error occurred.

Errors

On error, -1 is returned to the parent, and no child is created.

sys_eagain
Too many processes are running.
sys_enomem
Not enough memory to create child process.

See also

#rtl.baseunix.FpFork

Create child process


CLONE_CHILD_CLEARTID

Clone option: Erase child thread ID in child memory space when child exits.

Declaration

Source position: linux.pp line 69

const CLONE_CHILD_CLEARTID = $00200000;


CLONE_CHILD_SETTID

Clone option: Store child thread ID in child memory.

Declaration

Source position: linux.pp line 72

const CLONE_CHILD_SETTID = $01000000;


CLONE_DETACHED

Clone option: Start clone detached.

Declaration

Source position: linux.pp line 70

const CLONE_DETACHED = $00400000;


CLONE_FILES

Clone option: open files shared between processes

Declaration

Source position: linux.pp line 58

const CLONE_FILES = $00000400;


CLONE_FS

Clone option: fs info shared between processes

Declaration

Source position: linux.pp line 57

const CLONE_FS = $00000200;


CLONE_NEWNS

Clone options: Start child in new (filesystem) namespace.

Declaration

Source position: linux.pp line 65

const CLONE_NEWNS = $00020000;


CLONE_PARENT

Clone options: Set child parent to parent of calling process.

Declaration

Source position: linux.pp line 63

const CLONE_PARENT = $00008000;


CLONE_PARENT_SETTID

Clone option: Store child thread ID in memory in both parent and child.

Declaration

Source position: linux.pp line 68

const CLONE_PARENT_SETTID = $00100000;


CLONE_PID

Clone option: PID shared between processes

Declaration

Source position: linux.pp line 60

const CLONE_PID = $00001000;


CLONE_PTRACE

Clone options: if parent is traced, trace child also

Declaration

Source position: linux.pp line 61

const CLONE_PTRACE = $00002000;


CLONE_SETTLS

Clone option: The newtls parameter is the TLS descriptor of the child

Declaration

Source position: linux.pp line 67

const CLONE_SETTLS = $00080000;


CLONE_SIGHAND

Clone option: signal handlers shared between processes

Declaration

Source position: linux.pp line 59

const CLONE_SIGHAND = $00000800;


CLONE_STOPPED

Clone option: Start child in stopped state.

Declaration

Source position: linux.pp line 73

const CLONE_STOPPED = $02000000;


CLONE_SYSVSEM

Clone option: Caller and child share the same semaphore undo values

Declaration

Source position: linux.pp line 66

const CLONE_SYSVSEM = $00040000;


CLONE_THREAD

Clone options: Set child in thread group of calling process.

Declaration

Source position: linux.pp line 64

const CLONE_THREAD = $00010000;


CLONE_UNTRACED

Clone option: Do not allow a ptrace call on this clone.

Declaration

Source position: linux.pp line 71

const CLONE_UNTRACED = $00800000;


CLONE_VFORK

Clone options: suspend parent till child execs

Declaration

Source position: linux.pp line 62

const CLONE_VFORK = $00004000;


CLONE_VM

Clone option: VM shared between processes

Declaration

Source position: linux.pp line 56

const CLONE_VM = $00000100;


epoll_create

Create new epoll file descriptor

Declaration

Source position: linux.pp line 276

function epoll_create(

  size: cint

):cint;

Description

epoll_create creates a new epoll file descriptor. The size argument indicates to the kernel approximately how many structures should be allocated, but is by no means an upper limit.

On success, a file descriptor is returned that can be used in subsequent epoll_ctl or epoll_wait calls, and should be closed using the fpClose call.

Errors

On error, -1 is returned, and errno is set.

See also

epoll_ctl | Modify an epoll file descriptor
epoll_wait | Wait for an event on an epoll file descriptor.
fpClose | Close file descriptor


epoll_ctl

Modify an epoll file descriptor

Declaration

Source position: linux.pp line 278

function epoll_ctl(

  epfd: cint;

  op: cint;

  fd: cint;

  event: PEpoll_Event

):cint;

Description

epoll_ctl performs the op operation on epoll file descriptor epfd. The operation will be monitored on file descriptor fd, and is optionally controlled by event.

op can be one of the following values:

EPOLL_CTL_ADD
Add filedescriptor to list of events
EPOLL_CTL_MOD
Modify event for filedescriptor
EPOLL_CTL_DEL
Delete event for filedescriptor

The events field in event_data is a bitmask of one or more of the following values:

EPOLLIN
The file is ready for read operations
EPOLLOUT
The file is ready for write operations.
EPOLLPRI
Urgent data is available for read operations.
EPOLLERR
An error condition is signaled on the file descriptor.
EPOLLHUP
A Hang up happened on the file descriptor.
EPOLLET
Set the Edge Triggered behaviour for the file descriptor.
EPOLLONESHOT
Set One-Shot behaviour for the file descriptor. The event will be triggered only once.

Errors

On error -1 is returned, and errno is set accordingly.

See also

epoll_create | Create new epoll file descriptor
epoll_wait | Wait for an event on an epoll file descriptor.
fpClose | Close file descriptor


EPOLL_CTL_ADD

Add filedescriptor to list of events

Declaration

Source position: linux.pp line 140

const EPOLL_CTL_ADD = 1;


EPOLL_CTL_DEL

Delete event for filedescriptor

Declaration

Source position: linux.pp line 141

const EPOLL_CTL_DEL = 2;


EPOLL_CTL_MOD

Modify event for filedescriptor

Declaration

Source position: linux.pp line 142

const EPOLL_CTL_MOD = 3;


epoll_wait

Wait for an event on an epoll file descriptor.

Declaration

Source position: linux.pp line 280

function epoll_wait(

  epfd: cint;

  events: PEpoll_Event;

  maxevents: cint;

  timeout: cint

):cint;

Description

epoll_wait waits for timeout milliseconds for an event to occur on epoll file descriptor epfd. If timeout is -1, it waits indefinitely, if timeour is zero, it does not wait, but returns immediately, even if no events were detected.

On return, data for at most maxevents will be returned in the memory pointed to by events. The function returns the number of file descriptors for which events were reported. This can be zero if the timeout was reached.

Errors

On error -1 is returned, and errno is set accordingly.

See also

epoll_create | Create new epoll file descriptor
epoll_ctl | Modify an epoll file descriptor
fpClose | Close file descriptor


fdatasync

Synchronize the data in memory with the data on storage device

Declaration

Source position: linux.pp line 365

function fdatasync(

  fd: cint

):cint;

Description

fdatasync does the same as fpfsync but does not flush the metadata, unless it is vital to the correct reading/writing of the file. In practice, this means that unless the file size changed, the file metadata will not be synced.

See also

#rtl.unix.fsync

Synchronize file's kernel data with disk.


futex

Perform a futex operation

Declaration

Source position: linux.pp line 108

function futex(

  uaddr: pcint;

  op: cint;

  val: cint;

  timeout: ptimespec;

  addr2: pcint;

  val3: cint

):cint;

function futex(

  var uaddr;

  op: cint;

  val: cint;

  timeout: ptimespec;

  var addr2;

  val3: cint

):cint;

function futex(

  var uaddr;

  op: cint;

  val: cint;

  var timeout: TTimeSpec;

  var addr2;

  val3: cint

):cint;

function futex(

  uaddr: pcint;

  op: cint;

  val: cint;

  timeout: ptimespec

):cint;

function futex(

  var uaddr;

  op: cint;

  val: cint;

  timeout: ptimespec

):cint;

function futex(

  var uaddr;

  op: cint;

  val: cint;

  var timeout: TTimeSpec

):cint;

Description

futex performs an operation on a memory futex as described in the kernel manual page for futex. The mutex is located at uaddr, the operation op is one of the following constants:

FUTEX_WAIT
Futex option: Wait on futex till wake call arrives.
FUTEX_WAKE
Futex option: Wait on futex till wake call arrives.
FUTEX_FD
Futex option: Associate file descriptor with futex.
FUTEX_REQUEUE
Futex option: requeue waiting processes on other futex.
FUTEX_CMP_REQUEUE
Futex option: requeue waiting processes on other futex, but check it's value first

The value to check for is indicated in val, and a timeout can be specified in timeout. The optional arguments addr2 and val3 are used only with the FUTEX_REQUEUE and FUTEX_CMP_REQUEUE operations.

In case of an error, -1 is return. All other return values must be interpreted according to the operation performed.

This call directly interfaces with the Linux kernel, more information can be found in the kernel manual pages.

Errors

On error, -1 is returned. Use #rtl.baseunix.fpgeterrno to get the error code.


FUTEX_CMP_REQUEUE

Futex option: requeue waiting processes on other futex, but check it's value first

Declaration

Source position: linux.pp line 80

const FUTEX_CMP_REQUEUE = 4;


FUTEX_FD

Futex option: Associate file descriptor with futex.

Declaration

Source position: linux.pp line 78

const FUTEX_FD = 2;


FUTEX_LOCK_PI

Futex option: Undocumented

Declaration

Source position: linux.pp line 82

const FUTEX_LOCK_PI = 6;


futex_op

Futex operation:

Declaration

Source position: linux.pp line 123

function futex_op(

  op: cint;

  oparg: cint;

  cmp: cint;

  cmparg: cint

):cint;

Description

FUTEX_OP Performs an operation on a futex:

FUTEX_OP := ((op and $F) shl 28) or
            ((cmp and $F) shl 24) or
            ((oparg and $FFF) shl 12)
            or (cmparg and $FFF);


FUTEX_OP_ADD

Futex operation: Undocumented

Declaration

Source position: linux.pp line 87

const FUTEX_OP_ADD = 1;


FUTEX_OP_ANDN

Futex operation: Undocumented

Declaration

Source position: linux.pp line 89

const FUTEX_OP_ANDN = 3;


FUTEX_OP_CMP_EQ

Futex operation: Undocumented

Declaration

Source position: linux.pp line 94

const FUTEX_OP_CMP_EQ = 0;


FUTEX_OP_CMP_GE

Futex operation: Undocumented

Declaration

Source position: linux.pp line 99

const FUTEX_OP_CMP_GE = 5;


FUTEX_OP_CMP_GT

Futex operation: Undocumented

Declaration

Source position: linux.pp line 98

const FUTEX_OP_CMP_GT = 4;


FUTEX_OP_CMP_LE

Futex operation: Undocumented

Declaration

Source position: linux.pp line 97

const FUTEX_OP_CMP_LE = 3;


FUTEX_OP_CMP_LT

Futex operation: Undocumented

Declaration

Source position: linux.pp line 96

const FUTEX_OP_CMP_LT = 2;


FUTEX_OP_CMP_NE

Futex operation: Undocumented

Declaration

Source position: linux.pp line 95

const FUTEX_OP_CMP_NE = 1;


FUTEX_OP_OPARG_SHIFT

Futex operation: Undocumented

Declaration

Source position: linux.pp line 92

const FUTEX_OP_OPARG_SHIFT = 8;


FUTEX_OP_OR

Futex operation: Undocumented

Declaration

Source position: linux.pp line 88

const FUTEX_OP_OR = 2;


FUTEX_OP_SET

Futex operation: Undocumented

Declaration

Source position: linux.pp line 86

const FUTEX_OP_SET = 0;


FUTEX_OP_XOR

Futex operation: Undocumented

Declaration

Source position: linux.pp line 90

const FUTEX_OP_XOR = 4;


inotify_add_watch

Add a watch to a notify file descriptor

Declaration

Source position: linux.pp line 431

function inotify_add_watch(

  fd: cint;

  name: PChar;

  mask: cuint32

):cint;

Description

inotify_add_watch can be used to add a watch to an initialized inotify file descriptor (fd). The file or directory to watch can be specified in the name parameter, and the events that must be reported can be specified in mask. The following flags can be specified:

IN_ACCESS
Data was read from file.
IN_MODIFY
Data was written to file.
IN_ATTRIB
File attributes changed.
IN_CLOSE_WRITE
File opened for write was closed
IN_CLOSE_NOWRITE
File opened for read was closed
IN_CLOSE
File was closed (read or write)
IN_OPEN
File was opened
IN_MOVED_FROM
File was moved away from watched directory
IN_MOVED_TO
File was moved into watched directory
IN_MOVE
File was moved (in or out of directory)
IN_CREATE
A file was created in the directory.
IN_DELETE
A file was deleted from the directory.
IN_DELETE_SELF
Directory or file under observation was deleted.
IN_MOVE_SELF
Directory or file under observation was moved.
IN_ALL_EVENTS
All possible events OR-ed together.

These events can be OR-ed with some flags, controlling the behaviour of the watch:

IN_ONLYDIR
Only watch filename if it is a directory.
IN_ISDIR
Event occurred against directory.
IN_DONT_FOLLOW
Do not follow symlinks
IN_MASK_ADD
Add events to existing watch (OR-ing the sets) if one exists.
IN_ONESHOT
Only report one event, then remove the watch.

On return, the function returns a watch descriptor, which will be reported in the inotify_event structure's wd.

Errors

On Error, -1 is returned. fpgeterrno can be used to get more detailed error information.

See also

inotify_init | Initialize a new inotify file descriptor
inotify_init1 | Initialize a new inotify file descriptor with extra options.
inotify_rm_watch | Remove watch from Inotify file descriptor.
inotify_event | INotify event structure


inotify_init

Initialize a new inotify file descriptor

Declaration

Source position: linux.pp line 425

function inotify_init: cint;

Description

inotify_init initializes a new INotify file descriptor. No options can be specified. On return, the file descriptor is returned.

Errors

On Error, -1 is returned. fpgeterrno can be used to get more detailed error information

See also

inotify_init1 | Initialize a new inotify file descriptor with extra options.
inotify_add_watch | Add a watch to a notify file descriptor
inotify_rm_watch | Remove watch from Inotify file descriptor.


inotify_init1

Initialize a new inotify file descriptor with extra options.

Declaration

Source position: linux.pp line 427

function inotify_init1(

  flags: cint

):cint;

Description

inotify_init1 initializes a new INotify file descriptor. The following options can be OR-ed and passed in flags:

IN_NONBLOCK
Do not block on read
IN_CLOEXEC
Inotify close on exec flag.

Errors

On Error, -1 is returned. fpgeterrno can be used to get more detailed error information.

See also

inotify_init | Initialize a new inotify file descriptor
inotify_add_watch | Add a watch to a notify file descriptor
inotify_rm_watch | Remove watch from Inotify file descriptor.


inotify_rm_watch

Remove watch from Inotify file descriptor.

Declaration

Source position: linux.pp line 434

function inotify_rm_watch(

  fd: cint;

  wd: cint

):cint;

Description

inotify_rm_watch removes watch descriptor wd from inotify descriptor fd. On success, 0 is returned.

Errors

On Error, -1 is returned. fpgeterrno can be used to get more detailed error information.

See also

inotify_init | Initialize a new inotify file descriptor
inotify_init1 | Initialize a new inotify file descriptor with extra options.
inotify_add_watch | Add a watch to a notify file descriptor
inotify_event | INotify event structure


modify_ldt

Declaration

Source position: linux.pp line 249

function modify_ldt(

  func: cint;

  p: pointer;

  bytecount: culong

):cint;


MODIFY_LDT_CONTENTS_CODE

Modify_ldt option: Undocumented

Declaration

Source position: linux.pp line 225

const MODIFY_LDT_CONTENTS_CODE = 2;


MODIFY_LDT_CONTENTS_DATA

Modify_ldt option: Undocumented

Declaration

Source position: linux.pp line 223

const MODIFY_LDT_CONTENTS_DATA = 0;


MODIFY_LDT_CONTENTS_STACK

Modify_ldt option: Undocumented

Declaration

Source position: linux.pp line 224

const MODIFY_LDT_CONTENTS_STACK = 1;


sched_yield

Yield the processor to another thread.

Declaration

Source position: linux.pp line 253

procedure sched_yield;

Description

sched_yield yields the processor to another thread. The current thread is put at the back of its queue. If there is only 1 thread in the application, the thread continues to run. The call always returns zero.


setregid

Set Real and Effective Group ID

Declaration

Source position: linux.pp line 461

function setregid(

  rgid: uid_t;

  egid: uid_t

):cint;

Description

setregid sets the real group ID to rgid and the effective group ID to egid. Passing a value of -1 tells the system not to change that value.

Errors

On Error, -1 is returned. fpgeterrno can be used to get more detailed error information.

See also

setreuid


setreuid

Declaration

Source position: linux.pp line 462

function setreuid(

  ruid: uid_t;

  euid: uid_t

):cint;

Description

setreuid sets the real user ID to ruid and the effective user ID to euid. Passing a value of -1 tells the system not to change that value.

Errors

On Error, -1 is returned. fpgeterrno can be used to get more detailed error information.

See also

setregid

Set Real and Effective Group ID


sync_file_range

Force committing of data to disk

Declaration

Source position: linux.pp line 364

function sync_file_range(

  fd: cint;

  offset: off64_t;

  nbytes: off64_t;

  flags: cuint

):cint;

Description

sync_file_range forces the Linux kernel to write any data pages of a specified file (file descriptor fd) to disk. The range of the file is specified by the offset offset and the number of bytes nbytes. Options is an OR-ed combination of

SYNC_FILE_RANGE_WAIT_BEFORE
Wait for write-out of previously-submitted specified pages before writing more data.
SYNC_FILE_RANGE_WRITE
Initiate write of all dirty pages in the specified range.
SYNC_FILE_RANGE_WAIT_AFTER
Wait upon write-out of specified pages in the range after performing any write.

If none is specified, the operation does nothing.

Errors

On return -1 is returned and fperrno is set to the actual error code. See the Linux man page for more on the error codes.

See also

fdatasync

Synchronize the data in memory with the data on storage device


SYNC_FILE_RANGE_WAIT_AFTER

Wait upon write-out of specified pages in the range after performing any write.

Declaration

Source position: linux.pp line 362

const SYNC_FILE_RANGE_WAIT_AFTER = 4;


SYNC_FILE_RANGE_WAIT_BEFORE

Wait for write-out of previously-submitted specified pages before writing more data.

Declaration

Source position: linux.pp line 360

const SYNC_FILE_RANGE_WAIT_BEFORE = 1;


SYNC_FILE_RANGE_WRITE

Initiate write of all dirty pages in the specified range.

Declaration

Source position: linux.pp line 361

const SYNC_FILE_RANGE_WRITE = 2;


Sysinfo

Return kernel system information

Declaration

Source position: linux.pp line 52

function Sysinfo(

  Info: PSysInfo

):cint;

Description

SysInfo returns system information in Info. Returned information in Info includes:

uptime
Number of seconds since boot.
loads
1, 5 and 15 minute load averages.
totalram
total amount of main memory.
freeram
amount of free memory.
sharedram
amount of shared memory.
bufferram
amount of memory used by buffers.
totalswap
total amount of swapspace.
freeswap
amount of free swapspace.
procs
number of current processes.

Errors

None.

See also

#rtl.baseunix.fpUname

Return system name.

Example

program Example64;

{ Example to demonstrate the SysInfo function.
  Sysinfo is Linux-only. }

{$ifdef Linux}
Uses Linux;

Function Mb(L : Longint) : longint;

begin
  Mb:=L div (1024*1024);
end;

Var Info : TSysInfo;
    D,M,Secs,H : longint;
{$endif}

begin
  {$ifdef Linux}
  If Not (SysInfo(@Info)=0) then
    Halt(1);
  With Info do
    begin
    D:=Uptime div (3600*24);
    UpTime:=UpTime mod (3600*24);
    h:=uptime div 3600;
    uptime:=uptime mod 3600;
    m:=uptime div 60;
    secs:=uptime mod 60;
    Writeln('Uptime : ',d,'days, ',h,' hours, ',m,' min, ',secs,' s.');
    Writeln('Loads  : ',Loads[1],'/',Loads[2],'/',Loads[3]);
    Writeln('Total Ram  : ',Mb(totalram),'Mb.');
    Writeln('Free Ram   : ',Mb(freeram),'Mb.');
    Writeln('Shared Ram : ',Mb(sharedram),'Mb.');
    Writeln('Buffer Ram : ',Mb(bufferram),'Mb.');
    Writeln('Total Swap : ',Mb(totalswap),'Mb.');
    Writeln('Free Swap  : ',Mb(freeswap),'Mb.');
    end;
  {$endif}
end.


CloseDwarf

Close DWARF info file descriptor

Declaration

Source position: lnfodwrf.pp line 36

procedure CloseDwarf;

Description

CloseDwarf will close the file descriptor that was used to read DWARF debug information. This is useful if AllowReuseOfLineInfoData is used to cache DWARF information.

Errors

None.

See also

AllowReuseOfLineInfoData

Speed up LineInfo reading by reusing already-read information


DwarfBackTraceStr

Get a backtrace from an address

Declaration

Source position: lnfodwrf.pp line 35

function DwarfBackTraceStr(

  addr: CodePointer

):string;

Description

DwarfBackTraceStr returns a backtrace from a memory address Addr.

This is the actual callback for the backtrace handler System.BackTraceStrFunc.

Errors

None.

See also

GetLineInfo

Return source line information about an address.


GetLineInfo

Return source line information about an address.

Declaration

Source position: lnfodwrf.pp line 34

function GetLineInfo(

  addr: PtrUInt;

  var func: string;

  var source: string;

  var line: LongInt

):Boolean;

Arguments

addr | Address to examine
func | Name of function in which Addr resides.
source | Source file in which Addr was implemented.
line | Line number on which Addr was implemented.

Function result

True if the line information was found, False if not.

Description

GetLineInfo returns source line information about the address addr. It searches this information in the DWARF debugging information found in the binary: If the file was compiled without debug information, nothing will be returned. Upon succesful retrieval of the debug information, True is returned, and the func parameter is filled with the name of the function in which the address is located. The source parameter contains the name of the file in which the function was implemented, and line contains the line number in the source file for addr.

Errors

If no debug information is found, False is returned.


add(Tmatrix2_double,Double):Tmatrix2_double

Add scalar to two-dimensional double precision matrix

Declaration

Source position: matrix.pp line 584

operator operator +(

  const m: Tmatrix2_double;

  const x: Double

):Tmatrix2_double;

Description

This operator allows you to add a scalar value to a matrix. The scalar is added to all elements of the matrix, the result is returned as a new vector.


add(Tmatrix2_double,Tmatrix2_double):Tmatrix2_double

Add two two-dimensional double precision matrices together.

Declaration

Source position: matrix.pp line 532

operator operator +(

  const m1: Tmatrix2_double;

  const m2: Tmatrix2_double

):Tmatrix2_double;

Description

This operator allows you to add two two-dimensional double precision matrices together. A new matrix is returned with all elements of the two matrices added together.


add(Tmatrix2_extended,extended):Tmatrix2_extended

Add scalar to two-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 585

operator operator +(

  const m: Tmatrix2_extended;

  const x: extended

):Tmatrix2_extended;

Description

This operator allows you to add a scalar value to a matrix. The scalar is added to all elements of the matrix, the result is returned as a new vector.


add(Tmatrix2_extended,Tmatrix2_extended):Tmatrix2_extended

Add two two-dimensional extended precision matrices together.

Declaration

Source position: matrix.pp line 533

operator operator +(

  const m1: Tmatrix2_extended;

  const m2: Tmatrix2_extended

):Tmatrix2_extended;

Description

This operator allows you to add two two-dimensional extended precision matrices together. A new matrix is returned with all elements of the two matrices added together.


add(Tmatrix2_single,single):Tmatrix2_single

Add scalar to two-dimensional single precision matrix

Declaration

Source position: matrix.pp line 583

operator operator +(

  const m: Tmatrix2_single;

  const x: single

):Tmatrix2_single;

Description

This operator allows you to add a scalar value to a matrix. The scalar is added to all elements of the matrix, the result is returned as a new vector.


add(Tmatrix2_single,Tmatrix2_single):Tmatrix2_single

Add two two-dimensional single precision matrices together.

Declaration

Source position: matrix.pp line 531

operator operator +(

  const m1: Tmatrix2_single;

  const m2: Tmatrix2_single

):Tmatrix2_single;

Description

This operator allows you to add two two-dimensional single precision matrices together. A new matrix is returned with all elements of the two matrices added together.


add(Tmatrix3_double,Double):Tmatrix3_double

Add scalar to three-dimensional double precision matrix

Declaration

Source position: matrix.pp line 587

operator operator +(

  const m: Tmatrix3_double;

  const x: Double

):Tmatrix3_double;

Description

This operator allows you to add a scalar value to a matrix. The scalar is added to all elements of the matrix, the result is returned as a new vector.


add(Tmatrix3_double,Tmatrix3_double):Tmatrix3_double

Add two three-dimensional double precision matrices together.

Declaration

Source position: matrix.pp line 535

operator operator +(

  const m1: Tmatrix3_double;

  const m2: Tmatrix3_double

):Tmatrix3_double;

Description

This operator allows you to add two three-dimensional double precision matrices together. A new matrix is returned with all elements of the two matrices added together.


add(Tmatrix3_extended,extended):Tmatrix3_extended

Add scalar to three-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 588

operator operator +(

  const m: Tmatrix3_extended;

  const x: extended

):Tmatrix3_extended;

Description

This operator allows you to add a scalar value to a matrix. The scalar is added to all elements of the matrix, the result is returned as a new vector.


add(Tmatrix3_extended,Tmatrix3_extended):Tmatrix3_extended

Add two three-dimensional extended precision matrices together.

Declaration

Source position: matrix.pp line 536

operator operator +(

  const m1: Tmatrix3_extended;

  const m2: Tmatrix3_extended

):Tmatrix3_extended;

Description

This operator allows you to add two three-dimensional extended precision matrices together. A new matrix is returned with all elements of the two matrices added together.


add(Tmatrix3_single,single):Tmatrix3_single

Add scalar to three-dimensional single precision matrix

Declaration

Source position: matrix.pp line 586

operator operator +(

  const m: Tmatrix3_single;

  const x: single

):Tmatrix3_single;

Description

This operator allows you to add a scalar value to a matrix. The scalar is added to all elements of the matrix, the result is returned as a new vector.


add(Tmatrix3_single,Tmatrix3_single):Tmatrix3_single

Add two three-dimensional single precision matrices together.

Declaration

Source position: matrix.pp line 534

operator operator +(

  const m1: Tmatrix3_single;

  const m2: Tmatrix3_single

):Tmatrix3_single;

Description

This operator allows you to add two three-dimensional single precision matrices together. A new matrix is returned with all elements of the two matrices added together.


add(Tmatrix4_double,Double):Tmatrix4_double

Add scalar to four-dimensional double precision matrix

Declaration

Source position: matrix.pp line 590

operator operator +(

  const m: Tmatrix4_double;

  const x: Double

):Tmatrix4_double;

Description

This operator allows you to add a scalar value to a matrix. The scalar is added to all elements of the matrix, the result is returned as a new vector.


add(Tmatrix4_double,Tmatrix4_double):Tmatrix4_double

Add two four-dimensional double precision matrices together.

Declaration

Source position: matrix.pp line 538

operator operator +(

  const m1: Tmatrix4_double;

  const m2: Tmatrix4_double

):Tmatrix4_double;

Description

This operator allows you to add two four-dimensional double precision matrices together. A new matrix is returned with all elements of the two matrices added together.


add(Tmatrix4_extended,extended):Tmatrix4_extended

Add scalar to four-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 591

operator operator +(

  const m: Tmatrix4_extended;

  const x: extended

):Tmatrix4_extended;

Description

This operator allows you to add a scalar value to a matrix. The scalar is added to all elements of the matrix, the result is returned as a new vector.


add(Tmatrix4_extended,Tmatrix4_extended):Tmatrix4_extended

Add two four-dimensional extended precision matrices together.

Declaration

Source position: matrix.pp line 539

operator operator +(

  const m1: Tmatrix4_extended;

  const m2: Tmatrix4_extended

):Tmatrix4_extended;

Description

This operator allows you to add two four-dimensional extended precision matrices together. A new matrix is returned with all elements of the two matrices added together.


add(Tmatrix4_single,single):Tmatrix4_single

Add scalar to four-dimensional single precision matrix

Declaration

Source position: matrix.pp line 589

operator operator +(

  const m: Tmatrix4_single;

  const x: single

):Tmatrix4_single;

Description

This operator allows you to add a scalar value to a matrix. The scalar is added to all elements of the matrix, the result is returned as a new vector.


add(Tmatrix4_single,Tmatrix4_single):Tmatrix4_single

Add two four-dimensional single precision matrices together.

Declaration

Source position: matrix.pp line 537

operator operator +(

  const m1: Tmatrix4_single;

  const m2: Tmatrix4_single

):Tmatrix4_single;

Description

This operator allows you to add two four-dimensional single precision matrices together. A new matrix is returned with all elements of the two matrices added together.


add(Tvector2_double,Double):Tvector2_double

Add scalar to two-dimensional double precision vector

Declaration

Source position: matrix.pp line 409

operator operator +(

  const x: Tvector2_double;

  y: Double

):Tvector2_double;

Description

This operator allows you to add a scalar value to a vector. The scalar is added to all elements of the vector, the result is returned as a new vector.


add(Tvector2_double,Tvector2_double):Tvector2_double

Add two-dimensional double precision vectors together

Declaration

Source position: matrix.pp line 354

operator operator +(

  const x: Tvector2_double;

  const y: Tvector2_double

):Tvector2_double;

Description

This operator allows you to add two two-dimensional vectors with double precision together. The result is a new vector which consists of the sums of the individual elements of the two vectors.


add(Tvector2_extended,extended):Tvector2_extended

Add scalar to two-dimensional extended precision vector

Declaration

Source position: matrix.pp line 410

operator operator +(

  const x: Tvector2_extended;

  y: extended

):Tvector2_extended;

Description

This operator allows you to add a scalar value to a vector. The scalar is added to all elements of the vector, the result is returned as a new vector.


add(Tvector2_extended,Tvector2_extended):Tvector2_extended

Add two-dimensional extended precision vectors together

Declaration

Source position: matrix.pp line 355

operator operator +(

  const x: Tvector2_extended;

  const y: Tvector2_extended

):Tvector2_extended;

Description

This operator allows you to add two two-dimensional vectors with extended precision together. The result is a new vector which consists of the sums of the individual elements of the two vectors.


add(Tvector2_single,single):Tvector2_single

Add scalar to two-dimensional single precision vector

Declaration

Source position: matrix.pp line 408

operator operator +(

  const x: Tvector2_single;

  y: single

):Tvector2_single;

Description

This operator allows you to add a scalar value to a vector. The scalar is added to all elements of the vector, the result is returned as a new vector.


add(Tvector2_single,Tvector2_single):Tvector2_single

Add two-dimensional single precision vectors together

Declaration

Source position: matrix.pp line 353

operator operator +(

  const x: Tvector2_single;

  const y: Tvector2_single

):Tvector2_single;

Description

This operator allows you to add two two-dimensional vectors with single precision together. The result is a new vector which consists of the sums of the individual elements of the two vectors.


add(Tvector3_double,Double):Tvector3_double

Add scalar to three-dimensional double precision vector

Declaration

Source position: matrix.pp line 412

operator operator +(

  const x: Tvector3_double;

  y: Double

):Tvector3_double;

Description

This operator allows you to add a scalar value to a vector. The scalar is added to all elements of the vector, the result is returned as a new vector.


add(Tvector3_double,Tvector3_double):Tvector3_double

Add three-dimensional double precision vectors together

Declaration

Source position: matrix.pp line 357

operator operator +(

  const x: Tvector3_double;

  const y: Tvector3_double

):Tvector3_double;

Description

This operator allows you to add two three-dimensional vectors with double precision together. The result is a new vector which consists of the sums of the individual elements of the two vectors.


add(Tvector3_extended,extended):Tvector3_extended

Add scalar to three-dimensional extended precision vector

Declaration

Source position: matrix.pp line 413

operator operator +(

  const x: Tvector3_extended;

  y: extended

):Tvector3_extended;

Description

This operator allows you to add a scalar value to a vector. The scalar is added to all elements of the vector, the result is returned as a new vector.


add(Tvector3_extended,Tvector3_extended):Tvector3_extended

Add three-dimensional extended precision vectors together

Declaration

Source position: matrix.pp line 358

operator operator +(

  const x: Tvector3_extended;

  const y: Tvector3_extended

):Tvector3_extended;

Description

This operator allows you to add two three-dimensional vectors with extended precision together. The result is a new vector which consists of the sums of the individual elements of the two vectors.


add(Tvector3_single,single):Tvector3_single

Add scalar to three-dimensional single precision vector

Declaration

Source position: matrix.pp line 411

operator operator +(

  const x: Tvector3_single;

  y: single

):Tvector3_single;

Description

This operator allows you to add a scalar value to a vector. The scalar is added to all elements of the vector, the result is returned as a new vector.


add(Tvector3_single,Tvector3_single):Tvector3_single

Add three-dimensional extended precision vectors together

Declaration

Source position: matrix.pp line 356

operator operator +(

  const x: Tvector3_single;

  const y: Tvector3_single

):Tvector3_single;

Description

This operator allows you to add two three-dimensional vectors with single precision together. The result is a new vector which consists of the sums of the individual elements of the two vectors.


add(Tvector4_double,Double):Tvector4_double

Add scalar to four-dimensional double precision vector

Declaration

Source position: matrix.pp line 415

operator operator +(

  const x: Tvector4_double;

  y: Double

):Tvector4_double;

Description

This operator allows you to add a scalar value to a vector. The scalar is added to all elements of the vector, the result is returned as a new vector.


add(Tvector4_double,Tvector4_double):Tvector4_double

Add four-dimensional double precision vectors together

Declaration

Source position: matrix.pp line 360

operator operator +(

  const x: Tvector4_double;

  const y: Tvector4_double

):Tvector4_double;

Description

This operator allows you to add two four-dimensional vectors with single precision together. The result is a new vector which consists of the sums of the individual elements of the two vectors.


add(Tvector4_extended,extended):Tvector4_extended

Add scalar to four-dimensional extended precision vector

Declaration

Source position: matrix.pp line 416

operator operator +(

  const x: Tvector4_extended;

  y: extended

):Tvector4_extended;

Description

This operator allows you to add a scalar value to a vector. The scalar is added to all elements of the vector, the result is returned as a new vector.


add(Tvector4_extended,Tvector4_extended):Tvector4_extended

Add four-dimensional extended precision vectors together

Declaration

Source position: matrix.pp line 361

operator operator +(

  const x: Tvector4_extended;

  const y: Tvector4_extended

):Tvector4_extended;

Description

This operator allows you to add two two-dimensional vectors with extended precision together. The result is a new vector which consists of the sums of the individual elements of the two vectors.


add(Tvector4_single,single):Tvector4_single

Add scalar to four-dimensional single precision vector

Declaration

Source position: matrix.pp line 414

operator operator +(

  const x: Tvector4_single;

  y: single

):Tvector4_single;

Description

This operator allows you to add a scalar value to a vector. The scalar is added to all elements of the vector, the result is returned as a new vector.


add(Tvector4_single,Tvector4_single):Tvector4_single

Add four-dimensional single precision vectors together

Declaration

Source position: matrix.pp line 359

operator operator +(

  const x: Tvector4_single;

  const y: Tvector4_single

):Tvector4_single;

Description

This operator allows you to add two four-dimensional vectors with single precision together. The result is a new vector which consists of the sums of the individual elements of the two vectors.


assign(Tmatrix2_double):Tmatrix2_extended

Allow assignment of two-dimensional double precision matrix to two-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 452

operator operator :=(

  const v: Tmatrix2_double

):Tmatrix2_extended;

Description

This operator allows you to use a two-dimensional matrix with double precision values wherever a two-dimensional matrix with extended precision is expected.


assign(Tmatrix2_double):Tmatrix2_single

Allow assignment of two-dimensional double precision matrix to two-dimensional single precision matrix

Declaration

Source position: matrix.pp line 451

operator operator :=(

  const v: Tmatrix2_double

):Tmatrix2_single;

Description

This operator allows you to use a two-dimensional matrix with double precision values wherever a two-dimensional matrix with single precision is expected. Some accurace is lost because of the conversion.


assign(Tmatrix2_double):Tmatrix3_double

Allow assignment of two-dimensional double precision matrix to three-dimensional double precision matrix

Declaration

Source position: matrix.pp line 460

operator operator :=(

  const v: Tmatrix2_double

):Tmatrix3_double;

Description

This operator allows you to use a two-dimensional matrix with double precision values wherever a three-dimensional matrix with double precision is expected. The extra fields are set to 0.


assign(Tmatrix2_double):Tmatrix3_extended

Allow assignment of two-dimensional double precision matrix to three-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 461

operator operator :=(

  const v: Tmatrix2_double

):Tmatrix3_extended;

Description

This operator allows you to use a two-dimensional matrix with double precision values wherever a three-dimensional matrix with extended precision is expected. The extra fields are set to 0.


assign(Tmatrix2_double):Tmatrix3_single

Allow assignment of two-dimensional single precision matrix to three-dimensional single precision matrix

Declaration

Source position: matrix.pp line 459

operator operator :=(

  const v: Tmatrix2_double

):Tmatrix3_single;

Description

This operator allows you to use a two-dimensional matrix with single precision values wherever a three-dimensional matrix with single precision is expected. The extra fields are set to 0 and some accuracy is lost because of the conversion.


assign(Tmatrix2_double):Tmatrix4_double

Allow assignment of two-dimensional double precision matrix to four-dimensional double precision matrix

Declaration

Source position: matrix.pp line 470

operator operator :=(

  const v: Tmatrix2_double

):Tmatrix4_double;

Description

This operator allows you to use a two-dimensional matrix with double precision values wherever a four-dimensional matrix with double precision is expected. The extra fields are set to 0.


assign(Tmatrix2_double):Tmatrix4_extended

Allow assignment of two-dimensional double precision matrix to four-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 471

operator operator :=(

  const v: Tmatrix2_double

):Tmatrix4_extended;

Description

This operator allows you to use a two-dimensional matrix with double precision values wherever a four-dimensional matrix with extended precision is expected. The extra fields are set to 0.


assign(Tmatrix2_double):Tmatrix4_single

Allow assignment of two-dimensional double precision matrix to four-dimensional single precision matrix

Declaration

Source position: matrix.pp line 469

operator operator :=(

  const v: Tmatrix2_double

):Tmatrix4_single;

Description

This operator allows you to use a two-dimensional matrix with double precision values wherever a four-dimensional matrix with single precision is expected. The extra fields are set to 0 and some precision is lost because of the conversion.


assign(Tmatrix2_extended):Tmatrix2_double

Allow assignment of two-dimensional extended precision matrix to two-dimensional double precision matrix

Declaration

Source position: matrix.pp line 454

operator operator :=(

  const v: Tmatrix2_extended

):Tmatrix2_double;

Description

This operator allows you to use a two-dimensional two with extended precision values wherever a two-dimensional matrix with double precision is expected. Some accuracy is lost because of the conversion.


assign(Tmatrix2_extended):Tmatrix2_single

Allow assignment of two-dimensional extended precision matrix to two-dimensional single precision matrix

Declaration

Source position: matrix.pp line 453

operator operator :=(

  const v: Tmatrix2_extended

):Tmatrix2_single;

Description

This operator allows you to use a two-dimensional matrix with extended precision values wherever a two-dimensional matrix with single precision is expected. Some accuracy is lost because of the conversion.


assign(Tmatrix2_extended):Tmatrix3_double

Allow assignment of two-dimensional extended precision matrix to three-dimensional double precision matrix

Declaration

Source position: matrix.pp line 463

operator operator :=(

  const v: Tmatrix2_extended

):Tmatrix3_double;

Description

This operator allows you to use a two-dimensional matrix with extended precision values wherever a three-dimensional matrix with double precision is expected. The extra fields are set to 0 and some accuracy is lost because of the conversion.


assign(Tmatrix2_extended):Tmatrix3_extended

Allow assignment of two-dimensional extended precision matrix to three-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 464

operator operator :=(

  const v: Tmatrix2_extended

):Tmatrix3_extended;

Description

This operator allows you to use a two-dimensional matrix with extended precision values wherever a three-dimensional matrix with extended precision is expected. The extra fields are set to 0.


assign(Tmatrix2_extended):Tmatrix3_single

Allow assignment of two-dimensional extended precision matrix to three-dimensional single precision matrix

Declaration

Source position: matrix.pp line 462

operator operator :=(

  const v: Tmatrix2_extended

):Tmatrix3_single;

Description

This operator allows you to use a two-dimensional matrix with extended precision values wherever a three-dimensional matrix with single precision is expected. The extra fields are set to 0 and some accuracy is lost because of the conversion.


assign(Tmatrix2_extended):Tmatrix4_double

Allow assignment of two-dimensional extended precision matrix to four-dimensional double precision matrix

Declaration

Source position: matrix.pp line 473

operator operator :=(

  const v: Tmatrix2_extended

):Tmatrix4_double;

Description

This operator allows you to use a two-dimensional matrix with extended precision values wherever a four-dimensional matrix with double precision is expected. The extra fields are set to 0 and some accuracy is lost because of the conversion.


assign(Tmatrix2_extended):Tmatrix4_extended

Allow assignment of two-dimensional extended precision matrix to four-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 474

operator operator :=(

  const v: Tmatrix2_extended

):Tmatrix4_extended;

Description

This operator allows you to use a two-dimensional matrix with single precision values wherever a four-dimensional matrix with single precision is expected. The extra fields are set to 0.


assign(Tmatrix2_extended):Tmatrix4_single

Allow assignment of two-dimensional extended precision matrix to four-dimensional single precision matrix

Declaration

Source position: matrix.pp line 472

operator operator :=(

  const v: Tmatrix2_extended

):Tmatrix4_single;

Description

This operator allows you to use a two-dimensional matrix with extended precision values wherever a four-dimensional matrix with single precision is expected. The extra fields are set to 0 and some precision is lost because of the conversion.


assign(Tmatrix2_single):Tmatrix2_double

Allow assignment of two-dimensional single precision matrix to two-dimensional double precision matrix

Declaration

Source position: matrix.pp line 449

operator operator :=(

  const v: Tmatrix2_single

):Tmatrix2_double;

Description

This operator allows you to use a two-dimensional matrix with single precision values wherever a two-dimensional matrix with double precision is expected.


assign(Tmatrix2_single):Tmatrix2_extended

Allow assignment of two-dimensional single precision matrix to two-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 450

operator operator :=(

  const v: Tmatrix2_single

):Tmatrix2_extended;

Description

This operator allows you to use a two-dimensional matrix with single precision values wherever a two-dimensional matrix with extended precision is expected.


assign(Tmatrix2_single):Tmatrix3_double

Allow assignment of two-dimensional single precision matrix to three-dimensional double precision matrix

Declaration

Source position: matrix.pp line 457

operator operator :=(

  const v: Tmatrix2_single

):Tmatrix3_double;

Description

This operator allows you to use a two-dimensional matrix with single precision values wherever a three-dimensional matrix with double precision is expected. The extra fields are set to 0.


assign(Tmatrix2_single):Tmatrix3_extended

Allow assignment of two-dimensional single precision matrix to three-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 458

operator operator :=(

  const v: Tmatrix2_single

):Tmatrix3_extended;

Description

This operator allows you to use a two-dimensional matrix with single precision values wherever a three-dimensional matrix with extended precision is expected. The extra fields are set to 0.


assign(Tmatrix2_single):Tmatrix3_single

Allow assignment of two-dimensional single precision matrix to three-dimensional single precision matrix

Declaration

Source position: matrix.pp line 456

operator operator :=(

  const v: Tmatrix2_single

):Tmatrix3_single;

Description

This operator allows you to use a two-dimensional matrix with single precision values wherever a three-dimensional matrix with single precision is expected. The extra fields are set to 0.


assign(Tmatrix2_single):Tmatrix4_double

Allow assignment of two-dimensional single precision matrix to four-dimensional double precision matrix

Declaration

Source position: matrix.pp line 467

operator operator :=(

  const v: Tmatrix2_single

):Tmatrix4_double;

Description

This operator allows you to use a two-dimensional matrix with single precision values wherever a four-dimensional matrix with double precision is expected. The extra fields are set to 0.


assign(Tmatrix2_single):Tmatrix4_extended

Allow assignment of two-dimensional single precision matrix to four-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 468

operator operator :=(

  const v: Tmatrix2_single

):Tmatrix4_extended;

Description

This operator allows you to use a two-dimensional matrix with single precision values wherever a four-dimensional matrix with extended precision is expected. The extra fields are set to 0.


assign(Tmatrix2_single):Tmatrix4_single

Allow assignment of two-dimensional single precision matrix to four-dimensional single precision matrix

Declaration

Source position: matrix.pp line 466

operator operator :=(

  const v: Tmatrix2_single

):Tmatrix4_single;

Description

This operator allows you to use a two-dimensional matrix with single precision values wherever a four-dimensional matrix with single precision is expected. The extra fields are set to 0.


assign(Tmatrix3_double):Tmatrix2_double

Allow assignment of three-dimensional double precision matrix to two-dimensional double precision matrix

Declaration

Source position: matrix.pp line 480

operator operator :=(

  const v: Tmatrix3_double

):Tmatrix2_double;

Description

This operator allows you to use a three-dimensional matrix with double precision values wherever a two-dimensional matrix with double precision is expected. The surplus fields are thrown away.


assign(Tmatrix3_double):Tmatrix2_extended

Allow assignment of three-dimensional double precision matrix to two-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 481

operator operator :=(

  const v: Tmatrix3_double

):Tmatrix2_extended;

Description

This operator allows you to use a three-dimensional matrix with double precision values wherever a two-dimensional matrix with extended precision is expected. The surplus fields are thrown away.


assign(Tmatrix3_double):Tmatrix2_single

Allow assignment of three-dimensional double precision matrix to two-dimensional single precision matrix

Declaration

Source position: matrix.pp line 479

operator operator :=(

  const v: Tmatrix3_double

):Tmatrix2_single;

Description

This operator allows you to use a three-dimensional matrix with double precision values wherever a two-dimensional matrix with single precision is expected. The surplus fields are thrown away and some accuracy is lost because of the conversion.


assign(Tmatrix3_double):Tmatrix3_extended

Allow assignment of three-dimensional double precision matrix to three-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 489

operator operator :=(

  const v: Tmatrix3_double

):Tmatrix3_extended;

Description

This operator allows you to use a three-dimensional matrix with double precision values wherever a three-dimensional matrix with extended precision is expected.


assign(Tmatrix3_double):Tmatrix3_single

Allow assignment of three-dimensional double precision matrix to three-dimensional single precision matrix

Declaration

Source position: matrix.pp line 488

operator operator :=(

  const v: Tmatrix3_double

):Tmatrix3_single;

Description

This operator allows you to use a three-dimensional matrix with double precision values wherever a three-dimensional matrix with single precision is expected. Some precision is lost because of the conversion.


assign(Tmatrix3_double):Tmatrix4_double

Allow assignment of three-dimensional double precision matrix to four-dimensional double precision matrix

Declaration

Source position: matrix.pp line 497

operator operator :=(

  const v: Tmatrix3_double

):Tmatrix4_double;

Description

This operator allows you to use a three-dimensional matrix with double precision values wherever a four-dimensional matrix with double precision is expected.


assign(Tmatrix3_double):Tmatrix4_extended

Allow assignment of three-dimensional double precision matrix to four-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 498

operator operator :=(

  const v: Tmatrix3_double

):Tmatrix4_extended;

Description

This operator allows you to use a three-dimensional matrix with double precision values wherever a four-dimensional matrix with extended precision is expected.


assign(Tmatrix3_double):Tmatrix4_single

Allow assignment of three-dimensional double precision matrix to four-dimensional single precision matrix

Declaration

Source position: matrix.pp line 496

operator operator :=(

  const v: Tmatrix3_double

):Tmatrix4_single;

Description

This operator allows you to use a three-dimensional matrix with double precision values wherever a four-dimensional matrix with single precision is expected. Some precision is lost because of the conversion.


assign(Tmatrix3_extended):Tmatrix2_double

Allow assignment of three-dimensional extended precision matrix to two-dimensional double precision matrix

Declaration

Source position: matrix.pp line 483

operator operator :=(

  const v: Tmatrix3_extended

):Tmatrix2_double;

Description

This operator allows you to use a three-dimensional matrix with extended precision values wherever a two-dimensional matrix with double precision is expected. The surplus fields are thrown away and some accuracy is lost becuase of the conversion.


assign(Tmatrix3_extended):Tmatrix2_extended

Allow assignment of three-dimensional extended precision matrix to two-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 484

operator operator :=(

  const v: Tmatrix3_extended

):Tmatrix2_extended;

Description

This operator allows you to use a three-dimensional matrix with extended precision values wherever a two-dimensional matrix with extended precision is expected. The surplus fields are thrown away.


assign(Tmatrix3_extended):Tmatrix2_single

Allow assignment of three-dimensional extended precision matrix to two-dimensional single precision matrix

Declaration

Source position: matrix.pp line 482

operator operator :=(

  const v: Tmatrix3_extended

):Tmatrix2_single;

Description

This operator allows you to use a three-dimensional matrix with extended precision values wherever a two-dimensional matrix with single precision is expected. The surplus fields are thrown away and some precision is lost because of the conversion.


assign(Tmatrix3_extended):Tmatrix3_double

Allow assignment of three-dimensional extended precision matrix to three-dimensional double precision matrix

Declaration

Source position: matrix.pp line 491

operator operator :=(

  const v: Tmatrix3_extended

):Tmatrix3_double;

Description

This operator allows you to use a three-dimensional matrix with extended precision values wherever a three-dimensional matrix with double precision is expected. Some precision is lost because of the conversion.


assign(Tmatrix3_extended):Tmatrix3_single

Allow assignment of three-dimensional extended precision matrix to three-dimensional single precision matrix

Declaration

Source position: matrix.pp line 490

operator operator :=(

  const v: Tmatrix3_extended

):Tmatrix3_single;

Description

This operator allows you to use a three-dimensional matrix with extended precision values wherever a three-dimensional matrix with single precision is expected. Some precision is lost because of the conversion.


assign(Tmatrix3_extended):Tmatrix4_double

Allow assignment of three-dimensional extended precision matrix to four-dimensional double precision matrix

Declaration

Source position: matrix.pp line 500

operator operator :=(

  const v: Tmatrix3_extended

):Tmatrix4_double;

Description

This operator allows you to use a three-dimensional matrix with extended precision values wherever a four-dimensional matrix with double precision is expected. Some precision is lost because of the conversion.


assign(Tmatrix3_extended):Tmatrix4_extended

Allow assignment of three-dimensional extended precision matrix to four-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 501

operator operator :=(

  const v: Tmatrix3_extended

):Tmatrix4_extended;

Description

This operator allows you to use a three-dimensional matrix with extended precision values wherever a four-dimensional matrix with extended precision is expected.


assign(Tmatrix3_extended):Tmatrix4_single

Allow assignment of three-dimensional extended precision matrix to four-dimensional single precision matrix

Declaration

Source position: matrix.pp line 499

operator operator :=(

  const v: Tmatrix3_extended

):Tmatrix4_single;

Description

This operator allows you to use a three-dimensional matrix with extended precision values wherever a four-dimensional matrix with single precision is expected. Some precision is lost because of the conversion.


assign(Tmatrix3_single):Tmatrix2_double

Allow assignment of three-dimensional single precision matrix to two-dimensional double precision matrix

Declaration

Source position: matrix.pp line 477

operator operator :=(

  const v: Tmatrix3_single

):Tmatrix2_double;

Description

This operator allows you to use a three-dimensional matrix with single precision values wherever a two-dimensional matrix with double precision is expected. The surplus fields are thrown away.


assign(Tmatrix3_single):Tmatrix2_extended

Allow assignment of three-dimensional single precision matrix to two-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 478

operator operator :=(

  const v: Tmatrix3_single

):Tmatrix2_extended;

Description

This operator allows you to use a three-dimensional matrix with single precision values wherever a two-dimensional matrix with extended precision is expected. The surplus fields are thrown away.


assign(Tmatrix3_single):Tmatrix2_single

Allow assignment of three-dimensional single precision matrix to two-dimensional single precision matrix

Declaration

Source position: matrix.pp line 476

operator operator :=(

  const v: Tmatrix3_single

):Tmatrix2_single;

Description

This operator allows you to use a three-dimensional matrix with single precision values wherever a two-dimensional matrix with single precision is expected. The surplus fields are thrown away.


assign(Tmatrix3_single):Tmatrix3_double

Allow assignment of three-dimensional single precision matrix to three-dimensional double precision matrix

Declaration

Source position: matrix.pp line 486

operator operator :=(

  const v: Tmatrix3_single

):Tmatrix3_double;

Description

This operator allows you to use a three-dimensional matrix with single precision values wherever a three-dimensional matrix with double precision is expected.


assign(Tmatrix3_single):Tmatrix3_extended

Allow assignment of three-dimensional single precision matrix to three-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 487

operator operator :=(

  const v: Tmatrix3_single

):Tmatrix3_extended;

Description

This operator allows you to use a three-dimensional matrix with single precision values wherever a three-dimensional matrix with extended precision is expected.


assign(Tmatrix3_single):Tmatrix4_double

Allow assignment of three-dimensional single precision matrix to four-dimensional double precision matrix

Declaration

Source position: matrix.pp line 494

operator operator :=(

  const v: Tmatrix3_single

):Tmatrix4_double;

Description

This operator allows you to use a three-dimensional matrix with single precision values wherever a four-dimensional matrix with double precision is expected.


assign(Tmatrix3_single):Tmatrix4_extended

Allow assignment of three-dimensional single precision matrix to four-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 495

operator operator :=(

  const v: Tmatrix3_single

):Tmatrix4_extended;

Description

This operator allows you to use a three-dimensional matrix with single precision values wherever a four-dimensional matrix with extended precision is expected.


assign(Tmatrix3_single):Tmatrix4_single

Allow assignment of three-dimensional single precision matrix to four-dimensional single precision matrix

Declaration

Source position: matrix.pp line 493

operator operator :=(

  const v: Tmatrix3_single

):Tmatrix4_single;

Description

This operator allows you to use a three-dimensional matrix with single precision values wherever a four-dimensional matrix with single precision is expected.


assign(Tmatrix4_double):Tmatrix2_double

Allow assignment of four-dimensional double precision matrix to two-dimensional double precision matrix

Declaration

Source position: matrix.pp line 507

operator operator :=(

  const v: Tmatrix4_double

):Tmatrix2_double;

Description

This operator allows you to use a four-dimensional matrix with double precision values wherever a two-dimensional matrix with double precision is expected. The surplus fields are thrown away.


assign(Tmatrix4_double):Tmatrix2_extended

Allow assignment of four-dimensional double precision matrix to two-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 508

operator operator :=(

  const v: Tmatrix4_double

):Tmatrix2_extended;

Description

This operator allows you to use a four-dimensional matrix with double precision values wherever a two-dimensional matrix with extended precision is expected. The surplus fields are thrown away.


assign(Tmatrix4_double):Tmatrix2_single

Allow assignment of four-dimensional double precision matrix to two-dimensional single precision matrix

Declaration

Source position: matrix.pp line 506

operator operator :=(

  const v: Tmatrix4_double

):Tmatrix2_single;

Description

This operator allows you to use a four-dimensional matrix with double precision values wherever a two-dimensional matrix with single precision is expected. The surplus fields are thrown away and some precision is lost in the conversion.


assign(Tmatrix4_double):Tmatrix3_double

Allow assignment of four-dimensional double precision matrix to three-dimensional double precision matrix

Declaration

Source position: matrix.pp line 517

operator operator :=(

  const v: Tmatrix4_double

):Tmatrix3_double;

Description

This operator allows you to use a four-dimensional matrix with double precision values wherever a three-dimensional matrix with double precision is expected. The surplus fields are thrown away.


assign(Tmatrix4_double):Tmatrix3_extended

Allow assignment of four-dimensional double precision matrix to three-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 518

operator operator :=(

  const v: Tmatrix4_double

):Tmatrix3_extended;

Description

This operator allows you to use a four-dimensional matrix with double precision values wherever a three-dimensional matrix with extended precision is expected. The surplus fields are thrown away.


assign(Tmatrix4_double):Tmatrix3_single

Allow assignment of four-dimensional double precision matrix to three-dimensional single precision matrix

Declaration

Source position: matrix.pp line 516

operator operator :=(

  const v: Tmatrix4_double

):Tmatrix3_single;

Description

This operator allows you to use a four-dimensional matrix with double precision values wherever a three-dimensional matrix with single precision is expected. The surplus fields are thrown away and some precision is lost because of the conversion.


assign(Tmatrix4_double):Tmatrix4_extended

Allow assignment of four-dimensional double precision matrix to four-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 526

operator operator :=(

  const v: Tmatrix4_double

):Tmatrix4_extended;

Description

This operator allows you to use a four-dimensional matrix with double precision values wherever a four-dimensional matrix with extended precision is expected.


assign(Tmatrix4_double):Tmatrix4_single

Allow assignment of four-dimensional single precision matrix to four-dimensional single precision matrix

Declaration

Source position: matrix.pp line 525

operator operator :=(

  const v: Tmatrix4_double

):Tmatrix4_single;

Description

This operator allows you to use a four-dimensional matrix with double precision values wherever a four-dimensional matrix with single precision is expected. Some precision is lost because of the conversion.


assign(Tmatrix4_extended):Tmatrix2_double

Allow assignment of four-dimensional extended precision matrix to two-dimensional double precision matrix

Declaration

Source position: matrix.pp line 510

operator operator :=(

  const v: Tmatrix4_extended

):Tmatrix2_double;

Description

This operator allows you to use a four-dimensional matrix with extended precision values wherever a two-dimensional matrix with double precision is expected. The surplus fields are thrown away and some precision is lost in the conversion.


assign(Tmatrix4_extended):Tmatrix2_extended

Allow assignment of four-dimensional extended precision matrix to two-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 511

operator operator :=(

  const v: Tmatrix4_extended

):Tmatrix2_extended;

Description

This operator allows you to use a four-dimensional matrix with single precision values wherever a two-dimensional matrix with single precision is expected. The surplus fields are thrown away.


assign(Tmatrix4_extended):Tmatrix2_single

Allow assignment of four-dimensional extended precision matrix to two-dimensional single precision matrix

Declaration

Source position: matrix.pp line 509

operator operator :=(

  const v: Tmatrix4_extended

):Tmatrix2_single;

Description

This operator allows you to use a four-dimensional matrix with extended precision values wherever a two-dimensional matrix with single precision is expected. The surplus fields are thrown away and some precision is lost in the conversion.


assign(Tmatrix4_extended):Tmatrix3_double

Allow assignment of four-dimensional extended precision matrix to three-dimensional double precision matrix

Declaration

Source position: matrix.pp line 520

operator operator :=(

  const v: Tmatrix4_extended

):Tmatrix3_double;

Description

This operator allows you to use a four-dimensional matrix with extended precision values wherever a three-dimensional matrix with double precision is expected. The surplus fields are thrown away.


assign(Tmatrix4_extended):Tmatrix3_extended

Allow assignment of four-dimensional extended precision matrix to three-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 521

operator operator :=(

  const v: Tmatrix4_extended

):Tmatrix3_extended;

Description

This operator allows you to use a four-dimensional matrix with extended precision values wherever a three-dimensional matrix with double precision is expected. The surplus fields are thrown away.


assign(Tmatrix4_extended):Tmatrix3_single

Allow assignment of four-dimensional extended precision matrix to three-dimensional single precision matrix

Declaration

Source position: matrix.pp line 519

operator operator :=(

  const v: Tmatrix4_extended

):Tmatrix3_single;

Description

This operator allows you to use a four-dimensional matrix with extended precision values wherever a three-dimensional matrix with single precision is expected. The surplus fields are thrown away and some precision is lost because of the conversion.


assign(Tmatrix4_extended):Tmatrix4_double

Allow assignment of four-dimensional extended precision matrix to four-dimensional double precision matrix

Declaration

Source position: matrix.pp line 528

operator operator :=(

  const v: Tmatrix4_extended

):Tmatrix4_double;

Description

This operator allows you to use a four-dimensional matrix with extended precision values wherever a four-dimensional matrix with double precision is expected.


assign(Tmatrix4_extended):Tmatrix4_single

Allow assignment of four-dimensional extended precision matrix to four-dimensional single precision matrix

Declaration

Source position: matrix.pp line 527

operator operator :=(

  const v: Tmatrix4_extended

):Tmatrix4_single;

Description

This operator allows you to use a four-dimensional matrix with extended precision values wherever a four-dimensional matrix with single precision is expected. Some precision is lost because of the conversion.


assign(Tmatrix4_single):Tmatrix2_double

Allow assignment of four-dimensional single precision matrix to two-dimensional double precision matrix

Declaration

Source position: matrix.pp line 504

operator operator :=(

  const v: Tmatrix4_single

):Tmatrix2_double;

Description

This operator allows you to use a four-dimensional matrix with single precision values wherever a two-dimensional matrix with double precision is expected. The surplus fields are thrown away.


assign(Tmatrix4_single):Tmatrix2_extended

Allow assignment of four-dimensional single precision matrix to two-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 505

operator operator :=(

  const v: Tmatrix4_single

):Tmatrix2_extended;

Description

This operator allows you to use a four-dimensional matrix with single precision values wherever a two-dimensional matrix with extended precision is expected. The surplus fields are thrown away.


assign(Tmatrix4_single):Tmatrix2_single

Allow assignment of four-dimensional single precision matrix to two-dimensional single precision matrix

Declaration

Source position: matrix.pp line 503

operator operator :=(

  const v: Tmatrix4_single

):Tmatrix2_single;

Description

This operator allows you to use a four-dimensional matrix with single precision values wherever a two-dimensional matrix with single precision is expected. The surplus fields are thrown away.


assign(Tmatrix4_single):Tmatrix3_double

Allow assignment of four-dimensional single precision matrix to three-dimensional double precision matrix

Declaration

Source position: matrix.pp line 514

operator operator :=(

  const v: Tmatrix4_single

):Tmatrix3_double;

Description

This operator allows you to use a four-dimensional matrix with single precision values wherever a three-dimensional matrix with double precision is expected. The surplus fields are thrown away.


assign(Tmatrix4_single):Tmatrix3_extended

Allow assignment of four-dimensional single precision matrix to three-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 515

operator operator :=(

  const v: Tmatrix4_single

):Tmatrix3_extended;

Description

This operator allows you to use a four-dimensional matrix with single precision values wherever a three-dimensional matrix with extended precision is expected. The surplus fields are thrown away.


assign(Tmatrix4_single):Tmatrix3_single

Allow assignment of four-dimensional single precision matrix to three-dimensional single precision matrix

Declaration

Source position: matrix.pp line 513

operator operator :=(

  const v: Tmatrix4_single

):Tmatrix3_single;

Description

This operator allows you to use a four-dimensional matrix with single precision values wherever a three-dimensional matrix with single precision is expected. The surplus fields are thrown away.


assign(Tmatrix4_single):Tmatrix4_double

Allow assignment of four-dimensional single precision matrix to four-dimensional double precision matrix

Declaration

Source position: matrix.pp line 523

operator operator :=(

  const v: Tmatrix4_single

):Tmatrix4_double;

Description

This operator allows you to use a four-dimensional matrix with single precision values wherever a four-dimensional matrix with double precision is expected.


assign(Tmatrix4_single):Tmatrix4_extended

Allow assignment of four-dimensional single precision matrix to four-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 524

operator operator :=(

  const v: Tmatrix4_single

):Tmatrix4_extended;

Description

This operator allows you to use a four-dimensional matrix with single precision values wherever a four-dimensional matrix with extended precision is expected.


assign(Tvector2_double):Tvector2_extended

Allow assignment of double precision vector to extended precision vector

Declaration

Source position: matrix.pp line 274

operator operator :=(

  const v: Tvector2_double

):Tvector2_extended;

Description

This operator allows you to use a vector with double precision values wherever an extended precision vector is expected.


assign(Tvector2_double):Tvector2_single

Allow assignment of double precision vector to single precision vector

Declaration

Source position: matrix.pp line 273

operator operator :=(

  const v: Tvector2_double

):Tvector2_single;

Description

This operator allows you to use a vector with double precision values wherever a single precision vector is expected, at the cost of loosing some precision.


assign(Tvector2_double):Tvector3_double

Allow assignment of two-dimensional double precision vector to three-dimensional double precision vector

Declaration

Source position: matrix.pp line 282

operator operator :=(

  const v: Tvector2_double

):Tvector3_double;

Description

This operator allows you to use a two-dimensional vector with double precision values wherever a three-dimensional vector with double precision is expected. The third dimension is set to 0.0.


assign(Tvector2_double):Tvector3_extended

Allow assignment of two-dimensional double precision vector to three-dimensional extended precision vector

Declaration

Source position: matrix.pp line 283

operator operator :=(

  const v: Tvector2_double

):Tvector3_extended;

Description

This operator allows you to use a two-dimensional vector with double precision values wherever a three-dimensional vector with extended precision is expected. The third dimension is set to 0.0.


assign(Tvector2_double):Tvector3_single

Allow assignment of two-dimensional double precision vector to three-dimensional single precision vector

Declaration

Source position: matrix.pp line 281

operator operator :=(

  const v: Tvector2_double

):Tvector3_single;

Description

This operator allows you to use a two-dimensional vector with double precision values wherever a three-dimensional vector with single precision is expected. Some accuracy is lost because of the conversion and the third dimension is set to 0.0.


assign(Tvector2_double):Tvector4_double

Allow assignment of two-dimensional double precision vector to four-dimensional double precision vector

Declaration

Source position: matrix.pp line 292

operator operator :=(

  const v: Tvector2_double

):Tvector4_double;

Description

This operator allows you to use a two-dimensional vector with double precision values wherever a four-dimensional vector with double precision is expected. The third and fourth dimensions are set to 0.0.


assign(Tvector2_double):Tvector4_extended

Allow assignment of two-dimensional double precision vector to four-dimensional extended precision vector

Declaration

Source position: matrix.pp line 293

operator operator :=(

  const v: Tvector2_double

):Tvector4_extended;

Description

This operator allows you to use a two-dimensional vector with single precision values wherever a four-dimensional vector with extended precision is expected. The third and fourth dimensions are set to 0.0.


assign(Tvector2_double):Tvector4_single

Allow assignment of two-dimensional double precision vector to four-dimensional single precision vector

Declaration

Source position: matrix.pp line 291

operator operator :=(

  const v: Tvector2_double

):Tvector4_single;

Description

This operator allows you to use a two-dimensional vector with double precision values wherever a four-dimensional vector with single precision is expected. Some accurace is lost because of the conversion and the third and fourth dimensions are set to 0.0.


assign(Tvector2_extended):Tvector2_double

Allow assignment of extended precision vector to double precision vector

Declaration

Source position: matrix.pp line 276

operator operator :=(

  const v: Tvector2_extended

):Tvector2_double;

Description

This operator allows you to use a vector with extended precision values wherever a double precision vector is expected, at the cost of loosing some precision.


assign(Tvector2_extended):Tvector2_single

Allow assignment of extended precision vector to single precision vector

Declaration

Source position: matrix.pp line 275

operator operator :=(

  const v: Tvector2_extended

):Tvector2_single;

Description

This operator allows you to use a vector with extended precision values wherever a single precision vector is expected, at the cost of loosing some precision.


assign(Tvector2_extended):Tvector3_double

Allow assignment of two-dimensional extended precision vector to three-dimensional double precision vector

Declaration

Source position: matrix.pp line 285

operator operator :=(

  const v: Tvector2_extended

):Tvector3_double;

Description

This operator allows you to use a two-dimensional vector with extended precision values wherever a three-dimensional vector with double precision is expected. Some accuracy is lost because of the conversion and the third dimension is set to 0.0.


assign(Tvector2_extended):Tvector3_extended

Allow assignment of two-dimensional extened precision vector to three-dimensional extended precision vector

Declaration

Source position: matrix.pp line 286

operator operator :=(

  const v: Tvector2_extended

):Tvector3_extended;

Description

This operator allows you to use a two-dimensional vector with extended precision values wherever a three-dimensional vector with extended precision is expected. The third dimension is set to 0.0.


assign(Tvector2_extended):Tvector3_single

Allow assignment of two-dimensional extended precision vector to three-dimensional single precision vector

Declaration

Source position: matrix.pp line 284

operator operator :=(

  const v: Tvector2_extended

):Tvector3_single;

Description

This operator allows you to use a two-dimensional vector with extended precision values wherever a three-dimensional vector with single precision is expected. Some accuracy is lost because of the conversion and the third dimension is set to 0.0.


assign(Tvector2_extended):Tvector4_double

Allow assignment of two-dimensional extended precision vector to four-dimensional double precision vector

Declaration

Source position: matrix.pp line 295

operator operator :=(

  const v: Tvector2_extended

):Tvector4_double;

Description

This operator allows you to use a two-dimensional vector with extended precision values wherever a four-dimensional vector with double precision is expected. Some accuracy is lost because of the conversion and the third and fourth dimensions are set to 0.0.


assign(Tvector2_extended):Tvector4_extended

Allow assignment of two-dimensiona extended precision vector to four-dimensional extended precision vector

Declaration

Source position: matrix.pp line 296

operator operator :=(

  const v: Tvector2_extended

):Tvector4_extended;

Description

This operator allows you to use a two-dimensional vector with extended precision values wherever a four-dimensional vector with extended precision is expected. The third and fourth dimensions are set to 0.0.


assign(Tvector2_extended):Tvector4_single

Allow assignment of two-dimensional extended precision vector to four-dimensional single precision vector

Declaration

Source position: matrix.pp line 294

operator operator :=(

  const v: Tvector2_extended

):Tvector4_single;

Description

This operator allows you to use a two-dimensional vector with extended precision values wherever a four-dimensional vector with single precision is expected. Some accuracy is lost because of the conversion and the third and fourth dimensions are set to 0.0.


assign(Tvector2_single):Tvector2_double

Allow assignment of single precision vector to double precision vector

Declaration

Source position: matrix.pp line 271

operator operator :=(

  const v: Tvector2_single

):Tvector2_double;

Description

This operator allows you to use a vector with single precision values wherever a double precision vector is expected.


assign(Tvector2_single):Tvector2_extended

Allow assignment of single precision vector to extended precision vector

Declaration

Source position: matrix.pp line 272

operator operator :=(

  const v: Tvector2_single

):Tvector2_extended;

Description

This operator allows you to use a vector with single precision values wherever an extended precision vector is expected.


assign(Tvector2_single):Tvector3_double

Allow assignment of two-dimensional single precision vector to three-dimensional double precision vector

Declaration

Source position: matrix.pp line 279

operator operator :=(

  const v: Tvector2_single

):Tvector3_double;

Description

This operator allows you to use a two-dimensional vector with single precision values wherever a three-dimensional vector with double precision is expected. The third dimension is set to 0.0.


assign(Tvector2_single):Tvector3_extended

Allow assignment of two-dimensional single precision vector to three-dimensional extended precision vector

Declaration

Source position: matrix.pp line 280

operator operator :=(

  const v: Tvector2_single

):Tvector3_extended;

Description

This operator allows you to use a two-dimensional vector with single precision values wherever a three-dimensional vector with extended precision is expected. The third dimension is set to 0.0.


assign(Tvector2_single):Tvector3_single

Allow assignment of two-dimensional single precision vector to three-dimensional single precision vector

Declaration

Source position: matrix.pp line 278

operator operator :=(

  const v: Tvector2_single

):Tvector3_single;

Description

This operator allows you to use a two-dimensional vector with single precision values wherever a three-dimensional vector with single precision is expected. The third dimension is set to 0.0.


assign(Tvector2_single):Tvector4_double

Allow assignment of two-dimensional single precision vector to four-dimensional double precision vector

Declaration

Source position: matrix.pp line 289

operator operator :=(

  const v: Tvector2_single

):Tvector4_double;

Description

This operator allows you to use a two-dimensional vector with single precision values wherever a four-dimensional vector with double precision is expected. The third and fourth dimensions are set to 0.0.


assign(Tvector2_single):Tvector4_extended

Allow assignment of two-dimensional single precision vector to four-dimensional extended precision vector

Declaration

Source position: matrix.pp line 290

operator operator :=(

  const v: Tvector2_single

):Tvector4_extended;

Description

This operator allows you to use a two-dimensional vector with single precision values wherever a four-dimensional vector with extended precision is expected. The third and fourth dimensions are set to 0.0.


assign(Tvector2_single):Tvector4_single

Allow assignment of two-dimensional single precision vector to four-dimensional single precision vector

Declaration

Source position: matrix.pp line 288

operator operator :=(

  const v: Tvector2_single

):Tvector4_single;

Description

This operator allows you to use a two-dimensional vector with single precision values wherever a four-dimensional vector with single precision is expected. The third and fourth dimensions are set to 0.0.


assign(Tvector3_double):Tvector2_double

Allow assignment of three-dimensional double precision vector to two-dimensional double precision vector

Declaration

Source position: matrix.pp line 302

operator operator :=(

  const v: Tvector3_double

):Tvector2_double;

Description

This operator allows you to use a three-dimensional vector with double precision values wherever a two-dimensional vector with double precision is expected. The third dimension is thrown away.


assign(Tvector3_double):Tvector2_extended

Allow assignment of three-dimensional double precision vector to two-dimensional extended precision vector

Declaration

Source position: matrix.pp line 303

operator operator :=(

  const v: Tvector3_double

):Tvector2_extended;

Description

This operator allows you to use a three-dimensional vector with double precision values wherever a two-dimensional vector with extended precision is expected. The third dimension is thrown away.


assign(Tvector3_double):Tvector2_single

Allow assignment of three-dimensional double precision vector to two-dimensional single precision vector

Declaration

Source position: matrix.pp line 301

operator operator :=(

  const v: Tvector3_double

):Tvector2_single;

Description

This operator allows you to use a three-dimensional vector with double precision values wherever a two-dimensional vector with single precision is expected. The third dimension is thrown away and some precision is lost because of the conversion.


assign(Tvector3_double):Tvector3_extended

Allow assignment of three-dimensional double precision vector to three-dimensional extended precision vector

Declaration

Source position: matrix.pp line 311

operator operator :=(

  const v: Tvector3_double

):Tvector3_extended;

Description

This operator allows you to use a three-dimensional vector with double precision values wherever a three-dimensional vector with extended precision is expected.


assign(Tvector3_double):Tvector3_single

Allow assignment of three-dimensional double precision vector to three-dimensional single precision vector

Declaration

Source position: matrix.pp line 310

operator operator :=(

  const v: Tvector3_double

):Tvector3_single;

Description

This operator allows you to use a three-dimensional vector with double precision values wherever a three-dimensional vector with single precision is expected. Some precision is lost because of the conversion.


assign(Tvector3_double):Tvector4_double

Allow assignment of three-dimensional double precision vector to four-dimensional double precision vector

Declaration

Source position: matrix.pp line 319

operator operator :=(

  const v: Tvector3_double

):Tvector4_double;

Description

This operator allows you to use a three-dimensional vector with double precision values wherever a four-dimensional vector with double precision is expected. The fourth dimension is set to 0.


assign(Tvector3_double):Tvector4_extended

Allow assignment of three-dimensional double precision vector to four-dimensional extended precision vector

Declaration

Source position: matrix.pp line 320

operator operator :=(

  const v: Tvector3_double

):Tvector4_extended;

Description

This operator allows you to use a three-dimensional vector with double precision values wherever a four-dimensional vector with extended precision is expected. The fourth dimension is set to 0.


assign(Tvector3_double):Tvector4_single

Allow assignment of three-dimensional double precision vector to four-dimensional single precision vector

Declaration

Source position: matrix.pp line 318

operator operator :=(

  const v: Tvector3_double

):Tvector4_single;

Description

This operator allows you to use a three-dimensional vector with single precision values wherever a four-dimensional vector with double precision is expected. The fourth dimension is set to 0 and some precision is lost because of the conversion.


assign(Tvector3_extended):Tvector2_double

Allow assignment of three-dimensional extended precision vector to two-dimensional double precision vector

Declaration

Source position: matrix.pp line 305

operator operator :=(

  const v: Tvector3_extended

):Tvector2_double;

Description

This operator allows you to use a three-dimensional vector with extended precision values wherever a two-dimensional vector with double precision is expected. The third dimension is thrown away and some precision is lost because of the conversion.


assign(Tvector3_extended):Tvector2_extended

Allow assignment of three-dimensional extended precision vector to two-dimensional extended precision vector

Declaration

Source position: matrix.pp line 306

operator operator :=(

  const v: Tvector3_extended

):Tvector2_extended;

Description

This operator allows you to use a three-dimensional vector with extended precision values wherever a two-dimensional vector with extended precision is expected. The third dimension is thrown away.


assign(Tvector3_extended):Tvector2_single

Allow assignment of three-dimensional extended precision vector to two-dimensional single precision vector

Declaration

Source position: matrix.pp line 304

operator operator :=(

  const v: Tvector3_extended

):Tvector2_single;

Description

This operator allows you to use a three-dimensional vector with extended precision values wherever a two-dimensional vector with single precision is expected. The third dimension is thrown away and some precision is lost because of the conversion.


assign(Tvector3_extended):Tvector3_double

Allow assignment of three-dimensional extended precision vector to three-dimensional double precision vector

Declaration

Source position: matrix.pp line 313

operator operator :=(

  const v: Tvector3_extended

):Tvector3_double;

Description

This operator allows you to use a three-dimensional vector with extended precision values wherever a three-dimensional vector with double precision is expected. Some precision is lost because of the conversion.


assign(Tvector3_extended):Tvector3_single

Allow assignment of three-dimensional single precision vector to three-dimensional double precision vector

Declaration

Source position: matrix.pp line 312

operator operator :=(

  const v: Tvector3_extended

):Tvector3_single;

Description

This operator allows you to use a three-dimensional vector with single precision values wherever a three-dimensional vector with double precision is expected. Some precision is lost because of the conversion.


assign(Tvector3_extended):Tvector4_double

Allow assignment of three-dimensional extended precision vector to four-dimensional double precision vector

Declaration

Source position: matrix.pp line 322

operator operator :=(

  const v: Tvector3_extended

):Tvector4_double;

Description

This operator allows you to use a three-dimensional vector with extended precision values wherever a four-dimensional vector with double precision is expected. The fourth dimension is set to 0 and some accuracy is lost because of the conversion.


assign(Tvector3_extended):Tvector4_extended

Allow assignment of three-dimensional extended precision vector to four-dimensional extended precision vector

Declaration

Source position: matrix.pp line 323

operator operator :=(

  const v: Tvector3_extended

):Tvector4_extended;

Description

This operator allows you to use a three-dimensional vector with extended precision values wherever a four-dimensional vector with extended precision is expected. The fourth dimension is set to 0.


assign(Tvector3_extended):Tvector4_single

Allow assignment of three-dimensional extended precision vector to four-dimensional single precision vector

Declaration

Source position: matrix.pp line 321

operator operator :=(

  const v: Tvector3_extended

):Tvector4_single;

Description

This operator allows you to use a three-dimensional vector with extended precision values wherever a four-dimensional vector with single precision is expected. The fourth dimension is set to 0 and some accuracy is lost because of the conversion.


assign(Tvector3_single):Tvector2_double

Allow assignment of three-dimensional single precision vector to two-dimensional double precision vector

Declaration

Source position: matrix.pp line 299

operator operator :=(

  const v: Tvector3_single

):Tvector2_double;

Description

This operator allows you to use a three-dimensional vector with single precision values wherever a two-dimensional vector with double precision is expected. The third dimension is thrown away.


assign(Tvector3_single):Tvector2_extended

Allow assignment of three-dimensional single precision vector to two-dimensional extended precision vector

Declaration

Source position: matrix.pp line 300

operator operator :=(

  const v: Tvector3_single

):Tvector2_extended;

Description

This operator allows you to use a three-dimensional vector with single precision values wherever a two-dimensional vector with extended precision is expected. The third dimension is thrown away.


assign(Tvector3_single):Tvector2_single

Allow assignment of three-dimensional single precision vector to two-dimensional single precision vector

Declaration

Source position: matrix.pp line 298

operator operator :=(

  const v: Tvector3_single

):Tvector2_single;

Description

This operator allows you to use a three-dimensional vector with single precision values wherever a two-dimensional vector with single precision is expected. The third dimension is thrown away.


assign(Tvector3_single):Tvector3_double

Allow assignment of three-dimensional single precision vector to three-dimensional double precision vector

Declaration

Source position: matrix.pp line 308

operator operator :=(

  const v: Tvector3_single

):Tvector3_double;

Description

This operator allows you to use a three-dimensional vector with single precision values wherever a three-dimensional vector with double precision is expected.


assign(Tvector3_single):Tvector3_extended

Allow assignment of three-dimensional single precision vector to three-dimensional extended precision vector

Declaration

Source position: matrix.pp line 309

operator operator :=(

  const v: Tvector3_single

):Tvector3_extended;

Description

This operator allows you to use a three-dimensional vector with single precision values wherever a three-dimensional vector with extended precision is expected.


assign(Tvector3_single):Tvector4_double

Allow assignment of three-dimensional single precision vector to four-dimensional double precision vector

Declaration

Source position: matrix.pp line 316

operator operator :=(

  const v: Tvector3_single

):Tvector4_double;

Description

This operator allows you to use a three-dimensional vector with single precision values wherever a four-dimensional vector with double precision is expected. The fourth dimension is set to 0.


assign(Tvector3_single):Tvector4_extended

Allow assignment of three-dimensional single precision vector to four-dimensional extended precision vector

Declaration

Source position: matrix.pp line 317

operator operator :=(

  const v: Tvector3_single

):Tvector4_extended;

Description

This operator allows you to use a three-dimensional vector with single precision values wherever a four-dimensional vector with extended precision is expected. The fourth dimension is set to 0.


assign(Tvector3_single):Tvector4_single

Allow assignment of three-dimensional single precision vector to four-dimensional single precision vector

Declaration

Source position: matrix.pp line 315

operator operator :=(

  const v: Tvector3_single

):Tvector4_single;

Description

This operator allows you to use a three-dimensional vector with single precision values wherever a four-dimensional vector with single precision is expected. The fourth dimension is set to 0.


assign(Tvector4_double):Tvector2_double

Allow assignment of four-dimensional double precision vector to two-dimensional double precision vector

Declaration

Source position: matrix.pp line 329

operator operator :=(

  const v: Tvector4_double

):Tvector2_double;

Description

This operator allows you to use a four-dimensional vector with double precision values wherever a two-dimensional vector with double precision is expected. The third and fourth dimensions are thrown away.


assign(Tvector4_double):Tvector2_extended

Allow assignment of four-dimensional double precision vector to two-dimensional extended precision vector

Declaration

Source position: matrix.pp line 330

operator operator :=(

  const v: Tvector4_double

):Tvector2_extended;

Description

This operator allows you to use a four-dimensional vector with double precision values wherever a two-dimensional vector with extended precision is expected. The third and fourth dimensions are thrown away.


assign(Tvector4_double):Tvector2_single

Allow assignment of four-dimensional double precision vector to two-dimensional single precision vector

Declaration

Source position: matrix.pp line 328

operator operator :=(

  const v: Tvector4_double

):Tvector2_single;

Description

This operator allows you to use a four-dimensional vector with double precision values wherever a two-dimensional vector with single precision is expected. The third and fourth dimensions are thrown away and some accuracy is lost because of the conversion.


assign(Tvector4_double):Tvector3_double

Allow assignment of four-dimensional double precision vector to three-dimensional double precision vector

Declaration

Source position: matrix.pp line 339

operator operator :=(

  const v: Tvector4_double

):Tvector3_double;

Description

This operator allows you to use a four-dimensional vector with double precision values wherever a three-dimensional vector with double precision is expected. The fourth dimension is thrown away.


assign(Tvector4_double):Tvector3_extended

Allow assignment of four-dimensional double precision vector to three-dimensional extended precision vector

Declaration

Source position: matrix.pp line 340

operator operator :=(

  const v: Tvector4_double

):Tvector3_extended;

Description

This operator allows you to use a four-dimensional vector with double precision values wherever a three-dimensional vector with extended precision is expected. The fourth dimension is thrown away.


assign(Tvector4_double):Tvector3_single

Allow assignment of four-dimensional double precision vector to three-dimensional single precision vector

Declaration

Source position: matrix.pp line 338

operator operator :=(

  const v: Tvector4_double

):Tvector3_single;

Description

This operator allows you to use a four-dimensional vector with double precision values wherever a three-dimensional vector with single precision is expected. The fourth dimension is thrown away and some accuracy is lost because of the conversion.


assign(Tvector4_double):Tvector4_extended

Allow assignment of four-dimensional single precision vector to four-dimensional extended precision vector

Declaration

Source position: matrix.pp line 348

operator operator :=(

  const v: Tvector4_double

):Tvector4_extended;

Description

This operator allows you to use a four-dimensional vector with double precision values wherever a four-dimensional vector with extended precision is expected.


assign(Tvector4_double):Tvector4_single

Allow assignment of four-dimensional double precision vector to four-dimensional single precision vector

Declaration

Source position: matrix.pp line 347

operator operator :=(

  const v: Tvector4_double

):Tvector4_single;

Description

This operator allows you to use a four-dimensional vector with double precision values wherever a four-dimensional vector with single precision is expected. Some accuracy is lost because of the conversion.


assign(Tvector4_extended):Tvector2_double

Allow assignment of four-dimensional extended precision vector to two-dimensional double precision vector

Declaration

Source position: matrix.pp line 332

operator operator :=(

  const v: Tvector4_extended

):Tvector2_double;

Description

This operator allows you to use a four-dimensional vector with extended precision values wherever a two-dimensional vector with double precision is expected. The third and fourth dimensions are thrown away and some accuracy is lost because of the conversion.


assign(Tvector4_extended):Tvector2_extended

Allow assignment of four-dimensional extended precision vector to two-dimensional extended precision vector

Declaration

Source position: matrix.pp line 333

operator operator :=(

  const v: Tvector4_extended

):Tvector2_extended;

Description

This operator allows you to use a four-dimensional vector with extended precision values wherever a two-dimensional vector with extended precision is expected. The third and fourth dimensions are thrown away.


assign(Tvector4_extended):Tvector2_single

Allow assignment of four-dimensional extended precision vector to two-dimensional single precision vector

Declaration

Source position: matrix.pp line 331

operator operator :=(

  const v: Tvector4_extended

):Tvector2_single;

Description

This operator allows you to use a four-dimensional vector with extended precision values wherever a two-dimensional vector with single precision is expected. The third and fourth dimensions are thrown away and some accuracy is los because of the conversion.


assign(Tvector4_extended):Tvector3_double

Allow assignment of four-dimensional extended precision vector to three-dimensional double precision vector

Declaration

Source position: matrix.pp line 342

operator operator :=(

  const v: Tvector4_extended

):Tvector3_double;

Description

This operator allows you to use a four-dimensional vector with extended precision values wherever a three-dimensional vector with double precision is expected. The fourth dimension is thrown away and some accuracy is lost because of the conversion.


assign(Tvector4_extended):Tvector3_extended

Allow assignment of four-dimensional extended precision vector to three-dimensional extended precision vector

Declaration

Source position: matrix.pp line 343

operator operator :=(

  const v: Tvector4_extended

):Tvector3_extended;

Description

This operator allows you to use a four-dimensional vector with extended precision values wherever a three-dimensional vector with extended precision is expected. The fourth dimensions are thrown away.


assign(Tvector4_extended):Tvector3_single

Allow assignment of four-dimensional extended precision vector to three-dimensional single precision vector

Declaration

Source position: matrix.pp line 341

operator operator :=(

  const v: Tvector4_extended

):Tvector3_single;

Description

This operator allows you to use a four-dimensional vector with extended precision values wherever a three-dimensional vector with single precision is expected. The fourth dimension is thrown away and some accuracy is los because of the conversion.


assign(Tvector4_extended):Tvector4_double

Allow assignment of four-dimensional single precision vector to four-dimensional double precision vector

Declaration

Source position: matrix.pp line 350

operator operator :=(

  const v: Tvector4_extended

):Tvector4_double;

Description

This operator allows you to use a four-dimensional vector with extended precision values wherever a four-dimensional vector with double precision is expected. Some accuracy is lost because of the conversion.


assign(Tvector4_extended):Tvector4_single

Allow assignment of four-dimensional extended precision vector to four-dimensional single precision vector

Declaration

Source position: matrix.pp line 349

operator operator :=(

  const v: Tvector4_extended

):Tvector4_single;

Description

This operator allows you to use a four-dimensional vector with extended precision values wherever a four-dimensional vector with single precision is expected. Some accuracy is lost because of the conversion.


assign(Tvector4_single):Tvector2_double

Allow assignment of four-dimensional single precision vector to two-dimensional double precision vector

Declaration

Source position: matrix.pp line 326

operator operator :=(

  const v: Tvector4_single

):Tvector2_double;

Description

This operator allows you to use a four-dimensional vector with single precision values wherever a two-dimensional vector with double precision is expected. The third and fourth dimensions are thrown away.


assign(Tvector4_single):Tvector2_extended

Allow assignment of four-dimensional single precision vector to two-dimensional extended precision vector

Declaration

Source position: matrix.pp line 327

operator operator :=(

  const v: Tvector4_single

):Tvector2_extended;

Description

This operator allows you to use a four-dimensional vector with single precision values wherever a two-dimensional vector with extended precision is expected. The third and fourth dimensions are thrown away.


assign(Tvector4_single):Tvector2_single

Allow assignment of four-dimensional single precision vector to two-dimensional single precision vector

Declaration

Source position: matrix.pp line 325

operator operator :=(

  const v: Tvector4_single

):Tvector2_single;

Description

This operator allows you to use a four-dimensional vector with single precision values wherever a two-dimensional vector with single precision is expected. The third and fourth dimensions are thrown away.


assign(Tvector4_single):Tvector3_double

Allow assignment of four-dimensional single precision vector to three-dimensional double precision vector

Declaration

Source position: matrix.pp line 336

operator operator :=(

  const v: Tvector4_single

):Tvector3_double;

Description

This operator allows you to use a four-dimensional vector with single precision values wherever a three-dimensional vector with double precision is expected. The fourth dimension is thrown away.


assign(Tvector4_single):Tvector3_extended

Allow assignment of four-dimensional single precision vector to three-dimensional extended precision vector

Declaration

Source position: matrix.pp line 337

operator operator :=(

  const v: Tvector4_single

):Tvector3_extended;

Description

This operator allows you to use a four-dimensional vector with single precision values wherever a three-dimensional vector with extended precision is expected. The fourth dimension is thrown away.


assign(Tvector4_single):Tvector3_single

Allow assignment of four-dimensional single precision vector to three-dimensional single precision vector

Declaration

Source position: matrix.pp line 335

operator operator :=(

  const v: Tvector4_single

):Tvector3_single;

Description

This operator allows you to use a four-dimensional vector with single precision values wherever a three-dimensional vector with single precision is expected. The fourth dimension is thrown away.


assign(Tvector4_single):Tvector4_double

Allow assignment of four-dimensional single precision vector to four-dimensional double precision vector

Declaration

Source position: matrix.pp line 345

operator operator :=(

  const v: Tvector4_single

):Tvector4_double;

Description

This operator allows you to use a four-dimensional vector with single precision values wherever a four-dimensional vector with double precision is expected.


assign(Tvector4_single):Tvector4_extended

Allow assignment of four-dimensional single precision vector to four-dimensional extended precision vector

Declaration

Source position: matrix.pp line 346

operator operator :=(

  const v: Tvector4_single

):Tvector4_extended;

Description

This operator allows you to use a four-dimensional vector with single precision values wherever a four-dimensional vector with extended precision is expected.


divide(Tmatrix2_double,Double):Tmatrix2_double

Divide a two-dimensional single precision matrix by a scalar

Declaration

Source position: matrix.pp line 614

operator operator /(

  const m: Tmatrix2_double;

  const x: Double

):Tmatrix2_double;

Description

This operator allows you to divide a matrix by a scalar. All elements in the matrix are divided by the scalar, the result is returned as a new matrix.


divide(Tmatrix2_extended,extended):Tmatrix2_extended

Divide a two-dimensional single precision matrix by a scalar

Declaration

Source position: matrix.pp line 615

operator operator /(

  const m: Tmatrix2_extended;

  const x: extended

):Tmatrix2_extended;

Description

This operator allows you to divide a matrix by a scalar. All elements in the matrix are divided by the scalar, the result is returned as a new matrix.


divide(Tmatrix2_single,single):Tmatrix2_single

Divide a two-dimensional single precision matrix by a scalar

Declaration

Source position: matrix.pp line 613

operator operator /(

  const m: Tmatrix2_single;

  const x: single

):Tmatrix2_single;

Description

This operator allows you to divide a matrix by a scalar. All elements in the matrix are divided by the scalar, the result is returned as a new matrix.


divide(Tmatrix3_double,Double):Tmatrix3_double

Divide a two-dimensional single precision matrix by a scalar

Declaration

Source position: matrix.pp line 617

operator operator /(

  const m: Tmatrix3_double;

  const x: Double

):Tmatrix3_double;

Description

This operator allows you to divide a matrix by a scalar. All elements in the matrix are divided by the scalar, the result is returned as a new matrix.


divide(Tmatrix3_extended,extended):Tmatrix3_extended

Divide a two-dimensional single precision matrix by a scalar

Declaration

Source position: matrix.pp line 618

operator operator /(

  const m: Tmatrix3_extended;

  const x: extended

):Tmatrix3_extended;

Description

This operator allows you to divide a matrix by a scalar. All elements in the matrix are divided by the scalar, the result is returned as a new matrix.


divide(Tmatrix3_single,single):Tmatrix3_single

Divide a two-dimensional single precision matrix by a scalar

Declaration

Source position: matrix.pp line 616

operator operator /(

  const m: Tmatrix3_single;

  const x: single

):Tmatrix3_single;

Description

This operator allows you to divide a matrix by a scalar. All elements in the matrix are divided by the scalar, the result is returned as a new matrix.


divide(Tmatrix4_double,Double):Tmatrix4_double

Divide a two-dimensional single precision matrix by a scalar

Declaration

Source position: matrix.pp line 620

operator operator /(

  const m: Tmatrix4_double;

  const x: Double

):Tmatrix4_double;

Description

This operator allows you to divide a matrix by a scalar. All elements in the matrix are divided by the scalar, the result is returned as a new matrix.


divide(Tmatrix4_extended,extended):Tmatrix4_extended

Divide a two-dimensional single precision matrix by a scalar

Declaration

Source position: matrix.pp line 621

operator operator /(

  const m: Tmatrix4_extended;

  const x: extended

):Tmatrix4_extended;

Description

This operator allows you to divide a matrix by a scalar. All elements in the matrix are divided by the scalar, the result is returned as a new matrix.


divide(Tmatrix4_single,single):Tmatrix4_single

Divide a two-dimensional single precision matrix by a scalar

Declaration

Source position: matrix.pp line 619

operator operator /(

  const m: Tmatrix4_single;

  const x: single

):Tmatrix4_single;

Description

This operator allows you to divide a matrix by a scalar. All elements in the matrix are divided by the scalar, the result is returned as a new matrix.


divide(Tvector2_double,Double):Tvector2_double

Divide a two-dimensional double precision vector by a scalar

Declaration

Source position: matrix.pp line 439

operator operator /(

  const x: Tvector2_double;

  y: Double

):Tvector2_double;

Description

This operator allows you to divide a vector by a scalar value. Each vector element is divided by the scalar value; the result is returned as a new vector.


divide(Tvector2_extended,extended):Tvector2_extended

Divide a two-dimensional extended precision vector by a scalar

Declaration

Source position: matrix.pp line 440

operator operator /(

  const x: Tvector2_extended;

  y: extended

):Tvector2_extended;

Description

This operator allows you to divide a vector by a scalar value. Each vector element is divided by the scalar value; the result is returned as a new vector.


divide(Tvector2_single,single):Tvector2_single

Divide a two-dimensional single precision vector by a scalar

Declaration

Source position: matrix.pp line 438

operator operator /(

  const x: Tvector2_single;

  y: single

):Tvector2_single;

Description

This operator allows you to divide a vector by a scalar value. Each vector element is divided by the scalar value; the result is returned as a new vector.


divide(Tvector3_double,Double):Tvector3_double

Divide a three-dimensional double precision vector by a scalar

Declaration

Source position: matrix.pp line 442

operator operator /(

  const x: Tvector3_double;

  y: Double

):Tvector3_double;

Description

This operator allows you to divide a vector by a scalar value. Each vector element is divided by the scalar value; the result is returned as a new vector.


divide(Tvector3_extended,extended):Tvector3_extended

Divide a three-dimensional extended precision vector by a scalar

Declaration

Source position: matrix.pp line 443

operator operator /(

  const x: Tvector3_extended;

  y: extended

):Tvector3_extended;

Description

This operator allows you to divide a vector by a scalar value. Each vector element is divided by the scalar value; the result is returned as a new vector.


divide(Tvector3_single,single):Tvector3_single

Divide a three-dimensional single precision vector by a scalar

Declaration

Source position: matrix.pp line 441

operator operator /(

  const x: Tvector3_single;

  y: single

):Tvector3_single;

Description

This operator allows you to divide a vector by a scalar value. Each vector element is divided by the scalar value; the result is returned as a new vector.


divide(Tvector4_double,Double):Tvector4_double

Divide a four-dimensional double precision vector by a scalar

Declaration

Source position: matrix.pp line 445

operator operator /(

  const x: Tvector4_double;

  y: Double

):Tvector4_double;

Description

This operator allows you to divide a vector by a scalar value. Each vector element is divided by the scalar value; the result is returned as a new vector.


divide(Tvector4_extended,extended):Tvector4_extended

Divide a four-dimensional extended precision vector by a scalar

Declaration

Source position: matrix.pp line 446

operator operator /(

  const x: Tvector4_extended;

  y: extended

):Tvector4_extended;

Description

This operator allows you to divide a vector by a scalar value. Each vector element is divided by the scalar value; the result is returned as a new vector.


divide(Tvector4_single,single):Tvector4_single

Divide a four-dimensional single precision vector by a scalar

Declaration

Source position: matrix.pp line 444

operator operator /(

  const x: Tvector4_single;

  y: single

):Tvector4_single;

Description

This operator allows you to divide a vector by a scalar value. Each vector element is divided by the scalar value; the result is returned as a new vector.


multiply(Tmatrix2_double,Double):Tmatrix2_double

Multiply a two-dimensional double precision matrix by a scalar

Declaration

Source position: matrix.pp line 604

operator operator *(

  const m: Tmatrix2_double;

  const x: Double

):Tmatrix2_double;

Description

This operator allows you to multiply a matrix with a scalar. All elements in the matrix are multiplied by the scalar, the result is returned as a new matrix.


multiply(Tmatrix2_double,Tmatrix2_double):Tmatrix2_double

Give product of two two-dimensional double precision matrices

Declaration

Source position: matrix.pp line 562

operator operator *(

  const m1: Tmatrix2_double;

  const m2: Tmatrix2_double

):Tmatrix2_double;

Description

This operator allows you to multipy two two-dimensional single precision matrices. A new matrix is returned which is the product of both matrices. The product is calculated using the well known matrix multiplication algorithm.


multiply(Tmatrix2_double,Tvector2_double):Tvector2_double

Give product of a two-dimendional double precision matrix and vector

Declaration

Source position: matrix.pp line 573

operator operator *(

  const m: Tmatrix2_double;

  const v: Tvector2_double

):Tvector2_double;

Description

This operator allows you to multipy a two-dimensional double precision matrices with a two dimensional double precision vector. A new vector is returned which is the product of the matrix and the vector. The product is calculated using the well known matrix-vector multiplication algorithm.


multiply(Tmatrix2_extended,extended):Tmatrix2_extended

Multiply a two-dimensional extended precision matrix by a scalar

Declaration

Source position: matrix.pp line 605

operator operator *(

  const m: Tmatrix2_extended;

  const x: extended

):Tmatrix2_extended;

Description

This operator allows you to multiply a matrix with a scalar. All elements in the matrix are multiplied by the scalar, the result is returned as a new matrix.


multiply(Tmatrix2_extended,Tmatrix2_extended):Tmatrix2_extended

Give product of two two-dimensional extended precision matrices

Declaration

Source position: matrix.pp line 563

operator operator *(

  const m1: Tmatrix2_extended;

  const m2: Tmatrix2_extended

):Tmatrix2_extended;

Description

This operator allows you to multipy two two-dimensional single precision matrices. A new matrix is returned which is the product of both matrices. The product is calculated using the well known matrix multiplication algorithm.


multiply(Tmatrix2_extended,Tvector2_extended):Tvector2_extended

Give product of a two-dimendional extended precision matrix and vector

Declaration

Source position: matrix.pp line 574

operator operator *(

  const m: Tmatrix2_extended;

  const v: Tvector2_extended

):Tvector2_extended;

Description

This operator allows you to multipy a two-dimensional extended precision matrices with a two dimensional extended precision vector. A new vector is returned which is the product of the matrix and the vector. The product is calculated using the well known matrix-vector multiplication algorithm.


multiply(Tmatrix2_single,single):Tmatrix2_single

Multiply a two-dimensional single precision matrix by a scalar

Declaration

Source position: matrix.pp line 603

operator operator *(

  const m: Tmatrix2_single;

  const x: single

):Tmatrix2_single;

Description

This operator allows you to multiply a matrix with a scalar. All elements in the matrix are multiplied by the scalar, the result is returned as a new matrix.


multiply(Tmatrix2_single,Tmatrix2_single):Tmatrix2_single

Give product of two two-dimensional single precision matrices

Declaration

Source position: matrix.pp line 561

operator operator *(

  const m1: Tmatrix2_single;

  const m2: Tmatrix2_single

):Tmatrix2_single;

Description

This operator allows you to multipy two two-dimensional single precision matrices. A new matrix is returned which is the product of both matrices. The product is calculated using the well known matrix multiplication algorithm.


multiply(Tmatrix2_single,Tvector2_single):Tvector2_single

Give product of a two-dimendional single precision matrix and vector

Declaration

Source position: matrix.pp line 572

operator operator *(

  const m: Tmatrix2_single;

  const v: Tvector2_single

):Tvector2_single;

Description

This operator allows you to multipy a two-dimensional single precision matrices with a two dimensional single precision vector. A new vector is returned which is the product of the matrix and the vector. The product is calculated using the well known matrix-vector multiplication algorithm.


multiply(Tmatrix3_double,Double):Tmatrix3_double

Multiply a three-dimensional double precision matrix by a scalar

Declaration

Source position: matrix.pp line 607

operator operator *(

  const m: Tmatrix3_double;

  const x: Double

):Tmatrix3_double;

Description

This operator allows you to multiply a matrix with a scalar. All elements in the matrix are multiplied by the scalar, the result is returned as a new matrix.


multiply(Tmatrix3_double,Tmatrix3_double):Tmatrix3_double

Give product of two three-dimensional double precision matrices

Declaration

Source position: matrix.pp line 565

operator operator *(

  const m1: Tmatrix3_double;

  const m2: Tmatrix3_double

):Tmatrix3_double;

Description

This operator allows you to multipy two two-dimensional single precision matrices. A new matrix is returned which is the product of both matrices. The product is calculated using the well known matrix multiplication algorithm.


multiply(Tmatrix3_double,Tvector3_double):Tvector3_double

Give product of a three-dimendional double precision matrix and vector

Declaration

Source position: matrix.pp line 576

operator operator *(

  const m: Tmatrix3_double;

  const v: Tvector3_double

):Tvector3_double;

Description

This operator allows you to multipy a three-dimensional double precision matrices with a three dimensional double precision vector. A new vector is returned which is the product of the matrix and the vector. The product is calculated using the well known matrix-vector multiplication algorithm.


multiply(Tmatrix3_extended,extended):Tmatrix3_extended

Multiply a three-dimensional extended precision matrix by a scalar

Declaration

Source position: matrix.pp line 608

operator operator *(

  const m: Tmatrix3_extended;

  const x: extended

):Tmatrix3_extended;

Description

This operator allows you to multiply a matrix with a scalar. All elements in the matrix are multiplied by the scalar, the result is returned as a new matrix.


multiply(Tmatrix3_extended,Tmatrix3_extended):Tmatrix3_extended

Give product of two three-dimensional extended precision matrices

Declaration

Source position: matrix.pp line 566

operator operator *(

  const m1: Tmatrix3_extended;

  const m2: Tmatrix3_extended

):Tmatrix3_extended;

Description

This operator allows you to multipy two two-dimensional single precision matrices. A new matrix is returned which is the product of both matrices. The product is calculated using the well known matrix multiplication algorithm.


multiply(Tmatrix3_extended,Tvector3_extended):Tvector3_extended

Give product of a three-dimendional extended precision matrix and vector

Declaration

Source position: matrix.pp line 577

operator operator *(

  const m: Tmatrix3_extended;

  const v: Tvector3_extended

):Tvector3_extended;

Description

This operator allows you to multipy a three-dimensional extended precision matrices with a three dimensional extended precision vector. A new vector is returned which is the product of the matrix and the vector. The product is calculated using the well known matrix-vector multiplication algorithm.


multiply(Tmatrix3_single,single):Tmatrix3_single

Multiply a three-dimensional single precision matrix by a scalar

Declaration

Source position: matrix.pp line 606

operator operator *(

  const m: Tmatrix3_single;

  const x: single

):Tmatrix3_single;

Description

This operator allows you to multiply a matrix with a scalar. All elements in the matrix are multiplied by the scalar, the result is returned as a new matrix.


multiply(Tmatrix3_single,Tmatrix3_single):Tmatrix3_single

Give product of two three-dimensional single precision matrices

Declaration

Source position: matrix.pp line 564

operator operator *(

  const m1: Tmatrix3_single;

  const m2: Tmatrix3_single

):Tmatrix3_single;

Description

This operator allows you to multipy two two-dimensional single precision matrices. A new matrix is returned which is the product of both matrices. The product is calculated using the well known matrix multiplication algorithm.


multiply(Tmatrix3_single,Tvector3_single):Tvector3_single

Give product of a three-dimendional single precision matrix and vector

Declaration

Source position: matrix.pp line 575

operator operator *(

  const m: Tmatrix3_single;

  const v: Tvector3_single

):Tvector3_single;

Description

This operator allows you to multipy a three-dimensional single precision matrices with a three dimensional single precision vector. A new vector is returned which is the product of the matrix and the vector. The product is calculated using the well known matrix-vector multiplication algorithm.


multiply(Tmatrix4_double,Double):Tmatrix4_double

Multiply a four-dimensional double precision matrix by a scalar

Declaration

Source position: matrix.pp line 610

operator operator *(

  const m: Tmatrix4_double;

  const x: Double

):Tmatrix4_double;

Description

This operator allows you to multiply a matrix with a scalar. All elements in the matrix are multiplied by the scalar, the result is returned as a new matrix.


multiply(Tmatrix4_double,Tmatrix4_double):Tmatrix4_double

Give product of two four-dimensional double precision matrices

Declaration

Source position: matrix.pp line 568

operator operator *(

  const m1: Tmatrix4_double;

  const m2: Tmatrix4_double

):Tmatrix4_double;

Description

This operator allows you to multipy two two-dimensional single precision matrices. A new matrix is returned which is the product of both matrices. The product is calculated using the well known matrix multiplication algorithm.


multiply(Tmatrix4_double,Tvector4_double):Tvector4_double

Give product of a four-dimendional double precision matrix and vector

Declaration

Source position: matrix.pp line 579

operator operator *(

  const m: Tmatrix4_double;

  const v: Tvector4_double

):Tvector4_double;

Description

This operator allows you to multipy a four-dimensional double precision matrices with a four dimensional double precision vector. A new vector is returned which is the product of the matrix and the vector. The product is calculated using the well known matrix-vector multiplication algorithm.


multiply(Tmatrix4_extended,extended):Tmatrix4_extended

Multiply a four-dimensional extended precision matrix by a scalar

Declaration

Source position: matrix.pp line 611

operator operator *(

  const m: Tmatrix4_extended;

  const x: extended

):Tmatrix4_extended;

Description

This operator allows you to multiply a matrix with a scalar. All elements in the matrix are multiplied by the scalar, the result is returned as a new matrix.


multiply(Tmatrix4_extended,Tmatrix4_extended):Tmatrix4_extended

Give product of two four-dimensional extended precision matrices

Declaration

Source position: matrix.pp line 569

operator operator *(

  const m1: Tmatrix4_extended;

  const m2: Tmatrix4_extended

):Tmatrix4_extended;

Description

This operator allows you to multipy two two-dimensional single precision matrices. A new matrix is returned which is the product of both matrices. The product is calculated using the well known matrix multiplication algorithm.


multiply(Tmatrix4_extended,Tvector4_extended):Tvector4_extended

Give product of a four-dimendional extended precision matrix and vector

Declaration

Source position: matrix.pp line 580

operator operator *(

  const m: Tmatrix4_extended;

  const v: Tvector4_extended

):Tvector4_extended;

Description

This operator allows you to multipy a four-dimensional extended precision matrices with a four dimensional extended precision vector. A new vector is returned which is the product of the matrix and the vector. The product is calculated using the well known matrix-vector multiplication algorithm.


multiply(Tmatrix4_single,single):Tmatrix4_single

Multiply a four-dimensional single precision matrix by a scalar

Declaration

Source position: matrix.pp line 609

operator operator *(

  const m: Tmatrix4_single;

  const x: single

):Tmatrix4_single;

Description

This operator allows you to multiply a matrix with a scalar. All elements in the matrix are multiplied by the scalar, the result is returned as a new matrix.


multiply(Tmatrix4_single,Tmatrix4_single):Tmatrix4_single

Give product of two four-dimensional single precision matrices

Declaration

Source position: matrix.pp line 567

operator operator *(

  const m1: Tmatrix4_single;

  const m2: Tmatrix4_single

):Tmatrix4_single;

Description

This operator allows you to multipy two two-dimensional single precision matrices. A new matrix is returned which is the product of both matrices. The product is calculated using the well known matrix multiplication algorithm.


multiply(Tmatrix4_single,Tvector4_single):Tvector4_single

Give product of a four-dimendional single precision matrix and vector

Declaration

Source position: matrix.pp line 578

operator operator *(

  const m: Tmatrix4_single;

  const v: Tvector4_single

):Tvector4_single;

Description

This operator allows you to multipy a four-dimensional single precision matrices with a four dimensional single precision vector. A new vector is returned which is the product of the matrix and the vector. The product is calculated using the well known matrix-vector multiplication algorithm.


multiply(Tvector2_double,Double):Tvector2_double

Multiply a two-dimensional double precision vector by a scalar

Declaration

Source position: matrix.pp line 429

operator operator *(

  const x: Tvector2_double;

  y: Double

):Tvector2_double;

Description

This operator allows you to multiply a vector by a scalar value. Each vector element is multiplied by the scalar value; the result is returned as a new vector.


multiply(Tvector2_double,Tvector2_double):Tvector2_double

Multiply two vectors element wise

Declaration

Source position: matrix.pp line 384

operator operator *(

  const x: Tvector2_double;

  const y: Tvector2_double

):Tvector2_double;

Description

This operator returns a vector that contains the element by element multiplication of the two multiplied vectors.


multiply(Tvector2_extended,extended):Tvector2_extended

Multiply a two-dimensional extended precision vector by a scalar

Declaration

Source position: matrix.pp line 430

operator operator *(

  const x: Tvector2_extended;

  y: extended

):Tvector2_extended;

Description

This operator allows you to multiply a vector by a scalar value. Each vector element is multiplied by the scalar value; the result is returned as a new vector.


multiply(Tvector2_extended,Tvector2_extended):Tvector2_extended

Multiply two vectors element wise

Declaration

Source position: matrix.pp line 385

operator operator *(

  const x: Tvector2_extended;

  const y: Tvector2_extended

):Tvector2_extended;

Description

This operator returns a vector that contains the element by element multiplication of the two multiplied vectors.


multiply(Tvector2_single,single):Tvector2_single

Multiply a two-dimensional single precision vector by a scalar

Declaration

Source position: matrix.pp line 428

operator operator *(

  const x: Tvector2_single;

  y: single

):Tvector2_single;

Description

This operator allows you to multiply a vector by a scalar value. Each vector element is multiplied by the scalar value; the result is returned as a new vector.


multiply(Tvector2_single,Tvector2_single):Tvector2_single

Multiply two vectors element wise

Declaration

Source position: matrix.pp line 383

operator operator *(

  const x: Tvector2_single;

  const y: Tvector2_single

):Tvector2_single;

Description

This operator returns a vector that contains the element by element multiplication of the two multiplied vectors.


multiply(Tvector3_double,Double):Tvector3_double

Multiply a three-dimensional double precision vector by a scalar

Declaration

Source position: matrix.pp line 432

operator operator *(

  const x: Tvector3_double;

  y: Double

):Tvector3_double;

Description

This operator allows you to multiply a vector by a scalar value. Each vector element is multiplied by the scalar value; the result is returned as a new vector.


multiply(Tvector3_double,Tvector3_double):Tvector3_double

Multiply two vectors element wise

Declaration

Source position: matrix.pp line 387

operator operator *(

  const x: Tvector3_double;

  const y: Tvector3_double

):Tvector3_double;

Description

This operator returns a vector that contains the element by element multiplication of the two multiplied vectors.


multiply(Tvector3_extended,extended):Tvector3_extended

Multiply a three-dimensional extended precision vector by a scalar

Declaration

Source position: matrix.pp line 433

operator operator *(

  const x: Tvector3_extended;

  y: extended

):Tvector3_extended;

Description

This operator allows you to multiply a vector by a scalar value. Each vector element is multiplied by the scalar value; the result is returned as a new vector.


multiply(Tvector3_extended,Tvector3_extended):Tvector3_extended

Multiply two vectors element wise

Declaration

Source position: matrix.pp line 388

operator operator *(

  const x: Tvector3_extended;

  const y: Tvector3_extended

):Tvector3_extended;

Description

This operator returns a vector that contains the element by element multiplication of the two multiplied vectors.


multiply(Tvector3_single,single):Tvector3_single

Multiply a three-dimensional single precision vector by a scalar

Declaration

Source position: matrix.pp line 431

operator operator *(

  const x: Tvector3_single;

  y: single

):Tvector3_single;

Description

This operator allows you to multiply a vector by a scalar value. Each vector element is multiplied by the scalar value; the result is returned as a new vector.


multiply(Tvector3_single,Tvector3_single):Tvector3_single

Multiply two vectors element wise

Declaration

Source position: matrix.pp line 386

operator operator *(

  const x: Tvector3_single;

  const y: Tvector3_single

):Tvector3_single;

Description

This operator returns a vector that contains the element by element multiplication of the two multiplied vectors.


multiply(Tvector4_double,Double):Tvector4_double

Multiply a four-dimensional double precision vector by a scalar

Declaration

Source position: matrix.pp line 435

operator operator *(

  const x: Tvector4_double;

  y: Double

):Tvector4_double;

Description

This operator allows you to multiply a vector by a scalar value. Each vector element is multiplied by the scalar value; the result is returned as a new vector.


multiply(Tvector4_double,Tvector4_double):Tvector4_double

Multiply two vectors element wise

Declaration

Source position: matrix.pp line 390

operator operator *(

  const x: Tvector4_double;

  const y: Tvector4_double

):Tvector4_double;

Description

This operator returns a vector that contains the element by element multiplication of the two multiplied vectors.


multiply(Tvector4_extended,extended):Tvector4_extended

Multiply a four-dimensional extended precision vector by a scalar

Declaration

Source position: matrix.pp line 436

operator operator *(

  const x: Tvector4_extended;

  y: extended

):Tvector4_extended;

Description

This operator allows you to multiply a vector by a scalar value. Each vector element is multiplied by the scalar value; the result is returned as a new vector.


multiply(Tvector4_extended,Tvector4_extended):Tvector4_extended

Multiply two vectors element wise

Declaration

Source position: matrix.pp line 391

operator operator *(

  const x: Tvector4_extended;

  const y: Tvector4_extended

):Tvector4_extended;

Description

This operator returns a vector that contains the element by element multiplication of the two multiplied vectors.


multiply(Tvector4_single,single):Tvector4_single

Multiply a four-dimensional single precision vector by a scalar

Declaration

Source position: matrix.pp line 434

operator operator *(

  const x: Tvector4_single;

  y: single

):Tvector4_single;

Description

This operator allows you to multiply a vector by a scalar value. Each vector element is multiplied by the scalar value; the result is returned as a new vector.


multiply(Tvector4_single,Tvector4_single):Tvector4_single

Multiply two vectors element wise

Declaration

Source position: matrix.pp line 389

operator operator *(

  const x: Tvector4_single;

  const y: Tvector4_single

):Tvector4_single;

Description

This operator returns a vector that contains the element by element multiplication of the two multiplied vectors.


negative(Tmatrix2_double):Tmatrix2_double

Negate two-dimensional double precision matrix.

Declaration

Source position: matrix.pp line 552

operator operator -(

  const m1: Tmatrix2_double

):Tmatrix2_double;

Description

This operation returns a matrix with all elements negated.


negative(Tmatrix2_extended):Tmatrix2_extended

Negate two-dimensional extended precision matrix.

Declaration

Source position: matrix.pp line 553

operator operator -(

  const m1: Tmatrix2_extended

):Tmatrix2_extended;

Description

This operation returns a matrix with all elements negated.


negative(Tmatrix2_single):Tmatrix2_single

Negate two-dimensional single precision matrix.

Declaration

Source position: matrix.pp line 551

operator operator -(

  const m1: Tmatrix2_single

):Tmatrix2_single;

Description

This operation returns a matrix with all elements negated.


negative(Tmatrix3_double):Tmatrix3_double

Negate three-dimensional double precision matrix.

Declaration

Source position: matrix.pp line 555

operator operator -(

  const m1: Tmatrix3_double

):Tmatrix3_double;

Description

This operation returns a matrix with all elements negated.


negative(Tmatrix3_extended):Tmatrix3_extended

Negate three-dimensional extended precision matrix.

Declaration

Source position: matrix.pp line 556

operator operator -(

  const m1: Tmatrix3_extended

):Tmatrix3_extended;

Description

This operation returns a matrix with all elements negated.


negative(Tmatrix3_single):Tmatrix3_single

Negate three-dimensional single precision matrix.

Declaration

Source position: matrix.pp line 554

operator operator -(

  const m1: Tmatrix3_single

):Tmatrix3_single;

Description

This operation returns a matrix with all elements negated.


negative(Tmatrix4_double):Tmatrix4_double

Negate four-dimensional double precision matrix.

Declaration

Source position: matrix.pp line 558

operator operator -(

  const m1: Tmatrix4_double

):Tmatrix4_double;

Description

This operation returns a matrix with all elements negated.


negative(Tmatrix4_extended):Tmatrix4_extended

Negate four-dimensional extended precision matrix.

Declaration

Source position: matrix.pp line 559

operator operator -(

  const m1: Tmatrix4_extended

):Tmatrix4_extended;

Description

This operation returns a matrix with all elements negated.


negative(Tmatrix4_single):Tmatrix4_single

Negate four-dimensional single precision matrix.

Declaration

Source position: matrix.pp line 557

operator operator -(

  const m1: Tmatrix4_single

):Tmatrix4_single;

Description

This operation returns a matrix with all elements negated.


negative(Tvector2_double):Tvector2_double

Negate two-dimensional vector.

Declaration

Source position: matrix.pp line 374

operator operator -(

  const x: Tvector2_double

):Tvector2_double;

Description

This operation returns a vector in the opposite direction of the vector that is passed. In order to do so, all values in the vector are negated.


negative(Tvector2_extended):Tvector2_extended

Negate two-dimensional vector.

Declaration

Source position: matrix.pp line 375

operator operator -(

  const x: Tvector2_extended

):Tvector2_extended;

Description

This operation returns a vector in the opposite direction of the vector that is passed. In order to do so, all values in the vector are negated.


negative(Tvector2_single):Tvector2_single

Negate two-dimensional vector.

Declaration

Source position: matrix.pp line 373

operator operator -(

  const x: Tvector2_single

):Tvector2_single;

Description

This operation returns a vector in the opposite direction of the vector that is passed. In order to do so, all values in the vector are negated.


negative(Tvector3_double):Tvector3_double

Negate three-dimensional vector.

Declaration

Source position: matrix.pp line 377

operator operator -(

  const x: Tvector3_double

):Tvector3_double;

Description

This operation returns a vector in the opposite direction of the vector that is passed. In order to do so, all values in the vector are negated.


negative(Tvector3_extended):Tvector3_extended

Negate three-dimensional vector.

Declaration

Source position: matrix.pp line 378

operator operator -(

  const x: Tvector3_extended

):Tvector3_extended;

Description

This operation returns a vector in the opposite direction of the vector that is passed. In order to do so, all values in the vector are negated.


negative(Tvector3_single):Tvector3_single

Negate three-dimensional vector.

Declaration

Source position: matrix.pp line 376

operator operator -(

  const x: Tvector3_single

):Tvector3_single;

Description

This operation returns a vector in the opposite direction of the vector that is passed. In order to do so, all values in the vector are negated.


negative(Tvector4_double):Tvector4_double

Negate four-dimensional vector.

Declaration

Source position: matrix.pp line 380

operator operator -(

  const x: Tvector4_double

):Tvector4_double;

Description

This operation returns a vector in the opposite direction of the vector that is passed. In order to do so, all values in the vector are negated.


negative(Tvector4_extended):Tvector4_extended

Negate four-dimensional vector.

Declaration

Source position: matrix.pp line 381

operator operator -(

  const x: Tvector4_extended

):Tvector4_extended;

Description

This operation returns a vector in the opposite direction of the vector that is passed. In order to do so, all values in the vector are negated.


negative(Tvector4_single):Tvector4_single

Negate four-dimensional vector.

Declaration

Source position: matrix.pp line 379

operator operator -(

  const x: Tvector4_single

):Tvector4_single;

Description

This operation returns a vector in the opposite direction of the vector that is passed. In order to do so, all values in the vector are negated.


power(Tvector2_double,Tvector2_double):Double

Calculate the internal product of two vectors.

Declaration

Source position: matrix.pp line 394

operator operator **(

  const x: Tvector2_double;

  const y: Tvector2_double

):Double;

Description

This operator returns the internal product of the two vectors, that is, the elements of the two vectors are element-wise multiplied, and then added together.


power(Tvector2_extended,Tvector2_extended):extended

Calculate the internal product of two vectors.

Declaration

Source position: matrix.pp line 395

operator operator **(

  const x: Tvector2_extended;

  const y: Tvector2_extended

):extended;

Description

This operator returns the internal product of the two vectors, that is, the elements of the two vectors are element-wise multiplied, and then added together.


power(Tvector2_single,Tvector2_single):single

Calculate the internal product of two vectors.

Declaration

Source position: matrix.pp line 393

operator operator **(

  const x: Tvector2_single;

  const y: Tvector2_single

):single;

Description

This operator returns the internal product of the two vectors, that is, the elements of the two vectors are element-wise multiplied, and then added together.


power(Tvector3_double,Tvector3_double):Double

Calculate the internal product of two vectors.

Declaration

Source position: matrix.pp line 397

operator operator **(

  const x: Tvector3_double;

  const y: Tvector3_double

):Double;

Description

This operator returns the internal product of the two vectors, that is, the elements of the two vectors are element-wise multiplied, and then added together.


power(Tvector3_extended,Tvector3_extended):extended

Calculate the internal product of two vectors.

Declaration

Source position: matrix.pp line 398

operator operator **(

  const x: Tvector3_extended;

  const y: Tvector3_extended

):extended;

Description

This operator returns the internal product of the two vectors, that is, the elements of the two vectors are element-wise multiplied, and then added together.


power(Tvector3_single,Tvector3_single):single

Calculate the internal product of two vectors.

Declaration

Source position: matrix.pp line 396

operator operator **(

  const x: Tvector3_single;

  const y: Tvector3_single

):single;

Description

This operator returns the internal product of the two vectors, that is, the elements of the two vectors are element-wise multiplied, and then added together.


power(Tvector4_double,Tvector4_double):Double

Calculate the internal product of two vectors.

Declaration

Source position: matrix.pp line 400

operator operator **(

  const x: Tvector4_double;

  const y: Tvector4_double

):Double;

Description

This operator returns the internal product of the two vectors, that is, the elements of the two vectors are element-wise multiplied, and then added together.


power(Tvector4_extended,Tvector4_extended):extended

Calculate the internal product of two vectors.

Declaration

Source position: matrix.pp line 401

operator operator **(

  const x: Tvector4_extended;

  const y: Tvector4_extended

):extended;

Description

This operator returns the internal product of the two vectors, that is, the elements of the two vectors are element-wise multiplied, and then added together.


power(Tvector4_single,Tvector4_single):single

Calculate the internal product of two vectors.

Declaration

Source position: matrix.pp line 399

operator operator **(

  const x: Tvector4_single;

  const y: Tvector4_single

):single;

Description

This operator returns the internal product of the two vectors, that is, the elements of the two vectors are element-wise multiplied, and then added together.


subtract(Tmatrix2_double,Double):Tmatrix2_double

Subtract scalar to two-dimensional double precision matrix

Declaration

Source position: matrix.pp line 594

operator operator -(

  const m: Tmatrix2_double;

  const x: Double

):Tmatrix2_double;

Description

This operator allows you to subtract a scalar value from a matrix. The scalar is subtracted from all elements of the matrix, the result is returned as a new matrix.


subtract(Tmatrix2_double,Tmatrix2_double):Tmatrix2_double

Subtract a two-dimensional double precision matrix from another.

Declaration

Source position: matrix.pp line 542

operator operator -(

  const m1: Tmatrix2_double;

  const m2: Tmatrix2_double

):Tmatrix2_double;

Description

This operator allows you to subtract a two-dimensional double precision matrix from another. A new matrix is returned with all elements of the two matrices subtracted from each other.


subtract(Tmatrix2_extended,extended):Tmatrix2_extended

Add scalar to two-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 595

operator operator -(

  const m: Tmatrix2_extended;

  const x: extended

):Tmatrix2_extended;

Description

This operator allows you to subtract a scalar value from a matrix. The scalar is subtracted from all elements of the matrix, the result is returned as a new matrix.


subtract(Tmatrix2_extended,Tmatrix2_extended):Tmatrix2_extended

Subtract a two-dimensional extended precision matrix from another.

Declaration

Source position: matrix.pp line 543

operator operator -(

  const m1: Tmatrix2_extended;

  const m2: Tmatrix2_extended

):Tmatrix2_extended;

Description

This operator allows you to subtract a two-dimensional extended precision matrix from another. A new matrix is returned with all elements of the two matrices subtracted from each other.


subtract(Tmatrix2_single,single):Tmatrix2_single

Subtract scalar to two-dimensional single precision matrix

Declaration

Source position: matrix.pp line 593

operator operator -(

  const m: Tmatrix2_single;

  const x: single

):Tmatrix2_single;

Description

This operator allows you to subtract a scalar value from a matrix. The scalar is subtracted from all elements of the matrix, the result is returned as a new matrix.


subtract(Tmatrix2_single,Tmatrix2_single):Tmatrix2_single

Subtract a two-dimensional single precision matrix from another.

Declaration

Source position: matrix.pp line 541

operator operator -(

  const m1: Tmatrix2_single;

  const m2: Tmatrix2_single

):Tmatrix2_single;

Description

This operator allows you to subtract a two-dimensional single precision matrix from another. A new matrix is returned with all elements of the two matrices subtracted from each other.


subtract(Tmatrix3_double,Double):Tmatrix3_double

Add scalar to three-dimensional double precision matrix

Declaration

Source position: matrix.pp line 597

operator operator -(

  const m: Tmatrix3_double;

  const x: Double

):Tmatrix3_double;

Description

This operator allows you to subtract a scalar value from a matrix. The scalar is subtracted from all elements of the matrix, the result is returned as a new matrix.


subtract(Tmatrix3_double,Tmatrix3_double):Tmatrix3_double

Subtract a three-dimensional double precision matrix from another.

Declaration

Source position: matrix.pp line 545

operator operator -(

  const m1: Tmatrix3_double;

  const m2: Tmatrix3_double

):Tmatrix3_double;

Description

This operator allows you to subtract a three-dimensional double precision matrix from another. A new matrix is returned with all elements of the two matrices subtracted from each other.


subtract(Tmatrix3_extended,extended):Tmatrix3_extended

Add scalar to three-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 598

operator operator -(

  const m: Tmatrix3_extended;

  const x: extended

):Tmatrix3_extended;

Description

This operator allows you to substract a scalar value from a matrix. The scalar is subtracted from all elements of the matrix, the result is returned as a new matrix.


subtract(Tmatrix3_extended,Tmatrix3_extended):Tmatrix3_extended

Subtract a three-dimensional extended precision matrix from another.

Declaration

Source position: matrix.pp line 546

operator operator -(

  const m1: Tmatrix3_extended;

  const m2: Tmatrix3_extended

):Tmatrix3_extended;

Description

This operator allows you to subtract a three-dimensional extended precision matrix from another. A new matrix is returned with all elements of the two matrices subtracted from each other.


subtract(Tmatrix3_single,single):Tmatrix3_single

Add scalar to three-dimensional single precision matrix

Declaration

Source position: matrix.pp line 596

operator operator -(

  const m: Tmatrix3_single;

  const x: single

):Tmatrix3_single;

Description

This operator allows you to subtract a scalar value from a matrix. The scalar is subtracted from all elements of the matrix, the result is returned as a new matrix.


subtract(Tmatrix3_single,Tmatrix3_single):Tmatrix3_single

Subtract a three-dimensional single precision matrix from another.

Declaration

Source position: matrix.pp line 544

operator operator -(

  const m1: Tmatrix3_single;

  const m2: Tmatrix3_single

):Tmatrix3_single;

Description

This operator allows you to subtract a three-dimensional single precision matrix from another. A new matrix is returned with all elements of the two matrices subtracted from each other.


subtract(Tmatrix4_double,Double):Tmatrix4_double

Add scalar to four-dimensional double precision matrix

Declaration

Source position: matrix.pp line 600

operator operator -(

  const m: Tmatrix4_double;

  const x: Double

):Tmatrix4_double;

Description

This operator allows you to subtract a scalar value from a matrix. The scalar is subtracted from all elements of the matrix, the result is returned as a new matrix.


subtract(Tmatrix4_double,Tmatrix4_double):Tmatrix4_double

Subtract a four-dimensional double precision matrix from another.

Declaration

Source position: matrix.pp line 548

operator operator -(

  const m1: Tmatrix4_double;

  const m2: Tmatrix4_double

):Tmatrix4_double;

Description

This operator allows you to subtract a four-dimensional double precision matrix from another. A new matrix is returned with all elements of the two matrices subtracted from each other.


subtract(Tmatrix4_extended,extended):Tmatrix4_extended

Add scalar to four-dimensional extended precision matrix

Declaration

Source position: matrix.pp line 601

operator operator -(

  const m: Tmatrix4_extended;

  const x: extended

):Tmatrix4_extended;

Description

This operator allows you to subtract a scalar value from a matrix. The scalar is subtracted from all elements of the matrix, the result is returned as a new matrix.


subtract(Tmatrix4_extended,Tmatrix4_extended):Tmatrix4_extended

Subtract a four-dimensional extended precision matrix from another.

Declaration

Source position: matrix.pp line 549

operator operator -(

  const m1: Tmatrix4_extended;

  const m2: Tmatrix4_extended

):Tmatrix4_extended;

Description

This operator allows you to subtract a four-dimensional extended precision matrix from another. A new matrix is returned with all elements of the two matrices subtracted from each other.


subtract(Tmatrix4_single,single):Tmatrix4_single

Add scalar to four-dimensional single precision matrix

Declaration

Source position: matrix.pp line 599

operator operator -(

  const m: Tmatrix4_single;

  const x: single

):Tmatrix4_single;

Description

This operator allows you to subtract a scalar value from a matrix. The scalar is subtracted from all elements of the matrix, the result is returned as a new matrix.


subtract(Tmatrix4_single,Tmatrix4_single):Tmatrix4_single

Subtract a four-dimensional single precision matrix from another.

Declaration

Source position: matrix.pp line 547

operator operator -(

  const m1: Tmatrix4_single;

  const m2: Tmatrix4_single

):Tmatrix4_single;

Description

This operator allows you to subtract a four-dimensional single precision matrix from another. A new matrix is returned with all elements of the two matrices subtracted from each other.


subtract(Tvector2_double,Double):Tvector2_double

Subtract scalar from two-dimensional double precision vector

Declaration

Source position: matrix.pp line 419

operator operator -(

  const x: Tvector2_double;

  y: Double

):Tvector2_double;

Description

This operator allows you to subtract a scalar value from a vector. The scalar is subtracted from all elements of the vector, the result is returned as a new vector.


subtract(Tvector2_double,Tvector2_double):Tvector2_double

Subtract two-dimensional double precision vectors from each other

Declaration

Source position: matrix.pp line 364

operator operator -(

  const x: Tvector2_double;

  const y: Tvector2_double

):Tvector2_double;

Description

This operator allows you to subtract two two-dimensional vectors with double precision from each other. The result is a new vector which consists of the difference of the individual elements of the two vectors.


subtract(Tvector2_extended,extended):Tvector2_extended

Subtract scalar from two-dimensional extended precision vector

Declaration

Source position: matrix.pp line 420

operator operator -(

  const x: Tvector2_extended;

  y: extended

):Tvector2_extended;

Description

This operator allows you to subtract a scalar value from a vector. The scalar is subtracted from all elements of the vector, the result is returned as a new vector.


subtract(Tvector2_extended,Tvector2_extended):Tvector2_extended

Subtract two-dimensional extended precision vectors from each other

Declaration

Source position: matrix.pp line 365

operator operator -(

  const x: Tvector2_extended;

  const y: Tvector2_extended

):Tvector2_extended;

Description

This operator allows you to subtract two two-dimensional vectors with extended precision from each other. The result is a new vector which consists of the difference of the individual elements of the two vectors.


subtract(Tvector2_single,single):Tvector2_single

Subtract scalar from two-dimensional single precision vector

Declaration

Source position: matrix.pp line 418

operator operator -(

  const x: Tvector2_single;

  y: single

):Tvector2_single;

Description

This operator allows you to subtract a scalar value from a vector. The scalar is subtracted from all elements of the vector, the result is returned as a new vector.


subtract(Tvector2_single,Tvector2_single):Tvector2_single

Subtract two-dimensional single precision vectors from each other

Declaration

Source position: matrix.pp line 363

operator operator -(

  const x: Tvector2_single;

  const y: Tvector2_single

):Tvector2_single;

Description

This operator allows you to subtract two two-dimensional vectors with single precision from each other. The result is a new vector which consists of the difference of the individual elements of the two vectors.


subtract(Tvector3_double,Double):Tvector3_double

Subtract scalar from three-dimensional double precision vector

Declaration

Source position: matrix.pp line 422

operator operator -(

  const x: Tvector3_double;

  y: Double

):Tvector3_double;

Description

This operator allows you to subtract a scalar value from a vector. The scalar is subtracted from all elements of the vector, the result is returned as a new vector.


subtract(Tvector3_double,Tvector3_double):Tvector3_double

Subtract three-dimensional double precision vectors from each other

Declaration

Source position: matrix.pp line 367

operator operator -(

  const x: Tvector3_double;

  const y: Tvector3_double

):Tvector3_double;

Description

This operator allows you to subtract two two-dimensional vectors with double precision from each other. The result is a new vector which consists of the difference of the individual elements of the two vectors.


subtract(Tvector3_extended,extended):Tvector3_extended

Subtract scalar from three-dimensional extended precision vector

Declaration

Source position: matrix.pp line 423

operator operator -(

  const x: Tvector3_extended;

  y: extended

):Tvector3_extended;

Description

This operator allows you to subtract a scalar value from a vector. The scalar is subtracted from all elements of the vector, the result is returned as a new vector.


subtract(Tvector3_extended,Tvector3_extended):Tvector3_extended

Subtract three-dimensional extended precision vectors from each other

Declaration

Source position: matrix.pp line 368

operator operator -(

  const x: Tvector3_extended;

  const y: Tvector3_extended

):Tvector3_extended;

Description

This operator allows you to subtract two three-dimensional vectors with extended precision from each other. The result is a new vector which consists of the difference of the individual elements of the two vectors.


subtract(Tvector3_single,single):Tvector3_single

Subtract scalar from three-dimensional single precision vector

Declaration

Source position: matrix.pp line 421

operator operator -(

  const x: Tvector3_single;

  y: single

):Tvector3_single;

Description

This operator allows you to subtract a scalar value from a vector. The scalar is subtracted from all elements of the vector, the result is returned as a new vector.


subtract(Tvector3_single,Tvector3_single):Tvector3_single

Subtract three-dimensional single precision vectors from each other

Declaration

Source position: matrix.pp line 366

operator operator -(

  const x: Tvector3_single;

  const y: Tvector3_single

):Tvector3_single;

Description

This operator allows you to subtract two three-dimensional vectors with single precision from each other. The result is a new vector which consists of the difference of the individual elements of the two vectors.


subtract(Tvector4_double,Double):Tvector4_double

Subtract scalar from four-dimensional double precision vector

Declaration

Source position: matrix.pp line 425

operator operator -(

  const x: Tvector4_double;

  y: Double

):Tvector4_double;

Description

This operator allows you to subtract a scalar value from a vector. The scalar is subtracted from all elements of the vector, the result is returned as a new vector.


subtract(Tvector4_double,Tvector4_double):Tvector4_double

Subtract four-dimensional double precision vectors from each other

Declaration

Source position: matrix.pp line 370

operator operator -(

  const x: Tvector4_double;

  const y: Tvector4_double

):Tvector4_double;

Description

This operator allows you to subtract two four-dimensional vectors with double precision from each other. The result is a new vector which consists of the difference of the individual elements of the two vectors.


subtract(Tvector4_extended,extended):Tvector4_extended

Subtract scalar from four-dimensional extended precision vector

Declaration

Source position: matrix.pp line 426

operator operator -(

  const x: Tvector4_extended;

  y: extended

):Tvector4_extended;

Description

This operator allows you to subtract a scalar value from a vector. The scalar is subtracted from all elements of the vector, the result is returned as a new vector.


subtract(Tvector4_extended,Tvector4_extended):Tvector4_extended

Subtract four-dimensional extended precision vectors from each other

Declaration

Source position: matrix.pp line 371

operator operator -(

  const x: Tvector4_extended;

  const y: Tvector4_extended

):Tvector4_extended;

Description

This operator allows you to subtract two four-dimensional vectors with extended precision from each other. The result is a new vector which consists of the difference of the individual elements of the two vectors.


subtract(Tvector4_single,single):Tvector4_single

Subtract scalar from four-dimensional single precision vector

Declaration

Source position: matrix.pp line 424

operator operator -(

  const x: Tvector4_single;

  y: single

):Tvector4_single;

Description

This operator allows you to subtract a scalar value from a vector. The scalar is subtracted from all elements of the vector, the result is returned as a new vector.


subtract(Tvector4_single,Tvector4_single):Tvector4_single

Subtract four-dimensional single precision vectors from each other

Declaration

Source position: matrix.pp line 369

operator operator -(

  const x: Tvector4_single;

  const y: Tvector4_single

):Tvector4_single;

Description

This operator allows you to subtract two four-dimensional vectors with single precision from each other. The result is a new vector which consists of the difference of the individual elements of the two vectors.


symmetricaldifference(Tvector3_double,Tvector3_double):Tvector3_double

Calculate the external product of two three-dimensional vectors

Declaration

Source position: matrix.pp line 404

operator operator ><(

  const x: Tvector3_double;

  const y: Tvector3_double

):Tvector3_double;

Description

This operator returns the external product of two three dimensional vector. It is a vector orthonormal to the two multiplied vectors. The length of that vector is equal to the surface area of a parallelogram with the two vectors as sides.

The external product is often used to get a vector orthonormal to two other vectors, but of a predefined length. In order to do so, the result vector from the external product, is divided by its length, and then multiplied by the desired size.


symmetricaldifference(Tvector3_extended,Tvector3_extended):Tvector3_extended

Calculate the external product of two three-dimensional vectors

Declaration

Source position: matrix.pp line 405

operator operator ><(

  const x: Tvector3_extended;

  const y: Tvector3_extended

):Tvector3_extended;

Description

This operator returns the external product of two three dimensional vector. It is a vector orthonormal to the two multiplied vectors. The length of that vector is equal to the surface area of a parallelogram with the two vectors as sides.

The external product is often used to get a vector orthonormal to two other vectors, but of a predefined length. In order to do so, the result vector from the external product, is divided by its length, and then multiplied by the desired size.


symmetricaldifference(Tvector3_single,Tvector3_single):Tvector3_single

Calculate the external product of two three-dimensional vectors

Declaration

Source position: matrix.pp line 403

operator operator ><(

  const x: Tvector3_single;

  const y: Tvector3_single

):Tvector3_single;

Description

This operator returns the external product of two three dimensional vector. It is a vector orthonormal to the two multiplied vectors. The length of that vector is equal to the surface area of a parallelogram with the two vectors as sides.

The external product is often used to get a vector orthonormal to two other vectors, but of a predefined length. In order to do so, the result vector from the external product, is divided by its length, and then multiplied by the desired size.


emms

Reset floating point registers

Declaration

Source position: mmx.pp line 52

procedure emms;

Description

Emms sets all floating point registers to empty. This procedure must be called after you have used any MMX instructions, if you want to use floating point arithmetic. If you just want to move floating point data around, it isn't necessary to call this function, the compiler doesn't use the FPU registers when moving data. Only when doing calculations, you should use this function. The following code demonstrates this:

Program MMXDemo;
uses mmx;
var
   d1 : double;
   a : array[0..10000] of double;
   i : longint;
begin
   d1:=1.0;
{$mmx+}
   { floating point data is used, but we do _no_ arithmetic }
   for i:=0 to 10000 do
     a[i]:=d2;  { this is done with 64 bit moves }
{$mmx-}
   emms;   { clear fpu }
   { now we can do floating point arithmetic again }
end.

See also

femms

Reset floating point registers - AMD version


femms

Reset floating point registers - AMD version

Declaration

Source position: mmx.pp line 53

procedure femms;

Description

femms executes the femms assembler instruction for AMD processors. it is not supported by all assemblers, hence it is coded as byte codes.

See also

emms

Reset floating point registers


DetectMouse

Detect the presence of a mouse.

Declaration

Source position: mouseh.inc line 70

function DetectMouse: Byte;

Description

DetectMouse detects whether a mouse is attached to the system or not. If there is no mouse, then zero is returned. If a mouse is attached, then the number of mouse buttons is returnead.

This function should be called after the mouse driver was initialized.

Errors

None.

See also

InitMouse | Initialize the FPC mouse driver.
DoneMouse | Deinitialize mouse driver.

Example

Program Example1;

{ Program to demonstrate the DetectMouse function. }

Uses mouse;

Var
  Buttons : Byte;

begin
  InitMouse;
  Buttons:=DetectMouse;
  If Buttons=0 then
    Writeln('No mouse present.')
  else
    Writeln('Found mouse with ',Buttons,' buttons.');
  DoneMouse;
end.


DoneMouse

Deinitialize mouse driver.

Declaration

Source position: mouseh.inc line 67

procedure DoneMouse;

Description

DoneMouse De-initializes the mouse driver. It cleans up any memory allocated when the mouse was initialized, or removes possible mouse hooks from memory. The mouse functions will not work after DoneMouse was called. If DoneMouse is called a second time, it will exit at once. InitMouse should be called before DoneMouse can be called again.

For an example, see most other mouse functions.

Errors

None.

See also

DetectMouse | Detect the presence of a mouse.
InitMouse | Initialize the FPC mouse driver.


GetMouseButtons

Get the state of the mouse buttons

Declaration

Source position: mouseh.inc line 86

function GetMouseButtons: Word;

Description

GetMouseButtons returns the current button state of the mouse, i.e. it returns a or-ed combination of the following constants:

MouseLeftButton
When the left mouse button is held down.
MouseRightButton
When the right mouse button is held down.
MouseMiddleButton
When the middle mouse button is held down.

Errors

None.

See also

GetMouseEvent | Get next mouse event from the queue.
GetMouseX | Query the current horizontal position of the mouse cursor.
GetMouseY | Query the current vertical position of the mouse cursor.

Example

Program Example2;

{ Program to demonstrate the GetMouseButtons function. }

Uses mouse;

begin
  InitMouse;
  Writeln('Press right mouse button to exit program');
  While (GetMouseButtons<>MouseRightButton) do ;
  DoneMouse;
end.


GetMouseDriver

Get a copy of the currently active mouse driver.

Declaration

Source position: mouseh.inc line 106

procedure GetMouseDriver(

  var Driver: TMouseDriver

);

Description

GetMouseDriver returns the currently set mouse driver. It can be used to retrieve the current mouse driver, and override certain callbacks.

A more detailed explanation about getting and setting mouse drivers can be found in mousedrv.

For an example, see the section on writing a custom mouse driver, mousedrv

Errors

None.

See also

SetMouseDriver

Set a new mouse driver.


GetMouseEvent

Get next mouse event from the queue.

Declaration

Source position: mouseh.inc line 92

procedure GetMouseEvent(

  var MouseEvent: TMouseEvent

);

Description

GetMouseEvent returns the next mouse event (a movement, button press or button release), and waits for one if none is available in the queue.

Some mouse drivers can implement a mouse event queue which can hold multiple events till they are fetched. Others don't, and in that case, a one-event queue is implemented for use with PollMouseEvent.

Errors

None.

See also

GetMouseButtons | Get the state of the mouse buttons
GetMouseX | Query the current horizontal position of the mouse cursor.
GetMouseY | Query the current vertical position of the mouse cursor.


GetMouseX

Query the current horizontal position of the mouse cursor.

Declaration

Source position: mouseh.inc line 80

function GetMouseX: Word;

Description

GetMouseX returns the current X position of the mouse. X is measured in characters, starting at 0 for the left side of the screen.

Errors

None.

See also

GetMouseButtons | Get the state of the mouse buttons
GetMouseEvent | Get next mouse event from the queue.
GetMouseY | Query the current vertical position of the mouse cursor.

Example

Program Example4;

{ Program to demonstrate the GetMouseX,GetMouseY functions. }

Uses mouse;

Var
  X,Y : Word;

begin
  InitMouse;
  Writeln('Move mouse cursor to square 10,10 to end');
  Repeat
    X:=GetMouseX;
    Y:=GetMouseY;
    Writeln('X,Y= (',X,',',Y,')');
  Until (X=9) and (Y=9);
  DoneMouse;
end.


GetMouseY

Query the current vertical position of the mouse cursor.

Declaration

Source position: mouseh.inc line 83

function GetMouseY: Word;

Description

GetMouseY returns the current Y position of the mouse. Y is measured in characters, starting at 0 for the top of the screen.

For an example, see GetMouseX

Errors

None.

See also

GetMouseButtons | Get the state of the mouse buttons
GetMouseEvent | Get next mouse event from the queue.
GetMouseX | Query the current horizontal position of the mouse cursor.


HideMouse

Hide the mouse cursor.

Declaration

Source position: mouseh.inc line 77

procedure HideMouse;

Description

HideMouse hides the mouse cursor. This may or may not be implemented on all systems, and depends on the driver.

Errors

None.

See also

ShowMouse

Show the mouse cursor.

Example

Program Example5;

{ Program to demonstrate the HideMouse function. }

Uses mouse;

Var
  Event : TMouseEvent;
  Visible: Boolean;

begin
  InitMouse;
  ShowMouse;
  Visible:=True;
  Writeln('Press left mouse button to hide/show, right button quits');
  Repeat
   GetMouseEvent(Event);
   With Event do
     If (Buttons=MouseLeftbutton) and
        (Action=MouseActionDown) then
       begin
       If Visible then
         HideMouse
       else
         ShowMouse;
       Visible:=Not Visible;
       end;
  Until (Event.Buttons=MouseRightButton) and
        (Event.Action=MouseActionDown);
  DoneMouse;
end.


InitMouse

Initialize the FPC mouse driver.

Declaration

Source position: mouseh.inc line 64

procedure InitMouse;

Description

InitMouse Initializes the mouse driver. This will allocate any data structures needed for the mouse to function. All mouse functions can be used after a call to InitMouse.

A call to InitMouse must always be followed by a call to DoneMouse at program exit. Failing to do so may leave the mouse in an unusable state, or may result in memory leaks.

For an example, see most other functions.

Errors

None.

See also

DoneMouse | Deinitialize mouse driver.
DetectMouse | Detect the presence of a mouse.


PollMouseEvent

Query next mouse event. Do not wait if none available.

Declaration

Source position: mouseh.inc line 99

function PollMouseEvent(

  var MouseEvent: TMouseEvent

):Boolean;

Description

PollMouseEvent checks whether a mouse event is available, and returns it in MouseEvent if one is found. The function result is True in that case. If no mouse event is pending, the function result is False, and the contents of MouseEvent is undefined.

Note that after a call to PollMouseEvent, the event should still be removed from the mouse event queue with a call to GetMouseEvent.

Errors

None.

See also

GetMouseEvent | Get next mouse event from the queue.
PutMouseEvent | Put a mouse event in the venet queue.


PutMouseEvent

Put a mouse event in the venet queue.

Declaration

Source position: mouseh.inc line 95

procedure PutMouseEvent(

  const MouseEvent: TMouseEvent

);

Description

PutMouseEvent adds MouseEvent to the input queue. The next call to GetMouseEvent or PollMouseEvent will then return MouseEvent.

Please note that depending on the implementation the mouse event queue can hold only one value.

Errors

None.

See also

GetMouseEvent | Get next mouse event from the queue.
PollMouseEvent | Query next mouse event. Do not wait if none available.


SetMouseDriver

Set a new mouse driver.

Declaration

Source position: mouseh.inc line 103

procedure SetMouseDriver(

  const Driver: TMouseDriver

);

Description

SetMouseDriver sets the mouse driver to Driver. This function should be called before InitMouse is called, or after DoneMouse is called. If it is called after the mouse has been initialized, it does nothing.

For more information on setting the mouse driver, mousedrv.

For an example, see mousedrv

See also

InitMouse | Initialize the FPC mouse driver.
DoneMouse | Deinitialize mouse driver.
GetMouseDriver | Get a copy of the currently active mouse driver.


SetMouseXY

Set the mouse cursor position.

Declaration

Source position: mouseh.inc line 89

procedure SetMouseXY(

  x: Word;

  y: Word

);

Description

SetMouseXY places the mouse cursor on X,Y. X and Y are zero based character coordinates: 0,0 is the top-left corner of the screen, and the position is in character cells (i.e. not in pixels).

Errors

None.

See also

GetMouseX | Query the current horizontal position of the mouse cursor.
GetMouseY | Query the current vertical position of the mouse cursor.

Example

Program Example7;

{ Program to demonstrate the SetMouseXY function. }

Uses mouse;

begin
  InitMouse;
  Writeln('Click right mouse button to quit.');
  SetMouseXY(40,12);
  Repeat
    Writeln(GetMouseX,',',GetMouseY);
    If (GetMouseX>70) then
      SetMouseXY(10,GetMouseY);
    If (GetMouseY>20) then
      SetMouseXY(GetMouseX,5);
  Until (GetMouseButtons=MouseRightButton);
  DoneMouse;
end.


ShowMouse

Show the mouse cursor.

Declaration

Source position: mouseh.inc line 74

procedure ShowMouse;

Description

ShowMouse shows the mouse cursor if it was previously hidden. The capability to hide or show the mouse cursor depends on the driver.

For an example, see HideMouse

Errors

None.

See also

HideMouse

Hide the mouse cursor.


Abstract

Abstract error handler.

Declaration

Source position: objects.pp line 646

procedure Abstract;

Description

When implementing abstract methods, do not declare them as abstract. Instead, define them simply as virtual. In the implementation of such abstract methods, call the Abstract procedure. This allows explicit control of what happens when an abstract method is called.

The current implementation of Abstract terminates the program with a run-time error 211.

Errors

None.


CallPointerConstructor

Call a constructor with a pointer argument.

Declaration

Source position: objects.pp line 584

function CallPointerConstructor(

  Ctor: CodePointer;

  Obj: pointer;

  VMT: pointer;

  Param1: pointer

):pointer;

Description

CallVoidConstructor calls the constructor of an object. Ctor is the address of the constructor, Obj is a pointer to the instance. If it is Nil, then a new instance is allocated. VMT is a pointer to the object's VMT. Param1 is passed to the constructor. The return value is a pointer to the instance.

Note that this can only be used on constructors that require a pointer as the sole argument. It can also be used to call a constructor with a single argument by reference.

Errors

If the constructor expects other arguments than a pointer, the stack may be corrupted.

See also

CallVoidConstructor | Call a constructor with no arguments
CallPointerMethod | Call a method with a single pointer argument
CallVoidLocal | Call a local nested procedure.
CallPointerLocal | Call a local nested function with a pointer argument
CallVoidMethodLocal | Call a local procedure of a method
CallPointerMethodLocal | Call a local procedure of a method with a pointer argument


CallPointerLocal

Call a local nested function with a pointer argument

Declaration

Source position: objects.pp line 602

function CallPointerLocal(

  Func: CodePointer;

  Frame: Pointer;

  Param1: pointer

):pointer;

Description

CallPointerLocal calls the local procedure with address Func, where Frame is the frame of the wrapping function. It passes Param1 to the local function.

Errors

If the local function expects other parameters than a pointer, the stack may become corrupted.

See also

CallPointerMethod | Call a method with a single pointer argument
CallVoidMethod | Call an object method
CallVoidLocal | Call a local nested procedure.
CallVoidMethodLocal | Call a local procedure of a method
CallPointerMethodLocal | Call a local procedure of a method with a pointer argument
CallVoidConstructor | Call a constructor with no arguments
CallPointerConstructor | Call a constructor with a pointer argument.


CallPointerMethod

Call a method with a single pointer argument

Declaration

Source position: objects.pp line 593

function CallPointerMethod(

  Method: CodePointer;

  Obj: pointer;

  Param1: pointer

):pointer;

Description

CallPointerMethod calls the method with address Method for instance Obj. It passes Param1 to the method as the single argument. It returns a pointer to the instance.

Errors

If the method expects other parameters than a single pointer, the stack may become corrupted.

See also

CallVoidMethod | Call an object method
CallVoidLocal | Call a local nested procedure.
CallPointerLocal | Call a local nested function with a pointer argument
CallVoidMethodLocal | Call a local procedure of a method
CallPointerMethodLocal | Call a local procedure of a method with a pointer argument
CallVoidConstructor | Call a constructor with no arguments
CallPointerConstructor | Call a constructor with a pointer argument.


CallPointerMethodLocal

Call a local procedure of a method with a pointer argument

Declaration

Source position: objects.pp line 611

function CallPointerMethodLocal(

  Func: CodePointer;

  Frame: Pointer;

  Obj: pointer;

  Param1: pointer

):pointer;

Description

CallPointerMethodLocal calls the local procedure with address Func, where Frame is the frame of the wrapping method. It passes Param1 to the local function.

Errors

If the local function expects other parameters than a pointer, the stack may become corrupted.

See also

CallPointerMethod | Call a method with a single pointer argument
CallVoidMethod | Call an object method
CallPointerLocal | Call a local nested function with a pointer argument
CallVoidLocal | Call a local nested procedure.
CallVoidMethodLocal | Call a local procedure of a method
CallVoidConstructor | Call a constructor with no arguments
CallPointerConstructor | Call a constructor with a pointer argument.


CallVoidConstructor

Call a constructor with no arguments

Declaration

Source position: objects.pp line 583

function CallVoidConstructor(

  Ctor: CodePointer;

  Obj: pointer;

  VMT: pointer

):pointer;

Description

CallVoidConstructor calls the constructor of an object. Ctor is the address of the constructor, Obj is a pointer to the instance. If it is Nil, then a new instance is allocated. VMT is a pointer to the object's VMT. The return value is a pointer to the instance.

Note that this can only be used on constructors that require no arguments.

Errors

If the constructor expects arguments, the stack may be corrupted.

See also

CallPointerConstructor | Call a constructor with a pointer argument.
CallPointerMethod | Call a method with a single pointer argument
CallVoidLocal | Call a local nested procedure.
CallPointerLocal | Call a local nested function with a pointer argument
CallVoidMethodLocal | Call a local procedure of a method
CallPointerMethodLocal | Call a local procedure of a method with a pointer argument


CallVoidLocal

Call a local nested procedure.

Declaration

Source position: objects.pp line 601

function CallVoidLocal(

  Func: CodePointer;

  Frame: Pointer

):pointer;

Description

CallVoidLocal calls the local procedure with address Func, where Frame is the frame of the wrapping function.

Errors

If the local function expects parameters, the stack may become corrupted.

See also

CallPointerMethod | Call a method with a single pointer argument
CallVoidMethod | Call an object method
CallPointerLocal | Call a local nested function with a pointer argument
CallVoidMethodLocal | Call a local procedure of a method
CallPointerMethodLocal | Call a local procedure of a method with a pointer argument
CallVoidConstructor | Call a constructor with no arguments
CallPointerConstructor | Call a constructor with a pointer argument.


CallVoidMethod

Call an object method

Declaration

Source position: objects.pp line 592

function CallVoidMethod(

  Method: CodePointer;

  Obj: pointer

):pointer;

Description

CallVoidMethod calls the method with address Method for instance Obj. It returns a pointer to the instance.

Errors

If the method expects parameters, the stack may become corrupted.

See also

CallPointerMethod | Call a method with a single pointer argument
CallVoidLocal | Call a local nested procedure.
CallPointerLocal | Call a local nested function with a pointer argument
CallVoidMethodLocal | Call a local procedure of a method
CallPointerMethodLocal | Call a local procedure of a method with a pointer argument
CallVoidConstructor | Call a constructor with no arguments
CallPointerConstructor | Call a constructor with a pointer argument.


CallVoidMethodLocal

Call a local procedure of a method

Declaration

Source position: objects.pp line 610

function CallVoidMethodLocal(

  Func: CodePointer;

  Frame: Pointer;

  Obj: pointer

):pointer;

Description

CallVoidMethodLocal calls the local procedure with address Func, where Frame is the frame of the wrapping method.

Errors

If the local function expects parameters, the stack may become corrupted.

See also

CallPointerMethod | Call a method with a single pointer argument
CallVoidMethod | Call an object method
CallPointerLocal | Call a local nested function with a pointer argument
CallVoidLocal | Call a local nested procedure.
CallPointerMethodLocal | Call a local procedure of a method with a pointer argument
CallVoidConstructor | Call a constructor with no arguments
CallPointerConstructor | Call a constructor with a pointer argument.


DisposeStr

Dispose of a shortstring which was allocated on the heap.

Declaration

Source position: objects.pp line 630

procedure DisposeStr(

  P: PString

);

Description

DisposeStr removes a dynamically allocated string from the heap.

For an example, see NewStr.

Errors

None.

See also

NewStr | Allocate a copy of a shortstring on the heap.
SetStr | Allocate a copy of a shortstring on the heap.


LongDiv

Overflow safe divide

Declaration

Source position: objects.pp line 678

function LongDiv(

  X: LongInt;

  Y: Integer

):Integer;

Description

LongDiv divides X by Y. The result is of type Integer instead of type Longint, as you would get normally.

Errors

If Y is zero, a run-time error will be generated.

See also

LongMul

Overflow safe multiply.


LongMul

Overflow safe multiply.

Declaration

Source position: objects.pp line 672

function LongMul(

  X: Integer;

  Y: Integer

):LongInt;

Description

LongMul multiplies X with Y. The result is of type Longint. This avoids possible overflow errors you would normally get when multiplying X and Y that are too big.

Errors

None.

See also

LongDiv

Overflow safe divide


NewStr

Allocate a copy of a shortstring on the heap.

Declaration

Source position: objects.pp line 624

function NewStr(

  const S: string

):PString;

Description

NewStr makes a copy of the string S on the heap, and returns a pointer to this copy. If the string is empty then Nil is returned.

The allocated memory is not based on the declared size of the string passed to NewStr, but is baed on the actual length of the string.

Errors

If not enough memory is available, an 'out of memory' error will occur.

See also

DisposeStr | Dispose of a shortstring which was allocated on the heap.
SetStr | Allocate a copy of a shortstring on the heap.

Example

Program ex40;

{ Program to demonstrate the NewStr function }

Uses Objects;

Var S : String;
    P : PString;

begin
  S:='Some really cute string';
  P:=NewStr(S);
  If P^<>S then
    Writeln ('Oh-oh... Something is wrong !!');
  DisposeStr(P);
end.


RegisterObjects

Register standard objects.

Declaration

Source position: objects.pp line 653

procedure RegisterObjects;

Description

RegisterObjects registers the following objects for streaming:

  1. TCollection, see TCollection.
  2. TStringCollection, see TStringCollection.
  3. TStrCollection, see TStrCollection.

Errors

None.

See also

RegisterType

Register new object for streaming.


RegisterType

Register new object for streaming.

Declaration

Source position: objects.pp line 662

procedure RegisterType(

  var S: TStreamRec

);

Description

RegisterType registers a new type for streaming. An object cannot be streamed unless it has been registered first. The stream record S needs to have the following fields set:

ObjType: Sw_Word
This should be a unique identifier. Each possible type should have it's own identifier.
VmtLink: pointer
This should contain a pointer to the VMT (Virtual Method Table) of the object you try to register.
Load : Pointer
is a pointer to a method that initializes an instance of that object, and reads the initial values from a stream. This method should accept as it's sole argument a PStream type variable.
Store: Pointer
is a pointer to a method that stores an instance of the object to a stream. This method should accept as it's sole argument a PStream type variable.

The VMT of the object can be retrieved with the following expression:

VmtLink: Ofs(TypeOf(MyType)^);

Errors

In case of error (if a object with the same ObjType) is already registered), run-time error 212 occurs.

Example

Unit MyObject;

Interface

Uses Objects;

Type
     PMyObject = ^TMyObject;
     TMyObject = Object(TObject)
       Field : Longint;
       Constructor Init;
       Constructor Load (Var Stream : TStream);
       Destructor Done;
       Procedure Store (Var Stream : TStream);
       Function  GetField : Longint;
       Procedure SetField (Value : Longint);
       end;

Implementation

Constructor TMyobject.Init;

begin
  Inherited Init;
  Field:=-1;
end;

Constructor TMyobject.Load (Var Stream : TStream);

begin
  Stream.Read(Field,Sizeof(Field));
end;

Destructor TMyObject.Done;

begin
end;

Function TMyObject.GetField : Longint;

begin
  GetField:=Field;
end;

Procedure TMyObject.SetField (Value : Longint);

begin
  Field:=Value;
end;

Procedure TMyObject.Store (Var Stream : TStream);

begin
  Stream.Write(Field,SizeOf(Field));
end;

Const MyObjectRec : TStreamRec = (
        Objtype : 666;
        vmtlink : Ofs(TypeOf(TMyObject)^);
        Load : @TMyObject.Load;
        Store : @TMyObject.Store;
        );

begin
  RegisterObjects;
  RegisterType (MyObjectRec);
end.


SetStr

Allocate a copy of a shortstring on the heap.

Declaration

Source position: objects.pp line 632

procedure SetStr(

  var p: PString;

  const s: string

);

Description

SetStr makes a copy of the string S on the heap and returns the pointer to this copy in P. If P pointed to another string (i.e. was not Nil, the memory is released first. Contrary to NewStr, if the string is empty then a pointer to an empty string is returned.

The allocated memory is not based on the declared size of the string passed to NewStr, but is based on the actual length of the string.

Errors

If not enough memory is available, an 'out of memory' error will occur.

See also

DisposeStr | Dispose of a shortstring which was allocated on the heap.
NewStr | Allocate a copy of a shortstring on the heap.


AssignLst

Assign text file to printing device

Declaration

Source position: printer.pp line 40

procedure AssignLst(

  var F: text;

  ToFile: string

);

Description

AssignLst assigns to F a printing device - UNIX only. ToFile is a string with the following form:

  • '|filename options': This sets up a pipe with the program filename, with the given options, such as in the popen() call.
  • 'filename': Prints to file filename. Filename can contain the string 'PID' (No Quotes), which will be replaced by the PID of your program. When closing lst, the file will be sent to lpr and deleted. (lpr should be in PATH)
  • {'filename|'}: Same as previous, only the file is not sent to lpr, nor is it deleted. (useful for opening /dev/printer or for later printing)

See also

lst

Default printing file.

Example

program testprn;

uses printer;

var i : integer;
    f : text;

begin
  writeln ('Test of printer unit');
  writeln ('Writing to lst...');
  for i:=1 to 80 do writeln (lst,'This is line ',i,'.'#13);
  close (lst);
  writeln ('Done.');
  {$ifdef Unix}
  writeln ('Writing to pipe...');
  assignlst (f,'|/usr/bin/lpr -m');
  rewrite (f);
  for i:=1 to 80 do writeln (f,'This is line ',i,'.'#13);
  close (f);
  writeln ('Done.')
  {$endif}
end.


InitPrinter

Initialize the printer

Declaration

Source position: printerh.inc line 22

procedure InitPrinter(

  const PrinterName: string

);


IsLstAvailable

Determine whether printer is available.

Declaration

Source position: printerh.inc line 19

function IsLstAvailable: Boolean;


Accept

Accept a connection from a socket (deprecated).

Declaration

Source position: socketsh.inc line 179

function Accept(

  Sock: LongInt;

  var addr: TInetSockAddr;

  var SockIn: file;

  var SockOut: file

):Boolean;

function Accept(

  Sock: LongInt;

  var addr: TInetSockAddr;

  var SockIn: text;

  var SockOut: text

):Boolean;

function Accept(

  Sock: LongInt;

  var addr: string;

  var SockIn: text;

  var SockOut: text

):Boolean;

function Accept(

  Sock: LongInt;

  var addr: string;

  var SockIn: file;

  var SockOut: file

):Boolean;

Description

Accept accepts a connection from a socket Sock, which was listening for a connection. If a connection is accepted, a file descriptor is returned. On error -1 is returned. The returned socket may NOT be used to accept more connections. The original socket remains open.

The Accept call fills the address of the connecting entity in Addr, and sets its length in Addrlen. Addr should be pointing to enough space, and Addrlen should be set to the amount of space available, prior to the call.

The alternate forms of the Accept command, with the Text or File parameters are equivalent to subsequently calling the regular Accept function and the Sock2Text or Sock2File functions. These functions return True if successful, False otherwise.

Errors

On error, -1 is returned, and errors are reported in SocketError, and include the following:

ESockEBADF
The socket descriptor is invalid.
ESockENOTSOCK
The descriptor is not a socket.
SYS_EOPNOTSUPP
The socket type doesn't support the Listen operation.
ESockEFAULT
Addr points outside your address space.
ESockEWOULDBLOCK
The requested operation would block the process.

See also

FPListen | Listen for connections on a socket.
Connect | Open a connection to a server socket (deprecated).
FPConnect | Open a connection to a server socket.
FPBind | Bind a socket to an address.

Example

Program server;

{
  Program to test Sockets unit by Michael van Canneyt and Peter Vreman
  Server Version, First Run sock_svr to let it create a socket and then
  sock_cli to connect to that socket
}
{$mode fpc}
uses Sockets;

Var
  FromName : string;
  Buffer   : string[255];
  S        : Longint;
  Sin,Sout : Text;
  SAddr    : TInetSockAddr;

procedure perror (const S:string);
begin
  writeln (S,SocketError);
  halt(100);
end;

begin
  S:=fpSocket (AF_INET,SOCK_STREAM,0);
  if SocketError<>0 then
   Perror ('Server : Socket : ');
  SAddr.sin_family:=AF_INET;
  { port 50000 in network order }
  SAddr.sin_port:=htons(5000);
  SAddr.sin_addr.s_addr:=0;
  if fpBind(S,@SAddr,sizeof(saddr))=-1 then
   PError ('Server : Bind : ');
  if fpListen (S,1)=-1 then
   PError ('Server : Listen : ');
  Writeln('Waiting for Connect from Client, run now sock_cli in an other tty');
  if Accept(S,FromName,Sin,Sout) then
   PError ('Server : Accept : '+fromname);
  Reset(Sin);
  ReWrite(Sout);
  Writeln(Sout,'Message From Server');
  Flush(SOut);
  while not eof(sin) do
   begin
     Readln(Sin,Buffer);
     Writeln('Server : read : ',buffer);
   end;
end.


Bind

[Overview][Constants][Types][Procedures and functions][Index] Reference for unit 'Sockets' (#rtl)

Bind (deprecated)

Alias for fpBind.

Declaration

Source position: sockets.pp line 66

function Bind(

  Sock: LongInt;

  const addr: string

):Boolean;

Description

Bind is an alias for fpBind which binds to either a socket struct (Addr) or a string indicating a unix socket file (unix socket).

This function is deprecated, use fpBind instead.

See also

FPBind

Bind a socket to an address.


CloseSocket

Closes a socket handle.

Declaration

Source position: socketsh.inc line 172

function CloseSocket(

  Sock: LongInt

):LongInt;

Description

CloseSocket closes a socket handle. It returns 0 if the socket was closed succesfully, -1 if it failed.

Errors

On error, -1 is returned.

See also

FPSocket

Create new socket


Connect

Open a connection to a server socket (deprecated).

Declaration

Source position: socketsh.inc line 181

function Connect(

  Sock: LongInt;

  const addr: TInetSockAddr;

  var SockIn: text;

  var SockOut: text

):Boolean;

function Connect(

  Sock: LongInt;

  const addr: TInetSockAddr;

  var SockIn: file;

  var SockOut: file

):Boolean;

function Connect(

  Sock: LongInt;

  const addr: string;

  var SockIn: text;

  var SockOut: text

):Boolean;

function Connect(

  Sock: LongInt;

  const addr: string;

  var SockIn: file;

  var SockOut: file

):Boolean;

Description

Connect opens a connection to a peer, whose address is described by Addr. AddrLen contains the length of the address. The type of Addr depends on the kind of connection you're trying to make, but is generally one of TSockAddr or TUnixSockAddr.

The forms of the Connect command with the Text or File arguments are equivalent to subsequently calling the regular Connect function and the Sock2Text or Sock2File functions. These functions return True if successfull, False otherwise.

The Connect function returns a file descriptor if the call was successfull, -1 in case of error.

Errors

On error, -1 is returned and errors are reported in SocketError.

See also

FPListen | Listen for connections on a socket.
FPBind | Bind a socket to an address.
Accept | Accept a connection from a socket (deprecated).
FPAccept | Accept a connection from a socket.

Example

Program Client;

{
  Program to test Sockets unit by Michael van Canneyt and Peter Vreman
  Client Version, First Run sock_svr to let it create a socket and then
  sock_cli to connect to that socket
}

uses Sockets;

procedure PError(const S : string);
begin
  writeln(S,SocketError);
  halt(100);
end;

Var
  SAddr    : TInetSockAddr;
  Buffer   : string [255];
  S        : Longint;
  Sin,Sout : Text;
  i        : integer;

begin
  S:=fpSocket (AF_INET,SOCK_STREAM,0);
  if s=-1 then
   Perror('Client : Socket : ');
  SAddr.sin_family:=AF_INET;
  { port 50000 in network order }
  SAddr.sin_port:=htons(5000);
  { localhost : 127.0.0.1 in network order }
  SAddr.sin_addr.s_addr:=HostToNet((127 shl 24) or 1);
  if not Connect (S,SAddr,Sin,Sout) then
   PError('Client : Connect : ');
  Reset(Sin);
  ReWrite(Sout);
  Buffer:='This is a textstring sent by the Client.';
  for i:=1 to 10 do
    Writeln(Sout,Buffer);
  Flush(Sout);
  Readln(SIn,Buffer);
  WriteLn(Buffer);
  Close(sout);
end.

Example

program pfinger;

uses sockets,errors;

Var
  Addr : TInetSockAddr;
  S : Longint;
  Sin,Sout : Text;
  Line : string;

begin
  Addr.sin_family:=AF_INET;
  { port 79 in network order }
  Addr.sin_port:=79 shl 8;
  { localhost : 127.0.0.1 in network order }
  Addr.sin_addr.s_addr:=((1 shl 24) or 127);
  S:=fpSocket(AF_INET,SOCK_STREAM,0);
  If Not Connect (S,ADDR,SIN,SOUT) Then
    begin
    Writeln ('Couldn''t connect to localhost');
    Writeln ('Socket error : ',strerror(SocketError));
    halt(1);
    end;
  rewrite (sout);
  reset(sin);
  writeln (sout,paramstr(1));
  flush(sout);
  while not eof(sin) do
    begin
    readln (Sin,line);
    writeln (line);
    end;
  fpShutdown(s,2);
  close (sin);
  close (sout);
end.


fpaccept

Accept a connection from a socket.

Declaration

Source position: socketsh.inc line 163

function fpaccept(

  s: cint;

  addrx: psockaddr;

  addrlen: pSockLen

):cint;

Description

Accept accepts a connection from a socket S, which was listening for a connection. If a connection is accepted, a file descriptor is returned (positive number). On error -1 is returned. The returned socket may NOT be used to accept more connections. The original socket remains open.

The Accept call fills the address of the connecting entity in Addrx, and sets its length in Addrlen. Addrx should be pointing to enough space, and Addrlen should be set to the amount of space available, prior to the call.

Errors

On error, -1 is returned, and errors are reported in SocketError, and include the following:

ESockEBADF
The socket descriptor is invalid.
ESockENOTSOCK
The descriptor is not a socket.
SYS_EOPNOTSUPP
The socket type doesn't support the Listen operation.
ESockEFAULT
Addr points outside your address space.
ESockEWOULDBLOCK
The requested operation would block the process.

See also

fpListen | Listen for connections on a socket.
fpConnect | Open a connection to a server socket.
fpBind | Bind a socket to an address.

Example

Program server;

{
  Program to test Sockets unit by Michael van Canneyt and Peter Vreman
  Server Version, First Run sock_svr to let it create a socket and then
  sock_cli to connect to that socket
}
{$mode fpc}
uses Sockets;

Var
  FromName : string;
  Buffer   : string[255];
  S        : Longint;
  Sin,Sout : Text;
  SAddr    : TInetSockAddr;

procedure perror (const S:string);
begin
  writeln (S,SocketError);
  halt(100);
end;

begin
  S:=fpSocket (AF_INET,SOCK_STREAM,0);
  if SocketError<>0 then
   Perror ('Server : Socket : ');
  SAddr.sin_family:=AF_INET;
  { port 50000 in network order }
  SAddr.sin_port:=htons(5000);
  SAddr.sin_addr.s_addr:=0;
  if fpBind(S,@SAddr,sizeof(saddr))=-1 then
   PError ('Server : Bind : ');
  if fpListen (S,1)=-1 then
   PError ('Server : Listen : ');
  Writeln('Waiting for Connect from Client, run now sock_cli in an other tty');
  if Accept(S,FromName,Sin,Sout) then
   PError ('Server : Accept : '+fromname);
  Reset(Sin);
  ReWrite(Sout);
  Writeln(Sout,'Message From Server');
  Flush(SOut);
  while not eof(sin) do
   begin
     Readln(Sin,Buffer);
     Writeln('Server : read : ',buffer);
   end;
end.


fpbind

Bind a socket to an address.

Declaration

Source position: socketsh.inc line 161

function fpbind(

  s: cint;

  addrx: psockaddr;

  addrlen: TSockLen

):cint;

Description

fpBind binds the socket s to address Addrx. Addrx has length Addrlen. The function returns 0 if the call was succesful, -1 if not.

Errors

Errors are returned in SocketError and include the following:

ESockEBADF
The socket descriptor is invalid.
ESockEINVAL
The socket is already bound to an address,
ESockEACCESS
Address is protected and you don't have permission to open it.

More errors can be found in the Unix man pages.

See also

FPSocket

Create new socket


fpconnect

Open a connection to a server socket.

Declaration

Source position: socketsh.inc line 164

function fpconnect(

  s: cint;

  name: psockaddr;

  namelen: TSockLen

):cint;

Description

fpConnect uses the socket s to open a connection to a peer, whose address is described by Name. NameLen contains the length of the address. The type of Name depends on the kind of connection you are trying to make, but is generally one of TSockAddr or TUnixSockAddr.

The fpConnect function returns zero if the call was successfull, -1 in case of error.

Errors

On error, -1 is returned and errors are reported in SocketError.

See also

fpListen | Listen for connections on a socket.
fpBind | Bind a socket to an address.
fpAccept | Accept a connection from a socket.

Example

Program Client;

{
  Program to test Sockets unit by Michael van Canneyt and Peter Vreman
  Client Version, First Run sock_svr to let it create a socket and then
  sock_cli to connect to that socket
}

uses Sockets;

procedure PError(const S : string);
begin
  writeln(S,SocketError);
  halt(100);
end;

Var
  SAddr    : TInetSockAddr;
  Buffer   : string [255];
  S        : Longint;
  Sin,Sout : Text;
  i        : integer;

begin
  S:=fpSocket (AF_INET,SOCK_STREAM,0);
  if s=-1 then
   Perror('Client : Socket : ');
  SAddr.sin_family:=AF_INET;
  { port 50000 in network order }
  SAddr.sin_port:=htons(5000);
  { localhost : 127.0.0.1 in network order }
  SAddr.sin_addr.s_addr:=HostToNet((127 shl 24) or 1);
  if not Connect (S,SAddr,Sin,Sout) then
   PError('Client : Connect : ');
  Reset(Sin);
  ReWrite(Sout);
  Buffer:='This is a textstring sent by the Client.';
  for i:=1 to 10 do
    Writeln(Sout,Buffer);
  Flush(Sout);
  Readln(SIn,Buffer);
  WriteLn(Buffer);
  Close(sout);
end.

Example

program pfinger;

uses sockets,errors;

Var
  Addr : TInetSockAddr;
  S : Longint;
  Sin,Sout : Text;
  Line : string;

begin
  Addr.sin_family:=AF_INET;
  { port 79 in network order }
  Addr.sin_port:=79 shl 8;
  { localhost : 127.0.0.1 in network order }
  Addr.sin_addr.s_addr:=((1 shl 24) or 127);
  S:=fpSocket(AF_INET,SOCK_STREAM,0);
  If Not Connect (S,ADDR,SIN,SOUT) Then
    begin
    Writeln ('Couldn''t connect to localhost');
    Writeln ('Socket error : ',strerror(SocketError));
    halt(1);
    end;
  rewrite (sout);
  reset(sin);
  writeln (sout,paramstr(1));
  flush(sout);
  while not eof(sin) do
    begin
    readln (Sin,line);
    writeln (line);
    end;
  fpShutdown(s,2);
  close (sin);
  close (sout);
end.


fpgetpeername

Return the name (address) of the connected peer.

Declaration

Source position: socketsh.inc line 167

function fpgetpeername(

  s: cint;

  name: psockaddr;

  namelen: pSockLen

):cint;

Description

fpGetPeerName returns the name of the entity connected to the specified socket S. The Socket must be connected for this call to work.

Name should point to enough space to store the name, the amount of space pointed to should be set in Namelen. When the function returns succesfully, Name will be filled with the name, and Name will be set to the length of Name.

Errors

Errors are reported in SocketError, and include the following:

ESockEBADF
The socket descriptor is invalid.
ESockENOBUFS
The system doesn't have enough buffers to perform the operation.
ESockENOTSOCK
The descriptor is not a socket.
ESockEFAULT
Addr points outside your address space.
ESockENOTCONN
The socket isn't connected.

See also

fpConnect | Open a connection to a server socket.
fpSocket | Create new socket


fpgetsockname

Return name of socket.

Declaration

Source position: socketsh.inc line 166

function fpgetsockname(

  s: cint;

  name: psockaddr;

  namelen: pSockLen

):cint;

Description

fpGetSockName returns the current name of the specified socket S. Name should point to enough space to store the name, the amount of space pointed to should be set in Namelen. When the function returns succesfully, Name will be filled with the name, and Namelen will be set to the length of Name.

Errors

Errors are reported in SocketError, and include the following:

ESockEBADF
The socket descriptor is invalid.
ESockENOBUFS
The system doesn't have enough buffers to perform the operation.
ESockENOTSOCK
The descriptor is not a socket.
ESockEFAULT
Addr points outside your address space.

See also

fpBind

Bind a socket to an address.


fpgetsockopt

Get current socket options

Declaration

Source position: socketsh.inc line 168

function fpgetsockopt(

  s: cint;

  level: cint;

  optname: cint;

  optval: pointer;

  optlen: pSockLen

):cint;

Description

fpGetSockOpt gets the connection option optname, for socket S. The socket may be obtained from different levels, indicated by Level, which can be one of the following:

SOL_SOCKET
From the socket itself.
XXX
set Level to XXX, the protocol number of the protocol which should interpret the option.

The options are stored in the memory location pointed to by optval. optlen should point to the initial length of optval, and on return will contain the actual length of the stored data.

On success, 0 is returned. On Error, -1 is returned.

Errors

Errors are reported in SocketError, and include the following:

ESockEBADF
The socket descriptor is invalid.
ESockENOTSOCK
The descriptor is not a socket.
ESockEFAULT
OptVal points outside your address space.

See also

fpSetSockOpt

Set socket options.


fplisten

Listen for connections on a socket.

Declaration

Source position: socketsh.inc line 162

function fplisten(

  s: cint;

  backlog: cint

):cint;

Description

fpListen listens for up to backlog connections from socket S. The socket S must be of type SOCK_STREAM or Sock_SEQPACKET.

The function returns 0 if a connection was accepted, -1 if an error occurred.

Errors

Errors are reported in SocketError, and include the following:

ESockEBADF
The socket descriptor is invalid.
ESockENOTSOCK
The descriptor is not a socket.
SYS_EOPNOTSUPP
The socket type doesn't support the Listen operation.

See also

fpSocket | Create new socket
fpBind | Bind a socket to an address.
fpConnect | Open a connection to a server socket.


fprecv

Receive data on socket

Declaration

Source position: socketsh.inc line 157

function fprecv(

  s: cint;

  buf: pointer;

  len: size_t;

  flags: cint

):ssize_t;

Description

fpRecv reads at most len bytes from socket S into address buf. The socket must be in a connected state. Flags can be one of the following:

1
Process out-of band data.
4
Bypass routing, use a direct interface.
??
Wait for full request or report an error.

The functions returns the number of bytes actually read from the socket, or -1 if a detectable error occurred.

Errors

Errors are reported in SocketError, and include the following:

ESockEBADF
The socket descriptor is invalid.
ESockENOTCONN
The socket isn't connected.
ESockENOTSOCK
The descriptor is not a socket.
ESockEFAULT
The address is outside your address space.
ESockEMSGSIZE
The message cannot be sent atomically.
ESockEWOULDBLOCK
The requested operation would block the process.
ESockENOBUFS
The system doesn't have enough free buffers available.

See also

FPSend

Send data through socket


fprecvfrom

Receive data from an unconnected socket

Declaration

Source position: socketsh.inc line 158

function fprecvfrom(

  s: cint;

  buf: pointer;

  len: size_t;

  flags: cint;

  from: psockaddr;

  fromlen: pSockLen

):ssize_t;

Description

fpRecvFrom receives data in buffer Buf with maximum length Len from socket S. Receipt is controlled by options in Flags. The location pointed to by from will be filled with the address from the sender, and it's length will be stored in fromlen. The function returns the number of bytes received, or -1 on error. AddrLen.

Errors

On error, -1 is returned.

See also

fpSocket | Create new socket
fprecv | Receive data on socket


fpsend

Send data through socket

Declaration

Source position: socketsh.inc line 159

function fpsend(

  s: cint;

  msg: pointer;

  len: size_t;

  flags: cint

):ssize_t;

Description

fpSend sends Len bytes starting from address Msg to socket S. S must be in a connected state. Options can be passed in Flags.

The function returns the number of bytes sent, or -1 if a detectable error occurred.

Flags can be one of the following:

1
Process out-of band data.
4
Bypass routing, use a direct interface.

Errors

Errors are reported in SocketError, and include the following:

ESockEBADF
The socket descriptor is invalid.
ESockENOTSOCK
The descriptor is not a socket.
ESockEFAULT
The address is outside your address space.
ESockEMSGSIZE
The message cannot be sent atomically.
ESockEWOULDBLOCK
The requested operation would block the process.
ESockENOBUFS
The system doesn't have enough free buffers available.

See also

fpRecv

Receive data on socket


fpsendto

Send data through an unconnected socket to an address.

Declaration

Source position: socketsh.inc line 160

function fpsendto(

  s: cint;

  msg: pointer;

  len: size_t;

  flags: cint;

  tox: psockaddr;

  tolen: TSockLen

):ssize_t;

Description

fpSendTo sends data from buffer Msg with length len through socket S with options Flags. The data is sent to address tox, which has length toLen

Errors

On error, -1 is returned.

See also

fpSocket | Create new socket
fpSend | Send data through socket
fpRecvFrom | Receive data from an unconnected socket


fpsetsockopt

Set socket options.

Declaration

Source position: socketsh.inc line 169

function fpsetsockopt(

  s: cint;

  level: cint;

  optname: cint;

  optval: pointer;

  optlen: TSockLen

):cint;

Description

fpSetSockOpt sets the connection options for socket S. The socket may be manipulated at different levels, indicated by Level, which can be one of the following:

SOL_SOCKET
To manipulate the socket itself.
XXX
set Level to XXX, the protocol number of the protocol which should interprete the option.

The actual option is stored in a buffer pointed to by optval, with length optlen.

For more information on this call, refer to the unix manual page setsockopt

Errors

Errors are reported in SocketError, and include the following:

ESockEBADF
The socket descriptor is invalid.
ESockENOTSOCK
The descriptor is not a socket.
ESockEFAULT
OptVal points outside your address space.

See also

fpGetSockOpt

Get current socket options


fpshutdown

Close one end of full duplex connection.

Declaration

Source position: socketsh.inc line 165

function fpshutdown(

  s: cint;

  how: cint

):cint;

Description

fpShutDown closes one end of a full duplex socket connection, described by S. The parameter How determines how the connection will be shut down, and can be one of the following:

0
Further receives are disallowed.
1
Further sends are disallowed.
2
Sending nor receiving are allowed.

On succes, the function returns 0, on error -1 is returned.

Errors

SocketError is used to report errors, and includes the following:

ESockEBADF
The socket descriptor is invalid.
ESockENOTCONN
The socket isn't connected.
ESockENOTSOCK
The descriptor is not a socket.

See also

fpSocket | Create new socket
fpConnect | Open a connection to a server socket.


fpsocket

Create new socket

Declaration

Source position: socketsh.inc line 156

function fpsocket(

  domain: cint;

  xtype: cint;

  protocol: cint

):cint;

Description

fpSocket creates a new socket in domain Domain, from type xType using protocol Protocol. The Domain, Socket type and Protocol can be specified using predefined constants (see the section on constants for available constants) If succesfull, the function returns a socket descriptor, which can be passed to a subsequent fpBind call. If unsuccesfull, the function returns -1.

for an example, see Accept.

Errors

Errors are returned in SocketError, and include the follwing:

ESockEPROTONOSUPPORT
The protocol type or the specified protocol is not supported within this domain.
ESockEMFILE
The per-process descriptor table is full.
SYS_ENFILE
The system file table is full.
ESockEACCESS
Permission to create a socket of the specified type and/or protocol is denied.
ESockENOBUFS
Insufficient buffer space is available. The socket cannot be created until sufficient resources are freed.

See also

FPSocketPair

Create socket pair.


fpsocketpair

Create socket pair.

Declaration

Source position: socketsh.inc line 170

function fpsocketpair(

  d: cint;

  xtype: cint;

  protocol: cint;

  sv: pcint

):cint;

Description

fpSocketPair creates 2 sockets in domain D, from type xType and using protocol Protocol. The pair is returned in sv, and they are indistinguishable. The function returns -1 upon error and 0 upon success.

Errors

Errors are reported in SocketError, and are the same as in FPSocket

See also

Str2UnixSockAddr

Convert path to TUnixSockAddr


HostAddrToStr

Convert a host address to a string.

Declaration

Source position: socketsh.inc line 192

function HostAddrToStr(

  Entry: in_addr

):AnsiString;

Description

HostAddrToStr converts the host address in Entry to a string representation in human-readable form (a dotted quad).

Basically, it is the same as NetAddrToStr, but with the bytes in correct order.

See also

NetAddrToStr | Convert a network address to a string.
StrToHostAddr | Convert a string to a host address.
StrToNetAddr | Convert a string to a network address.


HostAddrToStr6

Convert a IPV6 host address to a string representation.

Declaration

Source position: socketsh.inc line 205

function HostAddrToStr6(

  Entry: Tin6_addr

):AnsiString;

Description

HostAddrToStr6 converts the IPV6 host address in Entry to a string representation in human-readable form.

Basically, it is the same as NetAddrToStr6, but with the bytes in correct order.

See also

NetAddrToStr | Convert a network address to a string.
StrToHostAddr | Convert a string to a host address.
StrToNetAddr | Convert a string to a network address.
StrToHostAddr6 | Convert a string to a IPV6 host address.


HostToNet

Convert a host address to a network address

Declaration

Source position: socketsh.inc line 197

function HostToNet(

  Host: in_addr

):in_addr;

function HostToNet(

  Host: LongInt

):LongInt;

Description

HostToNet converts a host address to a network address. It takes care of endianness of the host machine. The address can be specified as a dotted quad or as a longint.

Errors

None.

See also

NetToHost | Convert a network address to a host address.
NToHS | Convert short integer from network ordered to host ordered
HToNS | Convert short integer from host ordered to network ordered
ShortHostToNet | Convert a host port number to a network port number
ShortNetToHost | Convert a network port number to a host port number


htonl

Convert long integer from host ordered to network ordered

Declaration

Source position: socketsh.inc line 186

function htonl(

  host: Cardinal

):Cardinal; overload;

Description

htonl makes sure that the bytes in host are ordered in the correct way for sending over the network and returns the correctly ordered result.

See also

htons | Convert short integer from host ordered to network ordered
ntohl | Convert long integer from network ordered to host ordered
ntohs | Convert short integer from network ordered to host ordered


htons

Convert short integer from host ordered to network ordered

Declaration

Source position: socketsh.inc line 188

function htons(

  host: Word

):Word;

Description

htons makes sure that the bytes in host are ordered in the correct way for sending over the network and returns the correctly ordered result.

See also

htonl | Convert long integer from host ordered to network ordered
ntohl | Convert long integer from network ordered to host ordered
ntohs | Convert short integer from network ordered to host ordered


NetAddrToStr

Convert a network address to a string.

Declaration

Source position: socketsh.inc line 191

function NetAddrToStr(

  Entry: in_addr

):AnsiString;

Description

NetAddrToStr converts the network address in Entry to a string representation in human-readable form (a dotted quad).

See also

HostAddrToStr | Convert a host address to a string.
StrToNetAddr | Convert a string to a network address.
StrToHostAddr | Convert a string to a host address.


NetAddrToStr6

Convert a IPV6 network address to a string.

Declaration

Source position: socketsh.inc line 207

function NetAddrToStr6(

  Entry: Tin6_addr

):AnsiString;

Description

NetAddrToStr6 converts the IPV6 network address in Entry to a string representation in human-readable form.

Basically, it is the same as NetAddrToStr6, but with the bytes in correct order.

See also

NetAddrToStr | Convert a network address to a string.
StrToHostAddr | Convert a string to a host address.
StrToNetAddr | Convert a string to a network address.
StrToHostAddr6 | Convert a string to a IPV6 host address.


NetToHost

Convert a network address to a host address.

Declaration

Source position: socketsh.inc line 198

function NetToHost(

  Net: in_addr

):in_addr;

function NetToHost(

  Net: LongInt

):LongInt;

Description

NetToHost converts a network address to a host address. It takes care of endianness of the host machine. The address can be specified as a dotted quad or as a longint.

Errors

None.

See also

HostToNet | Convert a host address to a network address
NToHS | Convert short integer from network ordered to host ordered
HToNS | Convert short integer from host ordered to network ordered
ShortHostToNet | Convert a host port number to a network port number
ShortNetToHost | Convert a network port number to a host port number


NToHl

Convert long integer from network ordered to host ordered

Declaration

Source position: socketsh.inc line 187

function NToHl(

  Net: Cardinal

):Cardinal; overload;

Description

ntohs makes sure that the bytes in Net, received from the network, are ordered in the correct way for handling by the host machinen, and returns the correctly ordered result.

See also

htonl | Convert long integer from host ordered to network ordered
htons | Convert short integer from host ordered to network ordered
ntohs | Convert short integer from network ordered to host ordered


NToHs

Convert short integer from network ordered to host ordered

Declaration

Source position: socketsh.inc line 189

function NToHs(

  Net: Word

):Word;

Description

ntohs makes sure that the bytes in Net, received from the network, are ordered in the correct way for handling by the host machinen, and returns the correctly ordered result.

See also

htonl | Convert long integer from host ordered to network ordered
htons | Convert short integer from host ordered to network ordered
ntohl | Convert long integer from network ordered to host ordered


ShortHostToNet

[Overview][Constants][Types][Procedures and functions][Index] Reference for unit 'Sockets' (#rtl)

ShortHostToNet (deprecated)

Convert a host port number to a network port number

Declaration

Source position: socketsh.inc line 201

function ShortHostToNet(

  Host: Word

):Word;

Description

ShortHostToNet converts a host port number to a network port number. It takes care of endianness of the host machine.

Errors

None.

See also

ShortNetToHost | Convert a network port number to a host port number
HostToNet | Convert a host address to a network address
NToHS | Convert short integer from network ordered to host ordered
HToNS | Convert short integer from host ordered to network ordered


ShortNetToHost

[Overview][Constants][Types][Procedures and functions][Index] Reference for unit 'Sockets' (#rtl)

ShortNetToHost (deprecated)

Convert a network port number to a host port number

Declaration

Source position: socketsh.inc line 202

function ShortNetToHost(

  Net: Word

):Word;

Description

ShortNetToHost converts a network port number to a host port number. It takes care of endianness of the host machine.

Errors

None.

See also

ShortNetToHost | Convert a network port number to a host port number
HostToNet | Convert a host address to a network address
NToHS | Convert short integer from network ordered to host ordered
HToNS | Convert short integer from host ordered to network ordered


Sock2File

[Overview][Constants][Types][Procedures and functions][Index] Reference for unit 'Sockets' (#rtl)

Sock2File (deprecated)

Convert socket to untyped file descriptors

Declaration

Source position: socketsh.inc line 183

procedure Sock2File(

  Sock: LongInt;

  var SockIn: file;

  var SockOut: file

);

Description

Sock2File transforms a socket Sock into 2 Pascal file descriptors of type File, one for reading from the socket (SockIn), one for writing to the socket (SockOut).

Errors

None.

See also

FPSocket | Create new socket
Sock2Text | Convert socket to text file descriptors


Sock2Text

[Overview][Constants][Types][Procedures and functions][Index] Reference for unit 'Sockets' (#rtl)

Sock2Text (deprecated)

Convert socket to text file descriptors

Declaration

Source position: socketsh.inc line 178

procedure Sock2Text(

  Sock: LongInt;

  var SockIn: Text;

  var SockOut: Text

);

Description

Sock2Text transforms a socket Sock into 2 Pascal file descriptors of type Text, one for reading from the socket (SockIn), one for writing to the socket (SockOut).

Errors

None.

See also

FPSocket | Create new socket
Sock2File | Convert socket to untyped file descriptors


socketerror

Contains the error code for the last socket operation.

Declaration

Source position: socketsh.inc line 154

function socketerror: cint;

Description

SocketError contains the error code for the last socket operation. It can be examined to return the last socket error.


Str2UnixSockAddr

[Overview][Constants][Types][Procedures and functions][Index] Reference for unit 'Sockets' (#rtl)

Str2UnixSockAddr (deprecated)

Convert path to TUnixSockAddr

Declaration

Source position: sockets.pp line 65

procedure Str2UnixSockAddr(

  const addr: string;

  var t: TUnixSockAddr;

  var len: LongInt

);

Description

Str2UnixSockAddr transforms a Unix socket address in a string to a TUnixSockAddr structure which can be passed to the Bind call.

Errors

None.

See also

FPSocket | Create new socket
FPBind | Bind a socket to an address.


StrToHostAddr

Convert a string to a host address.

Declaration

Source position: socketsh.inc line 193

function StrToHostAddr(

  IP: AnsiString

):in_addr;

Description

StrToHostAddr converts the string representation in IP to a host address and returns the host address.

Errors

On error, the host address is filled with zeroes.

See also

NetAddrToStr | Convert a network address to a string.
HostAddrToStr | Convert a host address to a string.
StrToNetAddr | Convert a string to a network address.


StrToHostAddr6

Convert a string to a IPV6 host address.

Declaration

Source position: socketsh.inc line 206

function StrToHostAddr6(

  IP: string

):Tin6_addr;

Description

StrToHostAddr6 converts the string representation in IP to a IPV6 host address and returns the host address.

Errors

On error, the address is filled with zeroes.

See also

NetAddrToStr6 | Convert a IPV6 network address to a string.
HostAddrToStr6 | Convert a IPV6 host address to a string representation.
StrToHostAddr | Convert a string to a host address.


StrToNetAddr

Convert a string to a network address.

Declaration

Source position: socketsh.inc line 194

function StrToNetAddr(

  IP: AnsiString

):in_addr;

Description

StrToNetAddr converts the string representation in IP to a network address and returns the network address.

Errors

On error, the network address is filled with zeroes.

See also

NetAddrToStr | Convert a network address to a string.
HostAddrToStr | Convert a host address to a string.
StrToHostAddr | Convert a string to a host address.


StrToNetAddr6

Convert a string to a IPV6 network address

Declaration

Source position: socketsh.inc line 208

function StrToNetAddr6(

  IP: AnsiString

):Tin6_addr;

Description

StrToNetAddr6 converts the string representation in IP to a IPV6 network address and returns the network address.

Errors

On error, the address is filled with zeroes.

See also

NetAddrToStr6 | Convert a IPV6 network address to a string.
HostAddrToStr6 | Convert a IPV6 host address to a string representation.
StrToHostAddr6 | Convert a string to a IPV6 host address.


stralloc

Allocate memory for a new null-terminated string on the heap

Declaration

Source position: strings.pp line 97

function stralloc(

  L: SizeInt

):PChar;

Description

StrAlloc reserves memory on the heap for a string with length Len, terminating #0 included, and returns a pointer to it.

Errors

If there is not enough memory, a run-time error occurs.

See also

StrNew | Allocate room for new null-terminated string.
StrPCopy | Copy a pascal string to a null-terminated string


strcat

Concatenate 2 null-terminated strings.

Declaration

Source position: strings.pp line 43

function strcat(

  dest: PChar;

  source: PChar

):PChar;

Description

Attaches Source to Dest and returns Dest.

Errors

No length checking is performed.

See also

StrLCat

Concatenate 2 null-terminated strings, with length boundary.

Example

Program Example11;

Uses strings;

{ Program to demonstrate the StrCat function. }

Const P1 : PChar = 'This is a PChar String.';

Var P2 : PChar;

begin
  P2:=StrAlloc (StrLen(P1)*2+1);
  StrMove (P2,P1,StrLen(P1)+1); { P2=P1 }
  StrCat (P2,P1);               { Append P2 once more }
  Writeln ('P2 : ',P2);
  StrDispose(P2);
end.


strcomp

Compare 2 null-terminated strings, case sensitive.

Declaration

Source position: strings.pp line 49

function strcomp(

  str1: PChar;

  str2: PChar

):SizeInt;

Description

Compares the null-terminated strings S1 and S2. The result is

  • A negative SizeInt when S1<S2.
  • 0 when S1=S2.
  • A positive SizeInt when S1>S2.

For an example, see StrLComp.

Errors

None.

See also

StrLComp | Compare limited number of characters of 2 null-terminated strings
StrIComp | Compare 2 null-terminated strings, case insensitive.
StrLIComp | Compare limited number of characters in 2 null-terminated strings, ignoring case.


strcopy

Copy a null-terminated string

Declaration

Source position: strings.pp line 29

function strcopy(

  dest: PChar;

  source: PChar

):PChar; overload;

Description

Copy the null terminated string in Source to Dest, and returns a pointer to Dest. Dest needs enough room to contain Source, i.e. StrLen(Source)+1 bytes.

Errors

No length checking is performed.

See also

StrPCopy | Copy a pascal string to a null-terminated string
StrLCopy | Copy a null-terminated string, limited in length.
StrECopy | Copy a null-terminated string, return a pointer to the end.

Example

Program Example4;

Uses strings;

{ Program to demonstrate the StrCopy function. }

Const P : PCHar = 'This is a PCHAR string.';

var PP : PChar;

begin
  PP:=StrAlloc(Strlen(P)+1);
  STrCopy (PP,P);
  If StrComp (PP,P)<>0 then
    Writeln ('Oh-oh problems...')
  else
    Writeln ('All is well : PP=',PP);
  StrDispose(PP);
end.


strdispose

disposes of a null-terminated string on the heap

Declaration

Source position: strings.pp line 100

procedure strdispose(

  p: PChar

);

Description

Removes the string in P from the heap and releases the memory.

Errors

None.

See also

StrNew

Allocate room for new null-terminated string.

Example

Program Example17;

Uses strings;

{ Program to demonstrate the StrDispose function. }

Const P1 : PChar = 'This is a PChar string';

var P2 : PChar;

begin
  P2:=StrNew (P1);
  Writeln ('P2 : ',P2);
  StrDispose(P2);
end.


strecopy

Copy a null-terminated string, return a pointer to the end.

Declaration

Source position: strings.pp line 37

function strecopy(

  dest: PChar;

  source: PChar

):PChar;

Description

Copies the Null-terminated string in Source to Dest, and returns a pointer to the end (i.e. the terminating Null-character) of the copied string.

Errors

No length checking is performed.

See also

StrLCopy | Copy a null-terminated string, limited in length.
StrCopy | Copy a null-terminated string

Example

Program Example6;

Uses strings;

{ Program to demonstrate the StrECopy function. }

Const P : PChar = 'This is a PCHAR string.';

Var PP : PChar;

begin
  PP:=StrAlloc (StrLen(P)+1);
  If Longint(StrECopy(PP,P))-Longint(PP)<>StrLen(P) then
    Writeln('Something is wrong here !')
  else
    Writeln ('PP= ',PP);
  StrDispose(PP);
end.


strend

Return a pointer to the end of a null-terminated string

Declaration

Source position: strings.pp line 40

function strend(

  p: PChar

):PChar;

Description

Returns a pointer to the end of P. (i.e. to the terminating null-character.

Errors

None.

See also

StrLen

Length of a null-terminated string.

Example

Program Example6;

Uses strings;

{ Program to demonstrate the StrEnd function. }

Const P : PChar = 'This is a PCHAR string.';

begin
  If Longint(StrEnd(P))-Longint(P)<>StrLen(P) then
    Writeln('Something is wrong here !')
  else
    Writeln ('All is well..');
end.


stricomp

Compare 2 null-terminated strings, case insensitive.

Declaration

Source position: strings.pp line 55

function stricomp(

  str1: PChar;

  str2: PChar

):SizeInt;

Description

Compares the null-terminated strings S1 and S2, ignoring case. The result is

  • A negative SizeInt when S1<S2.
  • 0 when S1=S2.
  • A positive SizeInt when S1>S2.

Errors

None.

See also

StrLComp | Compare limited number of characters of 2 null-terminated strings
StrComp | Compare 2 null-terminated strings, case sensitive.
StrLIComp | Compare limited number of characters in 2 null-terminated strings, ignoring case.

Example

Program Example8;

Uses strings;

{ Program to demonstrate the StrLComp function. }

Const P1 : PChar = 'This is the first string.';
      P2 : PCHar = 'This is the second string.';

Var L : Longint;

begin
  Write ('P1 and P2 are ');
  If StrComp (P1,P2)<>0 then write ('NOT ');
  write ('equal. The first ');
  L:=1;
  While StrLComp(P1,P2,L)=0 do inc (L);
  dec(l);
  Writeln (l,' characters are the same.');
end.


stripos

Return the position of a substring in a string, case insensitive.

Declaration

Source position: strings.pp line 91

function stripos(

  str1: PChar;

  str2: PChar

):PChar;

Description

stripos returns the position of str2 in str1. It searches in a case-insensitive manner, and if it finds a match, it returns a pointer to the location of the match. If no match is found, Nil is returned.

Errors

No checks are done on the validity of the pointers, and the pointers are assumed to point to a properly null-terminated string. If either of these conditions are not met, a run-time error may follow.

See also

striscan | Scan a string for a character, case-insensitive
strpos | Search for a null-terminated substring in a null-terminated string


striscan

Scan a string for a character, case-insensitive

Declaration

Source position: strings.pp line 71

function striscan(

  p: PChar;

  c: Char

):PChar;

Description

striscan does the same as strscan but compares the characters case-insensitively. It returns a pointer to the first occurrence of the character c in the null-terminated string p, or Nil if c is not present in the string.

See also

strscan | Find first occurrence of a character in a null-terminated string.
strriscan | Scan a string reversely for a character, case-insensitive


strlcat

Concatenate 2 null-terminated strings, with length boundary.

Declaration

Source position: strings.pp line 64

function strlcat(

  dest: PChar;

  source: PChar;

  l: SizeInt

):PChar;

Description

Adds L characters from Source to Dest, and adds a terminating null-character. Returns Dest.

Errors

None.

See also

StrCat

Concatenate 2 null-terminated strings.

Example

Program Example12;

Uses strings;

{ Program to demonstrate the StrLCat function. }

Const P1 : PChar = '1234567890';

Var P2 : PChar;

begin
  P2:=StrAlloc (StrLen(P1)*2+1);
  P2^:=#0; { Zero length }
  StrCat (P2,P1);
  StrLCat (P2,P1,5);
  Writeln ('P2 = ',P2);
  StrDispose(P2)
end.


strlcomp

Compare limited number of characters of 2 null-terminated strings

Declaration

Source position: strings.pp line 52

function strlcomp(

  str1: PChar;

  str2: PChar;

  l: SizeInt

):SizeInt;

Description

Compares maximum L characters of the null-terminated strings S1 and S2. The result is

  • A negative SizeInt when S1<S2.
  • 0 when S1=S2.
  • A positive SizeInt when S1>S2.

Errors

None.

See also

StrComp | Compare 2 null-terminated strings, case sensitive.
StrIComp | Compare 2 null-terminated strings, case insensitive.
StrLIComp | Compare limited number of characters in 2 null-terminated strings, ignoring case.

Example

Program Example8;

Uses strings;

{ Program to demonstrate the StrLComp function. }

Const P1 : PChar = 'This is the first string.';
      P2 : PCHar = 'This is the second string.';

Var L : Longint;

begin
  Write ('P1 and P2 are ');
  If StrComp (P1,P2)<>0 then write ('NOT ');
  write ('equal. The first ');
  L:=1;
  While StrLComp(P1,P2,L)=0 do inc (L);
  dec(l);
  Writeln (l,' characters are the same.');
end.


strlcopy

Copy a null-terminated string, limited in length.

Declaration

Source position: strings.pp line 33

function strlcopy(

  dest: PChar;

  source: PChar;

  maxlen: SizeInt

):PChar; overload;

Description

Copies MaxLen characters from Source to Dest, and makes Dest a null terminated string.

Errors

No length checking is performed.

See also

StrCopy | Copy a null-terminated string
StrECopy | Copy a null-terminated string, return a pointer to the end.

Example

Program Example5;

Uses strings;

{ Program to demonstrate the StrLCopy function. }

Const P : PCHar = '123456789ABCDEF';

var PP : PCHar;

begin
  PP:=StrAlloc(11);
  Writeln ('First 10 characters of P : ',StrLCopy (PP,P,10));
  StrDispose(PP);
end.


strlen

Length of a null-terminated string.

Declaration

Source position: strings.pp line 23

function strlen(

  p: PChar

):SizeInt;

Description

Returns the length of the null-terminated string P. If P equals Nil, then zero (0) is returned.

Errors

None.

See also

StrNew

Allocate room for new null-terminated string.

Example

Program Example1;

Uses strings;

{ Program to demonstrate the StrLen function. }

Const P : PChar = 'This is a constant pchar string';

begin
  Writeln ('P         : ',p);
  Writeln ('length(P) : ',StrLen(P));
end.


strlicomp

Compare limited number of characters in 2 null-terminated strings, ignoring case.

Declaration

Source position: strings.pp line 58

function strlicomp(

  str1: PChar;

  str2: PChar;

  l: SizeInt

):SizeInt;

Description

Compares maximum L characters of the null-terminated strings S1 and S2, ignoring case. The result is

  • A negative SizeInt when S1<S2.
  • 0 when S1=S2.
  • A positive SizeInt when S1>S2.

For an example, see StrIComp

Errors

None.

See also

StrLComp | Compare limited number of characters of 2 null-terminated strings
StrComp | Compare 2 null-terminated strings, case sensitive.
StrIComp | Compare 2 null-terminated strings, case insensitive.


strlower

Convert null-terminated string to all-lowercase.

Declaration

Source position: strings.pp line 81

function strlower(

  p: PChar

):PChar;

Description

Converts P to an all-lowercase string. Returns P.

Errors

None.

See also

StrUpper

Convert null-terminated string to all-uppercase

Example

Program Example14;

Uses strings;

{ Program to demonstrate the StrLower and StrUpper functions. }

Const
    P1 : PChar = 'THIS IS AN UPPERCASE PCHAR STRING';
    P2 : PChar = 'this is a lowercase string';

begin
  Writeln ('Uppercase : ',StrUpper(P2));
  StrLower (P1);
  Writeln ('Lowercase : ',P1);
end.


strmove

Move a null-terminated string to new location.

Declaration

Source position: strings.pp line 61

function strmove(

  dest: PChar;

  source: PChar;

  l: SizeInt

):PChar;

Description

Copies MaxLen characters from Source to Dest. No terminating null-character is copied. Returns Dest

Errors

None.

See also

StrLCopy | Copy a null-terminated string, limited in length.
StrCopy | Copy a null-terminated string

Example

Program Example10;

Uses strings;

{ Program to demonstrate the StrMove function. }

Const P1 : PCHAR = 'This is a pchar string.';

Var P2 : Pchar;

begin
  P2:=StrAlloc(StrLen(P1)+1);
  StrMove (P2,P1,StrLen(P1)+1); { P2:=P1 }
  Writeln ('P2 = ',P2);
  StrDispose(P2);
end.


strnew

Allocate room for new null-terminated string.

Declaration

Source position: strings.pp line 94

function strnew(

  p: PChar

):PChar;

Description

Copies P to the Heap, and returns a pointer to the copy.

Errors

Returns Nil if no memory was available for the copy.

See also

StrCopy | Copy a null-terminated string
StrDispose | disposes of a null-terminated string on the heap

Example

Program Example16;

Uses strings;

{ Program to demonstrate the StrNew function. }

Const P1 : PChar = 'This is a PChar string';

var P2 : PChar;

begin
  P2:=StrNew (P1);
  If P1=P2 then
    writeln ('This can''t be happening...')
  else
    writeln ('P2 : ',P2);
  StrDispose(P2);
end.


strpas

Convert a null-terminated string to a shortstring.

Declaration

Source position: strings.pp line 21

function strpas(

  p: PChar

):shortstring;

Description

Converts a null terminated string in P to a Pascal string, and returns this string. The string is truncated at 255 characters.

Errors

None.

See also

StrPCopy

Copy a pascal string to a null-terminated string

Example

Program Example3;

Uses strings;

{ Program to demonstrate the StrPas function. }

Const P : PChar = 'This is a PCHAR string';

var S : string;

begin
  S:=StrPas (P);
  Writeln ('S : ',S);
end.


strpcopy

Copy a pascal string to a null-terminated string

Declaration

Source position: strings.pp line 26

function strpcopy(

  d: PChar;

  const s: string

):PChar;

Description

Converts the Pascal string in Se to a Null-terminated string, and copies it to D. D needs enough room to contain the string Source, i.e. Length(S)+1 bytes.

Errors

No length checking is performed.

See also

StrPas

Convert a null-terminated string to a shortstring.

Example

Program Example2;

Uses strings;

{ Program to demonstrate the StrPCopy function. }

Const S = 'This is a normal string.';

Var P : Pchar;

begin
  p:=StrAlloc (length(S)+1);
  if StrPCopy (P,S)<>P then
    Writeln ('This is impossible !!')
  else
    writeln (P);
  StrDispose(P);
end.


strpos

Search for a null-terminated substring in a null-terminated string

Declaration

Source position: strings.pp line 88

function strpos(

  str1: PChar;

  str2: PChar

):PChar;

Description

Returns a pointer to the first occurrence of S2 in S1. If S2 does not occur in S1, returns Nil.

Errors

None.

See also

StrScan | Find first occurrence of a character in a null-terminated string.
StrRScan | Find last occurrence of a character in a null-terminated string.

Example

Program Example15;

Uses strings;

{ Program to demonstrate the StrPos function. }

Const P : PChar = 'This is a PChar string.';
      S : Pchar = 'is';
begin
  Writeln ('Position of ''is'' in P : ',sizeint(StrPos(P,S))-sizeint(P));
end.


strriscan

Scan a string reversely for a character, case-insensitive

Declaration

Source position: strings.pp line 78

function strriscan(

  p: PChar;

  c: Char

):PChar;

Description

strriscan does the same as strrscan but compares the characters case-insensitively. It returns a pointer to the last occurrence of the character c in the null-terminated string p, or Nil if c is not present in the string.

See also

strrscan | Find last occurrence of a character in a null-terminated string.
striscan | Scan a string for a character, case-insensitive


strrscan

Find last occurrence of a character in a null-terminated string.

Declaration

Source position: strings.pp line 75

function strrscan(

  p: PChar;

  c: Char

):PChar;

Description

Returns a pointer to the last occurrence of the character C in the null-terminated string P. If C does not occur, returns Nil.

For an example, see StrScan.

Errors

None.

See also

StrScan | Find first occurrence of a character in a null-terminated string.
StrPos | Search for a null-terminated substring in a null-terminated string


strscan

Find first occurrence of a character in a null-terminated string.

Declaration

Source position: strings.pp line 68

function strscan(

  p: PChar;

  c: Char

):PChar;

Description

Returns a pointer to the first occurrence of the character C in the null-terminated string P. If C does not occur, returns Nil.

Errors

None.

See also

StrRScan | Find last occurrence of a character in a null-terminated string.
StrPos | Search for a null-terminated substring in a null-terminated string

Example

Program Example13;

Uses strings;

{ Program to demonstrate the StrScan and StrRScan functions. }

Const P : PChar = 'This is a PCHAR string.';
      S : Char = 's' ;

begin
  Writeln ('P, starting from first ''s'' : ',StrScan(P,s));
  Writeln ('P, starting from last ''s'' : ',StrRScan(P,s));
end.


strupper

Convert null-terminated string to all-uppercase

Declaration

Source position: strings.pp line 84

function strupper(

  p: PChar

):PChar;

Description

Converts P to an all-uppercase string. Returns P.

For an example, see StrLower

Errors

None.

See also

StrLower

Convert null-terminated string to all-lowercase.


AddChar

Add characters to the left of a string till a certain length

Declaration

Source position: strutils.pp line 162

function AddChar(

  C: Char;

  const S: string;

  N: Integer

):string;

Arguments

C | Char to be added
S | The string to be treated
N | The minimal length the string should have

Function result

The resulting string with length N

Description

AddChar adds characters (C) to the left of S till the length N is reached, and returns the resulting string. If the length of S is already equal to or larger than N, then no characters are added. The resulting string can be thought of as a right-aligned version of S, with length N.

Errors

None

See also

AddCharR | Add chars at the end of a string till it reaches a certain length
PadLeft | Add spaces to the left of a string till a certain length is reached.
PadRight | Add spaces to the right of a string till a certain length is reached.
PadCenter | Pad the string to a certain length, so the string is centered.


AddCharR

Add chars at the end of a string till it reaches a certain length

Declaration

Source position: strutils.pp line 163

function AddCharR(

  C: Char;

  const S: string;

  N: Integer

):string;

Arguments

C | The character to be added
S | The string to be treated
N | The minimal length the string should have

Function result

The resulting string with length N

Description

AddCharR adds characters (C) to the right of S till the length N is reached, and returns the resulting string. If the length of S is already equal to or larger than N, then no characters are added. The resulting string can be thought of as a left-aligned version of S, with length N .

Errors

None

See also

AddChar

Add characters to the left of a string till a certain length


AnsiContainsStr

Checks whether a string contains a given substring

Declaration

Source position: strutils.pp line 41

function AnsiContainsStr(

  const AText: string;

  const ASubText: string

):Boolean;

Arguments

AText | String to search in
ASubText | The substring to be searched for

Function result

True if the string contains the given substring, False otherwise

Description

AnsiContainsString checks whether AText contains ASubText, and returns True if this is the case, or returns False otherwise. The search is performed case-sensitive.

Errors

None

See also

AnsiContainsText | Check whether a string contains a certain substring, ignoring case.
AnsiEndsStr | Check whether a string ends with a certain substring
AnsiIndexStr | Searches, observing case, for a string in an array of strings.
AnsiStartsStr | Check whether a string starts with a given substring, observing case


AnsiContainsText

Check whether a string contains a certain substring, ignoring case.

Declaration

Source position: strutils.pp line 30

function AnsiContainsText(

  const AText: string;

  const ASubText: string

):Boolean;

Arguments

AText | The string to be searched
ASubText | The substring to search for

Function result

True if the substring was found, False otherwise.

Description

AnsiContainsString checks whether AText contains ASubText, and returns True if this is the case, or returns False otherwise. The search is performed case-insensitive.

See also

AnsiContainsStr | Checks whether a string contains a given substring
AnsiEndsText | Check whether a string ends with a certain substring, ignoring case.
AnsiIndexText | Searches, case insensitive, for a string in an array of strings.
AnsiStartsText | Check whether a string starts with a given substring, ignoring case


AnsiEndsStr

Check whether a string ends with a certain substring

Declaration

Source position: strutils.pp line 43

function AnsiEndsStr(

  const ASubText: string;

  const AText: string

):Boolean;

Arguments

ASubText | Substring to check for.
AText | Text to check the end of

Function result

True if the string ends on the substring, False otherwise.

Description

AnsiEndsStr checks AText to see whether it ends with ASubText, and returns True if it does, False if not. The check is performed case-sensitive. Basically, it checks whether the position of ASubText equals the length of AText minus the length of ASubText plus one.

Errors

None.

See also

AnsiEndsText | Check whether a string ends with a certain substring, ignoring case.
AnsiStartsStr | Check whether a string starts with a given substring, observing case
AnsiIndexStr | Searches, observing case, for a string in an array of strings.
AnsiContainsStr | Checks whether a string contains a given substring


AnsiEndsText

Check whether a string ends with a certain substring, ignoring case.

Declaration

Source position: strutils.pp line 32

function AnsiEndsText(

  const ASubText: string;

  const AText: string

):Boolean;

Arguments

ASubText | Substring to check for.
AText | Text to check the end of

Function result

True if the string ends on the substring, False otherwise.

Description

AnsiEndsStr checks AText to see whether it ends with ASubText , and returns True if it does, False if not. The check is performed case-insensitive. Basically, it checks whether the position of ASubText equals the length of AText minus the length of ASubText plus one.

Errors

None

See also

AnsiStartsText | Check whether a string starts with a given substring, ignoring case
AnsiEndsStr | Check whether a string ends with a certain substring
AnsiIndexText | Searches, case insensitive, for a string in an array of strings.
AnsiContainsText | Check whether a string contains a certain substring, ignoring case.


AnsiIndexStr

Searches, observing case, for a string in an array of strings.

Declaration

Source position: strutils.pp line 46

function AnsiIndexStr(

  const AText: string;

  const AValues: array of string

):Integer;

Arguments

AText | String to search for
AValues | Array of strings to search in.

Function result

Index of the matching element in the array, otherwise -1.

Description

AnsiIndexStr matches AText against each string in AValues. If a match is found, the corresponding index (zero-based) in the AValues array is returned. If no match is found, -1 is returned. The strings are matched observing case.

Errors

None.

See also

AnsiIndexText | Searches, case insensitive, for a string in an array of strings.
AnsiMatchStr | Check whether a string occurs in an array of strings, observing case.
AnsiMatchText | Check whether a string occurs in an array of strings, disregarding case.


AnsiIndexText

Searches, case insensitive, for a string in an array of strings.

Declaration

Source position: strutils.pp line 35

function AnsiIndexText(

  const AText: string;

  const AValues: array of string

):Integer;

Arguments

AText | String to search for
AValues | Array of strings to search in.

Function result

Index of the matching element in the array, otherwise -1.

Description

AnsiIndexStr matches AText against each string in AValues . If a match is found, the corresponding index (zero-based) in the AValues array is returned. If no match is found, -1 is returned. The strings are matched ignoring case.

Errors

None

See also

AnsiIndexStr | Searches, observing case, for a string in an array of strings.
AnsiMatchStr | Check whether a string occurs in an array of strings, observing case.
IndexStr | Searches, observing case, for a string in an array of strings.
MatchStr | Check whether a string occurs in an array of strings, observing case.
AnsiMatchText | Check whether a string occurs in an array of strings, disregarding case.


AnsiLeftStr

Copies a number of characters starting at the left of a string

Declaration

Source position: strutils.pp line 72

function AnsiLeftStr(

  const AText: AnsiString;

  const ACount: SizeInt

):AnsiString;

Arguments

AText | String to copy characters from.
ACount | The number of characters to copy.

Function result

Resulting string contains the first ACount characters

Description

AnsiLeftStr returns the ACount leftmost characters from AText. If ACount is larger than the length of AText, only as much characters as available in AText will be copied. If ACount is zero or negative, no characters will be copied. The characters are counted as characters, not as Bytes.

This function corresponds to the Visual Basic LeftStr function.

Errors

None.

See also

AnsiMidStr | Returns a number of characters copied from a given location in a string
AnsiRightStr | Copies a number of characters starting at the right of a string
LeftStr | Copies Count characters starting at the left of a string.
RightStr | Copy a given number of characters, counting from the right of a string.
MidStr | Copies a number of characters starting at a given position in a string.
LeftBStr | Copies Count characters starting at the left of a string.
RightBStr | Copy a given number of characters (bytes), counting from the right of a string.
MidBStr | Copies a number of characters starting at a given position in a string.


AnsiMatchStr

Check whether a string occurs in an array of strings, observing case.

Declaration

Source position: strutils.pp line 45

function AnsiMatchStr(

  const AText: string;

  const AValues: array of string

):Boolean;

Arguments

AText | String to check for
AValues | Array of string values to search in

Function result

True if the value appears in the array, False if not.

Description

AnsiMatchStr matches AText against each string in AValues. If a match is found, it returns True, otherwise False is returned. The strings are matched observing case.

This function simply calls AnsiIndexStr and checks whether it returns -1 or not.


AnsiMatchText

Check whether a string occurs in an array of strings, disregarding case.

Declaration

Source position: strutils.pp line 34

function AnsiMatchText(

  const AText: string;

  const AValues: array of string

):Boolean;

Arguments

AText | String to check for
AValues | Array of string values to search in

Function result

True if the value appears in the array, False if not.

Description

AnsiIndexStr matches AText against each string in AValues. If a match is found, it returns True, otherwise False is returned. The strings are matched ignoring case.

This function simply calls AnsiIndexText and checks whether it returns -1 or not.


AnsiMidStr

Returns a number of characters copied from a given location in a string

Declaration

Source position: strutils.pp line 74

function AnsiMidStr(

  const AText: AnsiString;

  const AStart: SizeInt;

  const ACount: SizeInt

):AnsiString;

Arguments

AText | String from which to copy
AStart | 1-based location in the string where to copy from.
ACount | Number of characters to copy.

Function result

The resulting string

Description

AnsiMidStr returns ACount characters from AText, starting at position AStart. If AStart+ACount is larger than the length of AText, only as much characters as available in AText (starting from AStart) will be copied. If ACount is zero or negative, no characters will be copied. The characters are counted as characters, not as Bytes.

This function corresponds to the Visual Basic MidStr function.

Errors

None

See also

AnsiLeftStr | Copies a number of characters starting at the left of a string
AnsiRightStr | Copies a number of characters starting at the right of a string
LeftStr | Copies Count characters starting at the left of a string.
RightStr | Copy a given number of characters, counting from the right of a string.
MidStr | Copies a number of characters starting at a given position in a string.
LeftBStr | Copies Count characters starting at the left of a string.
RightBStr | Copy a given number of characters (bytes), counting from the right of a string.
MidBStr | Copies a number of characters starting at a given position in a string.


AnsiProperCase

Pretty-Print a string: make lowercase and capitalize first letters of words

Declaration

Source position: strutils.pp line 171

function AnsiProperCase(

  const S: string;

  const WordDelims: TSysCharSet

):string;

Arguments

S | String to pretty-print
WordDelims | Characters to use as word delimiters

Function result

Resulting lowercase string with first letters capitalized

Description

AnsiProperCase converts S to an all lowercase string, but capitalizes the first letter of every word in the string, and returns the resulting string. When searching for words, the characters in WordDelimiters are used to determine the boundaries of words. The constant StdWordDelims can be used for this.


AnsiReplaceStr

Search and replace all occurrences of a string, case sensitive.

Declaration

Source position: strutils.pp line 44

function AnsiReplaceStr(

  const AText: string;

  const AFromText: string;

  const AToText: string

):string;

Arguments

AText | String in which to search and replace.
AFromText | String to search for
AToText | String to replace with

Function result

Result of the search and replace operation

Description

AnsiReplaceString searches AText for all occurrences of the string AFromText and replaces them with AToText, and returns the resulting string. The search is performed observing case.

Errors

None.

See also

AnsiReplaceText | Search and replace all occurrences of a string, case insensitive.
SearchBuf | Search a buffer for a certain string.


AnsiReplaceText

Search and replace all occurrences of a string, case insensitive.

Declaration

Source position: strutils.pp line 33

function AnsiReplaceText(

  const AText: string;

  const AFromText: string;

  const AToText: string

):string;

Arguments

AText | String in which to search and replace.
AFromText | String to search for
AToText | String to replace with

Function result

Result of the search and replace operation.

Description

AnsiReplaceString searches AText for all occurrences of the string AFromText and replaces them with AToText , and returns the resulting string. The search is performed ignoring case.

Errors

None.

See also

AnsiReplaceStr | Search and replace all occurrences of a string, case sensitive.
SearchBuf | Search a buffer for a certain string.


AnsiResemblesText

Check whether 2 strings resemble each other.

Declaration

Source position: strutils.pp line 29

function AnsiResemblesText(

  const AText: string;

  const AOther: string

):Boolean;

Arguments

AText | First text to compare
AOther | Second text to compare

Function result

True if the words match, False if not

Description

AnsiResemblesText will check whether AnsiResemblesProc is set. If it is not set, False is returned. If it is set, AText and AOtherText are passed to it and it's result is returned.

Errors

None.

See also

AnsiResemblesProc | Procedural variable, called when checking 2 strings for resemblances in AnsiResemblesText
SoundexProc | Default AnsiResemblesText implementation.


AnsiReverseString

Reverse the letters in a string.

Declaration

Source position: strutils.pp line 56

function AnsiReverseString(

  const AText: AnsiString

):AnsiString;

Arguments

AText

String to reverse

Function result

Reversed string

Description

AnsiReverseString returns a string with all characters of AText in reverse order.

if the result of this function equals AText, AText is called an anagram.

Errors

None.


AnsiRightStr

Copies a number of characters starting at the right of a string

Declaration

Source position: strutils.pp line 73

function AnsiRightStr(

  const AText: AnsiString;

  const ACount: SizeInt

):AnsiString;

Arguments

AText | String to copy characters from
ACount | Number of characters to copy

Function result

Resulting string

Description

AnsiLeftStr returns the ACount rightmost characters from AText. If ACount is larger than the length of AText, only as much characters as available in AText will be copied. If ACount is zero or negative, no characters will be copied. The characters are counted as characters, not as Bytes.

This function corresponds to the Visual Basic RightStr function.

Errors

None.

See also

AnsiLeftStr | Copies a number of characters starting at the left of a string
AnsiMidStr | Returns a number of characters copied from a given location in a string
LeftStr | Copies Count characters starting at the left of a string.
RightStr | Copy a given number of characters, counting from the right of a string.
MidStr | Copies a number of characters starting at a given position in a string.
LeftBStr | Copies Count characters starting at the left of a string.
RightBStr | Copy a given number of characters (bytes), counting from the right of a string.
MidBStr | Copies a number of characters starting at a given position in a string.


AnsiStartsStr

Check whether a string starts with a given substring, observing case

Declaration

Source position: strutils.pp line 42

function AnsiStartsStr(

  const ASubText: string;

  const AText: string

):Boolean;

Arguments

ASubText | Substring to check for
AText | String to check in

Function result

True if the given string starts with the substring, False if not.

Description

AnsiStartsStr checks AText to see whether it starts with ASubText , and returns True if it does, False if not. The check is performed case-sensitive. Basically, it checks whether the position of ASubText equals 1.

See also

AnsiEndsStr | Check whether a string ends with a certain substring
AnsiStartsStr | Check whether a string starts with a given substring, observing case
AnsiIndexStr | Searches, observing case, for a string in an array of strings.
AnsiContainsStr | Checks whether a string contains a given substring


AnsiStartsText

Check whether a string starts with a given substring, ignoring case

Declaration

Source position: strutils.pp line 31

function AnsiStartsText(

  const ASubText: string;

  const AText: string

):Boolean;

Arguments

ASubText | Substring to check for
AText | String to check in

Function result

True if the given string starts with the substring, False if not.

Description

AnsiStartsText checks AText to see whether it starts with ASubText , and returns True if it does, False if not. The check is performed case-insensitive. Basically, it checks whether the position of ASubText equals 1.

Errors

None.

See also

AnsiEndsText | Check whether a string ends with a certain substring, ignoring case.
AnsiStartsStr | Check whether a string starts with a given substring, observing case
AnsiIndexText | Searches, case insensitive, for a string in an array of strings.
AnsiContainsText | Check whether a string contains a certain substring, ignoring case.


BinToHex

Convert a binary buffer to a hexadecimal string

Declaration

Source position: strutils.pp line 202

procedure BinToHex(

  BinValue: PChar;

  HexValue: PChar;

  BinBufSize: Integer

);

Description

BinToHex converts the byte values in BinValue to a string consisting of 2-charachter hexadecimal strings in HexValue. BufSize specifies the length of BinValue, which means that HexValue must have size 2*BufSize.

For example a buffer containing the byte values 255 and 0 will be converted to FF00.

Errors

No length checking is done, so if an invalid size is specified, an exception may follow.

See also

HexToBin

Convert a hexadecimal string to a binary buffer


Copy2Space

Returns all characters in a string till the first space character (not included).

Declaration

Source position: strutils.pp line 169

function Copy2Space(

  const S: string

):string;

Arguments

S

String to return first characters from.

Function result

Characters from S till the first space.

Description

Copy2Space determines the position of the first space in the string S and returns all characters up to this position. The space character itself is not included in the result string. The string S is left untouched. If there is no space in S, then the whole string S is returned.

This function simply calls Copy2Symb with the space (ASCII code 32) as the symbol argument.

Errors

None.

See also

Copy2Symb | Returns all characters in a string till a given character (not included).
Copy2SpaceDel | Deletes and returns all characters in a string till the first space character (not included).


Copy2SpaceDel

Deletes and returns all characters in a string till the first space character (not included).

Declaration

Source position: strutils.pp line 170

function Copy2SpaceDel(

  var S: string

):string;

Arguments

S

String to delete and return first characters from.

Function result

Deleted characters from the string

Description

Copy2SpaceDel determines the position of the first space in the string S and returns all characters up to this position. The space character itself is not included in the result string. All returned characters, including the space, are deleted from the string S, after which it is right-trimmed. If there is no space in S, then the whole string S is returned, and S itself is emptied.

This function simply calls Copy2SymbDel with the space (ASCII code 32) as the symbol argument.

Errors

None.

See also

Copy2SymbDel | Deletes and returns all characters in a string till a given character (not included).
Copy2Space | Returns all characters in a string till the first space character (not included).


Copy2Symb

Returns all characters in a string till a given character (not included).

Declaration

Source position: strutils.pp line 167

function Copy2Symb(

  const S: string;

  Symb: Char

):string;

Arguments

S | String to return first characters from.
Symb | Symbol till which characters will be copied. Will not be included in the result.

Function result

Characters from the string till the first occurrence of the given character.

Description

Copy2Symb determines the position of the first occurrence of Symb in the string S and returns all characters up to this position. The Symb character itself is not included in the result string. The string S is left untouched. If Symb does not appear in S, then the whole of S is returned.

Errors

None.

See also

Copy2Space | Returns all characters in a string till the first space character (not included).
Copy2SymbDel | Deletes and returns all characters in a string till a given character (not included).


Copy2SymbDel

Deletes and returns all characters in a string till a given character (not included).

Declaration

Source position: strutils.pp line 168

function Copy2SymbDel(

  var S: string;

  Symb: Char

):string;

Arguments

S | String to delete and return first characters from.
Symb | Symbol till which characters will be copied. Will not be included in the result.

Function result

Characters from the string till the first occurrence of the given character.

Description

Copy2SymbDel determines the position of the first occurrence of Symb in the string S and returns all characters up to this position. The Symb character itself is not included in the result string. All returned characters and the Symb character, are deleted from the string S, after which it is right-trimmed. If Symb does not appear in S, then the whole of S is returned, and S itself is emptied.

Errors

None.

See also

Copy2SpaceDel | Deletes and returns all characters in a string till the first space character (not included).
Copy2Symb | Returns all characters in a string till a given character (not included).


Dec2Numb

Convert a decimal number to a string representation, using given a base.

Declaration

Source position: strutils.pp line 193

function Dec2Numb(

  N: LongInt;

  Len: Byte;

  Base: Byte

):string;

Arguments

N | Number to represent.
Len | Minimal length of the returned string
Base | Base to use when converting

Function result

The representation of the given number.

Description

Dec2Numb converts N to its representation using base Base. N must be a positive integer. The resulting string is left-padded with zeroes till it has length Len. Base must be in the range 2-36 to be meaningful, but no checking on this is performed.

Errors

If Base is out of range, the resulting string will contain unreadable (non-alphanumeric) characters.

See also

Hex2Dec | Converts a hexadecimal string to a decimal value
IntToBin | Converts an integer to a binary string representation, inserting spaces at fixed locations.
intToRoman | Represent an integer with roman numerals
RomanToInt | Convert a string with a Roman number to it's decimal value.


DecodeSoundexInt

Decodes the integer representation of a soundex code and returns the original soundex code.

Declaration

Source position: strutils.pp line 128

function DecodeSoundexInt(

  AValue: Integer

):string;

Arguments

AValue

Integer soundex value.

Function result

Soundex code corresponding to the integer value.

Description

DecodeSoundexInt converts the integer value AValue to a soundex string. It performs the reverse operation of the SoundexInt function. The result is the soundex string corresponding to AValue. .

Errors

None.

See also

SoundexInt | Soundex value as an integer.
DecodeSoundexWord | Decodes the word-sized representation of a soundex code and returns the original soundex code.
Soundex | Compute the soundex of a string


DecodeSoundexWord

Decodes the word-sized representation of a soundex code and returns the original soundex code.

Declaration

Source position: strutils.pp line 130

function DecodeSoundexWord(

  AValue: Word

):string;

Arguments

AValue

Word-sized soundex value.

Function result

Soundex code corresponding to the word-sized value.

Description

DecodeSoundexWord converts the integer value AValue to a soundex string. It performs the reverse operation of the SoundexWord function. The result is the soundex string corresponding to AValue .

Errors

None.

See also

SoundexInt | Soundex value as an integer.
DecodeSoundexInt | Decodes the integer representation of a soundex code and returns the original soundex code.
Soundex | Compute the soundex of a string


DelChars

Delete all occurrences of a given character from a string.

Declaration

Source position: strutils.pp line 154

function DelChars(

  const S: string;

  Chr: Char

):string;

Arguments

S | String to delete characters from.
Chr | Character which must be deleted.

Function result

Original string with all occurrences of the given character deleted.

Description

DelChars returns a copy of S with all Chr characters removed from it.

Errors

None.

See also

DelSpace | Delete all occurrences of a space from a string.
DelSpace1 | Reduces sequences of space characters to 1 space character.


DelSpace

Delete all occurrences of a space from a string.

Declaration

Source position: strutils.pp line 153

function DelSpace(

  const S: string

):string;

Arguments

S

String to delete spaces from.

Function result

String with all spaces removed.

Description

DelSpace returns a copy of S with all spaces (ASCII code 32) removed from it.

Errors

None.

See also

DelChars | Delete all occurrences of a given character from a string.
DelSpace1 | Reduces sequences of space characters to 1 space character.


DelSpace1

Reduces sequences of space characters to 1 space character.

Declaration

Source position: strutils.pp line 155

function DelSpace1(

  const S: string

):string;

Arguments

S

String to reduce space sequences in.

Function result

Original string with series of maximal 1 space.

Description

DelSpace1 returns a copy of S with all sequences of spaces reduced to 1 space.

Errors

None.

See also

DelChars | Delete all occurrences of a given character from a string.
DelSpace | Delete all occurrences of a space from a string.


DupeString

Creates and concatenates N copies of a string

Declaration

Source position: strutils.pp line 54

function DupeString(

  const AText: string;

  ACount: Integer

):string;

Arguments

AText | String to duplicate
ACount | Number of copies to create

Function result

Copies of the original string.

Description

DupeString returns a string consisting of ACount concatenations of AText. Thus

DupeString('1234567890',3);

will produce a string

'123456789012345678901234567890'

Errors

None.


ExtractDelimited

Extract the N-th delimited part from a string.

Declaration

Source position: strutils.pp line 179

function ExtractDelimited(

  N: Integer;

  const S: string;

  const Delims: TSysCharSet

):string;

Arguments

N | Which word to extract
S | String to extract word from
Delims | Characters to use as word delimiters.

Function result

N-th word

Description

ExtractDelimited extracts the N-th part from the string S. The set of characters in Delims are used to mark part boundaries. When a delimiter is encountered, a new part is started and the old part is ended. Another way of stating this is that any (possibly empty) series of characters not in Delims, situated between 2 characters in Delims, it is considered as piece of a part. This means that if 2 delimiter characters appear next to each other, there is an empty part between it. If an N-th part cannot be found, an empty string is returned. However, unlike ExtractWord, an empty string is a valid return value, i.e. a part can be empty.

The pre-defined constant StdWordDelims can be used for the Delims argument. The pre-defined constant Brackets would be better suited the Delims argument e.g. in case factors in a mathematical expression are searched.

Errors

None.

See also

ExtractSubStr | Extract a word from a string, starting at a given position in the string.
ExtractWord | Extract the N-th word out of a string.
ExtractWordPos | Extract a word from a string, and return the position where it was located in the string.


ExtractSubstr

Extract a word from a string, starting at a given position in the string.

Declaration

Source position: strutils.pp line 183

function ExtractSubstr(

  const S: string;

  var Pos: Integer;

  const Delims: TSysCharSet

):string;

Arguments

S | String to search in.
Pos | Initial position to start extracting. On exit returns the position of the next word.
Delims | Characters to use as word delimiters

Function result

The extracted word.

Description

ExtractSubStr returns all characters from S starting at position Pos till the first character in Delims, or till the end of S is reached. The delimiter character is not included in the result. Pos is then updated to point to the next first non-delimiter character in S. If Pos is larger than the Length of S, an empty string is returned.

The pre-defined constant StdWordDelims can be used for the Delims argument.

Errors

None.

See also

ExtractDelimited | Extract the N-th delimited part from a string.
ExtractWord | Extract the N-th word out of a string.
ExtractWordPos | Extract a word from a string, and return the position where it was located in the string.


ExtractWord

Extract the N-th word out of a string.

Declaration

Source position: strutils.pp line 174

function ExtractWord(

  N: Integer;

  const S: string;

  const WordDelims: TSysCharSet

):string;

Arguments

N | Which word to extract.
S | String to extract the word from.
WordDelims | Characters to use as word delimiters

Function result

The N-th word, or empty if N is out of range.

Description

ExtractWord extracts the N-th word from the string S. The set of characters in WordDelims are used to mark word boundaries. A word is defined as any non-empty sequence of characters which are not present in WordDelims: if a character is not in WordDelims, it is considered as part of a word. If an N-th word cannot be found, an empty string is returned.

Unlike ExtractDelimited, an empty string is not a valid return value, i.e. is not a word. If an empty string is returned, the index N was out of range.

The pre-defined constant StdWordDelims can be used for the WordDelims argument.

Errors

None.

See also

ExtractWordPos | Extract a word from a string, and return the position where it was located in the string.
ExtractSubStr | Extract a word from a string, starting at a given position in the string.
ExtractDelimited | Extract the N-th delimited part from a string.
IsWordPresent | Check for the presence of a word in a string.
WordCount | Count the number of words in a string.
WordPosition | Search position of Nth word in a string.


ExtractWordPos

Extract a word from a string, and return the position where it was located in the string.

Declaration

Source position: strutils.pp line 178

function ExtractWordPos(

  N: Integer;

  const S: string;

  const WordDelims: TSysCharSet;

  out Pos: Integer

):string;

Arguments

N | Which word to extract
S | String to extract a word from.
WordDelims | Characters to use as word delimiters
Pos | On return, contains the position of the N-th word.

Function result

N-th word of the string, or empty if N is out of range.

Description

ExtractWordPos extracts the N-th word from the string S and returns the position of this word in Pos. The set of characters in WordDelims are used to mark word boundaries. A word is defined as any non-empty sequence of characters which are not present in WordDelims : if a character is not in WordDelims , it is considered as part of a word. If an N -th word cannot be found, an empty string is returned and Pos is zero.

Unlike ExtractDelimited, an empty string is not a valid return value, i.e. is not a word. If an empty string is returned, the index N was out of range.

The pre-defined constant StdWordDelims can be used for the WordDelims argument.

Errors

None.

See also

ExtractWord | Extract the N-th word out of a string.
ExtractSubStr | Extract a word from a string, starting at a given position in the string.
IsWordPresent | Check for the presence of a word in a string.
WordCount | Count the number of words in a string.
WordPosition | Search position of Nth word in a string.


FindMatchesBoyerMooreCaseInSensitive

Find case-sensitive matches of a string using a Boyer-Moore algorithm

Declaration

Source position: strutils.pp line 231

procedure FindMatchesBoyerMooreCaseInSensitive(

  const S: PChar;

  const OldPattern: PChar;

  const SSize: SizeInt;

  const OldPatternSize: SizeInt;

  out aMatches: SizeIntArray;

  const aMatchAll: Boolean

);

procedure FindMatchesBoyerMooreCaseInSensitive(

  const S: string;

  const OldPattern: string;

  out aMatches: SizeIntArray;

  const aMatchAll: Boolean

);

Description

FindMatchesBoyerMooreCaseInSensitive finds occurrences of OldPattern (with length OldPatternSize) in S (with length SSize). The search is performed case-insensitively, and all (zero based) positions are reported in aMatches. If aMatchAll is True, all positions will be reported. If aMatchAll is False, only the first position is reported.

Errors

None.

See also

FindMatchesBoyerMooreCaseSensitive

Find case-sensitive matches of a string using a Boyer-Moore algorithm

SringReplace


FindMatchesBoyerMooreCaseSensitive

Find case-sensitive matches of a string using a Boyer-Moore algorithm

Declaration

Source position: strutils.pp line 228

procedure FindMatchesBoyerMooreCaseSensitive(

  const S: PChar;

  const OldPattern: PChar;

  const SSize: SizeInt;

  const OldPatternSize: SizeInt;

  out aMatches: SizeIntArray;

  const aMatchAll: Boolean

);

procedure FindMatchesBoyerMooreCaseSensitive(

  const S: string;

  const OldPattern: string;

  out aMatches: SizeIntArray;

  const aMatchAll: Boolean

);

Description

FindMatchesBoyerMooreCaseSensitive finds occurrences of OldPattern (with length OldPatternSize) in S (with length SSize). The search is performed case-sensitively, and all (zero based) positions are reported in aMatches. If aMatchAll is True, all positions will be reported. If aMatchAll is False, only the first position is reported.

Errors

None.

See also

FindMatchesBoyerMooreCaseInSensitive

Find case-sensitive matches of a string using a Boyer-Moore algorithm

SringReplace


FindPart

Search for a substring in a string, using wildcards.

Declaration

Source position: strutils.pp line 185

function FindPart(

  const HelpWilds: string;

  const InputStr: string

):SizeInt;

Arguments

HelpWilds | Search string, may contain wildcards.
InputStr | String to search in.

Function result

String matching the search expression.

Description

FindPart searches the string InputStr and returns the first string that matches the wildcards specification in HelpWilds . If no match is found, and empty string is returned. Currently, the only valid wildcards is the "?" character.

Errors

None.

See also

SearchBuf

Search a buffer for a certain string.


GetCmdLineArg

Returns the command-line argument following the given switch.

Declaration

Source position: strutils.pp line 190

function GetCmdLineArg(

  const Switch: string;

  SwitchChars: TSysCharSet

):string;

Arguments

Switch | Switch to search for
SwitchChars | Switch characters to use. Can be empty.

Function result

Command line argument that followed the switch

Description

GetCmdLineArg returns the value for the Switch option on the command-line, if any is given. Command-line arguments are considered switches if they start with one of the characters in the SwitchChars set. The value is the command-line argument following the switch command-line argument.

Gnu-style (long) Options of the form switch=value are not supported.

The StdSwitchChars constant can be used as value for the SwitchChars parameter.

Errors

The GetCmdLineArg does not check whether the value of the option does not start with a switch character. i.e.

myprogram -option1 -option2

will result in "-option2" as the result of the GetCmdLineArg call for option1.

See also

StdSwitchChars

Standard characters for the SwitchChars argument of GetCmdLineArg.


Hex2Dec

Converts a hexadecimal string to a decimal value

Declaration

Source position: strutils.pp line 192

function Hex2Dec(

  const S: string

):LongInt;

Arguments

S

String to convert

Function result

Hexadecimal value of the string

Description

Hex2Dec converts the hexadecimal value in the string S to its decimal value. Unlike the standard Valor StrToInt functions, there need not be a $ sign in front of the hexadecimal value to indicate that it is indeed a hexadecimal value.

Errors

If S does not contain a valid hexadecimal value, an EConvertError exception will be raised.

See also

Dec2Numb | Convert a decimal number to a string representation, using given a base.
IntToBin | Converts an integer to a binary string representation, inserting spaces at fixed locations.
intToRoman | Represent an integer with roman numerals
RomanToInt | Convert a string with a Roman number to it's decimal value.


HexToBin

Convert a hexadecimal string to a binary buffer

Declaration

Source position: strutils.pp line 203

function HexToBin(

  HexValue: PChar;

  BinValue: PChar;

  BinBufSize: Integer

):Integer;

Description

HexToBin scans the hexadecimal string representation in HexValue and transforms every 2 character hexadecimal number to a byte and stores it in BinValue. The buffer size is the size of the binary buffer. Scanning will stop if the size of the binary buffer is reached or when an invalid character is encountered. The return value is the number of stored bytes.

Errors

No length checking is done, so if an invalid size is specified, an exception may follow.

See also

BinToHex

Convert a binary buffer to a hexadecimal string


IfThen

Returns one of two strings, depending on a boolean expression

Declaration

Source position: strutils.pp line 59

function IfThen(

  AValue: Boolean;

  const ATrue: string;

  const AFalse: string = ''

):string; overload;

Arguments

AValue | Determines which of the two possibilities to take
ATrue | String to return if the expression evaluates as True.
AFalse | String to return if the expression evaluates as false. Default is the empty string.

Function result

Either AFalse or ATrue, depending on the expression.

Description

IfThen returns ATrue if AValue is True, and returns AFalse if AValue is false.

Errors

None.

See also

AnsiMatchStr | Check whether a string occurs in an array of strings, observing case.
AnsiMatchText | Check whether a string occurs in an array of strings, disregarding case.


IndexStr

Searches, observing case, for a string in an array of strings.

Declaration

Source position: strutils.pp line 48

function IndexStr(

  const AText: UnicodeString;

  const AValues: array of UnicodeString

):Integer;

Description

IndexStr matches AText against each unicode string in AValues. If a match is found, the corresponding index (zero-based) in the AValues array is returned. If no match is found, -1 is returned. The strings are matched observing case.

Errors

None.

See also

AnsiIndexText | Searches, case insensitive, for a string in an array of strings.
MatchStr | Check whether a string occurs in an array of strings, observing case.
AnsiIndexStr | Searches, observing case, for a string in an array of strings.


IntToBin

Converts an integer to a binary string representation, inserting spaces at fixed locations.

Declaration

Source position: strutils.pp line 195

function IntToBin(

  Value: LongInt;

  Digits: Integer;

  Spaces: Integer

):string;

function IntToBin(

  Value: LongInt;

  Digits: Integer

):string;

function intToBin(

  Value: Int64;

  Digits: Integer

):string;

Arguments

Value | Value to convert
Digits | Number of bits in the resulting string.
Spaces | Number of digits after which to insert a space.

Function result

Resulting string

Arguments

Value | Value to convert
Digits | Number of bits in the resulting string.

Arguments

Value | Value to convert
Digits | Number of bits in the resulting string.

Description

IntToBin converts Value to a string with it's binary (base 2) representation. The resulting string contains at least Digits digits, with spaces inserted every Spaces digits. Spaces should be a nonzero value. If Digits is larger than 32, it is truncated to 32.

Errors

If spaces is zero, a division by zero error will occur.

See also

Hex2Dec | Converts a hexadecimal string to a decimal value
IntToRoman | Represent an integer with roman numerals


IntToRoman

Represent an integer with roman numerals

Declaration

Source position: strutils.pp line 198

function IntToRoman(

  Value: LongInt

):string;

Arguments

Value

Value to convert

Function result

Value in roman numerals

Description

IntToRoman converts Value to a string with the Roman representation of Value. Number up to 1 million can be represented this way.

Errors

None.

See also

RomanToInt | Convert a string with a Roman number to it's decimal value.
Hex2Dec | Converts a hexadecimal string to a decimal value
IntToBin | Converts an integer to a binary string representation, inserting spaces at fixed locations.


IsEmptyStr

Check whether a string is empty, disregaring whitespace characters

Declaration

Source position: strutils.pp line 152

function IsEmptyStr(

  const S: string;

  const EmptyChars: TSysCharSet

):Boolean;

Arguments

S | String to check
EmptyChars | Characters to consider as whitespace

Function result

True if the string consists solely of empty characters.

Description

IsEmptyStr returns True if the string S only contains characters whitespace characters, all characters in EmptyChars are considered whitespace characters. If a character not present in EmptyChars is found in S, False is returned.

Errors

None.

See also

IsWild | Check whether a string matches a wildcard search expression.
FindPart | Search for a substring in a string, using wildcards.
IsWordPresent | Check for the presence of a word in a string.


IsWild

Check whether a string matches a wildcard search expression.

Declaration

Source position: strutils.pp line 186

function IsWild(

  InputStr: string;

  Wilds: string;

  IgnoreCase: Boolean

):Boolean;

Arguments

InputStr | String to search
Wilds | Wildcard specification
IgnoreCase | Search case insensitive or not.

Function result

True if the string matches the wildcard specification, False otherwise.

Description

IsWild checks InputStr for the presence of the Wilds string. Wilds may contain "?" and "*" wildcard characters, which have their usual meaning: "*" matches any series of characters, possibly empty. "?" matches any single character. The function returns True if a string is found that matches Wilds, False otherwise.

If IgnoreCase is True, the non-wildcard characters are matched case insensitively. If it is False, case is observed when searching.

Errors

None.

See also

SearchBuf | Search a buffer for a certain string.
FindPart | Search for a substring in a string, using wildcards.


IsWordPresent

Check for the presence of a word in a string.

Declaration

Source position: strutils.pp line 184

function IsWordPresent(

  const W: string;

  const S: string;

  const WordDelims: TSysCharSet

):Boolean;

Arguments

W | Word to search for
S | String to search
WordDelims | Characters to use as word separators

Function result

True if the word is present, False if not.

Description

IsWordPresent checks for the presence of the word W in the string S. Words are delimited by the characters found in WordDelims. The function returns True if a match is found, False otherwise. The search is performed case sensitive.

This function is equivalent to the SearchBuf function with the soWholeWords option specified.

Errors

None.

See also

SearchBuf

Search a buffer for a certain string.


LeftBStr

Copies Count characters starting at the left of a string.

Declaration

Source position: strutils.pp line 75

function LeftBStr(

  const AText: AnsiString;

  const AByteCount: SizeInt

):AnsiString;

Arguments

AText | String to copy characters from.
AByteCount | Number of characters to copy.

Function result

First N characters of the string.

Description

LeftBStr returns a string containing the leftmost AByteCount bytes from the string AText . If AByteCount is larger than the length (in bytes) of AText , only as many bytes as available are returned.

Errors

None.

See also

LeftStr | Copies Count characters starting at the left of a string.
AnsiLeftStr | Copies a number of characters starting at the left of a string
RightBStr | Copy a given number of characters (bytes), counting from the right of a string.
MidBStr | Copies a number of characters starting at a given position in a string.


LeftStr

Copies Count characters starting at the left of a string.

Declaration

Source position: strutils.pp line 67

function LeftStr(

  const AText: AnsiString;

  const ACount: SizeInt

):AnsiString;

function LeftStr(

  const AText: WideString;

  const ACount: SizeInt

):WideString;

Arguments

AText | String to copy characters from.
ACount | Number of characters to copy.

Function result

First N characters of the string.

Arguments

AText | String to copy characters from.
ACount | Number of characters to copy.

Description

LeftStr returns a string containing the leftmost ACount characters from the string AText . If ACount is larger than the length (in characters) of AText , only as many characters as available are returned.

Errors

None.

See also

LeftBStr | Copies Count characters starting at the left of a string.
AnsiLeftStr | Copies a number of characters starting at the left of a string
RightStr | Copy a given number of characters, counting from the right of a string.
MidStr | Copies a number of characters starting at a given position in a string.


MatchStr

Check whether a string occurs in an array of strings, observing case.

Declaration

Source position: strutils.pp line 47

function MatchStr(

  const AText: UnicodeString;

  const AValues: array of UnicodeString

):Boolean;

Description

MatchStr matches AText against each unicode string in AValues. If a match is found, it returns True, otherwise False is returned. The strings are matched observing case.

This function simply calls IndexStr and checks whether it returns -1 or not.


MidBStr

Copies a number of characters starting at a given position in a string.

Declaration

Source position: strutils.pp line 71

function MidBStr(

  const AText: AnsiString;

  const AByteStart: SizeInt;

  const AByteCount: SizeInt

):AnsiString;

Arguments

AText | String to copy characters from.
AByteStart | Position (in bytes) to start copying from.
AByteCount | Number of characters (bytes) to copy.

Function result

Resulting string

Description

MidBStr returns a string containing the first AByteCount bytes from the string AText starting at position AByteStart. If AByteStart+AByteCount is larger than the length (in bytes) of AText, only as many bytes as available are returned. If AByteStart is less than 1 or larger than the length of AText, then no characters are returned.

Errors

None.

See also

LeftBStr | Copies Count characters starting at the left of a string.
AnsiMidStr | Returns a number of characters copied from a given location in a string
RightBStr | Copy a given number of characters (bytes), counting from the right of a string.
MidStr | Copies a number of characters starting at a given position in a string.


MidStr

Copies a number of characters starting at a given position in a string.

Declaration

Source position: strutils.pp line 69

function MidStr(

  const AText: AnsiString;

  const AStart: SizeInt;

  const ACount: SizeInt

):AnsiString;

function MidStr(

  const AText: WideString;

  const AStart: SizeInt;

  const ACount: SizeInt

):WideString;

Arguments

AText | String to copy characters from.
AStart | Position (in characters) to start copying from.
ACount | Number of characters to copy.

Function result

Resulting string

Arguments

AText | String to copy characters from.
AStart | Position (in characters) to start copying from.
ACount | Number of characters to copy.

Description

MidStr returns a string containing the first ACount bytes from the string AText starting at position AStart. If AStart+ACount is larger than the length (in characters) of AText, only as many characters as available are returned. If AStart is less than 1 or larger than the length of AText, then no characters are returned.

This function is equivalent to the standard Copy function, and is provided for completeness only.

Errors

None.

See also

LeftStr | Copies Count characters starting at the left of a string.
AnsiMidStr | Returns a number of characters copied from a given location in a string
RightStr | Copy a given number of characters, counting from the right of a string.
MidBStr | Copies a number of characters starting at a given position in a string.


NaturalCompareText

Compare using natural sort

Declaration

Source position: strutils.pp line 60

function NaturalCompareText(

  const S1: string;

  const S2: string

):Integer;

function NaturalCompareText(

  const Str1: string;

  const Str2: string;

  const ADecSeparator: Char;

  const AThousandSeparator: Char

):Integer;

Description

NaturalCompareText will compare 2 strings and return one of the following values:

-1
If S1 comes before S2
0
If S1 equals S2
1
If S1 comes after S2

When S1 and S2 are integer or floating point values, the actual values are compared. Thus '12' will come after '2'. If either of the values is not a valid integer or floating point values, the strings are compared case insensitively as texts using CompareText

A decimal separator and thousands separator can optionally be specified in ADecSeparator, AThousandSeparator. If none are specified, the defaults from the system unit will be used.

See also

CompareText


NPos

Returns the position of the N-th occurrence of a substring in a string.

Declaration

Source position: strutils.pp line 157

function NPos(

  const C: string;

  S: string;

  N: Integer

):SizeInt;

Arguments

C | Substring to search for
S | String to search.
N | Which position to return

Function result

Position of N-th occurrence of the substring, -1 if there is none.

Description

NPos checks S for the position of the N-th occurrence of C. If C occurs less than N times in S, or does not occur in S at all, 0 is returned. If N is less than 1, zero is returned.

Errors

None.

See also

WordPosition | Search position of Nth word in a string.
FindPart | Search for a substring in a string, using wildcards.


Numb2Dec

Converts a string representation of a number to its numerical value, given a certain base.

Declaration

Source position: strutils.pp line 194

function Numb2Dec(

  S: string;

  Base: Byte

):LongInt;

Arguments

S | String to convert
Base | Base to use when converting.

Function result

Numerical value of the string.

Description

Numb2Dec converts the number in string S to a decimal value. It assumes the number is represented using Base as the base. No checking is performed to see whether S contains a valid number using base Base.

Errors

None.

See also

Hex2Dec | Converts a hexadecimal string to a decimal value
Numb2USA | Insert thousand separators.


Numb2USA

Insert thousand separators.

Declaration

Source position: strutils.pp line 191

function Numb2USA(

  const S: string

):string;

Arguments

S

String to insert thousand separators in.

Function result

String with thousand separators inserted.

Description

Numb2USA inserts thousand separators in the string S at the places where they are supposed to be, i.e. every 3 digits. The string S should contain a valid integer number, i.e. no digital number. No checking on this is done.

Errors

None.


PadCenter

Pad the string to a certain length, so the string is centered.

Declaration

Source position: strutils.pp line 166

function PadCenter(

  const S: string;

  Len: SizeInt

):string;

Arguments

S | String to center
Len | Desired length of the resulting string

Function result

Centered string of the specified length

Description

PadCenter add spaces to the left and right of the string S till the result reaches length Len. If the number of spaces to add is odd, then the extra space will be added at the end. If the string S has length equal to or largert than Len, no spaces are added, and the string S is returned as-is.

Errors

None.

See also

PadLeft | Add spaces to the left of a string till a certain length is reached.
PadRight | Add spaces to the right of a string till a certain length is reached.
AddChar | Add characters to the left of a string till a certain length
AddCharR | Add chars at the end of a string till it reaches a certain length


PadLeft

Add spaces to the left of a string till a certain length is reached.

Declaration

Source position: strutils.pp line 164

function PadLeft(

  const S: string;

  N: Integer

):string;

Arguments

S | String to pad.
N | Minimal length of the resulting string.

Function result

String of length N, padded to the left with spaces

Description

PadLeft add spaces to the left of the string S till the result reaches length Len. If the string S has length equal to or largert than Len, no spaces are added, and the string S is returned as-is. The resulting string is S, right-justified on length Len.

Errors

None.

See also

PadLeft | Add spaces to the left of a string till a certain length is reached.
PadCenter | Pad the string to a certain length, so the string is centered.
AddChar | Add characters to the left of a string till a certain length
AddCharR | Add chars at the end of a string till it reaches a certain length


PadRight

Add spaces to the right of a string till a certain length is reached.

Declaration

Source position: strutils.pp line 165

function PadRight(

  const S: string;

  N: Integer

):string;

Arguments

S | String to pad.
N | Minimal length of the resulting string.

Function result

String of length N, padded to the right with spaces

Description

PadRight add spaces to the left of the string S till the result reaches length Len. If the string S has length equal to or largert than Len, no spaces are added, and the string S is returned as-is. The resulting string is S, left-justified on length Len.

Errors

None.

See also

PadLeft | Add spaces to the left of a string till a certain length is reached.
PadCenter | Pad the string to a certain length, so the string is centered.
AddChar | Add characters to the left of a string till a certain length
AddCharR | Add chars at the end of a string till it reaches a certain length


PosEx

Search for the occurrence of a character in a string, starting at a certain position.

Declaration

Source position: strutils.pp line 98

function PosEx(

  const SubStr: string;

  const S: string;

  Offset: SizeUInt

):SizeInt;

function PosEx(

  const SubStr: string;

  const S: string

):SizeInt;

function PosEx(

  c: Char;

  const S: string;

  Offset: SizeUInt

):SizeInt;

function PosEx(

  const SubStr: UnicodeString;

  const S: UnicodeString;

  Offset: SizeUInt

):SizeInt;

function PosEx(

  c: WideChar;

  const S: UnicodeString;

  Offset: SizeUInt

):SizeInt;

function PosEx(

  const SubStr: UnicodeString;

  const S: UnicodeString

):SizeInt;

Arguments

SubStr | String to search for.
S | String to search.
Offset | Initial position where to start searching.

Function result

Position of the character, or 0 if it is not found.

Arguments

SubStr | String to search for.
S | String to search.

Arguments

c | Character to search for.
S | String to search.
Offset | Initial position where to start searching.

Arguments

SubStr | String to search for.
S | String to search.
Offset | Initial position where to start searching.

Arguments

c | Character to search for.
S | String to search.
Offset | Initial position where to start searching.

Arguments

SubStr | String to search for.
S | String to search.

Description

PosEx returns the position of the first occurrence of the character C or the substring SubStr in the string S, starting the search at position Offset (default 1). If C or SubStr does not occur in S after the given Offset, zero is returned. The position Offset is also searched.

Errors

None.

See also

NPos | Returns the position of the N-th occurrence of a substring in a string.
AnsiContainsText | Check whether a string contains a certain substring, ignoring case.
AnsiContainsStr | Checks whether a string contains a given substring


PosSet

Return the position in a string of any character out of a set of characters

Declaration

Source position: strutils.pp line 211

function PosSet(

  const c: TSysCharSet;

  const s: ansistring

):SizeInt;

function PosSet(

  const c: string;

  const s: ansistring

):SizeInt;

Description

PosSet returns the position in s of the first found character which is in the set c. If none of the characters in c is found in s, then 0 is returned.

Errors

None.

See also

PosEx | Search for the occurrence of a character in a string, starting at a certain position.
PosSetEx | Return the position in a string of any character out of a set of characters, starting at a certain position
#rtl.system.pos | Search for substring in a string.
RPosEx | Find last occurrence substring or character in a string, starting at a certain position


PosSetEx

Return the position in a string of any character out of a set of characters, starting at a certain position

Declaration

Source position: strutils.pp line 213

function PosSetEx(

  const c: TSysCharSet;

  const s: ansistring;

  count: Integer

):SizeInt;

function PosSetEx(

  const c: string;

  const s: ansistring;

  count: Integer

):SizeInt;

Description

PosSetEx returns the position in s of the first found character which is in the set c, and starts searching at character position Count. If none of the characters in c is found in s, then 0 is returned.

Errors

None.

See also

PosEx | Search for the occurrence of a character in a string, starting at a certain position.
PosSet | Return the position in a string of any character out of a set of characters
#rtl.system.pos | Search for substring in a string.
RPosEx | Find last occurrence substring or character in a string, starting at a certain position


RandomFrom

Choose a random string from an array of strings.

Declaration

Source position: strutils.pp line 58

function RandomFrom(

  const AValues: array of string

):string; overload;

Arguments

AValues

Strings to choose from

Function result

Random string picked from the array.

Description

RandomFrom picks at random a valid index in the array AValues and returns the string at that position in the array.

Errors

None.

See also

AnsiMatchStr | Check whether a string occurs in an array of strings, observing case.
AnsiMatchText | Check whether a string occurs in an array of strings, disregarding case.


Removeleadingchars

Remove any leading characters in a set from a string

Declaration

Source position: strutils.pp line 216

procedure Removeleadingchars(

  var S: AnsiString;

  const CSet: TSysCharSet

);

Description

Removeleadingchars removes any starting characters from S that appear in the set CSet. It stops removing characters as soon as a character not in CSet is encountered. This is similar in behaviour to TrimLeft which used whitespace as the set.

Errors

None.

See also

TrimLeft | Trim whitespace from the beginning of a string.
RemoveTrailingChars | Remove any trailing characters in a set from a string
RemovePadChars | Remove any trailing or leading characters in a set from a string
TrimLeftSet | Remove any leading characters in a set from a string and returns the result


RemovePadChars

Remove any trailing or leading characters in a set from a string

Declaration

Source position: strutils.pp line 218

procedure RemovePadChars(

  var S: AnsiString;

  const CSet: TSysCharSet

);

Description

RemovePadChars removes any leading trailing characters from S that appear in the set CSet, i.e. it starts with the last character and works its way to the start of the string, and it stops removing characters as soon as a character not in CSet is encountered. Then the same procedure is repeated starting from the beginning of the string. This is similar in behaviour to Trim which used whitespace as the set.

Errors

None.

See also

Trim | Trim whitespace from the ends of a string.
RemoveLeadingChars | Remove any leading characters in a set from a string
RemoveTrailingChars | Remove any trailing characters in a set from a string
TrimSet | Remove any leading or trailing characters in a set from a string and returns the result
TrimLeftSet | Remove any leading characters in a set from a string and returns the result
TrimRightSet | Remove any trailing characters in a set from a string and returns the result


RemoveTrailingChars

Remove any trailing characters in a set from a string

Declaration

Source position: strutils.pp line 217

procedure RemoveTrailingChars(

  var S: AnsiString;

  const CSet: TSysCharSet

);

Description

RemoveTrailingChars removes any trailing characters from S that appear in the set CSet, i.e. it starts with the last character and works its way to the start of the string. It stops removing characters as soon as a character not in CSet is encountered. This is similar in behaviour to TrimRight which used whitespace as the set.

See also

TrimRight | Trim whitespace from the beginning of a string.
RemoveLeadingChars | Remove any leading characters in a set from a string
TrimRightSet | Remove any trailing characters in a set from a string and returns the result


ReplaceStr

Replace strings case-sensitively

Declaration

Source position: strutils.pp line 110

function ReplaceStr(

  const AText: string;

  const AFromText: string;

  const AToText: string

):string;

Description

ReplaceStr is a utility function that scans AText and replaces all occurrences of AFromText with AToText and returns the resulting string. It simply calls StringReplace with the appropriate options.

See also

StringReplace | Replace occurrences of one substring with another in a string.
ReplaceText | Replace strings case-insensitively


ReplaceText

Replace strings case-insensitively

Declaration

Source position: strutils.pp line 111

function ReplaceText(

  const AText: string;

  const AFromText: string;

  const AToText: string

):string;

Description

ReplaceText is a utility function that scans AText and replaces all occurrences of AFromText (case insensitive) with AToTextand returns the resulting string. It simply calls StringReplace with the appropriate options.

See also

StringReplace | Replace occurrences of one substring with another in a string.
ReplaceText | Replace strings case-insensitively


ReverseString

Reverse characters in a string

Declaration

Source position: strutils.pp line 55

function ReverseString(

  const AText: string

):string;

Arguments

AText

String to reverse

Function result

String with characters in reversed order.

Description

ReverseString returns a string, made up of the characters in string AText, in reverse order.

Errors

None.

See also

RandomFrom

Choose a random string from an array of strings.


RightBStr

Copy a given number of characters (bytes), counting from the right of a string.

Declaration

Source position: strutils.pp line 70

function RightBStr(

  const AText: AnsiString;

  const AByteCount: SizeInt

):AnsiString;

Arguments

AText | String to copy characters from.
AByteCount | Number of characters (bytes) to copy.

Function result

Resulting string.

Description

RightBStr returns a string containing the rightmost AByteCount bytes from the string AText. If AByteCount is larger than the length (in bytes) of AText, only as many bytes as available are returned.

Errors

None.

See also

LeftBStr | Copies Count characters starting at the left of a string.
AnsiRightStr | Copies a number of characters starting at the right of a string
RightStr | Copy a given number of characters, counting from the right of a string.
MidBStr | Copies a number of characters starting at a given position in a string.


RightStr

Copy a given number of characters, counting from the right of a string.

Declaration

Source position: strutils.pp line 68

function RightStr(

  const AText: AnsiString;

  const ACount: SizeInt

):AnsiString;

function RightStr(

  const AText: WideString;

  const ACount: SizeInt

):WideString;

Arguments

AText | String to copy characters from.
ACount | Number of characters to copy.

Function result

Resulting string.

Arguments

AText | String to copy characters from.
ACount | Number of characters to copy.

Description

RightStr returns a string containing the rightmost ACount characters from the string AText . If ACount is larger than the length (in characters) of AText , only as many characters as available are returned.

Errors

None.

See also

LeftStr | Copies Count characters starting at the left of a string.
AnsiRightStr | Copies a number of characters starting at the right of a string
RightBStr | Copy a given number of characters (bytes), counting from the right of a string.
MidStr | Copies a number of characters starting at a given position in a string.


RomanToInt

Convert a string with a Roman number to it's decimal value.

Declaration

Source position: strutils.pp line 200

function RomanToInt(

  const S: string;

  Strictness: TRomanConversionStrictness = rcsRelaxed

):LongInt;

Arguments

S

String to convert.

Function result

Value of the string.

Description

RomanToInt returns the decimal equivalent of the Roman numerals in the string S. Invalid characters are dropped from S. A negative numeral is supported as well. The level of error checking is determined by the strictness parameter, the values are described in the type TRomanConversionStrictness.

Errors

On error, a EConvertError exception is raised.

See also

TRomanConversionStrictness | How to treat invalid roman numerals in TryRomanToInt.
IntToRoman | Represent an integer with roman numerals
Hex2Dec | Converts a hexadecimal string to a decimal value
Numb2Dec | Converts a string representation of a number to its numerical value, given a certain base.


RomanToIntDef

Convert a roman numeral to an integer value

Declaration

Source position: strutils.pp line 201

function RomanToIntDef(

  const S: string;

  const ADefault: LongInt = 0;

  Strictness: TRomanConversionStrictness = rcsRelaxed

):LongInt;

Description

RomanToInt converts the roman numeral in S to an integer and returns the integer value. The strictness of the conversion algorithm is determined by Strictness. If the conversion fails, ADefault is returned.

See also

TRomanConversionStrictness | How to treat invalid roman numerals in TryRomanToInt.
TryRomanToInt | Try to convert a roman numeral to an integer value.
RomanToInt | Convert a string with a Roman number to it's decimal value.
IntToRoman | Represent an integer with roman numerals


RPos

Find last occurrence of substring or character in a string

Declaration

Source position: strutils.pp line 160

function RPos(

  c: Char;

  const S: AnsiString

):SizeInt; overload;

function RPos(

  const Substr: AnsiString;

  const Source: AnsiString

):SizeInt; overload;

Description

RPos looks in S for the character C or the string SubStr. It starts looking at the end of the string, and searches towards the beginning of the string. If a match is found, it returns the position of the match.

See also

RPosEx

Find last occurrence substring or character in a string, starting at a certain position


RPosex

Find last occurrence substring or character in a string, starting at a certain position

Declaration

Source position: strutils.pp line 158

function RPosEX(

  C: Char;

  const S: AnsiString;

  offs: Cardinal

):SizeInt; overload;

function RPosex(

  const Substr: AnsiString;

  const Source: AnsiString;

  offs: Cardinal

):SizeInt; overload;

Description

RPos looks in S for the character C or the string SubStr. It starts looking at position Offs (counted from the start of the string), and searches towards the beginning of the string. If a match is found, it returns the position of the match.

See also

RPos

Find last occurrence of substring or character in a string


SearchBuf

Search a buffer for a certain string.

Declaration

Source position: strutils.pp line 96

function SearchBuf(

  Buf: PChar;

  BufLen: SizeInt;

  SelStart: SizeInt;

  SelLength: SizeInt;

  SearchString: string;

  Options: TStringSearchOptions

):PChar;

function SearchBuf(

  Buf: PChar;

  BufLen: SizeInt;

  SelStart: SizeInt;

  SelLength: SizeInt;

  SearchString: string

):PChar;

Arguments

Buf | Buffer to search
BufLen | Length of the buffer.
SelStart | Start of selection.
SelLength | Length of selection.
SearchString | String to search for.
Options | Search options

Function result

Position of the string

Arguments

Buf | Buffer to search
BufLen | Length of the buffer.
SelStart | Start of selection.
SelLength | Length of selection.
SearchString | String to search for.

Description

SearchBuf searches the buffer Buf for the occurrence of SearchString. At must Buflen characters are searched, and the search is started at SelStart+SelLength. If a match is found, a pointer to the position of the match is returned. The parameter Options specifies how the search is conducted. It is a set of the following options:

Option | Effect
soDown | Searches forward, starting at the end of the selection. Default is searching up
soMatchCase | Observe case when searching. Default is to ignore case.
soWholeWord | Match only whole words. Default also returns parts of words

The standard constant WordDelimiters is used to mark the boundaries of words.

The SelStart parameter is zero based.

Errors

Buflen must be the real length of the string, no checking on this is performed.

See also

FindPart | Search for a substring in a string, using wildcards.
ExtractWord | Extract the N-th word out of a string.
ExtractWordPos | Extract a word from a string, and return the position where it was located in the string.
ExtractSubStr | Extract a word from a string, starting at a given position in the string.
IsWordPresent | Check for the presence of a word in a string.


Soundex

Compute the soundex of a string

Declaration

Source position: strutils.pp line 120

function Soundex(

  const AText: string;

  ALength: TSoundexLength

):string;

function Soundex(

  const AText: string

):string;

Arguments

AText | Text to compute soundex of
ALength | Length of the soundex

Function result

String with the soundex code of the original string.

Arguments

AText

Text to compute soundex of

Description

Soundex computes a soundex code for AText. The resulting code will at most have ALength characters. The soundex code is computed according to the US system of soundex computing, which may result in inaccurate results in other languages.

Note that AText may not contain null characters.

Errors

None.

See also

SoundexCompare | Compare soundex values of 2 strings.
SoundexInt | Soundex value as an integer.
SoundexProc | Default AnsiResemblesText implementation.
SoundexWord | Calculate a word-sized soundex value
SoundexSimilar | Check whether 2 strings have equal soundex values


SoundexCompare

Compare soundex values of 2 strings.

Declaration

Source position: strutils.pp line 133

function SoundexCompare(

  const AText: string;

  const AOther: string;

  ALength: TSoundexLength

):Integer;

function SoundexCompare(

  const AText: string;

  const AOther: string

):Integer;

Arguments

AText | First string.
AOther | Second string.
ALength | Length of soundexes to compare.

Function result

0 if the soundexes are equal. Negative of the first is smaller as the second, positive otherwise.

Arguments

AText | First string.
AOther | Second string.

Description

SoundexCompare computes the soundex codes of AText and AOther and feeds these to CompareText. It will return -1 if the soundex code of AText is less than the soundex code of AOther, 0 if they are equal, and 1 if the code of AOther is larger than the code of AText.

Errors

None.

See also

Soundex | Compute the soundex of a string
SoundexInt | Soundex value as an integer.
SoundexProc | Default AnsiResemblesText implementation.
SoundexWord | Calculate a word-sized soundex value
SoundexSimilar | Check whether 2 strings have equal soundex values


SoundexInt

Soundex value as an integer.

Declaration

Source position: strutils.pp line 126

function SoundexInt(

  const AText: string;

  ALength: TSoundexIntLength

):Integer;

function SoundexInt(

  const AText: string

):Integer;

Arguments

AText | Text for which to compute soundex value.
ALength | Length of the soundex value to compute.

Function result

Soundex value as a astring.

Arguments

AText

Text for which to compute soundex value.

Description

SoundexInt computes the Soundex code (with length ALength, default 4) of AText, and converts the code to an integer value.

Errors

None.

See also

Soundex | Compute the soundex of a string
SoundexCompare | Compare soundex values of 2 strings.
SoundexProc | Default AnsiResemblesText implementation.
SoundexWord | Calculate a word-sized soundex value
SoundexSimilar | Check whether 2 strings have equal soundex values


SoundexProc

Default AnsiResemblesText implementation.

Declaration

Source position: strutils.pp line 135

function SoundexProc(

  const AText: string;

  const AOther: string

):Boolean;

Arguments

AText | Second string.
AOther | First string.

Function result

0 if the soundexes are equal. Negative of the first is smaller as the second, positive otherwise.

Description

SoundexProc is the standard implementation for the AnsiResemblesText procedure: By default, AnsiResemblesProc is set to this function. It compares the soundex codes of AOther and AText and returns True if they are equal, or False if they are not.

Errors

None.

See also

Soundex | Compute the soundex of a string
SoundexCompare | Compare soundex values of 2 strings.
SoundexInt | Soundex value as an integer.
SoundexWord | Calculate a word-sized soundex value
SoundexSimilar | Check whether 2 strings have equal soundex values


SoundexSimilar

Check whether 2 strings have equal soundex values

Declaration

Source position: strutils.pp line 131

function SoundexSimilar(

  const AText: string;

  const AOther: string;

  ALength: TSoundexLength

):Boolean;

function SoundexSimilar(

  const AText: string;

  const AOther: string

):Boolean;

Arguments

AText | First string
AOther | Second string
ALength | Soundex length (default 4)

Function result

True if the strings have the same soundex value, False otherwise

Arguments

AText | First string
AOther | Second string

Description

SoundexSimilar returns True if the soundex codes (with length ALength) of AText and AOther are equal, and False if they are not.

Errors

None.

See also

Soundex | Compute the soundex of a string
SoundexCompare | Compare soundex values of 2 strings.
SoundexInt | Soundex value as an integer.
SoundexProc | Default AnsiResemblesText implementation.
SoundexWord | Calculate a word-sized soundex value
Soundex | Compute the soundex of a string


SoundexWord

Calculate a word-sized soundex value

Declaration

Source position: strutils.pp line 129

function SoundexWord(

  const AText: string

):Word;

Arguments

AText

String to calculate soundex value of

Function result

Soundex value as a word.

Description

SoundexInt computes the Soundex code (with length 4) of AText, and converts the code to a word-sized value.

AText may not contain null characters.

Errors

None.

See also

Soundex | Compute the soundex of a string
SoundexCompare | Compare soundex values of 2 strings.
SoundexInt | Soundex value as an integer.
SoundexProc | Default AnsiResemblesText implementation.
SoundexSimilar | Check whether 2 strings have equal soundex values


StringReplace

Optimized search-and-replace algorithm

Declaration

Source position: strutils.pp line 240

function StringReplace(

  const S: string;

  const OldPattern: string;

  const NewPattern: string;

  Flags: TReplaceFlags;

  Algorithm: TStringReplaceAlgorithm = sraDefault

):string; overload;

function StringReplace(

  const S: UnicodeString;

  const OldPattern: UnicodeString;

  const NewPattern: UnicodeString;

  Flags: TReplaceFlags

):UnicodeString; overload;

function StringReplace(

  const S: WideString;

  const OldPattern: WideString;

  const NewPattern: WideString;

  Flags: TReplaceFlags

):WideString; overload;

Description

StringReplace replaces one or all occurrences of OldPattern with NewPattern in the string S. The behaviour is controlled by Flags and the search mechanism may be optimized usin Algorithm. A list of possible algorithms is specified in TStringReplaceAlgorithm.

For ansistrings, this is an optimized version of the SysUtils.StringReplace algorithm. For widestrings or unicodestrings, the algorithm parameter is ignored and the default mechanism in sysutils is always used.

Errors

None.

See also

SysUtils.StringReplace | Replace occurrences of one substring with another in a string.
TStringReplaceAlgorithm | Algorithm to use in StringReplace


StringsReplace

Replace occurrences of a set of strings to another set of strings

Declaration

Source position: strutils.pp line 104

function StringsReplace(

  const S: string;

  OldPattern: array of string;

  NewPattern: array of string;

  Flags: TReplaceFlags

):string;

Description

StringsReplace scans S for the occurrence of one of the strings in OldPattern and replaces it with the corresponding string in NewPattern. It takes into account Flags, which has the same meaning as in StringReplace.

Corresponding strings are matched by location: the N-th string in OldPattern is replaced by the N-th string in NewPattern. Note that this means that the number of strings in both arrays must be the same.

Errors

If the number of strings in both arrays is different, then an exception is raised.

See also

StringReplace | Replace occurrences of one substring with another in a string.
TReplaceFlags | Flags for StringReplace function


StuffString

Replace part of a string with another string.

Declaration

Source position: strutils.pp line 57

function StuffString(

  const AText: string;

  AStart: Cardinal;

  ALength: Cardinal;

  const ASubText: string

):string;

Arguments

AText | Text on which to operate.
AStart | Start of section to be replaced.
ALength | Length of section to be replaced.
ASubText | Text to insert at the indicated position.

Function result

Resulting string with indicated section replaced.

Description

StuffString returns a copy of AText with the segment starting at AStart with length ALength, replaced with the string ASubText. Basically it deletes the segment of Atext and inserts the new text in it's place.

Errors

No checking on the validity of the AStart and ALength parameters is done. Providing invalid values may result in access violation errors.

See also

FindPart | Search for a substring in a string, using wildcards.
DelChars | Delete all occurrences of a given character from a string.
DelSpace | Delete all occurrences of a space from a string.
ExtractSubStr | Extract a word from a string, starting at a given position in the string.
DupeString | Creates and concatenates N copies of a string


Tab2Space

Convert tab characters to a number of spaces

Declaration

Source position: strutils.pp line 156

function Tab2Space(

  const S: string;

  Numb: Byte

):string;

Arguments

S | String in which to replace tab characters.
Numb | Number of spaces to replace tab characters with.

Function result

Strng with tab characters replaced

Description

Tab2Space returns a copy of S with all tab characters (ASCII character 9) converted to Numb spaces.

Errors

None.

See also

StuffString | Replace part of a string with another string.
FindPart | Search for a substring in a string, using wildcards.
ExtractWord | Extract the N-th word out of a string.
DelChars | Delete all occurrences of a given character from a string.
DelSpace | Delete all occurrences of a space from a string.
DelSpace1 | Reduces sequences of space characters to 1 space character.
DupeString | Creates and concatenates N copies of a string


TrimLeftSet

Remove any leading characters in a set from a string and returns the result

Declaration

Source position: strutils.pp line 220

function TrimLeftSet(

  const S: string;

  const CSet: TSysCharSet

):string;

Description

TrimLeftSet performs the same action as RemoveLeadingChars, but returns the resulting string.

Errors

None.

See also

TrimLeft | Trim whitespace from the beginning of a string.
RemoveLeadingChars | Remove any leading characters in a set from a string
RemoveTrailingChars | Remove any trailing characters in a set from a string
RemovePadChars | Remove any trailing or leading characters in a set from a string
TrimSet | Remove any leading or trailing characters in a set from a string and returns the result
TrimRightSet | Remove any trailing characters in a set from a string and returns the result


TrimRightSet

Remove any trailing characters in a set from a string and returns the result

Declaration

Source position: strutils.pp line 221

function TrimRightSet(

  const S: string;

  const CSet: TSysCharSet

):string;

Description

TrimLeftSet performs the same action as RemoveTrailingChars, but returns the resulting string.

Errors

None.

See also

TrimRight | Trim whitespace from the end of a string.
RemoveLeadingChars | Remove any leading characters in a set from a string
RemoveTrailingChars | Remove any trailing characters in a set from a string
RemovePadChars | Remove any trailing or leading characters in a set from a string
TrimSet | Remove any leading or trailing characters in a set from a string and returns the result
TrimLeftSet | Remove any leading characters in a set from a string and returns the result


TrimSet

Remove any leading or trailing characters in a set from a string and returns the result

Declaration

Source position: strutils.pp line 222

function TrimSet(

  const S: string;

  const CSet: TSysCharSet

):string;

Description

TrimSet performs the same action as RemovePadChars, but returns the resulting string.

Errors

None.

See also

Trim | Trim whitespace from the ends of a string.
RemoveLeadingChars | Remove any leading characters in a set from a string
RemoveTrailingChars | Remove any trailing characters in a set from a string
RemovePadChars | Remove any trailing or leading characters in a set from a string
TrimRightSet | Remove any trailing characters in a set from a string and returns the result
TrimLeftSet | Remove any leading characters in a set from a string and returns the result


TryRomanToInt

Try to convert a roman numeral to an integer value.

Declaration

Source position: strutils.pp line 199

function TryRomanToInt(

  S: string;

  out N: LongInt;

  Strictness: TRomanConversionStrictness = rcsRelaxed

):Boolean;

Description

TryRomanToInt will try to convert the roman numeral in S to an integer and returns the integer value in N. The strictness of the conversion algorithm is determined by Strictness. If the conversion succeeds, then True is returned, or else False.

See also

TRomanConversionStrictness | How to treat invalid roman numerals in TryRomanToInt.
RomanToIntDef | Convert a roman numeral to an integer value
RomanToInt | Convert a string with a Roman number to it's decimal value.
IntToRoman | Represent an integer with roman numerals


WordCount

Count the number of words in a string.

Declaration

Source position: strutils.pp line 172

function WordCount(

  const S: string;

  const WordDelims: TSysCharSet

):SizeInt;

Arguments

S | String to search in.
WordDelims | Characters to be used as word delimiters.

Function result

Number of words in the string.

Description

WordCount returns the number of words in the string S. A word is a non-empty string of characters bounded by one of the characters in WordDelims.

The pre-defined StdWordDelims constant can be used for the WordDelims argument.

Errors

None.

See also

WordPosition | Search position of Nth word in a string.
StdWordDelims | Standard word delimiter values.
ExtractWord | Extract the N-th word out of a string.
ExtractWordPos | Extract a word from a string, and return the position where it was located in the string.


WordPosition

Search position of Nth word in a string.

Declaration

Source position: strutils.pp line 173

function WordPosition(

  const N: Integer;

  const S: string;

  const WordDelims: TSysCharSet

):SizeInt;

Arguments

N | Which word to search for
S | String to search in.
WordDelims | Characters to be used as word delimiters.

Function result

Position of the N-th word, or -1 if there is none.

Description

WordPosition returns the position (in characters) of the N-th word in the string S. A word is a non-empty string of characters bounded by one of the characters in WordDelims. If N is out of range, zero is returned.

The pre-defined StdWordDelims constant can be used for the WordDelims argument.

Errors

None

See also

WordCount | Count the number of words in a string.
StdWordDelims | Standard word delimiter values.
ExtractWord | Extract the N-th word out of a string.
ExtractWordPos | Extract a word from a string, and return the position where it was located in the string.


XorDecode

Decode a string encoded with XorEncode

Declaration

Source position: strutils.pp line 189

function XorDecode(

  const Key: string;

  const Source: string

):string;

Arguments

Key | Key to use when decoding.
Source | String to decode

Function result

Hexadecimal representation of the XOR-encoded string.

Description

XorDecode decodes Source and returns the original string that was encrypted using XorEncode with key Key. If a different key is used than the key used to encode the string, the result will be unreadable.

Errors

If the string Source is not a valid XorEncode result (e.g. contains non-numerical characters), then a EConversionError exception will be raised.

See also

XorEncode | Encode a string by XOR-ing its characters using characters of a given key, representing the result as hex values.
XorString | Encode a string by XOR-ing its characters using characters of a given key.


XorEncode

Encode a string by XOR-ing its characters using characters of a given key, representing the result as hex values.

Declaration

Source position: strutils.pp line 188

function XorEncode(

  const Key: string;

  const Source: string

):string;

Arguments

Key | Key to use when encoding.
Source | String ro encode.

Function result

Original encoded string.

Description

XorEncode encodes the string Source by XOR-ing each character in Source with the corresponding character in Key (repeating Key as often as necessary) and representing the resulting ASCII code as a hexadecimal number (of length 2). The result is therefore twice as long as the original string, and every 2 bytes represent an ASCII code.

Feeding the resulting string with the same key Key to the XorDecode function will result in the original Source string.

This function can be used e.g. to trivially encode a password in a configuration file.

Errors

None.

See also

XorDecode | Decode a string encoded with XorEncode
XorString | Encode a string by XOR-ing its characters using characters of a given key.
Hex2Dec | Converts a hexadecimal string to a decimal value


XorString

Encode a string by XOR-ing its characters using characters of a given key.

Declaration

Source position: strutils.pp line 187

function XorString(

  const Key: ShortString;

  const Src: ShortString

):ShortString;

Arguments

Key | Key to use
Src | String to encode.

Function result

Resulting string

Description

XorString encodes the string Src by XOR-ing each character in Source with the corresponding character in Key, repeating Key as often as necessary. The resulting string may contain unreadable characters and may even contain null characters. For this reason it may be a better idea to use the XorEncode function instead, which will representing each resulting ASCII code as a hexadecimal number (of length 2).

Feeding the result again to XorString with the same Key, will result in the original string Src.

Errors

None.

See also

XorEncode | Encode a string by XOR-ing its characters using characters of a given key, representing the result as hex values.
XorDecode | Decode a string encoded with XorEncode


abs

Calculate absolute value

Declaration

Source position: systemh.inc line 806

function abs(

  l: LongInt

):LongInt;

function abs(

  l: Int64

):Int64;

function abs(

  d: ValReal

):ValReal;

Description

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.

Errors

None.

See also

Round

Round floating point value to nearest integer number.

Example

Program Example1;

{ Program to demonstrate the Abs function. }

Var
  r : real;
  i : integer;

begin
  r:=abs(-1.0);   { r:=1.0 }
  i:=abs(-21);    { i:=21 }
end.


AbstractError

Generate an abstract error.

Declaration

Source position: systemh.inc line 1442

procedure AbstractError;

Description

AbstractError generates an abstract error (run-time error 211). If the AbstractErrorProc constant is set, it will be called instead.

Errors

This routine causes a run-time error 211.

See also

AbstractErrorProc

Custom abstract error handling procedure


AbstractErrorProc

Custom abstract error handling procedure

Declaration

Source position: systemh.inc line 1463

const AbstractErrorProc: TAbstractErrorProc = Nil;

Description

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.

See also

TAbstractErrorProc

Abstract error handler procedural type.


AcquireExceptionObject

Obtain a reference to the current exception object

Declaration

Source position: objpash.inc line 362

function AcquireExceptionObject: Pointer;

Description

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, ReleaseExceptionObject must be called when the reference is no longer needed.

Errors

If there is no current exception, a run-time error 231 will occur.

See also

ReleaseExceptionObject

Decrease the reference count of the current exception object.


add(variant,variant):variant

Implement addition (+) operation on variants.

Declaration

Source position: varianth.inc line 365

operator operator +(

  const op1: variant;

  const op2: variant

):variant;

Description

The implementation of the addition + operation is delegated to the variant manager with operation opadd.

Errors

Execution of this operator may result in an exception if no variant manager is installed or if the types of the operand are not suitable for the operation.

See also

operator -(variant, variant): variant

Implement subtraction (-) operation on variants.


AddExitProc

Add an exit procedure to the exit procedure chain.

Declaration

Source position: systemh.inc line 1410

procedure AddExitProc(

  Proc: TProcedure

);

Description

AddExitProc adds Proc to the exit procedure chain. At program exit, all procedures added in this way will be called in reverse order.

Errors

None.

See also

ExitProc

Exit procedure pointer.


Addr

Return address of a variable

Declaration

Source position: system.fpd line 31

function Addr(

  X: TAnytype

):Pointer;

Description

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

Errors

None

See also

SizeOf

Return size of a variable or type.

Example

Program Example2;

{ Program to demonstrate the Addr function. }

Const Zero : integer = 0;

Var p : pointer;
    i : Integer;

begin
  p:=Addr(p);     { P points to itself }
  p:=Addr(I);     { P points to I }
  p:=Addr(Zero);  { P points to 'Zero' }
end.


Align

Return aligned version of an address

Declaration

Source position: systemh.inc line 790

function Align(

  Addr: PtrUInt;

  Alignment: PtrUInt

):PtrUInt;

function Align(

  Addr: Pointer;

  Alignment: PtrUInt

):Pointer;

Description

Align returns Address, aligned to Alignment bytes.

Errors

None.


AllocMem

Allocate and clear memory.

Declaration

Source position: heaph.inc line 96

function AllocMem(

  Size: PtrUInt

):pointer;

Description

AllocMem calls getmem GetMem, and clears the allocated memory, i.e. the allocated memory is filled with Size zero bytes.

See also

GetMem

Allocate new memory on the heap


AnsiToUtf8

Convert ansi string to UTF-8 string

Declaration

Source position: ustringh.inc line 136

function AnsiToUtf8(

  const s: RawByteString

):RawByteString;

Description

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.

Errors

None.

See also

Utf8toAnsi

Convert a UTF-8 encoded unicode string to an ansistring


Append

Open a file in append mode

Declaration

Source position: systemh.inc line 1248

procedure Append(

  var t: Text

);

Description

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.

Errors

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.

See also

Rewrite | Open file for writing
Close | Close a file
Reset | Open file for reading

Example

Program Example3;

{ Program to demonstrate the Append function. }

Var f : text;

begin
  Assign (f,'test.txt');
  Rewrite (f);            { file is opened for write, and emptied }
  Writeln (F,'This is the first line of text.txt');
  close (f);
  Append(f);              { file is opened for write, but NOT emptied.
                            any text written to it is appended.}
  Writeln (f,'This is the second line of text.txt');
  close (f);
end.


arctan

Calculate inverse tangent

Declaration

Source position: mathh.inc line 93

function arctan(

  d: ValReal

):ValReal;

Description

Arctan returns the Arctangent of X, which can be any Real type. The resulting angle is in radial units.

Errors

None

See also

Sin | Calculate sine of angle
Cos | Calculate cosine of angle

Example

Program Example4;

{ Program to demonstrate the ArcTan function. }

Var R : Real;

begin
  R:=ArcTan(0);      { R:=0 }
  R:=ArcTan(1)/pi;   { R:=0.25 }
end.


ArrayStringToPPchar

Concert an array of string to an array of null-terminated strings

Declaration

Source position: systemh.inc line 1435

function ArrayStringToPPchar(

  const S: array of AnsiString;

  reserveentries: LongInt

):PPChar;

Description

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.

Errors

If not enough memory is available, an error may occur.

See also

StringToPPChar

Split string in list of null-terminated strings


Assert

Check validity of a given condition.

Declaration

Source position: system.fpd line 32

procedure Assert(

  Expr: Boolean

);

procedure Assert(

  Expr: Boolean;

  const Msg: string

);

Description

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.

Errors

None.

See also

Halt | Stop program execution.
Runerror | Generate a run-time error.


AssertErrorProc

Custom assert error handling procedure

Declaration

Source position: systemh.inc line 1464

const AssertErrorProc: TAssertErrorProc = @ SysAssert;

Description

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.


Assign

Assign a name to a file

Declaration

Source position: systemh.inc line 1168

procedure Assign(

  out f: file;

  const Name: ShortString

);

procedure Assign(

  out f: file;

  const p: PAnsiChar

);

procedure Assign(

  out f: file;

  const c: AnsiChar

);

procedure Assign(

  out f: file;

  const Name: UnicodeString

);

procedure Assign(

  out f: file;

  const Name: RawByteString

);

procedure Assign(

  out f: TypedFile;

  const Name: shortstring

);

procedure Assign(

  out f: TypedFile;

  const p: PAnsiChar

);

procedure Assign(

  out f: TypedFile;

  const c: AnsiChar

);

procedure Assign(

  out f: TypedFile;

  const Name: unicodestring

);

procedure Assign(

  out f: TypedFile;

  const Name: RawByteString

);

procedure Assign(

  out t: Text;

  const s: shortstring

);

procedure Assign(

  out t: Text;

  const p: PAnsiChar

);

procedure Assign(

  out t: Text;

  const c: AnsiChar

);

procedure Assign(

  out t: Text;

  const s: unicodestring

);

procedure Assign(

  out t: Text;

  const s: RawByteString

);

Description

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.

Note that the filename (including path) can be only 255 characters long.

Errors

None.

See also

Reset | Open file for reading
Rewrite | Open file for writing
Append | Open a file in append mode

Example

Program Example5;

{ Program to demonstrate the Assign function. }

Var F : text;

begin
  Assign (F,'');
  Rewrite (f);
  { The following can be put in any file by redirecting it
    from the command line.}
  Writeln (f,'This goes to standard output !');
  Close (f);
  Assign (F,'Test.txt');
  rewrite (f);
  writeln (f,'This doesn''t go to standard output !');
  close (f);
end.


assign(ansistring):olevariant

Declaration

Source position: varianth.inc line 465

operator operator :=(

  const source: ansistring

):olevariant;


assign(ansistring):variant

Declaration

Source position: varianth.inc line 259

operator operator :=(

  const source: ansistring

):variant;


assign(Boolean):olevariant

Declaration

Source position: varianth.inc line 455

operator operator :=(

  const source: Boolean

):olevariant;


assign(Boolean):variant

Declaration

Source position: varianth.inc line 249

operator operator :=(

  const source: Boolean

):variant;


assign(Byte):olevariant

Declaration

Source position: varianth.inc line 445

operator operator :=(

  const source: Byte

):olevariant;


assign(Byte):variant

Declaration

Source position: varianth.inc line 239

operator operator :=(

  const source: Byte

):variant;


assign(Char):olevariant

Declaration

Source position: varianth.inc line 460

operator operator :=(

  const source: Char

):olevariant;


assign(Char):variant

Declaration

Source position: varianth.inc line 254

operator operator :=(

  const source: Char

):variant;


assign(comp):olevariant

Assign a comp-precision float to an ole-variant

Declaration

Source position: varianth.inc line 482

operator operator :=(

  const source: comp

):olevariant;


assign(comp):variant

Assign a comp-precision float to a variant

Declaration

Source position: varianth.inc line 278

operator operator :=(

  const source: comp

):variant;

Description

The resulting variant is a double-precision value.


assign(currency):olevariant

Declaration

Source position: varianth.inc line 489

operator operator :=(

  const source: currency

):olevariant;


assign(currency):variant

Declaration

Source position: varianth.inc line 285

operator operator :=(

  const source: currency

):variant;


assign(Double):olevariant

Declaration

Source position: varianth.inc line 476

operator operator :=(

  const source: Double

):olevariant;


assign(Double):variant

Declaration

Source position: varianth.inc line 272

operator operator :=(

  const source: Double

):variant;


assign(DWord):olevariant

Declaration

Source position: varianth.inc line 449

operator operator :=(

  const source: DWord

):olevariant;


assign(DWord):variant

Declaration

Source position: varianth.inc line 243

operator operator :=(

  const source: DWord

):variant;


assign(extended):olevariant

Assign an extended-precision float to an ole-variant

Declaration

Source position: varianth.inc line 479

operator operator :=(

  const source: extended

):olevariant;


assign(extended):variant

Assign an extended-precision float to a variant

Declaration

Source position: varianth.inc line 275

operator operator :=(

  const source: extended

):variant;

Description

The resulting variant is a double-precision value


assign(Int64):olevariant

Declaration

Source position: varianth.inc line 452

operator operator :=(

  const source: Int64

):olevariant;


assign(Int64):variant

Declaration

Source position: varianth.inc line 246

operator operator :=(

  const source: Int64

):variant;


assign(longbool):olevariant

Declaration

Source position: varianth.inc line 457

operator operator :=(

  const source: longbool

):olevariant;


assign(longbool):variant

Declaration

Source position: varianth.inc line 251

operator operator :=(

  const source: longbool

):variant;


assign(LongInt):olevariant

Declaration

Source position: varianth.inc line 450

operator operator :=(

  const source: LongInt

):olevariant;


assign(LongInt):variant

Declaration

Source position: varianth.inc line 244

operator operator :=(

  const source: LongInt

):variant;


assign(olevariant):ansistring

Declaration

Source position: varianth.inc line 410

operator operator :=(

  const source: olevariant

):ansistring;


assign(olevariant):Boolean

Declaration

Source position: varianth.inc line 400

operator operator :=(

  const source: olevariant

):Boolean;


assign(olevariant):Byte

Declaration

Source position: varianth.inc line 390

operator operator :=(

  const source: olevariant

):Byte;


assign(olevariant):Char

Declaration

Source position: varianth.inc line 405

operator operator :=(

  const source: olevariant

):Char;


assign(olevariant):comp

Assign an ole- variant to a comp-precision float

Declaration

Source position: varianth.inc line 427

operator operator :=(

  const source: olevariant

):comp;


assign(olevariant):currency

Declaration

Source position: varianth.inc line 434

operator operator :=(

  const source: olevariant

):currency;


assign(olevariant):Double

Declaration

Source position: varianth.inc line 421

operator operator :=(

  const source: olevariant

):Double;


assign(olevariant):DWord

Declaration

Source position: varianth.inc line 394

operator operator :=(

  const source: olevariant

):DWord;


assign(olevariant):QWord

Declaration

Source position: varianth.inc line 396

operator operator :=(

  const source: olevariant

):QWord;


assign(olevariant):extended

Assign an ole- variant to an extended-precision float

Declaration

Source position: varianth.inc line 424

operator operator :=(

  const source: olevariant

):extended;


assign(olevariant):Int64

Declaration

Source position: varianth.inc line 397

operator operator :=(

  const source: olevariant

):Int64;


assign(olevariant):longbool

Declaration

Source position: varianth.inc line 402

operator operator :=(

  const source: olevariant

):longbool;


assign(olevariant):LongInt

Declaration

Source position: varianth.inc line 395

operator operator :=(

  const source: olevariant

):LongInt;


assign(olevariant):Real

Assign an ole- variant to a real-precision float

Declaration

Source position: varianth.inc line 430

operator operator :=(

  const source: olevariant

):Real;


assign(olevariant):ShortInt

Declaration

Source position: varianth.inc line 391

operator operator :=(

  const source: olevariant

):ShortInt;


assign(olevariant):shortstring

Declaration

Source position: varianth.inc line 409

operator operator :=(

  const source: olevariant

):shortstring;


assign(olevariant):single

Assign an ole- variant to a single-precision float

Declaration

Source position: varianth.inc line 418

operator operator :=(

  const source: olevariant

):single;


assign(olevariant):SmallInt

Declaration

Source position: varianth.inc line 393

operator operator :=(

  const source: olevariant

):SmallInt;


assign(olevariant):TDateTime

Declaration

Source position: varianth.inc line 436

operator operator :=(

  const source: olevariant

):TDateTime;


assign(olevariant):TError

Declaration

Source position: varianth.inc line 438

operator operator :=(

  const source: olevariant

):TError;


assign(olevariant):UnicodeString

Assign an ole-variant to a unicode string

Declaration

Source position: varianth.inc line 413

operator operator :=(

  const source: olevariant

):UnicodeString;


assign(olevariant):variant

Declaration

Source position: varianth.inc line 343

operator operator :=(

  const source: olevariant

):variant;


assign(olevariant):WideChar

Declaration

Source position: varianth.inc line 406

operator operator :=(

  const source: olevariant

):WideChar;


assign(olevariant):widestring

Declaration

Source position: varianth.inc line 411

operator operator :=(

  const source: olevariant

):widestring;


assign(olevariant):Word

Declaration

Source position: varianth.inc line 392

operator operator :=(

  const source: olevariant

):Word;


assign(olevariant):wordbool

Declaration

Source position: varianth.inc line 401

operator operator :=(

  const source: olevariant

):wordbool;


assign(QWord):olevariant

Declaration

Source position: varianth.inc line 451

operator operator :=(

  const source: QWord

):olevariant;


assign(QWord):variant

Declaration

Source position: varianth.inc line 245

operator operator :=(

  const source: QWord

):variant;


assign(Real):olevariant

Assign a real-precision float to an ole-variant

Declaration

Source position: varianth.inc line 485

operator operator :=(

  const source: Real

):olevariant;


assign(Real):variant

Assign a real-precision float to a variant

Declaration

Source position: varianth.inc line 281

operator operator :=(

  const source: Real

):variant;

Description

The resulting variant is a double-precision value.


assign(real48):Double

Declaration

Source position: mathh.inc line 112

operator operator :=(

  b: real48

):Double;


assign(real48):extended

Declaration

Source position: mathh.inc line 115

operator operator :=(

  b: real48

):extended;


assign(ShortInt):olevariant

Declaration

Source position: varianth.inc line 446

operator operator :=(

  const source: ShortInt

):olevariant;


assign(ShortInt):variant

Declaration

Source position: varianth.inc line 240

operator operator :=(

  const source: ShortInt

):variant;


assign(shortstring):olevariant

Declaration

Source position: varianth.inc line 464

operator operator :=(

  const source: shortstring

):olevariant;


assign(shortstring):variant

Declaration

Source position: varianth.inc line 258

operator operator :=(

  const source: shortstring

):variant;


assign(single):olevariant

Assign a single-precision float to an ole-variant

Declaration

Source position: varianth.inc line 473

operator operator :=(

  const source: single

):olevariant;


assign(single):variant

Assign a single-precision float to a variant

Declaration

Source position: varianth.inc line 269

operator operator :=(

  const source: single

):variant;

Description

The resulting variant is a double-precision value


assign(SmallInt):olevariant

Declaration

Source position: varianth.inc line 448

operator operator :=(

  const source: SmallInt

):olevariant;


assign(SmallInt):variant

Declaration

Source position: varianth.inc line 242

operator operator :=(

  const source: SmallInt

):variant;


assign(TDateTime):olevariant

Declaration

Source position: varianth.inc line 491

operator operator :=(

  const source: TDateTime

):olevariant;


assign(TDateTime):variant

Declaration

Source position: varianth.inc line 287

operator operator :=(

  const source: TDateTime

):variant;


assign(TError):olevariant

Declaration

Source position: varianth.inc line 493

operator operator :=(

  const source: TError

):olevariant;


assign(TError):variant

Declaration

Source position: varianth.inc line 289

operator operator :=(

  const source: TError

):variant;


assign(UCS4String):variant

Assign UCS4String to a variant, performing the necessary conversions

Declaration

Source position: varianth.inc line 262

operator operator :=(

  const source: UCS4String

):variant;

Description

The resulting variant is a widestring.


assign(UnicodeString):olevariant

Assign a unicodestring to an ole-variant

Declaration

Source position: varianth.inc line 468

operator operator :=(

  const source: UnicodeString

):olevariant;


assign(UnicodeString):variant

Assign UnicodeString to a variant, performing the necessary conversions

Declaration

Source position: varianth.inc line 264

operator operator :=(

  const source: UnicodeString

):variant;

Description

The resulting variant is a widestring.


assign(UTF8String):variant

Assign an UTF-8 string to a variant, performing the necessary conversions

Declaration

Source position: varianth.inc line 261

operator operator :=(

  const source: UTF8String

):variant;

Description

The resulting variant is a widestring.


assign(variant):ansistring

Declaration

Source position: varianth.inc line 316

operator operator :=(

  const source: variant

):ansistring;


assign(variant):Boolean

Declaration

Source position: varianth.inc line 306

operator operator :=(

  const source: variant

):Boolean;


assign(variant):Byte

Declaration

Source position: varianth.inc line 296

operator operator :=(

  const source: variant

):Byte;


assign(variant):Char

Declaration

Source position: varianth.inc line 311

operator operator :=(

  const source: variant

):Char;


assign(variant):comp

Assign a variant to a comp-precision float

Declaration

Source position: varianth.inc line 335

operator operator :=(

  const source: variant

):comp;


assign(variant):currency

Declaration

Source position: varianth.inc line 349

operator operator :=(

  const source: variant

):currency;


assign(variant):Double

Declaration

Source position: varianth.inc line 329

operator operator :=(

  const source: variant

):Double;


assign(variant):DWord

Declaration

Source position: varianth.inc line 300

operator operator :=(

  const source: variant

):DWord;


assign(variant):QWord

Declaration

Source position: varianth.inc line 302

operator operator :=(

  const source: variant

):QWord;


assign(variant):extended

Assign a variant to a extended-precision float

Declaration

Source position: varianth.inc line 332

operator operator :=(

  const source: variant

):extended;


assign(variant):Int64

Declaration

Source position: varianth.inc line 303

operator operator :=(

  const source: variant

):Int64;


assign(variant):longbool

Declaration

Source position: varianth.inc line 308

operator operator :=(

  const source: variant

):longbool;


assign(variant):LongInt

Declaration

Source position: varianth.inc line 301

operator operator :=(

  const source: variant

):LongInt;


assign(variant):olevariant

Declaration

Source position: varianth.inc line 346

operator operator :=(

  const source: variant

):olevariant;


assign(variant):Real

Assign a variant to a real-precision float

Declaration

Source position: varianth.inc line 338

operator operator :=(

  const source: variant

):Real;


assign(variant):ShortInt

Declaration

Source position: varianth.inc line 297

operator operator :=(

  const source: variant

):ShortInt;


assign(variant):shortstring

Declaration

Source position: varianth.inc line 315

operator operator :=(

  const source: variant

):shortstring;


assign(variant):single

Assign a variant to a single-precision float

Declaration

Source position: varianth.inc line 326

operator operator :=(

  const source: variant

):single;


assign(variant):SmallInt

Declaration

Source position: varianth.inc line 299

operator operator :=(

  const source: variant

):SmallInt;


assign(variant):TDateTime

Declaration

Source position: varianth.inc line 351

operator operator :=(

  const source: variant

):TDateTime;


assign(variant):TError

Declaration

Source position: varianth.inc line 353

operator operator :=(

  const source: variant

):TError;


assign(variant):unicodestring

Assign a variant to a unicodestring

Declaration

Source position: varianth.inc line 321

operator operator :=(

  const source: variant

):unicodestring;


assign(variant):UTF8String

Assign a variant to an UTF8String

Declaration

Source position: varianth.inc line 318

operator operator :=(

  const source: variant

):UTF8String;


assign(variant):WideChar

Declaration

Source position: varianth.inc line 312

operator operator :=(

  const source: variant

):WideChar;


assign(variant):widestring

Declaration

Source position: varianth.inc line 317

operator operator :=(

  const source: variant

):widestring;


assign(variant):Word

Declaration

Source position: varianth.inc line 298

operator operator :=(

  const source: variant

):Word;


assign(variant):wordbool

Declaration

Source position: varianth.inc line 307

operator operator :=(

  const source: variant

):wordbool;


assign(WideChar):olevariant

Declaration

Source position: varianth.inc line 461

operator operator :=(

  const source: WideChar

):olevariant;


assign(WideChar):variant

Declaration

Source position: varianth.inc line 255

operator operator :=(

  const source: WideChar

):variant;


assign(widestring):olevariant

Declaration

Source position: varianth.inc line 466

operator operator :=(

  const source: widestring

):olevariant;


assign(widestring):variant

Declaration

Source position: varianth.inc line 260

operator operator :=(

  const source: widestring

):variant;


assign(Word):olevariant

Declaration

Source position: varianth.inc line 447

operator operator :=(

  const source: Word

):olevariant;


assign(Word):variant

Declaration

Source position: varianth.inc line 241

operator operator :=(

  const source: Word

):variant;


assign(wordbool):olevariant

Declaration

Source position: varianth.inc line 456

operator operator :=(

  const source: wordbool

):olevariant;


assign(wordbool):variant

Declaration

Source position: varianth.inc line 250

operator operator :=(

  const source: wordbool

):variant;


Assigned

Check if a pointer is valid

Declaration

Source position: system.fpd line 34

function Assigned(

  P: Pointer

):Boolean;

Description

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.

Errors

None

See also

New

Dynamically allocate memory for variable

Example

Program Example96;

{ Program to demonstrate the Assigned function. }

Var P : Pointer;

begin
  If Not Assigned(P) then
    Writeln ('Pointer is initially NIL');
  P:=@P;
  If Not Assigned(P) then
    Writeln('Internal inconsistency')
  else
    Writeln('All is well in FPC')
end.


BasicEventCreate

Obsolete. Don't use

Declaration

Source position: threadh.inc line 165

function BasicEventCreate(

  EventAttributes: Pointer;

  AManualReset: Boolean;

  InitialState: Boolean;

  const Name: ansistring

):PEventState;

Description

BasicEventCreate is obsolete, use RTLEventCreate instead.

See also

RTLEventCreate

Create a new RTL event


basiceventdestroy

Obsolete. Don't use

Declaration

Source position: threadh.inc line 166

procedure basiceventdestroy(

  state: PEventState

);

Description

basiceventdestroy is obsolete. Use RTLEventDestroy instead.

See also

RTLEventDestroy

Destroy a RTL Event


basiceventResetEvent

Obsolete. Don't use

Declaration

Source position: threadh.inc line 167

procedure basiceventResetEvent(

  state: PEventState

);

Description

basiceventResetEvent is obsolete. Use RTLEventResetEvent instead.

See also

RTLEventResetEvent

Reset an event


basiceventSetEvent

Obsolete. Don't use

Declaration

Source position: threadh.inc line 168

procedure basiceventSetEvent(

  state: PEventState

);

Description

basiceventSetEvent is obsolete. Use RTLEventSetEvent instead.

See also

RTLEventSetEvent

Notify threads of the event.


basiceventWaitFor

Obsolete. Don't use

Declaration

Source position: threadh.inc line 169

function basiceventWaitFor(

  Timeout: Cardinal;

  state: PEventState

):LongInt;

Description

basiceventwaitfor is obsolete. Use RTLEventWaitFor instead.

See also

RTLEventWaitFor

Wait for an event.


BeginThread

Start a new thread.

Declaration

Source position: threadh.inc line 129

function BeginThread(

  sa: Pointer;

  stacksize: SizeUInt;

  ThreadFunction: TThreadFunc;

  p: pointer;

  creationFlags: DWord;

  var ThreadId: TThreadID

):TThreadID;

function BeginThread(

  ThreadFunction: TThreadFunc

):TThreadID;

function BeginThread(

  ThreadFunction: TThreadFunc;

  p: pointer

):TThreadID;

function BeginThread(

  ThreadFunction: TThreadFunc;

  p: pointer;

  var ThreadId: TThreadID

):TThreadID;

function BeginThread(

  ThreadFunction: TThreadFunc;

  p: pointer;

  var ThreadId: TThreadID;

  const stacksize: SizeUInt

):TThreadID;

Description

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 4MiB is used.

The function returns the thread handle (or ID, on some other operating systems like Linux or OS/2) on success, or 0 if an error occurred. Note that the thread ID and handle are the same on Unix processes, and that the thread ID and thread handle are different on windows systems.

Errors

On error, the value "0" is returned.

See also

EndThread

End the current thread.


BEtoN

Convert Big Endian-ordered integer to Native-ordered integer

Declaration

Source position: systemh.inc line 829

function BEtoN(

  const AValue: SmallInt

):SmallInt;

function BEtoN(

  const AValue: Word

):Word;

function BEtoN(

  const AValue: LongInt

):LongInt;

function BEtoN(

  const AValue: DWord

):DWord;

function BEtoN(

  const AValue: Int64

):Int64;

function BEtoN(

  const AValue: QWord

):QWord;

Description

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.

See also

LEtoN | Convert Little Endian-ordered integer to Native-ordered integer
NtoBE | Convert Native-ordered integer to a Big Endian-ordered integer
NtoLE | Convert Native-ordered integer to a Little Endian-ordered integer


binStr

Convert integer to string with binary representation.

Declaration

Source position: systemh.inc line 1105

function binStr(

  Val: LongInt;

  cnt: Byte

):shortstring;

function binStr(

  Val: Int64;

  cnt: Byte

):shortstring;

function binStr(

  Val: QWord;

  cnt: Byte

):shortstring;

Description

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

Errors

None.

See also

Str | Convert a numerical or enumeration value to a string.
Val | Calculate numerical/enumerated value of a string.
HexStr | Convert integer value to string with hexadecimal representation.
OctStr | Convert integer to a string with octal representation.

Example

Program example82;

{ Program to demonstrate the BinStr function }

Const Value = 45678;

Var I : longint;

begin
  For I:=8 to 20 do
    Writeln (BinStr(Value,I):20);
end.


BlockRead

Read data from an untyped file into memory

Declaration

Source position: systemh.inc line 1193

procedure BlockRead(

  var f: file;

  var Buf;

  count: Int64;

  var Result: Int64

);

procedure BlockRead(

  var f: file;

  var Buf;

  count: LongInt;

  var Result: LongInt

);

procedure BlockRead(

  var f: file;

  var Buf;

  count: Cardinal;

  var Result: Cardinal

);

procedure BlockRead(

  var f: file;

  var Buf;

  count: Word;

  var Result: Word

);

procedure BlockRead(

  var f: file;

  var Buf;

  count: Word;

  var Result: Integer

);

procedure BlockRead(

  var f: file;

  var Buf;

  count: Int64

);

Description

Blockread reads count or less records from file F. A record is a block of bytes with size specified by the Rewrite or Reset 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.

Errors

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.

See also

Blockwrite | Write data from memory to an untyped file
Close | Close a file
Reset | Open file for reading
Assign | Assign a name to a file

Example

Program Example6;

{ Program to demonstrate the BlockRead and BlockWrite functions. }

Var Fin, fout : File;
    NumRead,NumWritten : Word;
    Buf : Array[1..2048] of byte;
    Total : Longint;

begin
  Assign (Fin, Paramstr(1));
  Assign (Fout,Paramstr(2));
  Reset (Fin,1);
  Rewrite (Fout,1);
  Total:=0;
  Repeat
    BlockRead (Fin,buf,Sizeof(buf),NumRead);
    BlockWrite (Fout,Buf,NumRead,NumWritten);
    inc(Total,NumWritten);
  Until (NumRead=0) or (NumWritten<>NumRead);
  Write ('Copied ',Total,' bytes from file ',paramstr(1));
  Writeln (' to file ',paramstr(2));
  close(fin);
  close(fout);
end.


BlockWrite

Write data from memory to an untyped file

Declaration

Source position: systemh.inc line 1187

procedure BlockWrite(

  var f: file;

  const Buf;

  Count: Int64;

  var Result: Int64

);

procedure BlockWrite(

  var f: file;

  const Buf;

  Count: LongInt;

  var Result: LongInt

);

procedure BlockWrite(

  var f: file;

  const Buf;

  Count: Cardinal;

  var Result: Cardinal

);

procedure BlockWrite(

  var f: file;

  const Buf;

  Count: Word;

  var Result: Word

);

procedure BlockWrite(

  var f: file;

  const Buf;

  Count: Word;

  var Result: Integer

);

procedure BlockWrite(

  var f: file;

  const Buf;

  Count: LongInt

);

Description

BlockWrite writes count records from buffer to the file F.A record is a block of bytes with size specified by the Rewrite or Reset 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.

Errors

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.

See also

Blockread | Read data from an untyped file into memory
Close | Close a file
Rewrite | Open file for writing
Assign | Assign a name to a file


Break

Exit current loop construct.

Declaration

Source position: system.fpd line 35

procedure Break;

Description

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 although Break is a compiler intrinsic (i.e. is treated specially) it is defined as a procedure in the system unit, and hence can be redefined.

Errors

None.

See also

Continue | Continue with next loop cycle.
Exit | Exit current subroutine.

Example

Program Example87;

{ Program to demonstrate the Break function. }

Var I : longint;

begin
  I:=0;
  While I<10 Do
    begin
    Inc(I);
    If I>5 Then
      Break;
    Writeln (i);
    end;
  I:=0;
  Repeat
    Inc(I);
    If I>5 Then
      Break;
    Writeln (i);
  Until I>=10;
  For I:=1 to 10 do
    begin
    If I>5 Then
      Break;
    Writeln (i);
    end;
end.

Example

{
  Example 121:
  Continue, break and exit are system procedures.
  They can be redefined
}

procedure continue;

begin
  Writeln('Continue');
end;

Procedure Exit;

begin
  Writeln('exit');
end;

Procedure Break;

begin
  Writeln('Break');
end;

begin
  Repeat
    Continue;
    Break;
    exit;
  Until True;
end.


BsfByte

Return the position of the rightmost set bit in an 8-bit value

Declaration

Source position: systemh.inc line 1004

function BsfByte(

  const AValue: Byte

):Byte;

Description

BsfByte scans the byte AValue, starting at position 0 (rightmost position) and returns the index of the first set bit. The position is measured from the 0-th, rightmost bit.

When the input is 0, the result is 255 (unsigned equivalent of -1).

See also

BsrByte | Return the position of the leftmost set bit in an 8-bit value
BsfWord | Return the position of the rightmost set bit in a 16-bit value
BsfDWord | Return the position of the rightmost set bit in a 32-bit value
BsfQWord | Return the position of the rightmost set bit in a 64-bit value


BsfDWord

Return the position of the rightmost set bit in a 32-bit value

Declaration

Source position: systemh.inc line 1026

function BsfDWord(

  const AValue: DWord

):Cardinal;

Description

BsfDWord scans the DWord AValue, starting at position 0 (rightmost position) , and returns the index of the first set bit. The position is measured from the 0-th, rightmost bit.

When the input is 0, the result is 255 (unsigned equivalent of -1).

See also

BsfByte | Return the position of the rightmost set bit in an 8-bit value
BsfWord | Return the position of the rightmost set bit in a 16-bit value
BsrDWord | Return the position of the leftmost set bit in a 32-bit value
BsfQWord | Return the position of the rightmost set bit in a 64-bit value


BsfQWord

Return the position of the rightmost set bit in a 64-bit value

Declaration

Source position: systemh.inc line 1037

function BsfQWord(

  const AValue: QWord

):Cardinal;

Description

BsfQWord scans the QWord AValue, starting at position 0 (rightmost position) , and returns the index of the first set bit. The position is measured from the 0-th, rightmost bit.

When the input is 0, the result is 255 (unsigned equivalent of -1).

See also

BsfByte | Return the position of the rightmost set bit in an 8-bit value
BsfWord | Return the position of the rightmost set bit in a 16-bit value
BsfDWord | Return the position of the rightmost set bit in a 32-bit value
BsrQWord | Return the position of the leftmost set bit in a 64-bit value


BsfWord

Return the position of the rightmost set bit in a 16-bit value

Declaration

Source position: systemh.inc line 1015

function BsfWord(

  const AValue: Word

):Cardinal;

Description

BsfWord scans the word AValue, starting at position 0 (rightmost position) , and returns the index of the first set bit. The position is measured from the 0-th, rightmost bit.

When the input is 0, the result is 255 (unsigned equivalent of -1).

See also

BsfByte | Return the position of the rightmost set bit in an 8-bit value
BsrWord | Return the position of the leftmost set bit in a 16-bit value
BsfDWord | Return the position of the rightmost set bit in a 32-bit value
BsfQWord | Return the position of the rightmost set bit in a 64-bit value


BsrByte

Return the position of the leftmost set bit in an 8-bit value

Declaration

Source position: systemh.inc line 1009

function BsrByte(

  const AValue: Byte

):Byte;

Description

BsfByte scans the byte AValue, starting at the leftmost position and working towards position 0, and returns the index of the first set bit. The position is measured from the 0-th, rightmost bit.

When the input is 0, the result is 255 (unsigned equivalent of -1).

See also

BsfByte | Return the position of the rightmost set bit in an 8-bit value
BsrWord | Return the position of the leftmost set bit in a 16-bit value
BsrDWord | Return the position of the leftmost set bit in a 32-bit value
BsrQWord | Return the position of the leftmost set bit in a 64-bit value


BsrDWord

Return the position of the leftmost set bit in a 32-bit value

Declaration

Source position: systemh.inc line 1031

function BsrDWord(

  const AValue: DWord

):Cardinal;

Description

BsrDWord scans the DWord AValue, starting at the leftmost position and working towards position 0, and returns the index of the first set bit. The position is measured from the 0-th, rightmost bit.

When the input is 0, the result is 255 (unsigned equivalent of -1).

See also

BsrByte | Return the position of the leftmost set bit in an 8-bit value
BsrWord | Return the position of the leftmost set bit in a 16-bit value
BsfDWord | Return the position of the rightmost set bit in a 32-bit value
BsrQWord | Return the position of the leftmost set bit in a 64-bit value


BsrQWord

Return the position of the leftmost set bit in a 64-bit value

Declaration

Source position: systemh.inc line 1042

function BsrQWord(

  const AValue: QWord

):Cardinal;

Description

BsfQWord scans the QWord AValue, starting at the leftmost position and working towards position 0, and returns the index of the first set bit. The position is measured from the 0-th, rightmost bit.

When the input is 0, the result is 255 (unsigned equivalent of -1).

See also

BsfByte | Return the position of the rightmost set bit in an 8-bit value
BsfWord | Return the position of the rightmost set bit in a 16-bit value
BsfDWord | Return the position of the rightmost set bit in a 32-bit value
BsrQWord | Return the position of the leftmost set bit in a 64-bit value


BsrWord

Return the position of the leftmost set bit in a 16-bit value

Declaration

Source position: systemh.inc line 1020

function BsrWord(

  const AValue: Word

):Cardinal;

Description

BsrWord scans the word AValue, starting at the leftmost position and working towards position 0, and returns the index of the first set bit. The position is measured from the 0-th, rightmost bit.

When the input is 0, the result is 255 (unsigned equivalent of -1).

See also

BsrByte | Return the position of the leftmost set bit in an 8-bit value
BsfWord | Return the position of the rightmost set bit in a 16-bit value
BsrDWord | Return the position of the leftmost set bit in a 32-bit value
BsrQWord | Return the position of the leftmost set bit in a 64-bit value


CaptureBacktrace

Return stack trace

Declaration

Source position: systemh.inc line 1314

function CaptureBacktrace(

  skipframes: SizeInt;

  count: SizeInt;

  frames: PCodePointer

):SizeInt;

Description

CaptureBacktrace will fill the array pointed to by frames with the addresses of a backtrace. It will skip skipframes frames, and will write at most count addresses. Frames must point to enough memory to hold the stacktrace, which is count*sizeof(codepointer) bytes.

See also

Get_pc_addr | Get Program Counter address
get_caller_stackinfo | Return caller stack infomation
get_caller_addr | Return the address of the caller.
get_caller_frame | Return the frame pointer of the caller


chdir

Change current working directory.

Declaration

Source position: systemh.inc line 1271

procedure chdir(

  const s: shortstring

); overload;

procedure chdir(

  const s: RawByteString

); overload;

procedure chdir(

  const s: unicodestring

); overload;

Description

Chdir changes the working directory of the process to S.

Errors

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.

See also

Mkdir | Create a new directory.
Rmdir | Remove directory when empty.

Example

Program Example7;

{ Program to demonstrate the ChDir function. }

begin
  {$I-}
  ChDir (ParamStr(1));
  if IOresult<>0 then
    Writeln ('Cannot change to directory : ',paramstr (1));
end.


chr

Convert byte value to character value

Declaration

Source position: systemh.inc line 1121

function chr(

  b: Byte

):Char;

Description

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.

Errors

None.

See also

Ord | Return ordinal value of an ordinal type.
Str | Convert a numerical or enumeration value to a string.

Example

Program Example8;

{ Program to demonstrate the Chr function. }

begin
  Write (chr(10),chr(13)); { The same effect as Writeln; }
end.


Close

Close a file

Declaration

Source position: systemh.inc line 1186

procedure Close(

  var f: file

);

procedure Close(

  var t: Text

);

Description

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 Reset or Rewrite is sufficient.

Errors

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.

See also

Assign | Assign a name to a file
Reset | Open file for reading
Rewrite | Open file for writing
Flush | Write file buffers to disk

Example

Program Example9;

{ Program to demonstrate the Close function. }

Var F : text;

begin
 Assign (f,'Test.txt');
 ReWrite (F);
 Writeln (F,'Some text written to Test.txt');
 close (f); { Flushes contents of buffer to disk,
              closes the file. Omitting this may
              cause data NOT to be written to disk.}
end.


CloseThread

Close a thread and free up resources used by the thread

Declaration

Source position: threadh.inc line 148

function CloseThread(

  threadHandle: TThreadID

):DWord;

Description

CloseThread must be called on any thread started with BeginThread. It must be called after the thread has ended (either by exiting the thread function or after calling EndThread).

Errors

If no threadmanager is installed, an exception may be raised or runtime error 232 may occur if no exceptions are used.

See also

BeginThread | Start a new thread.
EndThread | End the current thread.


CompareByte

Compare 2 memory buffers byte per byte

Declaration

Source position: systemh.inc line 751

function CompareByte(

  const buf1;

  const buf2;

  len: SizeInt

):SizeInt;

Description

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.

Errors

None.

See also

CompareChar | ompare 2 memory buffers character per character
CompareChar0 | Compare two buffers character by character till a null-character is reached.
CompareWord | Compare 2 memory buffers word per word
CompareDWord | Compare 2 memory buffers DWord per DWord

Example

Program Example99;

{ Program to demonstrate the CompareByte function. }

Const
  ArraySize     = 100;
  HalfArraySize = ArraySize Div 2;

Var
  Buf1,Buf2 : Array[1..ArraySize] of byte;
  I : longint;

  Procedure CheckPos(Len : Longint);

  Begin
    Write('First ',Len,' positions are ');
    if CompareByte(Buf1,Buf2,Len)<>0 then
      Write('NOT ');
    Writeln('equal');
  end;

begin
  For I:=1 to ArraySize do
    begin
    Buf1[i]:=I;
    If I<=HalfArraySize Then
      Buf2[I]:=I
    else
      Buf2[i]:=HalfArraySize-I;
    end;
  CheckPos(HalfArraySize div 2);
  CheckPos(HalfArraySize);
  CheckPos(HalfArraySize+1);
  CheckPos(HalfArraySize + HalfArraySize Div 2);
end.


CompareChar

ompare 2 memory buffers character per character

Declaration

Source position: systemh.inc line 750

function CompareChar(

  const buf1;

  const buf2;

  len: SizeInt

):SizeInt;

Description

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.

Errors

None.

See also

CompareByte | Compare 2 memory buffers byte per byte
CompareChar0 | Compare two buffers character by character till a null-character is reached.
CompareWord | Compare 2 memory buffers word per word
CompareDWord | Compare 2 memory buffers DWord per DWord

Example

Program Example100;

{ Program to demonstrate the CompareChar function. }

Const
  ArraySize     = 100;
  HalfArraySize = ArraySize Div 2;

Var
  Buf1,Buf2 : Array[1..ArraySize] of char;
  I : longint;

  Procedure CheckPos(Len : Longint);

  Begin
    Write('First ',Len,' characters are ');
    if CompareChar(Buf1,Buf2,Len)<>0 then
      Write('NOT ');
    Writeln('equal');
  end;

  Procedure CheckNullPos(Len : Longint);

  Begin
    Write('First ',Len,' non-null characters are ');
    if CompareChar0(Buf1,Buf2,Len)<>0 then
      Write('NOT ');
    Writeln('equal');
  end;

begin
  For I:=1 to ArraySize do
    begin
    Buf1[i]:=chr(I);
    If I<=HalfArraySize Then
      Buf2[I]:=chr(I)
    else
      Buf2[i]:=chr(HalfArraySize-I);
    end;
  CheckPos(HalfArraySize div 2);
  CheckPos(HalfArraySize);
  CheckPos(HalfArraySize+1);
  CheckPos(HalfArraySize + HalfArraySize Div 2);
  For I:=1 to 4 do
    begin
    buf1[Random(ArraySize)+1]:=Chr(0);
    buf2[Random(ArraySize)+1]:=Chr(0);
    end;
  Randomize;
  CheckNullPos(HalfArraySize div 2);
  CheckNullPos(HalfArraySize);
  CheckNullPos(HalfArraySize+1);
  CheckNullPos(HalfArraySize + HalfArraySize Div 2);
end.


CompareChar0

Compare two buffers character by character till a null-character is reached.

Declaration

Source position: systemh.inc line 756

function CompareChar0(

  const buf1;

  const buf2;

  len: SizeInt

):SizeInt;

Description

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.

Errors

None.

See also

CompareByte | Compare 2 memory buffers byte per byte
CompareChar | ompare 2 memory buffers character per character
CompareDWord | Compare 2 memory buffers DWord per DWord
CompareWord | Compare 2 memory buffers word per word


CompareDWord

Compare 2 memory buffers DWord per DWord

Declaration

Source position: systemh.inc line 753

function CompareDWord(

  const buf1;

  const buf2;

  len: SizeInt

):SizeInt;

Description

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.

Errors

None.

See also

CompareChar | ompare 2 memory buffers character per character
CompareByte | Compare 2 memory buffers byte per byte
CompareWord | Compare 2 memory buffers word per word

Example

Program Example101;

{ Program to demonstrate the CompareDWord function. }

Const
  ArraySize     = 100;
  HalfArraySize = ArraySize Div 2;

Var
  Buf1,Buf2 : Array[1..ArraySize] of Dword;
  I : longint;

  Procedure CheckPos(Len : Longint);

  Begin
    Write('First ',Len,' DWords are ');
    if CompareDWord(Buf1,Buf2,Len)<>0 then
      Write('NOT ');
    Writeln('equal');
  end;

begin
  For I:=1 to ArraySize do
    begin
    Buf1[i]:=I;
    If I<=HalfArraySize Then
      Buf2[I]:=I
    else
      Buf2[i]:=HalfArraySize-I;
    end;
  CheckPos(HalfArraySize div 2);
  CheckPos(HalfArraySize);
  CheckPos(HalfArraySize+1);
  CheckPos(HalfArraySize + HalfArraySize Div 2);
end.


CompareWord

Compare 2 memory buffers word per word

Declaration

Source position: systemh.inc line 752

function CompareWord(

  const buf1;

  const buf2;

  len: SizeInt

):SizeInt;

Description

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.

Errors

None.

See also

CompareChar | ompare 2 memory buffers character per character
CompareByte | Compare 2 memory buffers byte per byte
CompareDWord | Compare 2 memory buffers DWord per DWord

Example

Program Example102;

{ Program to demonstrate the CompareWord function. }

Const
  ArraySize     = 100;
  HalfArraySize = ArraySize Div 2;

Var
  Buf1,Buf2 : Array[1..ArraySize] of Word;
  I : longint;

  Procedure CheckPos(Len : Longint);

  Begin
    Write('First ',Len,' words are ');
    if CompareWord(Buf1,Buf2,Len)<>0 then
      Write('NOT ');
    Writeln('equal');
  end;

begin
  For I:=1 to ArraySize do
    begin
    Buf1[i]:=I;
    If I<=HalfArraySize Then
      Buf2[I]:=I
    else
      Buf2[i]:=HalfArraySize-I;
    end;
  CheckPos(HalfArraySize div 2);
  CheckPos(HalfArraySize);
  CheckPos(HalfArraySize+1);
  CheckPos(HalfArraySize + HalfArraySize Div 2);
end.


Concat

Append one string to another.

Declaration

Source position: system.fpd line 36

function Concat(

  const S1: string;

  const S2: string;

  const S3: string;

  const Sn: string

):string;

Description

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.

Errors

None.

See also

Copy | Copy part of a string.
Delete | Delete part of a string.
Insert | Insert one string in another.
Pos | Search for substring in a string.
Length | Returns length of a string or array.

Example

Program Example10;

{ Program to demonstrate the Concat function. }
Var
  S : String;

begin
  S:=Concat('This can be done',' Easier ','with the + operator !');
end.


Continue

Continue with next loop cycle.

Declaration

Source position: system.fpd line 37

procedure Continue;

Description

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 although Continue is a compiler intrinsic (i.e. is treated specially) it is defined as an identifier in the system unit, hence it can be redefined.

Errors

None.

See also

Break | Exit current loop construct.
Exit | Exit current subroutine.

Example

Program Example86;

{ Program to demonstrate the Continue function. }

Var I : longint;

begin
  I:=0;
  While I<10 Do
    begin
    Inc(I);
    If I<5 Then
      Continue;
    Writeln (i);
    end;
  I:=0;
  Repeat
    Inc(I);
    If I<5 Then
      Continue;
    Writeln (i);
  Until I>=10;
  For I:=1 to 10 do
    begin
    If I<5 Then
      Continue;
    Writeln (i);
    end;
end.

Example

{
  Example 121:
  Continue, break and exit are system procedures.
  They can be redefined
}

procedure continue;

begin
  Writeln('Continue');
end;

Procedure Exit;

begin
  Writeln('exit');
end;

Procedure Break;

begin
  Writeln('Break');
end;

begin
  Repeat
    Continue;
    Break;
    exit;
  Until True;
end.


CopyArray

Copy managed-type elements in array

Declaration

Source position: rttih.inc line 16

procedure CopyArray(

  dest: Pointer;

  source: Pointer;

  typeInfo: Pointer;

  count: SizeInt

);

Description

CopyArray copies count elements containing managed types from the array pointed to by source to the array pointed to by dest. For this, it uses the type information of the elements as specified in typeinfo.

Under normal circumstances, this procedure should not be used, it is called automatically by the compiler when an array-typed variables are assigned to each other.

See also

InitializeArray | Initialize managed-type elements in array
FinalizeArray | Finalize managed-type elements in array
DynArraySize | Return length of dynamic array
DynArrayClear | Clear dynamical array
DynArrayDim | Return the number of dimensions in a dynamic array
DynArrayBounds | Return the bounds of the dynamic array


cos

Calculate cosine of angle

Declaration

Source position: mathh.inc line 96

function cos(

  d: ValReal

):ValReal;

Description

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.

Errors

None.

See also

Arctan | Calculate inverse tangent
Sin | Calculate sine of angle

Example

Program Example12;

{ Program to demonstrate the Cos function. }

Var R : Real;

begin
  R:=Cos(Pi);    { R:=-1 }
  R:=Cos(Pi/2);  { R:=0  }
  R:=Cos(0);     { R:=1  }
end.


Cseg

Return code segment

Declaration

Source position: systemh.inc line 1062

function Cseg: Word;

Description

CSeg returns the Code segment register. In Free Pascal, it returns always a zero, since Free Pascal is a 32/64 bit compiler.

Errors

None.

See also

DSeg | Return data segment
Seg | Return segment
Ofs | Return offset of a variable.
Ptr | Combine segment and offset to pointer

Example

Program Example13;

{ Program to demonstrate the CSeg function. }

var W : word;

begin
  W:=CSeg; {W:=0, provided for compatibility,
                  FPC is 32 bit.}
end.


Dec

Decrease value of variable

Declaration

Source position: system.fpd line 38

procedure Dec(

  var X: TOrdinal

);

procedure Dec(

  var X: TOrdinal;

  Decrement: TOrdinal

);

Description

Dec decreases the value of X with Decrement. If Decrement isn't specified, then 1 is taken as a default.

Errors

A range check can occur, or an underflow error, if an attempt is made to decrease X below its minimum value.

See also

Inc

Increase value of integer variable

Example

Program Example14;

{ Program to demonstrate the Dec function. }

Var
  I  : Integer;
  L  : Longint;
  W  : Word;
  B  : Byte;
  Si : ShortInt;

begin
 I:=1;
 L:=2;
 W:=3;
 B:=4;
 Si:=5;
 Dec (i);    { i:=0  }
 Dec (L,2);  { L:=0  }
 Dec (W,2);  { W:=1  }
 Dec (B,-2); { B:=6  }
 Dec (Si,0); { Si:=5 }
end.


DefaultAnsi2UnicodeMove

Standard widestring manager callback

Declaration

Source position: ustringh.inc line 52

procedure DefaultAnsi2UnicodeMove(

  source: PChar;

  cp: TSystemCodePage;

  var dest: unicodestring;

  len: SizeInt

);

Description

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.


DefaultAnsi2WideMove

Standard implementation of Ansi to Widestring conversion routine

Declaration

Source position: wstringh.inc line 34

procedure DefaultAnsi2WideMove(

  source: PChar;

  cp: TSystemCodePage;

  var dest: widestring;

  len: SizeInt

);

Description

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.

Errors

None.

See also

DefaultUnicode2AnsiMove

Standard widestring manager callback


DefaultUnicode2AnsiMove

Standard widestring manager callback

Declaration

Source position: ustringh.inc line 51

procedure DefaultUnicode2AnsiMove(

  source: PUnicodeChar;

  var dest: RawByteString;

  cp: TSystemCodePage;

  len: SizeInt

);

Description

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.

Errors

None.

See also

WidestringManager

Current widestring manager.


Delete

Delete part of a string.

Declaration

Source position: systemh.inc line 1082

procedure Delete(

  var s: shortstring;

  index: SizeInt;

  count: SizeInt

);

procedure Delete(

  var S: RawByteString;

  Index: SizeInt;

  Size: SizeInt

);

procedure Delete(

  var S: UnicodeString;

  Index: SizeInt;

  Size: SizeInt

);

procedure Delete(

  var S: WideString;

  Index: SizeInt;

  Size: SizeInt

);

Description

Delete removes Count characters from string S, starting at position Index. All characters after the deleted characters are shifted Count positions to the left, and the length of the string is adjusted.

Errors

Shortstring variant's third parameter is called Count, in other overloaded variants it is called Index

See also

Copy | Copy part of a string.
Pos | Search for substring in a string.
Insert | Insert one string in another.

Example

Program Example15;

{ Program to demonstrate the Delete function. }

Var
  S : String;

begin
  S:='This is not easy !';
  Delete (S,9,4); { S:='This is easy !' }
end.


Dispose

Free dynamically allocated memory

Declaration

Source position: system.fpd line 40

procedure Dispose(

  P: Pointer

);

procedure Dispose(

  P: TypedPointer;

  Des: TProcedure

);

Description

The first form Dispose releases the memory allocated with a call to New. 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.

Errors

An runtime error will occur if the pointer doesn't point to a location in the heap.

See also

New | Dynamically allocate memory for variable
Getmem | Allocate new memory on the heap
Freemem | Release allocated memory

Example

Program Example16;

{ Program to demonstrate the Dispose and New functions. }

Type SS = String[20];

     AnObj = Object
       I : integer;
       Constructor Init;
       Destructor Done;
       end;

Var
  P : ^SS;
  T : ^AnObj;

Constructor Anobj.Init;

begin
 Writeln ('Initializing an instance of AnObj !');
end;

Destructor AnObj.Done;

begin
  Writeln ('Destroying an instance of AnObj !');
end;

begin
  New (P);
  P^:='Hello, World !';
  Dispose (P);
  { P is undefined from here on !}
  New(T,Init);
  T^.i:=0;
  Dispose (T,Done);
end.


divide(variant,variant):variant

Implement division (/) operation on variants.

Declaration

Source position: varianth.inc line 368

operator operator /(

  const op1: variant;

  const op2: variant

):variant;

Description

The implementation of the division / operation is delegated to the variant manager with operation opDivide.

Errors

Execution of this operator may result in an exception if no variant manager is installed or if the types of the operand are not suitable for the operation.

See also

operator *(variant, variant): variant

Implement multiplication (*) operation on variants.


DoneCriticalsection

Clean up a critical section.

Declaration

Source position: threadh.inc line 161

procedure DoneCriticalsection(

  var cs: TRTLCriticalSection

);

Description

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

See also

InitCriticalsection | Initialize a critical section
EnterCriticalsection | Enter a critical section
LeaveCriticalsection | Leave a critical section


DoneThread

End the current thread

Declaration

Source position: threadh.inc line 123

procedure DoneThread;

Description

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.

See also

BeginThread

Start a new thread.


Dseg

Return data segment

Declaration

Source position: systemh.inc line 1063

function Dseg: Word;

Description

DSeg returns the data segment register. In Free Pascal, it returns always a zero, since Free Pascal is a 32/64 bit compiler.

Errors

None.

See also

CSeg | Return code segment
Seg | Return segment
Ofs | Return offset of a variable.
Ptr | Combine segment and offset to pointer

Example

Program Example17;

{ Program to demonstrate the DSeg function. }

Var
  W : Word;

begin
  W:=DSeg; {W:=0, This function is provided for compatibility,
                  FPC is a 32 bit compiler.}
end.


DumpExceptionBackTrace

Create backtrace

Declaration

Source position: systemh.inc line 1403

procedure DumpExceptionBackTrace(

  var f: text

);

Description

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.

Errors

No check is done to see whether f is opened for writing.

See also

dump_stack

Dump stack to the given text file.


Dump_Stack

Dump stack to the given text file.

Declaration

Source position: systemh.inc line 1400

procedure Dump_Stack(

  var f: text;

  fp: pointer;

  addr: CodePointer = Nil

);

procedure Dump_Stack(

  var f: text;

  skipframes: LongInt

);

Description

Dump_Stack prints a stack dump to the file f, with base frame pointer bp

Errors

The file f must be opened for writing or an error will occur.

See also

get_caller_addr | Return the address of the caller.
get_caller_frame | Return the frame pointer of the caller
get_frame | Return the current frame


DynArrayBounds

Return the bounds of the dynamic array

Declaration

Source position: dynarrh.inc line 36

function DynArrayBounds(

  a: Pointer;

  typeInfo: Pointer

):TBoundArray;

Description

DynArrayBounds returns the bounds of all the dimensions of the dynamic array a with type information typeInfo.

The result is an array (zero-based) with the maximum valid index for each dimension in the array: the lower bound is not present in the result, it is always zero.

See also

InitializeArray | Initialize managed-type elements in array
FinalizeArray | Finalize managed-type elements in array
CopyArray | Copy managed-type elements in array
DynArraySize | Return length of dynamic array
DynArrayClear | Clear dynamical array
DynArrayDim | Return the number of dimensions in a dynamic array


DynArrayClear

Clear dynamical array

Declaration

Source position: dynarrh.inc line 34

procedure DynArrayClear(

  var a: Pointer;

  typeInfo: Pointer

);

Description

DynArrayClear clears the array (a) using its type info (typeInfo). It is equal to setting the length to zero.

See also

InitializeArray | Initialize managed-type elements in array
FinalizeArray | Finalize managed-type elements in array
CopyArray | Copy managed-type elements in array
DynArraySize | Return length of dynamic array
DynArrayDim | Return the number of dimensions in a dynamic array
DynArrayBounds | Return the bounds of the dynamic array


DynArrayDim

Return the number of dimensions in a dynamic array

Declaration

Source position: dynarrh.inc line 35

function DynArrayDim(

  typeInfo: Pointer

):Integer;

Description

DynArrayDim returns the number of dimensions in a dynamic array, using the type information (typeInfo) of the array.

See also

InitializeArray | Initialize managed-type elements in array
FinalizeArray | Finalize managed-type elements in array
CopyArray | Copy managed-type elements in array
DynArraySize | Return length of dynamic array
DynArrayClear | Clear dynamical array
DynArrayBounds | Return the bounds of the dynamic array


DynArrayIndex

Return pointer to indicated element

Declaration

Source position: dynarrh.inc line 39

function DynArrayIndex(

  a: Pointer;

  const indices: array of SizeInt;

  typeInfo: Pointer

):Pointer;

Description

DynArrayIndex returns a pointer to the element indicated by indices in dynamic array a with type information typinfo. The length of indices must equal the number of dimensions of the array (as returned by DynArrayDim).

Errors

No bounds checking is performed, it is therefor possible to get an access violation if one of the indexes is out of range.

See also

InitializeArray | Initialize managed-type elements in array
FinalizeArray | Finalize managed-type elements in array
CopyArray | Copy managed-type elements in array
DynArraySize | Return length of dynamic array
DynArrayClear | Clear dynamical array
DynArrayBounds | Return the bounds of the dynamic array
DynArrayDim | Return the number of dimensions in a dynamic array
IsDynArrayRectangular | Check whether all dimensions have the same size


DynArraySetLength

Set the length of a dynamic array

Declaration

Source position: dynarrh.inc line 32

procedure DynArraySetLength(

  var a: Pointer;

  typeInfo: Pointer;

  dimCnt: SizeInt;

  lengthVec: PSizeInt

);

Description

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 TDynArrayTypeInfo

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

Errors

If an invalid pointer is specified, an error may occur.

See also

SetLength | Set length of a string.
tdynarraytypeinfo | Type information for a dynamic array.


DynArraySize

Return length of dynamic array

Declaration

Source position: dynarrh.inc line 33

function DynArraySize(

  a: pointer

):tdynarrayindex;

Description

DynArraySize gets the number of elements in the array (a) the result is equal to Length for dynamic arrays.

See also

InitializeArray | Initialize managed-type elements in array
FinalizeArray | Finalize managed-type elements in array
CopyArray | Copy managed-type elements in array
DynArrayClear | Clear dynamical array
DynArrayDim | Return the number of dimensions in a dynamic array
DynArrayBounds | Return the bounds of the dynamic array


EmptyMethod

Empty method alias

Declaration

Source position: systemh.inc line 1443

procedure EmptyMethod;

Description

Emptymethod is meant for the compiler only. It should not be used directly.


EndThread

End the current thread.

Declaration

Source position: threadh.inc line 141

procedure EndThread(

  ExitCode: DWord

);

procedure EndThread;

Description

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 (WaitForThreadTerminate). If it is omitted, zero is used.

This function does not return.

See also

WaitForThreadTerminate | Wait for a thread to terminate.
BeginThread | Start a new thread.


EnterCriticalsection

Enter a critical section

Declaration

Source position: threadh.inc line 162

procedure EnterCriticalsection(

  var cs: TRTLCriticalSection

);

Description

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 LeaveCriticalSection), 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 InitCriticalSection prior to a call to EnterCriticalsection.

A call to EnterCriticalsection must always be matched by a call to LeaveCriticalSection. 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.

See also

InitCriticalsection | Initialize a critical section
DoneCriticalsection | Clean up a critical section.
LeaveCriticalsection | Leave a critical section


EnumResourceLanguages

Enumerate available languages for a resource of given type and name

Declaration

Source position: resh.inc line 59

function EnumResourceLanguages(

  ModuleHandle: TFPResourceHMODULE;

  ResourceType: PChar;

  ResourceName: PChar;

  EnumFunc: EnumResLangProc;

  lParam: PtrInt

):LongBool;

Description

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.

Errors

None.

See also

EnumResourceTypes | Enumerate available resource types
EnumResourceNames | Enumerate available resource names for a specified resource type
EnumResourceLanguages | Enumerate available languages for a resource of given type and name


EnumResourceNames

Enumerate available resource names for a specified resource type

Declaration

Source position: resh.inc line 58

function EnumResourceNames(

  ModuleHandle: TFPResourceHMODULE;

  ResourceType: PChar;

  EnumFunc: EnumResNameProc;

  lParam: PtrInt

):LongBool;

Description

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.

Errors

None.

See also

EnumResourceTypes | Enumerate available resource types
EnumResourceLanguages | Enumerate available languages for a resource of given type and name


EnumResourceTypes

Enumerate available resource types

Declaration

Source position: resh.inc line 57

function EnumResourceTypes(

  ModuleHandle: TFPResourceHMODULE;

  EnumFunc: EnumResTypeProc;

  lParam: PtrInt

):LongBool;

Description

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.

Errors

None.

See also

EnumResourceNames | Enumerate available resource names for a specified resource type
EnumResourceLanguages | Enumerate available languages for a resource of given type and name


EOF

Check for end of file

Declaration

Source position: systemh.inc line 1202

function EOF(

  var f: file

):Boolean;

function EOF(

  var t: Text

):Boolean;

function EOF: Boolean;

Description

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.

Errors

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.

See also

Eoln | Check for end of line
Assign | Assign a name to a file
Reset | Open file for reading
Rewrite | Open file for writing

Example

Program Example18;

{ Program to demonstrate the Eof function. }

Var T1,T2 : text;
    C : Char;

begin
  { Set file to read from. Empty means from standard input.}
  assign (t1,paramstr(1));
  reset (t1);
  { Set file to write to. Empty means to standard output. }
  assign (t2,paramstr(2));
  rewrite (t2);
  While not eof(t1) do
    begin
    read (t1,C);
    write (t2,C);
    end;
  Close (t1);
  Close (t2);
end.


EOLn

Check for end of line

Declaration

Source position: systemh.inc line 1253

function EOLn(

  var t: Text

):Boolean;

function EOLn: Boolean;

Description

EoLn 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 EoLn returns False. If no file F is specified, standard input is assumed. It can only be used on files of type Text.

Errors

None.

See also

Eof | Check for end of file
Assign | Assign a name to a file
Reset | Open file for reading
Rewrite | Open file for writing

Example

Program Example19;

{ Program to demonstrate the Eoln function. }

begin
  { This program waits for keyboard input. }
  { It will print True when an empty line is put in,
    and false when you type a non-empty line.
    It will only stop when you press enter.}
  While not Eoln do
    Writeln (eoln);
end.


equal(variant,variant):Boolean

Implement = (equality) operation on variants.

Declaration

Source position: varianth.inc line 373

operator operator =(

  const op1: variant;

  const op2: variant

):Boolean;

Description

The implementation of the equality (=) operation is delegated to the variant manager with operation opcmpeq.

Errors

Execution of this operator may result in an exception if no variant manager is installed or if the types of the operand are not suitable for the operation.

See also

operator <(variant, variant): boolean

Implement < (less than) operation on variants.


Erase

Delete a file from disk

Declaration

Source position: systemh.inc line 1203

procedure Erase(

  var f: file

);

procedure Erase(

  var t: Text

);

Description

Erase removes an unopened file from disk. The file should be assigned with Assign, but not opened with Reset or Rewrite

Errors

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.

See also

Assign

Assign a name to a file

Example

Program Example20;

{ Program to demonstrate the Erase function. }

Var F : Text;

begin
  { Create a file with a line of text in it}
  Assign (F,'test.txt');
  Rewrite (F);
  Writeln (F,'Try and find this when I''m finished !');
  close (f);
  { Now remove the file }
  Erase (f);
end.


Error

Generate run-time error

Declaration

Source position: systemh.inc line 1394

procedure Error(

  RunTimeError: TRuntimeError

);

Description

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.

See also

RunError | Generate a run-time error.
Halt | Stop program execution.


Erroraddr

Address where the last error occurred.

Declaration

Source position: systemh.inc line 642

const Erroraddr: CodePointer = Nil;


Errorcode

Last error code.

Declaration

Source position: systemh.inc line 643

const Errorcode: Word = 0;


ErrorProc

Custom error handling procedure.

Declaration

Source position: systemh.inc line 1462

const ErrorProc: TErrorProc = Nil;

Description

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.

See also

TErrorProc | Standard error handler procedural type.
Halt | Stop program execution.


Exclude

Exlude element from a set if it is present.

Declaration

Source position: system.fpd line 42

procedure Exclude(

  var S: TSetType;

  E: TSetElement

);

Description

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);

Errors

If the type of the element E is not equal to the base type of the set S, the compiler will generate an error.

See also

Include

Include element in set if it was not yet present.

Example

program Example111;

{ Program to demonstrate the Include/Exclude functions }

Type
  TEnumA = (aOne,aTwo,aThree);
  TEnumAs = Set of TEnumA;

Var
  SA : TEnumAs;

  Procedure PrintSet(S : TEnumAs);

  var
    B : Boolean;

    procedure DoEl(A : TEnumA; Desc : String);

    begin
      If A in S then
        begin
        If B then
          Write(',');
        B:=True;
        Write(Desc);
        end;
    end;

  begin
    Write('[');
    B:=False;
    DoEl(aOne,'aOne');
    DoEl(aTwo,'aTwo');
    DoEl(aThree,'aThree');
    Writeln(']')
  end;

begin
  SA:=[];
  Include(SA,aOne);
  PrintSet(SA);
  Include(SA,aThree);
  PrintSet(SA);
  Exclude(SA,aOne);
  PrintSet(SA);
  Exclude(SA,aTwo);
  PrintSet(SA);
  Exclude(SA,aThree);
  PrintSet(SA);
end.


Exit

Exit current subroutine.

Declaration

Source position: system.fpd line 43

procedure Exit(

  const X: TAnyType

);

procedure Exit;

Description

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.

In Object Pascal or Delphi modes, if the Exit statement is surrounded by one or more Try .. Finally constructs, the Finally blocks are executed, which means that if the finally blocks are used to free resources, then these resources will also be freed when Exit is called.

Note that although Exit is a compiler intrinsic (i.e. is treated specially) it is defined as an identifier in the system unit, hence it can be redefined.

Errors

None.

See also

Halt

Stop program execution.

Example

Program Example21;

{ Program to demonstrate the Exit function. }

Procedure DoAnExit (Yes : Boolean);

{ This procedure demonstrates the normal Exit }

begin
  Writeln ('Hello from DoAnExit !');
  If Yes then
    begin
    Writeln ('Bailing out early.');
    exit;
    end;
  Writeln ('Continuing to the end.');
end;

Function Positive (Which : Integer) : Boolean;

{ This function demonstrates the extra FPC feature of Exit :
  You can specify a return value for the function }

begin
  if Which>0 then
    exit (True)
  else
    exit (False);
end;

begin
  { This call will go to the end }
  DoAnExit (False);
  { This call will bail out early }
  DoAnExit (True);
  if Positive (-1) then
    Writeln ('The compiler is nuts, -1 is not positive.')
  else
    Writeln ('The compiler is not so bad, -1 seems to be negative.');
end.

Example

{
  Example 121:
  Continue, break and exit are system procedures.
  They can be redefined
}

procedure continue;

begin
  Writeln('Continue');
end;

Procedure Exit;

begin
  Writeln('exit');
end;

Procedure Break;

begin
  Writeln('Break');
end;

begin
  Repeat
    Continue;
    Break;
    exit;
  Until True;
end.


ExitCode

Exit code for the program, will be communicated to the OS on exit.

Declaration

Source position: systemh.inc line 669

var ExitCode: LongInt = ;


ExitProc

Exit procedure pointer.

Declaration

Source position: systemh.inc line 641

const ExitProc: CodePointer = Nil;


exp

Exponentiate

Declaration

Source position: mathh.inc line 97

function exp(

  d: ValReal

):ValReal;

Description

Exp returns the exponent of X, i.e. the number e to the power X.

Errors

None.

See also

Ln

Calculate logarithm

Example

Program Example22;

{ Program to demonstrate the Exp function. }

begin
  Writeln (Exp(1):8:2); { Should print 2.72 }
end.


FilePos

Get position in file

Declaration

Source position: systemh.inc line 1199

function FilePos(

  var f: file

):Int64;

Description

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. Untyped files have a default record size of 128, if the second parameter to Reset isn't specified.

Errors

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.

See also

Filesize

Size of file

Example

Program Example23;

{ Program to demonstrate the FilePos function. }

Var F : File of Longint;
    L,FP : longint;

begin
  { Fill a file with data :
    Each position contains the position ! }
  Assign (F,'test.tmp');
  Rewrite (F);
  For L:=0 to 100 do
    begin
    FP:=FilePos(F);
    Write (F,FP);
    end;
  Close (F);
  Reset (F);
  { If all goes well, nothing is displayed here. }
  While not (Eof(F)) do
    begin
    FP:=FilePos (F);
    Read (F,L);
    if L<>FP then
      Writeln ('Something wrong: Got ',l,' on pos ',FP);
    end;
  Close (F);
  Erase (f);
end.


FileSize

Size of file

Declaration

Source position: systemh.inc line 1200

function FileSize(

  var f: file

):Int64;

Description

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. Untyped files have a default record size of 128, if the second parameter to Reset isn't specified.

Errors

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.

See also

Filepos

Get position in file

Example

Program Example24;

{ Program to demonstrate the FileSize function. }

Var F : File Of byte;
    L : File Of Longint;

begin
  Assign (F,paramstr(1));
  Reset (F);
  Writeln ('File size in bytes : ',FileSize(F));
  Close (F);
  Assign (L,paramstr (1));
  Reset (L);
  Writeln ('File size in Longints : ',FileSize(L));
  Close (f);
end.


FillByte

Fill memory region with 8-bit pattern

Declaration

Source position: systemh.inc line 741

procedure FillByte(

  var x;

  count: SizeInt;

  value: Byte

);

Description

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 Fillword, and if it is a multiple of 4 bytes it is better to use FillDWord, these routines are optimized for their respective sizes.

Errors

No checking on the size of X is done.

See also

Fillchar | Fill memory region with certain character
FillDWord | Fill memory region with 32-bit pattern
Fillword | Fill memory region with 16-bit pattern
Move | Move data from one location in memory to another

Example

Program Example103;

{ Program to demonstrate the FillByte function. }

Var S : String[10];
    I : Byte;

begin
  For i:=10 downto 0 do
    begin
    { Fill S with i bytes }
    FillByte (S,SizeOf(S),32);
    { Set Length }
    SetLength(S,I);
    Writeln (s,'*');
    end;
end.


FillChar

Fill memory region with certain character

Declaration

Source position: systemh.inc line 738

procedure FillChar(

  var x;

  count: SizeInt;

  Value: Byte

);

procedure FillChar(

  var x;

  count: SizeInt;

  Value: Boolean

);

procedure FillChar(

  var x;

  count: SizeInt;

  Value: Char

);

Description

Fillchar fills the memory starting at X with Count bytes or characters with value equal to Value.

Errors

No checking on the size of X is done.

See also

Fillword | Fill memory region with 16-bit pattern
Move | Move data from one location in memory to another
FillByte | Fill memory region with 8-bit pattern
FillDWord | Fill memory region with 32-bit pattern

Example

Program Example25;

{ Program to demonstrate the FillChar function. }

Var S : String[10];
    I : Byte;
begin
  For i:=10 downto 0 do
    begin
    { Fill S with i spaces }
    FillChar (S,SizeOf(S),' ');
    { Set Length }
    SetLength(S,I);
    Writeln (s,'*');
    end;
end.


FillDWord

Fill memory region with 32-bit pattern

Declaration

Source position: systemh.inc line 743

procedure FillDWord(

  var x;

  count: SizeInt;

  value: DWord

);

Description

Fillword fills the memory starting at X with Count DWords with value equal to Value. A DWord is 4 bytes in size.

Errors

No checking on the size of X is done.

See also

FillByte | Fill memory region with 8-bit pattern
Fillchar | Fill memory region with certain character
Fillword | Fill memory region with 16-bit pattern
Move | Move data from one location in memory to another

Example

Program Example104;

{ Program to demonstrate the FillDWord function. }

Const
  ArraySize = 1000;

Var
  S : Array [1..ArraySize] of DWord;
  I : longint;

begin
  FillDWord(S,ArraySize,0);
  For I:=1 to ArraySize do
    If S[i]<>0 then
      Writeln('Position ',i,' not zeroed out');
end.


FillQWord

Fill memory range with QWord (64-bit) values

Declaration

Source position: systemh.inc line 744

procedure FillQWord(

  var x;

  count: SizeInt;

  value: QWord

);

Description

FillQWord fills the memory location of x with Count times value. The size of the filled memory location is therefor 8*count bytes.

Errors

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.

See also

FillChar | Fill memory region with certain character
FillWord | Fill memory region with 16-bit pattern


FillWord

Fill memory region with 16-bit pattern

Declaration

Source position: systemh.inc line 742

procedure FillWord(

  var x;

  count: SizeInt;

  Value: Word

);

Description

Fillword fills the memory starting at X with Count words with value equal to Value. A word is 2 bytes in size.

Errors

No checking on the size of X is done.

See also

Fillchar | Fill memory region with certain character
Move | Move data from one location in memory to another

Example

Program Example76;

{ Program to demonstrate the FillWord function. }

Var W : Array[1..100] of Word;

begin
  { Quick initialization of array W }
  FillWord(W,100,0);
end.


FinalizeArray

Finalize managed-type elements in array

Declaration

Source position: rttih.inc line 15

procedure FinalizeArray(

  p: Pointer;

  typeInfo: Pointer;

  count: SizeInt

);

Description

FinalizeArray dereferences and clears managed types in the array pointed to by p. For this, it uses the type information of the elements as specified in typeinfo.

Under normal circumstances, this procedure should not be used, it is called automatically by the compiler when an array-typed variable containing managed types goes out of scope.

See also

InitializeArray | Initialize managed-type elements in array
CopyArray | Copy managed-type elements in array
DynArraySize | Return length of dynamic array
DynArrayClear | Clear dynamical array
DynArrayDim | Return the number of dimensions in a dynamic array
DynArrayBounds | Return the bounds of the dynamic array


FindResource

Locate a resource and return a handle to it.

Declaration

Source position: resh.inc line 60

function FindResource(

  ModuleHandle: TFPResourceHMODULE;

  ResourceName: PChar;

  ResourceType: PChar

):TFPResourceHandle;

function FindResource(

  ModuleHandle: TFPResourceHMODULE;

  const ResourceName: AnsiString;

  const ResourceType: AnsiString

):TFPResourceHandle;

Description

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

Errors

None. In case the resource was not found, 0 is returned.

See also

FreeResource | Free a loaded resource
LoadResource | Load a resource for use
SizeofResource | Return the size of a particular resource
LockResource | Lock a resource
UnlockResource | Unlock a previously locked resource
FreeResource | Free a loaded resource


FindResourceEx

Find a resource based on type, name, language

Declaration

Source position: resh.inc line 61

function FindResourceEx(

  ModuleHandle: TFPResourceHMODULE;

  ResourceType: PChar;

  ResourceName: PChar;

  Language: Word

):TFPResourceHandle;

function FindResourceEx(

  ModuleHandle: TFPResourceHMODULE;

  const ResourceType: AnsiString;

  const ResourceName: AnsiString;

  Language: Word

):TFPResourceHandle;

Description

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.

Errors

None.


float_raise

Raise floating point exception

Declaration

Source position: mathh.inc line 74

procedure float_raise(

  i: TFPUException

);

procedure float_raise(

  i: TFPUExceptionMask

);

Description

float_raise raises the floating point exceptions specified by softfloat_exception_flags.

See also

softfloat_exception_flags | Current soft float exception flags
softfloat_exception_mask | Current soft float exception mask


Flush

Write file buffers to disk

Declaration

Source position: systemh.inc line 1249

procedure Flush(

  var t: Text

);

Description

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.

Errors

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.

See also

Close

Close a file

Example

Program Example26;

{ Program to demonstrate the Flush function. }

Var F : Text;

begin
  { Assign F to standard output }
  Assign (F,'');
  Rewrite (F);
  Writeln (F,'This line is written first, but appears later !');
  { At this point the text is in the internal pascal buffer,
    and not yet written to standard output }
  Writeln ('This line appears first, but is written later !');
  { A writeln to 'output' always causes a flush - so this text is
    written to screen }
  Flush (f);
  { At this point, the text written to F is written to screen. }
  Write (F,'Finishing ');
  Close (f);  { Closing a file always causes a flush first }
  Writeln ('off.');
end.


FlushThread

Flush all standard files

Declaration

Source position: threadh.inc line 145

procedure FlushThread;

Description

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.

See also

EndThread

End the current thread.


FMADouble

Internal function, do not use

Declaration

Source position: mathh.inc line 201

function FMADouble(

  d1: Double;

  d2: Double;

  d3: Double

):Double;


FMAExtended

Internal function, do not use

Declaration

Source position: mathh.inc line 204

function FMAExtended(

  e1: extended;

  e2: extended;

  e3: extended

):extended;


FMASingle

Internal function, do not use

Declaration

Source position: mathh.inc line 199

function FMASingle(

  s1: single;

  s2: single;

  s3: single

):single;


fpc_dynarray_rangecheck

Auxiliary compiler routine

Declaration

Source position: dynarrh.inc line 41

procedure fpc_dynarray_rangecheck(

  p: pointer;

  i: tdynarrayindex

);

Description

fpc_dynarray_rangecheck is an auxiliary routine for checking whether an array index is in range for the array.


fpc_SarInt64

SAR (int64)

Declaration

Source position: systemh.inc line 975

function fpc_SarInt64(

  const AValue: Int64;

  const Shift: Byte

):Int64;

Description

fpc_SarInt64 is a FPC helper function which should not be used directly.


FPower10

Fast multiply with a power of 10

Declaration

Source position: mathh.inc line 104

function FPower10(

  val: Extended;

  Power: LongInt

):Extended;

Description

FPower10 multplies val with 10 to the power Power. It uses a fast algorithm to calculate the result.


frac

Return fractional part of floating point value.

Declaration

Source position: mathh.inc line 99

function frac(

  d: ValReal

):ValReal;

Description

Frac returns the non-integer part of X.

Errors

None.

See also

Round | Round floating point value to nearest integer number.
Int | Calculate integer part of floating point value.

Example

Program Example27;

{ Program to demonstrate the Frac function. }

Var R : Real;

begin
  Writeln (Frac (123.456):0:3);  { Prints  O.456 }
  Writeln (Frac (-123.456):0:3); { Prints -O.456 }
end.


Freemem

Release allocated memory

Declaration

Source position: heaph.inc line 85

procedure Freemem(

  p: pointer;

  Size: PtrUInt

);

function Freemem(

  p: pointer

):PtrUInt;

Description

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.

Errors

An error will occur when P doesn't point to the heap.

See also

Getmem | Allocate new memory on the heap
New | Dynamically allocate memory for variable
Dispose | Free dynamically allocated memory

Example

Program Example28;

{ Program to demonstrate the FreeMem and GetMem functions. }

Var P : Pointer;
    MM : Longint;

begin
  { Get memory for P }
  GetMem (P,80);
  FillChar (P^,80,' ');
  FreeMem (P,80);
end.


Freememory

Alias for FreeMem

Declaration

Source position: heaph.inc line 86

procedure Freememory(

  p: pointer;

  Size: PtrUInt

);

function Freememory(

  p: pointer

):PtrUInt;

Description

FreeMemory is an alias for FreeMem.

See also

FreeMem

Release allocated memory


FreeResource

Free a loaded resource

Declaration

Source position: resh.inc line 66

function FreeResource(

  ResData: TFPResourceHGLOBAL

):LongBool;

Description

FreeResource unloads the resource identified by ResData from memory. The resource must have been loaded by LoadResource. It returns True if the operation was succesful, False otherwise.

Errors

On error, False is returned.

See also

FindResource | Locate a resource and return a handle to it.
LoadResource | Load a resource for use
SizeofResource | Return the size of a particular resource
LockResource | Lock a resource
UnlockResource | Unlock a previously locked resource
FreeResource | Free a loaded resource


Get8087CW

Declaration

Source position: mathh.inc line 22

function Get8087CW: Word;


GetCPUCount

Return the number of cores on the system

Declaration

Source position: threadh.inc line 28

function GetCPUCount: LongWord;

Description

GetCPUCount returns the number of CPU cores on the system. Whether these are physically separate CPUs or cores on a single CPU is deliberately undefined.

See also

CPUCount

Number of cores on the system


GetCurrentThreadId

Return the id of the currently running thread.

Declaration

Source position: threadh.inc line 154

function GetCurrentThreadId: TThreadID;

Description

GetCurrentThreadId returns the ID of the currently running thread. It can be used in calls such as KillThread or ThreadSetPriority

Errors

None.

See also

KillThread | Kill a running thread
ThreadSetPriority | Set the priority of a thread.


getdir

Return the current directory

Declaration

Source position: systemh.inc line 1274

procedure getdir(

  drivenr: Byte;

  var dir: shortstring

); overload;

procedure getdir(

  drivenr: Byte;

  var dir: RawByteString

); overload;

procedure getdir(

  drivenr: Byte;

  var dir: unicodestring

); overload;

Description

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.

Errors

An error is returned under dos, if the drive requested isn't ready.

See also

Chdir

Change current working directory.

Example

Program Example29;

{ Program to demonstrate the GetDir function. }

Var S : String;

begin
  GetDir (0,S);
  Writeln ('Current directory is : ',S);
end.


GetFPCHeapStatus

Return FPC heap manager status information

Declaration

Source position: heaph.inc line 100

function GetFPCHeapStatus: TFPCHeapStatus;


GetHeapStatus

Return the memory manager heap status.

Declaration

Source position: heaph.inc line 99

function GetHeapStatus: THeapStatus;


GetMem

Allocate new memory on the heap

Declaration

Source position: heaph.inc line 83

procedure Getmem(

  out p: pointer;

  Size: PtrUInt

);

function GetMem(

  size: PtrUInt

):pointer;

Description

Getmem reserves Size bytes memory on the heap, and returns a pointer to this memory in p. What happens if no more memory is available, depends on the value of the variable ReturnNilIfGrowHeapfails: if the variable is True then Nil is returned. If the variable is False, a run-time error is generated. The default value is False, so by default an error is generated.

The newly allocated memory is not initialized in any way, and may contain garbage data. It must be cleared with a call to FillChar or FillWord.

For an example, see Freemem.

Errors

None.

See also

Freemem | Release allocated memory
Dispose | Free dynamically allocated memory
New | Dynamically allocate memory for variable
returnnilifgrowheapfails | Describe behaviour if getmem fails.
MemSize | Return the size of a memory block.


GetMemory

Alias for GetMem

Declaration

Source position: heaph.inc line 84

procedure Getmemory(

  out p: pointer;

  Size: PtrUInt

);

function GetMemory(

  size: PtrUInt

):pointer;

Description

Getmemory is an alias for GetMem.

See also

GetMem

Allocate new memory on the heap


GetMemoryManager

Return current memory manager

Declaration

Source position: heaph.inc line 54

procedure GetMemoryManager(

  var MemMgr: TMemoryManager

);

Description

GetMemoryManager stores the current Memory Manager record in MemMgr.

For an example, see the programmer's guide.

Errors

None.

See also

SetMemoryManager | Set a memory manager
IsMemoryManagerSet | Is the memory manager set


GetMXCSR

Declaration

Source position: mathh.inc line 30

function GetMXCSR: DWord;


GetProcessID

Get the current process ID

Declaration

Source position: systemh.inc line 1324

function GetProcessID: SizeUInt;

Description

GetProcessID returns the current process ID. The meaning of the return value of this call is system dependent.

Errors

None.

See also

GetThreadID

Get the current Thread ID.


GetResourceManager

Return the currently active resource manager

Declaration

Source position: resh.inc line 87

procedure GetResourceManager(

  var Manager: TResourceManager

);

Description

GetResourceManager returns the currently active resource manager record in Manager. There is always an active resource manager record.

Errors

None.

See also

TResourceManager | Resource manager definition
SetResourceManager | Set the resource manager


GetSSECSR

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'System' (#rtl)

GetSSECSR (deprecated)

Declaration

Source position: mathh.inc line 32

function GetSSECSR: DWord;


GetTextCodePage

Get the codepage used in a text file.

Declaration

Source position: systemh.inc line 1262

function GetTextCodePage(

  var T: Text

):TSystemCodePage;

Description

GetTextCodePage returns the codepage that the text file T uses. All strings written to the file will be converted to the indicated codepage. By default, the codepage is set to CP_ACP.

Errors

None.

See also

TextRec | Text file type
SetTextCodePage | Set the codepage used in a text file.


GetThreadID

Get the current Thread ID.

Declaration

Source position: systemh.inc line 1325

function GetThreadID: TThreadID;

Description

GetThreadID returns the current process ID. The meaning of the return value of this call is system dependent.

See also

GetProcessID

Get the current process ID


GetThreadManager

Return the current thread manager

Declaration

Source position: threadh.inc line 113

function GetThreadManager(

  var TM: TThreadManager

):Boolean;

Description

GetThreadManager returns the currently used thread manager in TM.

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

See also

SetThreadManager | Set the thread manager, optionally return the current thread manager.
TThreadManager | Thread manager record.


GetUnicodeStringManager

Return a copy of the currently active unicodetring manager.

Declaration

Source position: ustringh.inc line 147

procedure GetUnicodeStringManager(

  var Manager: TUnicodeStringManager

);

Description

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.

See also

SetUnicodeStringManager | Set the unicodestring manager
TUnicodeStringManager | Unicode string manager


GetVariantManager

Return the current variant manager.

Declaration

Source position: varianth.inc line 219

procedure GetVariantManager(

  var VarMgr: tvariantmanager

);

Description

GetVariantManager returns the current variant manager in varmgr.

See also

SetVariantManager

Set the current variant manager.


GetWideStringManager

Return a copy of the currently active widestring manager.

Declaration

Source position: ustringh.inc line 143

procedure GetWideStringManager(

  var Manager: TUnicodeStringManager

);

Description

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.

See also

SetWideStringManager | Set the widestring manager
TWideStringManager | Record containing the various callbacks of the widestring manager.


get_caller_addr

Return the address of the caller.

Declaration

Source position: systemh.inc line 1316

function get_caller_addr(

  framebp: pointer;

  addr: CodePointer = Nil

):CodePointer;

Description

get_caller_frame returns a pointer to address ( the return address) of the caller of the routine which has as frame framebp.

See also

get_frame | Return the current frame
get_caller_frame | Return the frame pointer of the caller
Dump_Stack | Dump stack to the given text file.


get_caller_frame

Return the frame pointer of the caller

Declaration

Source position: systemh.inc line 1317

function get_caller_frame(

  framebp: pointer;

  addr: CodePointer = Nil

):pointer;

Description

get_caller_frame returns a pointer to the frame of the caller of the routine which has as frame framebp.

See also

get_caller_addr | Return the address of the caller.
get_frame | Return the current frame
Dump_Stack | Dump stack to the given text file.


get_caller_stackinfo

Return caller stack infomation

Declaration

Source position: systemh.inc line 1318

procedure get_caller_stackinfo(

  var framebp: pointer;

  var addr: CodePointer

);

Description

get_caller_stackinfo returns caller address in addr and frame base pointer in framebp.

See also

CaptureBacktrace | Return stack trace
Get_pc_addr | Get Program Counter address
get_caller_addr | Return the address of the caller.
get_caller_frame | Return the frame pointer of the caller


get_frame

Return the current frame

Declaration

Source position: systemh.inc line 1307

function get_frame: pointer;

Description

get_frame returns a pointer to the current stack frame.

See also

get_caller_addr | Return the address of the caller.
get_caller_frame | Return the frame pointer of the caller


Get_pc_addr

Get Program Counter address

Declaration

Source position: systemh.inc line 1310

function Get_pc_addr: CodePointer;

Description

Get_pc_addr returns the program counter address (current execution address).

See also

CaptureBacktrace | Return stack trace
get_caller_stackinfo | Return caller stack infomation
get_caller_addr | Return the address of the caller.
get_caller_frame | Return the frame pointer of the caller


greaterthan(variant,variant):Boolean

Implement > (greater than) operation on variants.

Declaration

Source position: varianth.inc line 375

operator operator >(

  const op1: variant;

  const op2: variant

):Boolean;

Description

The implementation of the "greater than" comparison (>) operation is delegated to the variant manager with operation opcmpgt.

Errors

Execution of this operator may result in an exception if no variant manager is installed or if the types of the operand are not suitable for the operation.

See also

operator <(variant, variant): boolean

Implement < (less than) operation on variants.


greaterthanorequal(variant,variant):Boolean

Implement >= (greater than or equal) operation on variants.

Declaration

Source position: varianth.inc line 376

operator operator >=(

  const op1: variant;

  const op2: variant

):Boolean;

Description

The implementation of the "greater than or equal" comparison (>=) operation is delegated to the variant manager with operation opcmpge.

Errors

Execution of this operator may result in an exception if no variant manager is installed or if the types of the operand are not suitable for the operation.

See also

operator <(variant, variant): boolean

Implement < (less than) operation on variants.


halt

Stop program execution.

Declaration

Source position: systemh.inc line 1408

procedure halt(

  errnum: LongInt

);

procedure halt;

Description

Halt stops program execution and returns control to the calling program. The optional argument Errnum specifies an exit value. If omitted, zero is returned.

Note that this skips any try/finally (implicit or explicit) or try/except blocks, thus may result in memory leaks. Finalization sections of units will be executed.

Errors

None.

See also

Exit

Exit current subroutine.

Example

Program Example30;

{ Program to demonstrate the Halt function. }

begin
 Writeln ('Before Halt.');
 Halt (1); { Stop with exit code 1 }
 Writeln ('After Halt doesn''t get executed.');
end.


hexStr

Convert integer value to string with hexadecimal representation.

Declaration

Source position: systemh.inc line 1103

function hexStr(

  Val: LongInt;

  cnt: Byte

):shortstring;

function hexStr(

  Val: Int64;

  cnt: Byte

):shortstring;

function hexStr(

  Val: QWord;

  cnt: Byte

):shortstring;

function hexStr(

  Val: Pointer

):shortstring;

Description

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.

Errors

None.

See also

Str | Convert a numerical or enumeration value to a string.
Val | Calculate numerical/enumerated value of a string.
BinStr | Convert integer to string with binary representation.

Example

Program example81;

{ Program to demonstrate the HexStr function }

Const Value = 45678;

Var I : longint;

begin
  For I:=1 to 10 do
    Writeln (HexStr(Value,I));
end.


hi

Return high byte/word/nibble of value.

Declaration

Source position: systemh.inc line 769

function hi(

  b: Byte

):Byte;

function hi(

  i: Integer

):Byte;

function hi(

  w: Word

):Byte;

function hi(

  l: LongInt

):Word;

function hi(

  l: DWord

):Word;

function hi(

  i: Int64

):DWord;

function hi(

  q: QWord

):DWord;

Description

Hi returns the high nibble, byte or word or longword from X, depending on the size of X.

8 | Byte, High nibble
16 | Byte, High byte
32 | Word, High word
64 | Cardinal, High DWord

Note that in delphi or TP, this function always treats its argument as if it was a Word, so the results may differ from FPC.

Errors

None.

See also

Lo

Return low nibble/byte/word of value.

Example

Program Example31;

{ Program to demonstrate the Hi function. }

var
  L : Longint;
  W : Word;
  B : Byte;

begin
  L:=1 Shl 16;     { = $10000 }
  W:=1 Shl 8;      { = $100 }
  B:=1 Shl 4;      { = $10  }
  Writeln (Hi(L)); { Prints 1 }
  Writeln (Hi(W)); { Prints 1 }
  Writeln (Hi(B)); { Prints 1 }
end.


High

Return highest index of open array or enumerated

Declaration

Source position: system.fpd line 45

function High(

  Arg: TypeOrVariable

):TOrdinal;

Description

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. For dynamic arrays, it returns the same as Length -1, meaning that it reports -1 for empty arrays.
  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. If the array is empty, then -1 is returned.
  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 !).

Errors

None.

See also

Low | Return lowest index of open array or enumerated
Ord | Return ordinal value of an ordinal type.
Pred | Return previous element for an ordinal type.
Succ | Return next element of ordinal type.

Example

Program example80;

{ Example to demonstrate the High and Low functions. }

Type TEnum = ( North, East, South, West );
     TRange = 14..55;
     TArray = Array [2..10] of Longint;

Function Average (Row : Array of Longint) : Real;

Var I : longint;
    Temp : Real;

begin
  Temp := Row[0];
  For I := 1 to High(Row) do
     Temp := Temp + Row[i];
  Average := Temp / (High(Row)+1);
end;

Var A : TEnum;
    B : TRange;
    C : TArray;
    I : longint;

begin
  Writeln ('TEnum  goes from : ',Ord(Low(TEnum)),' to ', Ord(high(TEnum)),'.');
  Writeln ('A      goes from : ',Ord(Low(A)),' to ', Ord(high(A)),'.');
  Writeln ('TRange goes from : ',Ord(Low(TRange)),' to ', Ord(high(TRange)),'.');
  Writeln ('B      goes from : ',Ord(Low(B)),' to ', Ord(high(B)),'.');
  Writeln ('TArray index goes from : ',Ord(Low(TArray)),' to ', Ord(high(TArray)),'.');
  Writeln ('C index      goes from : ',Low(C),' to ', high(C),'.');
  For I:=Low(C) to High(C) do
    C[i]:=I;
  Writeln ('Average :',Average(c));
  Write ('Type of return value is always same as type of argument:');
  Writeln(high(high(word)));
end.


HINSTANCE

Windows compatibility type for use in resources

Declaration

Source position: resh.inc line 56

function HINSTANCE: TFPResourceHMODULE;

Description

This is an opaque type.


Inc

Increase value of integer variable

Declaration

Source position: system.fpd line 46

procedure Inc(

  var X: TOrdinal

);

procedure Inc(

  var X: TOrdinal;

  Increment: TOrdinal

);

Description

Inc increases the value of X with Increment. If Increment isn't specified, then 1 is taken as a default.

Errors

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.

See also

Dec

Decrease value of variable

Example

Program Example32;

{ Program to demonstrate the Inc function. }

Const
  C : Cardinal  = 1;
  L : Longint   = 1;
  I : Integer   = 1;
  W : Word      = 1;
  B : Byte      = 1;
  SI : ShortInt = 1;
  CH : Char     = 'A';

begin
  Inc (C);     { C:=2    }
  Inc (L,5);   { L:=6    }
  Inc (I,-3);  { I:=-2   }
  Inc (W,3);   { W:=4    }
  Inc (B,100); { B:=101  }
  Inc (SI,-3); { Si:=-2  }
  Inc (CH,1);  { ch:='B' }
end.


Include

Include element in set if it was not yet present.

Declaration

Source position: system.fpd line 48

procedure Include(

  var S: TSetType;

  E: TSetElement

);

Description

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 Exclude

Errors

If the type of the element E is not equal to the base type of the set S, the compiler will generate an error.

See also

Exclude

Exlude element from a set if it is present.


IndexByte

Search for a byte in a memory range.

Declaration

Source position: systemh.inc line 746

function IndexByte(

  const buf;

  len: SizeInt;

  b: Byte

):SizeInt;

Description

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.

Errors

Buf and Len are not checked to see if they are valid values.

See also

IndexChar | Search for a character in a memory range.
IndexDWord | Search for a DWord value in a memory range.
IndexWord | Search for a WORD value in a memory range.
CompareByte | Compare 2 memory buffers byte per byte

Example

Program Example105;

{ Program to demonstrate the IndexByte function. }

Const
  ArraySize = 256;
  MaxValue = 256;

Var
  Buffer : Array[1..ArraySize] of Byte;
  I,J : longint;
  K : Byte;

begin
  Randomize;
  For I:=1 To ArraySize do
    Buffer[I]:=Random(MaxValue);
  For I:=1 to 10 do
    begin
    K:=Random(MaxValue);
    J:=IndexByte(Buffer,ArraySize,K);
    if J=-1 then
      Writeln('Value ',K,' was not found in buffer.')
    else
      Writeln('Found ',K,' at position ',J,' in buffer');
    end;
end.


IndexChar

Search for a character in a memory range.

Declaration

Source position: systemh.inc line 745

function IndexChar(

  const buf;

  len: SizeInt;

  b: Char

):SizeInt;

Description

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.

Errors

Buf and Len are not checked to see if they are valid values.

See also

IndexByte | Search for a byte in a memory range.
IndexDWord | Search for a DWord value in a memory range.
IndexWord | Search for a WORD value in a memory range.
CompareChar | ompare 2 memory buffers character per character

Example

Program Example108;

{ Program to demonstrate the IndexChar function. }

Const
  ArraySize = 1000;
  MaxValue = 26;

Var
  Buffer : Array[1..ArraySize] of Char;
  I,J : longint;
  K : Char;

begin
  Randomize;
  For I:=1 To ArraySize do
    Buffer[I]:=chr(Ord('A')+Random(MaxValue));
  For I:=1 to 10 do
    begin
    K:=chr(Ord('A')+Random(MaxValue));
    J:=IndexChar(Buffer,ArraySize,K);
    if J=-1 then
      Writeln('Value ',K,' was not found in buffer.')
    else
      Writeln('Found ',K,' at position ',J,' in buffer');
    end;
end.


IndexChar0

Return index of a character in null-terminated array of char.

Declaration

Source position: systemh.inc line 755

function IndexChar0(

  const buf;

  len: SizeInt;

  b: Char

):SizeInt;

Description

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.

Errors

On error, -1 is returned.

See also

IndexByte | Search for a byte in a memory range.
IndexChar | Search for a character in a memory range.
IndexWord | Search for a WORD value in a memory range.
IndexDWord | Search for a DWord value in a memory range.
CompareChar0 | Compare two buffers character by character till a null-character is reached.


IndexDWord

Search for a DWord value in a memory range.

Declaration

Source position: systemh.inc line 748

function IndexDWord(

  const buf;

  len: SizeInt;

  b: DWord

):SizeInt;

Description

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

Errors

Buf and Len are not checked to see if they are valid values.

See also

IndexByte | Search for a byte in a memory range.
IndexChar | Search for a character in a memory range.
IndexWord | Search for a WORD value in a memory range.
CompareDWord | Compare 2 memory buffers DWord per DWord

Example

Program Example106;

{ Program to demonstrate the IndexDWord function. }

Const
  ArraySize = 1000;
  MaxValue = 1000;

Var
  Buffer : Array[1..ArraySize] of DWord;
  I,J : longint;
  K : DWord;

begin
  Randomize;
  For I:=1 To ArraySize do
    Buffer[I]:=Random(MaxValue);
  For I:=1 to 10 do
    begin
    K:=Random(MaxValue);
    J:=IndexDWord(Buffer,ArraySize,K);
    if J=-1 then
      Writeln('Value ',K,' was not found in buffer.')
    else
      Writeln('Found ',K,' at position ',J,' in buffer');
    end;
end.


IndexQWord

Return the position of a QWord in a memory range

Declaration

Source position: systemh.inc line 749

function IndexQWord(

  const buf;

  len: SizeInt;

  b: QWord

):SizeInt;

Description

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.

Errors

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.

See also

IndexDWord

Search for a DWord value in a memory range.


Indexword

Search for a WORD value in a memory range.

Declaration

Source position: systemh.inc line 747

function Indexword(

  const buf;

  len: SizeInt;

  b: Word

):SizeInt;

Description

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

Errors

Buf and Len are not checked to see if they are valid values.

See also

IndexByte | Search for a byte in a memory range.
IndexDWord | Search for a DWord value in a memory range.
IndexChar | Search for a character in a memory range.
CompareWord | Compare 2 memory buffers word per word

Example

Program Example107;

{ Program to demonstrate the IndexWord function. }

Const
  ArraySize = 1000;
  MaxValue = 1000;

Var
  Buffer : Array[1..ArraySize] of Word;
  I,J : longint;
  K : Word;

begin
  Randomize;
  For I:=1 To ArraySize do
    Buffer[I]:=Random(MaxValue);
  For I:=1 to 10 do
    begin
    K:=Random(MaxValue);
    J:=IndexWord(Buffer,ArraySize,K);
    if J=-1 then
      Writeln('Value ',K,' was not found in buffer.')
    else
      Writeln('Found ',K,' at position ',J,' in buffer');
    end;
end.


InitCriticalSection

Initialize a critical section

Declaration

Source position: threadh.inc line 160

procedure InitCriticalSection(

  var cs: TRTLCriticalSection

);

Description

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

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

See also

DoneCriticalsection | Clean up a critical section.
EnterCriticalsection | Enter a critical section
LeaveCriticalsection | Leave a critical section


InitializeArray

Initialize managed-type elements in array

Declaration

Source position: rttih.inc line 14

procedure InitializeArray(

  p: Pointer;

  typeInfo: Pointer;

  count: SizeInt

);

Description

InitializeArray initializes managed types in the array pointed to by p. For this, it uses the type information of the elements as specified in typeinfo.

Under normal circumstances, this procedure should not be used, it is called automatically by the compiler when an array-typed variable is declared and the array contains elements with managed types.

See also

FinalizeArray | Finalize managed-type elements in array
CopyArray | Copy managed-type elements in array


InitThread

Initialize a thread

Declaration

Source position: threadh.inc line 122

procedure InitThread(

  stklen: SizeUInt

);

Description

Do not use, this is used internally by the thread manager.


InitThreadVars

Initialize threadvars

Declaration

Source position: threadh.inc line 120

procedure InitThreadVars(

  RelocProc: TRelocateThreadVarHandler

);

Description

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.

Errors

None.

See also

TThreadManager

Thread manager record.


Insert

Insert one string in another.

Declaration

Source position: systemh.inc line 1083

procedure Insert(

  const source: shortstring;

  var s: shortstring;

  index: SizeInt

);

procedure Insert(

  source: Char;

  var s: shortstring;

  index: SizeInt

);

procedure Insert(

  const Source: RawByteString;

  var S: RawByteString;

  Index: SizeInt

);

procedure Insert(

  const Source: UnicodeString;

  var S: UnicodeString;

  Index: SizeInt

);

procedure Insert(

  const Source: WideString;

  var S: WideString;

  Index: SizeInt

);

Description

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)

Errors

None.

See also

Delete | Delete part of a string.
Copy | Copy part of a string.
Pos | Search for substring in a string.

Example

Program Example33;

{ Program to demonstrate the Insert function. }

Var S : String;

begin
  S:='Free Pascal is difficult to use !';
  Insert ('NOT ',S,pos('difficult',S));
  writeln (s);
end.


int

Calculate integer part of floating point value.

Declaration

Source position: mathh.inc line 100

function int(

  d: ValReal

):ValReal;

Description

Int returns the integer part of any Real X, as a Real.

Errors

None.

See also

Frac | Return fractional part of floating point value.
Round | Round floating point value to nearest integer number.

Example

Program Example34;

{ Program to demonstrate the Int function. }

begin
  Writeln (Int(123.456):0:1);  { Prints  123.0 }
  Writeln (Int(-123.456):0:1); { Prints -123.0 }
end.


Int8

A signed 8-bits integer

Declaration

Source position: systemh.inc line 396

type Int8 = ShortInt;

See also

ShortInt

A signed 8-bits integer


Int16

A signed 16-bits integer

Declaration

Source position: systemh.inc line 397

type Int16 = SmallInt;

See also

SmallInt

A signed 16-bits integer


Int32

A signed 32-bits integer

Declaration

Source position: systemh.inc line 398

type Int32 = LongInt;

See also

Longint

A signed 32-bits integer


Int64

64-bit, signed integer

Declaration

Source position: system.fpd line 22

type Int64 = - 9223372036854775808..9223372036854775807;

Description

Int64 is a 64-bit, signed integer type, with range [-9223372036854775808..9223372036854775807].

See also

QWord | 64-bit unsigned integer
Longint | A signed 32-bits integer
Longword | An unsigned 32-bits integer


Integer

A signed 16-bits integer

Declaration

Source position: systemh.inc line 110

type Integer = SmallInt;

Description

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.

Remark: Note that due to the way the language modes are implemented, if you refer to integer with the fully qualified name System.Integer, you will still get a 16-bit integer.


IntegerArray

Generic array of integer.

Declaration

Source position: systemh.inc line 585

type IntegerArray = array [0..$effffff] of Integer;


intdivide(variant,variant):variant

Implement div (integer division) operation on variants.

Declaration

Source position: varianth.inc line 370

operator operator div(

  const op1: variant;

  const op2: variant

):variant;

Description

The implementation of the integer division Div operation is delegated to the variant manager with operation opintdivide.

Errors

Execution of this operator may result in an exception if no variant manager is installed or if the types of the operand are not suitable for the operation.

See also

operator mod(variant, variant): variant

Implement mod (modulo) operation on variants.


InterlockedCompareExchange

Conditional exchange

Declaration

Source position: systemh.inc line 1332

function InterlockedCompareExchange(

  var Target: LongInt;

  NewValue: LongInt;

  Comperand: LongInt

):LongInt;

function InterlockedCompareExchange(

  var Target: Pointer;

  NewValue: Pointer;

  Comperand: Pointer

):Pointer;

function InterlockedCompareExchange(

  var Target: Cardinal;

  NewValue: Cardinal;

  Comperand: Cardinal

):Cardinal;

Description

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.

Errors

None.

See also

InterLockedDecrement | Thread-safe decrement
InterLockedIncrement | Thread-safe increment
InterLockedExchange | Exchange 2 integers in a thread-safe way
InterLockedExchangeAdd | Thread-safe add and exchange of 2 values


InterlockedCompareExchange64

Declaration

Source position: systemh.inc line 1338

function InterlockedCompareExchange64(

  var Target: Int64;

  NewValue: Int64;

  Comperand: Int64

):Int64;

function InterlockedCompareExchange64(

  var Target: QWord;

  NewValue: QWord;

  Comperand: QWord

):Int64;


InterLockedDecrement

Thread-safe decrement

Declaration

Source position: systemh.inc line 1329

function InterLockedDecrement(

  var Target: LongInt

):LongInt;

function InterLockedDecrement(

  var Target: Pointer

):Pointer;

function InterLockedDecrement(

  var Target: Cardinal

):Cardinal;

Description

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

Errors

None.

See also

InterLockedIncrement | Thread-safe increment
InterLockedExchange | Exchange 2 integers in a thread-safe way
InterLockedExchangeAdd | Thread-safe add and exchange of 2 values
InterlockedCompareExchange | Conditional exchange


InterLockedDecrement64

Declaration

Source position: systemh.inc line 1335

function InterLockedDecrement64(

  var Target: Int64

):Int64;

function InterLockedDecrement64(

  var Target: QWord

):QWord;


InterLockedExchange

Exchange 2 integers in a thread-safe way

Declaration

Source position: systemh.inc line 1330

function InterLockedExchange(

  var Target: LongInt;

  Source: LongInt

):LongInt;

function InterLockedExchange(

  var Target: Pointer;

  Source: Pointer

):Pointer;

function InterLockedExchange(

  var Target: Cardinal;

  Source: Cardinal

):Cardinal;

Description

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.

Errors

None.

See also

InterLockedDecrement | Thread-safe decrement
InterLockedIncrement | Thread-safe increment
InterLockedExchangeAdd | Thread-safe add and exchange of 2 values
InterlockedCompareExchange | Conditional exchange


InterLockedExchange64

Declaration

Source position: systemh.inc line 1336

function InterLockedExchange64(

  var Target: Int64;

  Source: Int64

):Int64;

function InterLockedExchange64(

  var Target: QWord;

  Source: QWord

):QWord;


InterLockedExchangeAdd

Thread-safe add and exchange of 2 values

Declaration

Source position: systemh.inc line 1331

function InterLockedExchangeAdd(

  var Target: LongInt;

  Source: LongInt

):LongInt;

function InterLockedExchangeAdd(

  var Target: Pointer;

  Source: Pointer

):Pointer;

function InterLockedExchangeAdd(

  var Target: Cardinal;

  Source: Cardinal

):Cardinal;

Description

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

Errors

None.

See also

InterLockedDecrement | Thread-safe decrement
InterLockedIncrement | Thread-safe increment
InterLockedExchange | Exchange 2 integers in a thread-safe way
InterlockedCompareExchange | Conditional exchange


InterLockedExchangeAdd64

Declaration

Source position: systemh.inc line 1337

function InterLockedExchangeAdd64(

  var Target: Int64;

  Source: Int64

):Int64;

function InterLockedExchangeAdd64(

  var Target: QWord;

  Source: QWord

):QWord;


InterLockedIncrement

Thread-safe increment

Declaration

Source position: systemh.inc line 1328

function InterLockedIncrement(

  var Target: LongInt

):LongInt;

function InterLockedIncrement(

  var Target: Pointer

):Pointer;

function InterLockedIncrement(

  var Target: Cardinal

):Cardinal;

Description

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

Errors

None.

See also

InterLockedDecrement | Thread-safe decrement
InterLockedExchange | Exchange 2 integers in a thread-safe way
InterLockedExchangeAdd | Thread-safe add and exchange of 2 values
InterlockedCompareExchange | Conditional exchange


InterLockedIncrement64

Declaration

Source position: systemh.inc line 1334

function InterLockedIncrement64(

  var Target: Int64

):Int64;

function InterLockedIncrement64(

  var Target: QWord

):QWord;


IOResult

Return result of last file IO operation

Declaration

Source position: systemh.inc line 1320

function IOResult: Word;

Description

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.

Errors

None.

Example

Program Example35;

{ Program to demonstrate the IOResult function. }

Var F : text;

begin
  Assign (f,paramstr(1));
  {$i-}
  Reset (f);
  {$i+}
  If IOresult<>0 then
    writeln ('File ',paramstr(1),' doesn''t exist')
  else
    writeln ('File ',paramstr(1),' exists');
end.


IsDynArrayRectangular

Check whether all dimensions have the same size

Declaration

Source position: dynarrh.inc line 38

function IsDynArrayRectangular(

  a: Pointer;

  typeInfo: Pointer

):Boolean;

Description

IsDynArrayRectangular returns True if all dimensions of the dynamic array a with type information typinfo have the same bounds. It returns True if the array is empty.

See also

InitializeArray | Initialize managed-type elements in array
FinalizeArray | Finalize managed-type elements in array
CopyArray | Copy managed-type elements in array
DynArraySize | Return length of dynamic array
DynArrayClear | Clear dynamical array
DynArrayBounds | Return the bounds of the dynamic array
DynArrayDim | Return the number of dimensions in a dynamic array


IsMemoryManagerSet

Is the memory manager set

Declaration

Source position: heaph.inc line 56

function IsMemoryManagerSet: Boolean;

Description

IsMemoryManagerSet will return True if the memory manager has been set to another value than the system heap manager, it will return False otherwise.

Errors

None.

See also

SetMemoryManager | Set a memory manager
GetMemoryManager | Return current memory manager


Is_IntResource

Check whether a resource is an internal resource

Declaration

Source position: resh.inc line 52

function Is_IntResource(

  aStr: PChar

):Boolean;

Description

Is_IntResource returns True if the resource type is internal (system predefined) resource or false if it is a user-defined resource type.

Errors

None.


KillThread

Kill a running thread

Declaration

Source position: threadh.inc line 150

function KillThread(

  threadHandle: TThreadID

):DWord;

Description

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.

Errors

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

See also

WaitForThreadTerminate | Wait for a thread to terminate.
EndThread | End the current thread.
SuspendThread | Suspend a running thread.


LeaveCriticalsection

Leave a critical section

Declaration

Source position: threadh.inc line 163

procedure LeaveCriticalsection(

  var cs: TRTLCriticalSection

);

Description

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

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

See also

InitCriticalsection | Initialize a critical section
DoneCriticalsection | Clean up a critical section.
EnterCriticalsection | Enter a critical section


leftshift(variant,variant):variant

Implement binary shl operation on variants.

Declaration

Source position: varianth.inc line 363

operator operator shl(

  const op1: variant;

  const op2: variant

):variant;

Description

The implementation of the shl operation is delegated to the variant manager with operation opshiftleft.

Errors

Execution of this operator may result in an exception if no variant manager is installed or if the types of the operand are not suitable for the operation.

See also

operator shr(variant, variant): variant

Implement binary shr operation on variants.


lessthan(variant,variant):Boolean

Implement < (less than) operation on variants.

Declaration

Source position: varianth.inc line 374

operator operator <(

  const op1: variant;

  const op2: variant

):Boolean;

Description

The implementation of the "less than" comparison (<) operation is delegated to the variant manager with operation opcmplt.

Errors

Execution of this operator may result in an exception if no variant manager is installed or if the types of the operand are not suitable for the operation.

See also

operator >(variant, variant): boolean

Implement > (greater than) operation on variants.


lessthanorequal(variant,variant):Boolean

Implement <= (less than or equal) operation on variants.

Declaration

Source position: varianth.inc line 377

operator operator <=(

  const op1: variant;

  const op2: variant

):Boolean;

Description

The implementation of the "less than or equal" comparison (<=) operation is delegated to the variant manager with operation opcmple.

Errors

Execution of this operator may result in an exception if no variant manager is installed or if the types of the operand are not suitable for the operation.

See also

operator <(variant, variant): boolean

Implement < (less than) operation on variants.


LEtoN

Convert Little Endian-ordered integer to Native-ordered integer

Declaration

Source position: systemh.inc line 836

function LEtoN(

  const AValue: SmallInt

):SmallInt;

function LEtoN(

  const AValue: Word

):Word;

function LEtoN(

  const AValue: LongInt

):LongInt;

function LEtoN(

  const AValue: DWord

):DWord;

function LEtoN(

  const AValue: Int64

):Int64;

function LEtoN(

  const AValue: QWord

):QWord;

Description

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.

See also

BEtoN | Convert Big Endian-ordered integer to Native-ordered integer
NtoBE | Convert Native-ordered integer to a Big Endian-ordered integer
NtoLE | Convert Native-ordered integer to a Little Endian-ordered integer


ln

Calculate logarithm

Declaration

Source position: mathh.inc line 94

function ln(

  d: ValReal

):ValReal;

Description

Ln returns the natural logarithm of the Real parameter X. X must be positive.

Errors

An run-time error will occur when X is negative.

See also

Exp

Exponentiate

Example

Program Example37;

{ Program to demonstrate the Ln function. }

begin
  Writeln (Ln(1));      { Prints 0 }
  Writeln (Ln(Exp(1))); { Prints 1 }
end.


lo

Return low nibble/byte/word of value.

Declaration

Source position: systemh.inc line 768

function lo(

  B: Byte

):Byte;

function lo(

  i: Integer

):Byte;

function lo(

  w: Word

):Byte;

function lo(

  l: LongInt

):Word;

function lo(

  l: DWord

):Word;

function lo(

  i: Int64

):DWord;

function lo(

  q: QWord

):DWord;

Description

Lo returns the high nibble, byte or word or longword from X, depending on the size of X.

8 | Byte, low nibble
16 | Byte, low byte
32 | Word, low word
64 | Cardinal, low DWord

Errors

None.

See also

Ord | Return ordinal value of an ordinal type.
Chr | Convert byte value to character value
Hi | Return high byte/word/nibble of value.

Example

Program Example38;

{ Program to demonstrate the Lo function. }

Var L : Longint;
    W : Word;
    B : Byte;
begin
  L:=(1 Shl 16) + (1 Shl 4);  { $10010 }
  Writeln (Lo(L));            { Prints 16 }
  W:=(1 Shl 8) + (1 Shl 4);   { $110   }
  Writeln (Lo(W));            { Prints 16 }
  B:=$EF;
  Writeln (Lo(B));            { Prints 15 }
end.


LoadResource

Load a resource for use

Declaration

Source position: resh.inc line 62

function LoadResource(

  ModuleHandle: TFPResourceHMODULE;

  ResHandle: TFPResourceHandle

):TFPResourceHGLOBAL;

Description

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

Errors

On error, 0 is returned.

See also

FindResource | Locate a resource and return a handle to it.
FreeResource | Free a loaded resource
SizeofResource | Return the size of a particular resource
LockResource | Lock a resource
UnlockResource | Unlock a previously locked resource
FreeResource | Free a loaded resource


LockResource

Lock a resource

Declaration

Source position: resh.inc line 64

function LockResource(

  ResData: TFPResourceHGLOBAL

):Pointer;

Description

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

Errors

if the function fails, Nil is returned.

See also

FindResource | Locate a resource and return a handle to it.
FreeResource | Free a loaded resource
SizeofResource | Return the size of a particular resource
LoadResource | Load a resource for use
UnlockResource | Unlock a previously locked resource
FreeResource | Free a loaded resource


logicaland(variant,variant):variant

Implement logical/binary and operation on variants

Declaration

Source position: varianth.inc line 360

operator operator and(

  const op1: variant;

  const op2: variant

):variant;

Description

The implementation of the and operation is delegated to the variant manager with operation opand.

Errors

Execution of this operator may result in an exception if no variant manager is installed or if the types of the operand are not suitable for the operation.

See also

operator or(variant, variant): variant | Implement logical/binary or operation on variants
operator xor(variant, variant): variant | Implement logical/binary xor operation on variants
operator not(variant): variant | Implement logical/binary not operation on variants


logicalnot(variant):variant

Implement logical/binary not operation on variants

Declaration

Source position: varianth.inc line 362

operator operator not(

  const op: variant

):variant;

Description

The implementation of the not operation is delegated to the variant manager with operation opnot.

Errors

Execution of this operator may result in an exception if no variant manager is installed or if the types of the operand are not suitable for the operation.

See also

operator and(variant, variant): variant | Implement logical/binary and operation on variants
operator or(variant, variant): variant | Implement logical/binary or operation on variants
operator xor(variant, variant): variant | Implement logical/binary xor operation on variants


logicalor(variant,variant):variant

Implement logical/binary or operation on variants

Declaration

Source position: varianth.inc line 359

operator operator or(

  const op1: variant;

  const op2: variant

):variant;

Description

The implementation of the or operation is delegated to the variant manager with operation opor.

Errors

Execution of this operator may result in an exception if no variant manager is installed or if the types of the operand are not suitable for the operation.

See also

operator and(variant, variant): variant | Implement logical/binary and operation on variants
operator xor(variant, variant): variant | Implement logical/binary xor operation on variants
operator not(variant): variant | Implement logical/binary not operation on variants


logicalxor(variant,variant):variant

Implement logical/binary xor operation on variants

Declaration

Source position: varianth.inc line 361

operator operator xor(

  const op1: variant;

  const op2: variant

):variant;

Description

The implementation of the xor operation is delegated to the variant manager with operation opxor.

Errors

Execution of this operator may result in an exception if no variant manager is installed or if the types of the operand are not suitable for the operation.

See also

operator or(variant, variant): variant | Implement logical/binary or operation on variants
operator and(variant, variant): variant | Implement logical/binary and operation on variants
operator not(variant): variant | Implement logical/binary not operation on variants


longjmp

Jump to address.

Declaration

Source position: setjumph.inc line 27

procedure longjmp(

  var S: jmp_buf;

  value: LongInt

);

Description

LongJmp jumps to the adress in the envjmp_buf, and restores the registers that were stored in it at the corresponding SetJmp 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 SetJmp

Errors

None.

See also

SetJmp

Save current execution point.


Low

Return lowest index of open array or enumerated

Declaration

Source position: system.fpd line 49

function Low(

  Arg: TypeOrVariable

):TOrdinal;

Description

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

Errors

None.

See also

High | Return highest index of open array or enumerated
Ord | Return ordinal value of an ordinal type.
Pred | Return previous element for an ordinal type.
Succ | Return next element of ordinal type.


lowerCase

Return lowercase version of a string.

Declaration

Source position: systemh.inc line 1101

function lowerCase(

  const s: shortstring

):shortstring; overload;

function lowerCase(

  c: Char

):Char; overload;

function lowercase(

  const s: ansistring

):ansistring;

function LowerCase(

  const s: UnicodeString

):UnicodeString;

function LowerCase(

  c: UnicodeChar

):UnicodeChar;

Description

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.

Lowercase does not change the number of characters (or bytes) in an ansistring.

Errors

None.

See also

Upcase

Convert a string to all uppercase.

Example

program Example73;

{ Program to demonstrate the Lowercase function. }

var c:char;

begin
  for c:='A' to 'Z' do
    write(lowercase(c));
  Writeln;
  Writeln(Lowercase('ABCDEFGHIJKLMNOPQRSTUVWXYZ'));
end.


MakeLangID

Create a langauge ID

Declaration

Source position: resh.inc line 53

function MakeLangID(

  primary: Word;

  sub: Word

):Word;

Description

MakeLangID creates a language ID from the primary and sub language IDS.


MemSize

Return the size of a memory block.

Declaration

Source position: heaph.inc line 89

function MemSize(

  p: pointer

):PtrUInt;

Description

MemSize returns the size of a memory block on the heap.

Errors

Passing an invalid pointer may lead to run-time errors (access violations).

See also

GetMem | Allocate new memory on the heap
FreeMem | Release allocated memory


mkdir

Create a new directory.

Declaration

Source position: systemh.inc line 1272

procedure mkdir(

  const s: shortstring

); overload;

procedure mkdir(

  const s: RawByteString

); overload;

procedure mkdir(

  const s: unicodestring

); overload;

Description

Mkdir creates a new directory S.

For an example, see Rmdir.

Errors

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.

See also

Chdir | Change current working directory.
Rmdir | Remove directory when empty.


modulus(variant,variant):variant

Implement mod (modulo) operation on variants.

Declaration

Source position: varianth.inc line 371

operator operator mod(

  const op1: variant;

  const op2: variant

):variant;

Description

The implementation of the modulo Mod operation is delegated to the variant manager with operation opModulus.

Errors

Execution of this operator may result in an exception if no variant manager is installed or if the types of the operand are not suitable for the operation.

See also

operator div(variant, variant): variant

Implement div (integer division) operation on variants.


Move

Move data from one location in memory to another

Declaration

Source position: systemh.inc line 737

procedure Move(

  const source;

  var dest;

  count: SizeInt

);

Description

Move moves Count bytes from Source to Dest.

Errors

If either Dest or Source is outside the accessible memory for the process, then a run-time error will be generated.

See also

Fillword | Fill memory region with 16-bit pattern
Fillchar | Fill memory region with certain character

Example

Program Example42;

{ Program to demonstrate the Move function. }

Var S1,S2 : String [30];

begin
  S1:='Hello World !';
  S2:='Bye, bye    !';
  Move (S1,S2,Sizeof(S1));
  Writeln (S2);
end.


MoveChar0

Move data till first zero character

Declaration

Source position: systemh.inc line 754

procedure MoveChar0(

  const buf1;

  var buf2;

  len: SizeInt

);

Description

MoveChar0 moves Count bytes from buf1 to buf2, and stops moving if a zero character is found.

Errors

No checking is done to see if Count stays within the memory allocated to the process.

See also

Move

Move data from one location in memory to another

Example

Program Example109;

{ Program to demonstrate the MoveChar0 function. }

Var
  Buf1,Buf2 : Array[1..80] of char;
  I : longint;

begin
  Randomize;
  For I:=low(buf1) to high(buf1) do
    Buf1[i]:=chr(Random(16)+Ord('A'));
  Writeln('Original buffer');
  writeln(Buf1);
  Buf1[Random(80)+1]:=#0;
  MoveChar0(Buf1,Buf2,80);
  Writeln('Randomly zero-terminated Buffer');
  Writeln(Buf2);
end.


multiply(variant,variant):variant

Implement multiplication (*) operation on variants.

Declaration

Source position: varianth.inc line 367

operator operator *(

  const op1: variant;

  const op2: variant

):variant;

Description

The implementation of the multiplication * operation is delegated to the variant manager with operation opMultiply.

Errors

Execution of this operator may result in an exception if no variant manager is installed or if the types of the operand are not suitable for the operation.

See also

operator /(variant, variant): variant

Implement division (/) operation on variants.


negative(variant):variant

Implement - (unary minus, negation) operation on variants.

Declaration

Source position: varianth.inc line 372

operator operator -(

  const op: variant

):variant;

Description

The implementation of the unary minus (-) operation is delegated to the variant manager with operation varNeg.

Errors

Execution of this operator may result in an exception if no variant manager is installed or if the types of the operand are not suitable for the operation.

See also

operator -(variant, variant): variant

Implement subtraction (-) operation on variants.


New

Dynamically allocate memory for variable

Declaration

Source position: system.fpd line 50

procedure New(

  var P: Pointer

);

procedure New(

  var P: Pointer;

  Cons: TProcedure

);

Description

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.

The newly allocated memory is not initialized in any way, and may contain garbage data. It must be cleared with a call to FillChar or FillWord.

For an example, see Dispose.

Errors

What happens if no more memory is available, depends on the value of the variable ReturnNilIfGrowHeapfails: if the variable is True then Nil is returned. If the variable is False, a run-time error is generated.

See also

Dispose | Free dynamically allocated memory
Freemem | Release allocated memory
Getmem | Allocate new memory on the heap
ReturnNilIfGrowHeapfails | Describe behaviour if getmem fails.


NtoBE

Convert Native-ordered integer to a Big Endian-ordered integer

Declaration

Source position: systemh.inc line 843

function NtoBE(

  const AValue: SmallInt

):SmallInt;

function NtoBE(

  const AValue: Word

):Word;

function NtoBE(

  const AValue: LongInt

):LongInt;

function NtoBE(

  const AValue: DWord

):DWord;

function NtoBE(

  const AValue: Int64

):Int64;

function NtoBE(

  const AValue: QWord

):QWord;

Description

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.

See also

BEtoN | Convert Big Endian-ordered integer to Native-ordered integer
LEtoN | Convert Little Endian-ordered integer to Native-ordered integer
NtoLE | Convert Native-ordered integer to a Little Endian-ordered integer


NtoLE

Convert Native-ordered integer to a Little Endian-ordered integer

Declaration

Source position: systemh.inc line 850

function NtoLE(

  const AValue: SmallInt

):SmallInt;

function NtoLE(

  const AValue: Word

):Word;

function NtoLE(

  const AValue: LongInt

):LongInt;

function NtoLE(

  const AValue: DWord

):DWord;

function NtoLE(

  const AValue: Int64

):Int64;

function NtoLE(

  const AValue: QWord

):QWord;

Description

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.

See also

BEtoN | Convert Big Endian-ordered integer to Native-ordered integer
LEtoN | Convert Little Endian-ordered integer to Native-ordered integer
NtoBE | Convert Native-ordered integer to a Big Endian-ordered integer


Null

Null variant

Declaration

Source position: varianth.inc line 225

function Null: Variant;


OctStr

Convert integer to a string with octal representation.

Declaration

Source position: systemh.inc line 1104

function OctStr(

  Val: LongInt;

  cnt: Byte

):shortstring;

function OctStr(

  Val: Int64;

  cnt: Byte

):shortstring;

function OctStr(

  Val: QWord;

  cnt: Byte

):shortstring;

Description

OctStr returns a string with the octal representation of Value. The string has exactly cnt charaters.

Errors

None.

See also

Str | Convert a numerical or enumeration value to a string.
Val | Calculate numerical/enumerated value of a string.
BinStr | Convert integer to string with binary representation.
HexStr | Convert integer value to string with hexadecimal representation.

Example

Program example112;

{ Program to demonstrate the OctStr function }

Const Value = 45678;

Var I : longint;

begin
  For I:=1 to 10 do
    Writeln (OctStr(Value,I));
  For I:=1 to 16 do
    Writeln (OctStr(I,3));
end.


odd

Is a value odd or even ?

Declaration

Source position: systemh.inc line 817

function odd(

  l: LongInt

):Boolean;

function odd(

  l: LongWord

):Boolean;

function odd(

  l: Int64

):Boolean;

function odd(

  l: QWord

):Boolean;

Description

Odd returns True if X is odd, or False otherwise.

Errors

None.

See also

Abs | Calculate absolute value
Ord | Return ordinal value of an ordinal type.

Example

Program Example43;

{ Program to demonstrate the Odd function. }

begin
  If Odd(1) Then
    Writeln ('Everything OK with 1 !');
  If Not Odd(2) Then
    Writeln ('Everything OK with 2 !');
end.


Ofs

Return offset of a variable.

Declaration

Source position: system.fpd line 52

function Ofs(

  var X

):LongInt;

Description

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/64 bit compiler.

Errors

None.

See also

DSeg | Return data segment
CSeg | Return code segment
Seg | Return segment
Ptr | Combine segment and offset to pointer

Example

Program Example44;

{ Program to demonstrate the Ofs function. }

Var W : Pointer;

begin
  W:=Pointer(Ofs(W)); { W contains its own offset. }
end.


Ord

Return ordinal value of an ordinal type.

Declaration

Source position: system.fpd line 53

function Ord(

  X: TOrdinal

):LongInt;

Description

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.

Errors

None.

See also

Chr | Convert byte value to character value
Succ | Return next element of ordinal type.
Pred | Return previous element for an ordinal type.
High | Return highest index of open array or enumerated
Low | Return lowest index of open array or enumerated

Example

Program Example45;

{ Program to demonstrate the Ord,Pred,Succ functions. }

Type
  TEnum = (Zero, One, Two, Three, Four);

Var
  X : Longint;
  Y : TEnum;

begin
  X:=125;
  Writeln (Ord(X));  { Prints 125 }
  X:=Pred(X);
  Writeln (Ord(X));  { prints 124 }
  Y:= One;
  Writeln (Ord(y));  { Prints 1 }
  Y:=Succ(Y);
  Writeln (Ord(Y));  { Prints 2}
end.


ParamCount

Return number of command-line parameters passed to the program.

Declaration

Source position: systemh.inc line 1396

function ParamCount: LongInt;

Description

Paramcount returns the number of command-line arguments. If no arguments were given to the running program, 0 is returned.

Errors

None.

See also

Paramstr

Return value of a command-line argument.

Example

Program Example46;

{ Program to demonstrate the ParamCount and ParamStr functions. }
Var
  I : Longint;

begin
  Writeln (paramstr(0),' : Got ',ParamCount,' command-line parameters: ');
  For i:=1 to ParamCount do
    Writeln (ParamStr (i));
end.


ParamStr

Return value of a command-line argument.

Declaration

Source position: systemh.inc line 1397

function ParamStr(

  l: LongInt

):string;

Description

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 returned 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), so it is best to avoid using it on that platform.

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

Errors

None.

See also

Paramcount

Return number of command-line parameters passed to the program.


pi

Return the value of PI.

Declaration

Source position: mathh.inc line 89

function pi: ValReal;

Description

Pi returns the value of Pi (3.1415926535897932385).

Errors

None.

See also

Cos | Calculate cosine of angle
Sin | Calculate sine of angle

Example

Program Example47;

{ Program to demonstrate the Pi function. }

begin
  Writeln (Pi);         {3.1415926}
  Writeln (Sin(Pi));
end.


PopCnt

Count number of set bits

Declaration

Source position: systemh.inc line 1045

function PopCnt(

  const AValue: Byte

):Byte;

function PopCnt(

  const AValue: Word

):Word;

function PopCnt(

  const AValue: DWord

):DWord;

function PopCnt(

  const AValue: QWord

):QWord;

Description

PopCnt (population count) counts the number of set bits in AValue.


Pos

Search for substring in a string.

Declaration

Source position: systemh.inc line 1085

function Pos(

  const substr: shortstring;

  const s: shortstring

):SizeInt;

function Pos(

  C: Char;

  const s: shortstring

):SizeInt;

function Pos(

  const Substr: ShortString;

  const Source: RawByteString

):SizeInt;

function pos(

  const substr: shortstring;

  c: Char

):SizeInt;

function Pos(

  const Substr: RawByteString;

  const Source: RawByteString

):SizeInt;

function Pos(

  c: AnsiChar;

  const s: RawByteString

):SizeInt;

function Pos(

  const Substr: UnicodeString;

  const Source: UnicodeString

):SizeInt;

function Pos(

  c: Char;

  const s: UnicodeString

):SizeInt;

function Pos(

  c: UnicodeChar;

  const s: UnicodeString

):SizeInt;

function Pos(

  const c: RawByteString;

  const s: UnicodeString

):SizeInt;

function Pos(

  const c: UnicodeString;

  const s: RawByteString

):SizeInt;

function Pos(

  const c: ShortString;

  const s: UnicodeString

):SizeInt;

function Pos(

  const Substr: WideString;

  const Source: WideString

):SizeInt;

function Pos(

  c: Char;

  const s: WideString

):SizeInt;

function Pos(

  c: WideChar;

  const s: WideString

):SizeInt;

function Pos(

  c: WideChar;

  const s: RawByteString

):SizeInt;

function Pos(

  const c: RawByteString;

  const s: WideString

):SizeInt;

function Pos(

  const c: WideString;

  const s: RawByteString

):SizeInt;

function Pos(

  const c: ShortString;

  const s: WideString

):SizeInt;

function Pos(

  c: Char;

  const v: Variant

):SizeInt;

function Pos(

  s: ShortString;

  const v: Variant

):SizeInt;

function Pos(

  const a: AnsiString;

  const v: Variant

):SizeInt;

function Pos(

  const w: WideString;

  const v: Variant

):SizeInt;

function Pos(

  const w: UnicodeString;

  const v: Variant

):SizeInt;

function Pos(

  const v: Variant;

  const c: Char

):SizeInt;

function Pos(

  const v: Variant;

  const s: ShortString

):SizeInt;

function Pos(

  const v: Variant;

  const a: AnsiString

):SizeInt;

function Pos(

  const v: Variant;

  const w: WideString

):SizeInt;

function Pos(

  const v: Variant;

  const w: UnicodeString

):SizeInt;

function Pos(

  const v1: Variant;

  const v2: Variant

):SizeInt;

Description

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.

Errors

None

See also

Length | Returns length of a string or array.
Copy | Copy part of a string.
Delete | Delete part of a string.
Insert | Insert one string in another.

Example

Program Example48;

{ Program to demonstrate the Pos function. }

Var
  S : String;

begin
  S:='The first space in this sentence is at position : ';
  Writeln (S,pos(' ',S));
  S:='The last letter of the alphabet doesn''t appear in this sentence ';
  If (Pos ('Z',S)=0) and (Pos('z',S)=0) then
    Writeln (S);
end.


power(variant,variant):variant

Implement power (**) operation on variants.

Declaration

Source position: varianth.inc line 369

operator operator **(

  const op1: variant;

  const op2: variant

):variant;

Description

The implementation of the power ** operation is delegated to the variant manager with operation opPower.

Errors

Execution of this operator may result in an exception if no variant manager is installed or if the types of the operand are not suitable for the operation.

See also

operator *(variant, variant): variant

Implement multiplication (*) operation on variants.


Pred

Return previous element for an ordinal type.

Declaration

Source position: system.fpd line 54

function Pred(

  X: TOrdinal

):TOrdinal;

Description

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 Ord

Errors

Run-time error 201 is generated when the result is out of range.

See also

Ord | Return ordinal value of an ordinal type.
Succ | Return next element of ordinal type.
High | Return highest index of open array or enumerated
Low | Return lowest index of open array or enumerated


prefetch

Prefetch a memory location

Declaration

Source position: systemh.inc line 757

procedure prefetch(

  const mem

);

Description

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.

Errors

None.


ptr

Combine segment and offset to pointer

Declaration

Source position: systemh.inc line 1061

function ptr(

  sel: LongInt;

  off: LongInt

):FarPointer;

Description

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

Remark:
  1. In the 32/64-bit flat-memory model supported by Free Pascal, this function is obsolete.
  2. The returned address is simply the offset.

Errors

None.

See also

Addr

Return address of a variable

Example

Program Example59;

{ Program to demonstrate the Ptr (compatibility) function. }

type pString = ^String;

Var P : pString;
    S : String;

begin
  S:='Hello, World !';
  P:=pString(Ptr(Seg(S),Longint(Ofs(S))));
  {P now points to S !}
  Writeln (P^);
end.


PtrInt

Signed integer type with same size as Pointer.

Declaration

Source position: systemh.inc line 338

type PtrInt = Int64;

Description

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

See also

ptruInt

Unsigned integer type with same size as Pointer.


PtrInt

Signed integer type with same size as Pointer.

Declaration

Source position: systemh.inc line 350

type PtrInt = LongInt;

Description

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

See also

ptruInt

Unsigned integer type with same size as Pointer.


PtrUInt

Unsigned integer type with same size as Pointer.

Declaration

Source position: systemh.inc line 339

type PtrUInt = QWord;

Description

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.


PtrUInt

Unsigned integer type with same size as Pointer.

Declaration

Source position: systemh.inc line 351

type PtrUInt = DWord;

Description

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.


RaiseList

List of currently raised exceptions.

Declaration

Source position: objpash.inc line 349

function RaiseList: PExceptObject;

Description

RaiseList returns a pointer to the list of currently raised exceptions (i.e. a pointer to the first exception block.


Random

Generate random number

Declaration

Source position: systemh.inc line 794

function Random(

  l: LongInt

):LongInt;

function Random(

  l: Int64

):Int64;

function Random: extended;

Description

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

Remark: The Free Pascal implementation of the Random routine uses the Mersenne Twister to simulate randomness. This implementation has a better statistical distribution than for example a Linear Congruential generator algorithm, but is considerably slower than the latter. If speed is an issue, then alternate random number generators should be considered.

Errors

None.

See also

Randomize

Initialize random number generator

Example

Program Example49;

{ Program to demonstrate the Random and Randomize functions. }

Var I,Count,guess : Longint;
    R : Real;

begin
  Randomize; { This way we generate a new sequence every time
               the program is run}
  Count:=0;
  For i:=1 to 1000 do
    If Random>0.5 then inc(Count);
  Writeln ('Generated ',Count,' numbers > 0.5');
  Writeln ('out of 1000 generated numbers.');
  count:=0;
  For i:=1 to 5 do
    begin
    write ('Guess a number between 1 and 5 : ');
    readln(Guess);
    If Guess=Random(5)+1 then inc(count);
    end;
  Writeln ('You guessed ',Count,' out of 5 correct.');
end.


Randomize

Initialize random number generator

Declaration

Source position: systemh.inc line 799

procedure Randomize;

Description

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

For an example, see Random.

Errors

None.

See also

Random

Generate random number


Read

Read from a text file into variable

Declaration

Source position: system.fpd line 55

procedure Read(

  var F: Text;

  Args: Arguments

);

procedure Read(

  Args: Arguments

);

Description

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.

Errors

If no data is available, empty values are returned (0 for ordinal values, empty strings for string values)

See also

Readln | Read from a text file into variable and goto next line
Blockread | Read data from an untyped file into memory
Write | Write variable to a text file
Blockwrite | Write data from memory to an untyped file

Example

Program Example50;

{ Program to demonstrate the Read(Ln) function. }

Var S : String;
    C : Char;
    F : File of char;

begin
  Assign (F,'ex50.pp');
  Reset (F);
  C:='A';
  Writeln ('The characters before the first space in ex50.pp are : ');
  While not Eof(f) and (C<>' ') do
    Begin
    Read (F,C);
    Write (C);
    end;
 Writeln;
 Close (F);
 Writeln ('Type some words. An empty line ends the program.');
 repeat
   Readln (S);
 until S='';
end.


ReadBarrier

Memory Read Barrier

Declaration

Source position: systemh.inc line 758

procedure ReadBarrier;

Description

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.

See also

ReadDependencyBarrier | Memory Read Dependency Barrier
ReadWriteBarrier | Memory read/write barrier
WriteBarrier | Memory write barrier


ReadDependencyBarrier

Memory Read Dependency Barrier

Declaration

Source position: systemh.inc line 759

procedure ReadDependencyBarrier;

Description

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.

See also

ReadBarrier | Memory Read Barrier
ReadWriteBarrier | Memory read/write barrier
WriteBarrier | Memory write barrier


ReadLn

Read from a text file into variable and goto next line

Declaration

Source position: system.fpd line 56

procedure ReadLn(

  var F: Text;

  Args: Arguments

);

procedure ReadLn(

  Args: Arguments

);

Description

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 any of the supported line ending styles, independent of the platform on which the code is running (supported line ending styles are CRLF, LF or CR). 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 Read.

Errors

If no data is available, empty values are returned (0 for ordinal values, empty strings for string values)

See also

Read | Read from a text file into variable
Blockread | Read data from an untyped file into memory
Write | Write variable to a text file
Blockwrite | Write data from memory to an untyped file


ReadWriteBarrier

Memory read/write barrier

Declaration

Source position: systemh.inc line 760

procedure ReadWriteBarrier;

Description

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.

See also

ReadBarrier | Memory Read Barrier
ReadDependencyBarrier | Memory Read Dependency Barrier
WriteBarrier | Memory write barrier


Real2Double

Convert Turbo Pascal style real to double.

Declaration

Source position: mathh.inc line 111

function Real2Double(

  r: real48

):Double;

Description

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.

Errors

None.

Example

program Example110;

{ Program to demonstrate the Real2Double function. }

Var
  i : integer;
  R : Real48;
  D : Double;
  E : Extended;
  F : File of Real48;

begin
  Assign(F,'reals.dat');
  Reset(f);
  For I:=1 to 10 do
    begin
    Read(F,R);
    D:=Real2Double(R);
    Writeln('Real ',i,' : ',D);
    D:=R;
    Writeln('Real (direct to double)  ',i,' : ',D);
    E:=R;
    Writeln('Real (direct to Extended) ',i,' : ',E);
    end;
  Close(f);
end.


ReAllocMem

Re-allocate memory on the heap

Declaration

Source position: heaph.inc line 97

function ReAllocMem(

  var p: pointer;

  Size: PtrUInt

):pointer;

Description

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.

See also

GetMem | Allocate new memory on the heap
FreeMem | Release allocated memory


ReAllocMemory

Alias for ReAllocMem

Declaration

Source position: heaph.inc line 98

function ReAllocMemory(

  p: pointer;

  Size: PtrUInt

):pointer;

Description

ReAllocMemory is an alias for ReAllocMem.

See also

ReAllocMem

Re-allocate memory on the heap


ReleaseExceptionObject

Decrease the reference count of the current exception object.

Declaration

Source position: objpash.inc line 370

procedure ReleaseExceptionObject;

Description

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

Calling this method is only valid within an except block.

Errors

If there is no current exception object, a run-time error 231 will occur.

See also

AcquireExceptionObject

Obtain a reference to the current exception object


Rename

Rename file on disk

Declaration

Source position: systemh.inc line 1171

procedure Rename(

  var f: file;

  const s: ShortString

);

procedure Rename(

  var f: file;

  const p: PAnsiChar

);

procedure Rename(

  var f: file;

  const c: AnsiChar

);

procedure Rename(

  var f: file;

  const s: UnicodeString

);

procedure Rename(

  var f: file;

  const s: RawByteString

);

procedure Rename(

  var t: Text;

  const s: shortstring

);

procedure Rename(

  var t: Text;

  const p: PAnsiChar

);

procedure Rename(

  var t: Text;

  const c: AnsiChar

);

procedure Rename(

  var t: Text;

  const s: unicodestring

);

procedure Rename(

  var t: Text;

  const s: RawByteString

);

Description

Rename changes the name of the assigned file F to S. F must be assigned, but not opened.

Errors

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.

See also

Erase

Delete a file from disk

Example

Program Example77;

{ Program to demonstrate the Rename function. }
Var F : Text;

begin
  Assign (F,paramstr(1));
  Rename (F,paramstr(2));
end.


Reset

Open file for reading

Declaration

Source position: systemh.inc line 1184

procedure Reset(

  var f: file;

  l: LongInt

);

procedure Reset(

  var f: file

);

procedure Reset(

  var f: TypedFile

);

procedure Reset(

  var t: Text

);

Description

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.

Note that the path can be only 255 characters long.

Errors

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.

See also

Rewrite | Open file for writing
Assign | Assign a name to a file
Close | Close a file
Append | Open a file in append mode

Example

Program Example51;

{ Program to demonstrate the Reset function. }

Function FileExists (Name : String) : boolean;

Var F : File;

begin
  {$i-}
  Assign (F,Name);
  Reset (F);
  {$I+}
  FileExists:=(IoResult=0) and (Name<>'');
  if FileExists then
    Close (f);
end;

begin
  If FileExists (Paramstr(1)) then
    Writeln ('File found')
  else
    Writeln ('File NOT found');
end.


ResumeThread

Resume a suspended thread.

Declaration

Source position: threadh.inc line 147

function ResumeThread(

  threadHandle: TThreadID

):DWord;

Description

ResumeThread causes a suspended thread (using SuspendThread) 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.

Errors

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

See also

SuspendThread | Suspend a running thread.
KillThread | Kill a running thread


Rewrite

Open file for writing

Declaration

Source position: systemh.inc line 1182

procedure Rewrite(

  var f: file;

  l: LongInt

);

procedure Rewrite(

  var f: file

);

procedure Rewrite(

  var f: TypedFile

);

procedure Rewrite(

  var t: Text

);

Description

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 Reset is needed.

File sharing is not taken into account when calling Rewrite.

Note that the path can be only 255 characters long.

Errors

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.

See also

Reset | Open file for reading
Assign | Assign a name to a file
Close | Close a file
Flush | Write file buffers to disk
Append | Open a file in append mode

Example

Program Example52;

{ Program to demonstrate the Rewrite function. }

Var F : File;
    I : longint;

begin
  Assign (F,'Test.tmp');
  { Create the file. Recordsize is 4 }
  Rewrite (F,Sizeof(I));
  For I:=1 to 10 do
    BlockWrite (F,I,1);
  close (f);
  { F contains now a binary representation of
    10 longints going from 1 to 10 }
end.


rightshift(variant,variant):variant

Implement binary shr operation on variants.

Declaration

Source position: varianth.inc line 364

operator operator shr(

  const op1: variant;

  const op2: variant

):variant;

Description

The implementation of the shr operation is delegated to the variant manager with operation opshiftright.

Errors

Execution of this operator may result in an exception if no variant manager is installed or if the types of the operand are not suitable for the operation.

See also

operator shl(variant, variant): variant

Implement binary shl operation on variants.


rmdir

Remove directory when empty.

Declaration

Source position: systemh.inc line 1273

procedure rmdir(

  const s: shortstring

); overload;

procedure rmdir(

  const s: RawByteString

); overload;

procedure rmdir(

  const s: unicodestring

); overload;

Description

Rmdir removes the directory S.

Errors

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.

See also

Chdir | Change current working directory.
Mkdir | Create a new directory.

Example

Program Example53;

{ Program to demonstrate the MkDir and RmDir functions. }

Const D : String[8] = 'TEST.DIR';

Var S : String;

begin
  Writeln ('Making directory ',D);
  Mkdir (D);
  Writeln ('Changing directory to ',D);
  ChDir (D);
  GetDir (0,S);
  Writeln ('Current Directory is : ',S);
  WRiteln ('Going back');
  ChDir ('..');
  Writeln ('Removing directory ',D);
  RmDir (D);
end.


RolByte

Rotate bits of a byte value to the left

Declaration

Source position: systemh.inc line 884

function RolByte(

  const AValue: Byte

):Byte;

function RolByte(

  const AValue: Byte;

  const Dist: Byte

):Byte;

Description

RolByte rotates the bits of the byte AValue with Dist positions to the left. If Dist is not specified, then 1 is assumed.

Errors

None.

See also

RorByte | Rotate bits of a byte value to the right
RolWord | Rotate bits of a word value to the left
RolDWord | Rotate bits of a DWord (cardinal) value to the left
RolQWord | Rotate bits of a QWord (64-bit) value to the left


RolDWord

Rotate bits of a DWord (cardinal) value to the left

Declaration

Source position: systemh.inc line 914

function RolDWord(

  const AValue: DWord

):DWord;

function RolDWord(

  const AValue: DWord;

  const Dist: Byte

):DWord;

Description

RolDWord rotates the bits of the DWord (cardinal) AValue with Dist positions to the left. If Dist is not specified, then 1 is assumed.

Errors

None.

See also

RolByte | Rotate bits of a byte value to the left
RolWord | Rotate bits of a word value to the left
RorDWord | Rotate bits of a DWord (cardinal) value to the right
RolQWord | Rotate bits of a QWord (64-bit) value to the left


RolQWord

Rotate bits of a QWord (64-bit) value to the left

Declaration

Source position: systemh.inc line 929

function RolQWord(

  const AValue: QWord

):QWord;

function RolQWord(

  const AValue: QWord;

  const Dist: Byte

):QWord;

Description

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.

Errors

None.

See also

RolByte | Rotate bits of a byte value to the left
RolWord | Rotate bits of a word value to the left
RolDWord | Rotate bits of a DWord (cardinal) value to the left
RorQWord | Rotate bits of a QWord (64-bit) value to the right


RolWord

Rotate bits of a word value to the left

Declaration

Source position: systemh.inc line 899

function RolWord(

  const AValue: Word

):Word;

function RolWord(

  const AValue: Word;

  const Dist: Byte

):Word;

Description

RolWord rotates the bits of the word AValue with Dist positions to the right. If Dist is not specified, then 1 is assumed.

Errors

None.

See also

RolByte | Rotate bits of a byte value to the left
RorWord | Rotate bits of a word value to the right
RolDWord | Rotate bits of a DWord (cardinal) value to the left
RolQWord | Rotate bits of a QWord (64-bit) value to the left


RorByte

Rotate bits of a byte value to the right

Declaration

Source position: systemh.inc line 881

function RorByte(

  const AValue: Byte

):Byte;

function RorByte(

  const AValue: Byte;

  const Dist: Byte

):Byte;

Description

RorByte rotates the bits of the byte AValue with Dist positions to the right. If Dist is not specified, then 1 is assumed.

Errors

None.

See also

RolByte | Rotate bits of a byte value to the left
RorWord | Rotate bits of a word value to the right
RorDWord | Rotate bits of a DWord (cardinal) value to the right
RorQWord | Rotate bits of a QWord (64-bit) value to the right


RorDWord

Rotate bits of a DWord (cardinal) value to the right

Declaration

Source position: systemh.inc line 911

function RorDWord(

  const AValue: DWord

):DWord;

function RorDWord(

  const AValue: DWord;

  const Dist: Byte

):DWord;

Description

RorDWord rotates the bits of the DWord (cardinal) AValue with Dist positions to the right. If Dist is not specified, then 1 is assumed.

Errors

None.

See also

RorByte | Rotate bits of a byte value to the right
RolDWord | Rotate bits of a DWord (cardinal) value to the left
RorWord | Rotate bits of a word value to the right
RorQWord | Rotate bits of a QWord (64-bit) value to the right


RorQWord

Rotate bits of a QWord (64-bit) value to the right

Declaration

Source position: systemh.inc line 926

function RorQWord(

  const AValue: QWord

):QWord;

function RorQWord(

  const AValue: QWord;

  const Dist: Byte

):QWord;

Description

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.

Errors

None.

See also

RorByte | Rotate bits of a byte value to the right
RorWord | Rotate bits of a word value to the right
RorDWord | Rotate bits of a DWord (cardinal) value to the right
RolQWord | Rotate bits of a QWord (64-bit) value to the left


RorWord

Rotate bits of a word value to the right

Declaration

Source position: systemh.inc line 896

function RorWord(

  const AValue: Word

):Word;

function RorWord(

  const AValue: Word;

  const Dist: Byte

):Word;

Description

RorWord rotates the bits of the word AValue with Dist positions to the right. If Dist is not specified, then 1 is assumed.

Errors

None.

See also

RorByte | Rotate bits of a byte value to the right
RolWord | Rotate bits of a word value to the left
RorDWord | Rotate bits of a DWord (cardinal) value to the right
RorQWord | Rotate bits of a QWord (64-bit) value to the right


round

Round floating point value to nearest integer number.

Declaration

Source position: mathh.inc line 98

function round(

  d: ValReal

):Int64;

Description

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.

Errors

None.

See also

Frac | Return fractional part of floating point value.
Int | Calculate integer part of floating point value.
Trunc | Truncate a floating point value.

Example

Program Example54;

{ Program to demonstrate the Round function. }

begin
  Writeln (Round(1234.56));  { Prints 1235     }
  Writeln (Round(-1234.56)); { Prints -1235    }
  Writeln (Round(12.3456));  { Prints 12       }
  Writeln (Round(-12.3456)); { Prints -12      }
  Writeln (Round(2.5));      { Prints 2 (down) }
  Writeln (Round(3.5));      { Prints 4 (up)   }

end.


RTLEventCreate

Create a new RTL event

Declaration

Source position: threadh.inc line 171

function RTLEventCreate: PRTLEvent;

Description

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 RTLEventdestroy

RTLEvent is used mainly for the synchronize method.

See also

RTLEventDestroy | Destroy a RTL Event
RTLEventSetEvent | Notify threads of the event.
RTLEventReSetEvent | Reset an event
RTLEventWaitFor | Wait for an event.


RTLeventdestroy

Destroy a RTL Event

Declaration

Source position: threadh.inc line 172

procedure RTLeventdestroy(

  state: PRTLEvent

);

Description

RTLeventdestroy destroys the RTL event State. After a call to RTLeventdestroy, the State RTL event may no longer be used.

See also

RTLEventCreate | Create a new RTL event
RTLEventResetEvent | Reset an event
RTLEventSetEvent | Notify threads of the event.


RTLeventResetEvent

Reset an event

Declaration

Source position: threadh.inc line 174

procedure RTLeventResetEvent(

  state: PRTLEvent

);

Description

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.

See also

RTLEventCreate | Create a new RTL event
RTLEventDestroy | Destroy a RTL Event
RTLEventSetEvent | Notify threads of the event.
RTLEventWaitFor | Wait for an event.


RTLeventSetEvent

Notify threads of the event.

Declaration

Source position: threadh.inc line 173

procedure RTLeventSetEvent(

  state: PRTLEvent

);

Description

RTLeventSetEvent notifies other threads which are listening, that the event has occurred.

See also

RTLEventCreate | Create a new RTL event
RTLEventResetEvent | Reset an event
RTLEventDestroy | Destroy a RTL Event
RTLEventWaitFor | Wait for an event.


RTLeventWaitFor

Wait for an event.

Declaration

Source position: threadh.inc line 175

procedure RTLeventWaitFor(

  state: PRTLEvent

);

procedure RTLeventWaitFor(

  state: PRTLEvent;

  timeout: LongInt

);

Description

RTLeventWaitFor suspends the thread till the event occurs. The event will occur when another thread calls RTLEventSetEvent 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.

See also

RTLEventCreate | Create a new RTL event
RTLEventDestroy | Destroy a RTL Event
RTLEventSetEvent | Notify threads of the event.
RTLEventWaitFor | Wait for an event.


RunError

Generate a run-time error.

Declaration

Source position: systemh.inc line 1406

procedure RunError(

  w: Word

);

procedure RunError;

Description

Runerror stops the execution of the program, and generates a run-time error ErrorCode.

Errors

None.

See also

Exit | Exit current subroutine.
Halt | Stop program execution.

Example

Program Example55;

{ Program to demonstrate the RunError function. }

begin
  { The program will stop end emit a run-error 106 }
  RunError (106);
end.


SarInt64

64-bit Shift Arithmetic Right

Declaration

Source position: systemh.inc line 972

function SarInt64(

  const AValue: Int64

):Int64;

function SarInt64(

  const AValue: Int64;

  Shift: Byte

):Int64;

Description

SarInt64 performs an arithmetic right shift for Shift positions on a 64-bit integer AValue and returns the result. Shift is optional, and is 1 by default. The difference with the regular Shr shift operation is that the leftmost bit is preserved during the shift operation.

See also

SarShortInt | 8-bit Shift Arithmetic Right
SarSmallInt | 16-bit Shift Arithmetic Right
SarLongInt | 32-bit Shift Arithmetic Right


SarLongint

32-bit Shift Arithmetic Right

Declaration

Source position: systemh.inc line 969

function SarLongint(

  const AValue: LongInt;

  const Shift: Byte = 1

):LongInt;

Description

SarLongint performs an arithmetic right shift for Shift positions on a 32-bit integer AValue and returns the result. Shift is optional, and is 1 by default. The difference with the regular Shr shift operation is that the leftmost bit is preserved during the shift operation.

See also

SarShortInt | 8-bit Shift Arithmetic Right
SarSmallInt | 16-bit Shift Arithmetic Right
SarInt64 | 64-bit Shift Arithmetic Right


SarShortint

8-bit Shift Arithmetic Right

Declaration

Source position: systemh.inc line 955

function SarShortint(

  const AValue: ShortInt;

  const Shift: Byte = 1

):ShortInt;

Description

SarShortint performs an arithmetic right shift for Shift positions on an 8-bit integer AValue and returns the result. Shift is optional, and is 1 by default. The difference with the regular Shr shift operation is that the leftmost bit is preserved during the shift operation.

See also

SarSmallint | 16-bit Shift Arithmetic Right
SarLongint | 32-bit Shift Arithmetic Right
SarInt64 | 64-bit Shift Arithmetic Right


SarSmallint

16-bit Shift Arithmetic Right

Declaration

Source position: systemh.inc line 962

function SarSmallint(

  const AValue: SmallInt;

  const Shift: Byte = 1

):SmallInt;

Description

SarSmallint performs an arithmetic right shift for Shift positions on an 16-bit integer AValue and returns the result. Shift is optional, and is 1 by default. The difference with the regular Shr shift operation is that the leftmost bit is preserved during the shift operation.

See also

SarShortint | 8-bit Shift Arithmetic Right
SarLongint | 32-bit Shift Arithmetic Right
SarInt64 | 64-bit Shift Arithmetic Right


Seek

Set file position

Declaration

Source position: systemh.inc line 1201

procedure Seek(

  var f: file;

  Pos: Int64

);

Description

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 Reset or Rewrite, 128 is assumed.

Errors

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.

See also

Eof | Check for end of file
SeekEof | Set file position to end of file
SeekEoln | Set file position to end of line

Example

Program Example56;

{ Program to demonstrate the Seek function. }

Var
  F : File;
  I,j : longint;

begin
  { Create a file and fill it with data }
  Assign (F,'test.tmp');
  Rewrite(F); { Create file }
  Close(f);
  FileMode:=2;
  ReSet (F,Sizeof(i)); { Opened read/write }
  For I:=0 to 10 do
    BlockWrite (F,I,1);
  { Go Back to the begining of the file }
  Seek(F,0);
  For I:=0 to 10 do
    begin
    BlockRead (F,J,1);
    If J<>I then
      Writeln ('Error: expected ' ,i,', got ',j);
    end;
  Close (f);
end.


SeekEOF

Set file position to end of file

Declaration

Source position: systemh.inc line 1256

function SeekEOF(

  var t: Text

):Boolean;

function SeekEOF: Boolean;

Description

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.

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

Errors

A run-time error is generated if the file F isn't opened.

See also

Eof | Check for end of file
SeekEoln | Set file position to end of line
Seek | Set file position

Example

Program Example57;

{ Program to demonstrate the SeekEof function. }
Var C : Char;

begin
  { this will print all characters from standard input except
    Whitespace characters. }
  While Not SeekEof do
    begin
    Read (C);
    Write (C);
    end;
end.


SeekEOLn

Set file position to end of line

Declaration

Source position: systemh.inc line 1255

function SeekEOLn(

  var t: Text

):Boolean;

function SeekEOLn: Boolean;

Description

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.

Errors

A run-time error is generated if the file F isn't opened.

See also

Eof | Check for end of file
SeekEof | Set file position to end of file
Seek | Set file position

Example

Program Example58;

{ Program to demonstrate the SeekEoln function. }
Var
  C : Char;

begin
  { This will read the first line of standard output and print
    all characters except whitespace. }
  While not SeekEoln do
    Begin
    Read (c);
    Write (c);
    end;
end.


Seg

Return segment

Declaration

Source position: system.fpd line 59

function Seg(

  var X

):LongInt;

Description

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.

Errors

None.

See also

DSeg | Return data segment
CSeg | Return code segment
Ofs | Return offset of a variable.
Ptr | Combine segment and offset to pointer

Example

Program Example60;

{ Program to demonstrate the Seg function. }
Var
  W : Word;

begin
  W:=Seg(W);  { W contains its own Segment}
end.


SemaphoreDestroy

Destroy a semaphore

Declaration

Source position: threadh.inc line 179

procedure SemaphoreDestroy(

  const sem: Pointer

);

Description

SemaphoreDestroy destroys a semaphore, created with SemaphoreInit.

The use of semaphores requires thread support (use #rtl.cthreads unit on unices).

Errors

If no thread support is compiled in, then calling this function will result in a run-time error 232.

See also

#rtl.cthreads | Initialize the thread manager with a POSIX thread manager
SemaphoreWait | Wait for semaphore to become available
SemaphorePost | Make semaphore available
SemaphoreInit | Create a new semaphore


SemaphoreInit

Create a new semaphore

Declaration

Source position: threadh.inc line 178

function SemaphoreInit: Pointer;

Description

SemaphoreInit creates a new semaphore, which can be used in thread synchronization. The semaphore can be used with SemaphoreWait and SemaphorePost, and must be destroyed with SemaphoreDestroy.

The result is an untyped pointer (thread support is platform dependent).

The use of semaphores requires thread support (use #rtl.cthreads unit on unices).

Errors

On error, Pointer(-1) is returned. If no thread support is compiled in, then calling this function will result in a run-time error 232.

See also

#rtl.cthreads | Initialize the thread manager with a POSIX thread manager
SemaphoreWait | Wait for semaphore to become available
SemaphorePost | Make semaphore available
SemaphoreDestroy | Destroy a semaphore


SemaphorePost

Make semaphore available

Declaration

Source position: threadh.inc line 181

procedure SemaphorePost(

  const sem: Pointer

);

Description

SemaphorePost makes the semaphore FSem to available. Any threads that were waiting for the semaphore FSem to become available (using SemaphoreWait, will continue to execute.

The use of semaphores requires thread support (use #rtl.cthreads unit on unices).

Errors

If no thread support is compiled in, then calling this function will result in a run-time error 232.

See also

#rtl.cthreads | Initialize the thread manager with a POSIX thread manager
SemaphoreInit | Create a new semaphore
SemaphoreWait | Wait for semaphore to become available
SemaphoreDestroy | Destroy a semaphore


SemaphoreWait

Wait for semaphore to become available

Declaration

Source position: threadh.inc line 180

procedure SemaphoreWait(

  const sem: Pointer

);

Description

SemaphoreWait waits (indefinitely) for the semaphore FSem to become available.

The use of semaphores requires thread support (use #rtl.cthreads unit on unices).

Errors

If no thread support is compiled in, then calling this function will result in a run-time error 232.

See also

#rtl.cthreads | Initialize the thread manager with a POSIX thread manager
SemaphoreInit | Create a new semaphore
SemaphorePost | Make semaphore available
SemaphoreDestroy | Destroy a semaphore


Set8087CW

Declaration

Source position: mathh.inc line 21

procedure Set8087CW(

  cw: Word

);


SetCodePage

Set the codepage of a string

Declaration

Source position: systemh.inc line 1144

procedure SetCodePage(

  var s: RawByteString;

  CodePage: TSystemCodePage;

  Convert: Boolean = True

);

Description

SetCodePage sets the codepage of a string S to CodePage. If Convert is True then the string will be transcoded to the new codepage. The resulting string will have reference count 1.

See also

StringCodePage

Get the code page of a string


Setjmp

Save current execution point.

Declaration

Source position: setjumph.inc line 26

function Setjmp(

  var S: jmp_buf

):LongInt;

Description

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 LongJmp with env as an argument was made somewhere in the program.

Errors

None.

See also

LongJmp

Jump to address.

Example

program example79;

{ Program to demonstrate the setjmp, longjmp functions }

procedure dojmp(var env : jmp_buf; value : longint);

begin
  value:=2;
  Writeln ('Going to jump !');
  { This will return to the setjmp call,
    and return value instead of 0 }
  longjmp(env,value);
end;

var env : jmp_buf;

begin
  if setjmp(env)=0 then
    begin
    writeln ('Passed first time.');
    dojmp(env,2);
    end
  else
    writeln ('Passed second time.');
end.


SetMemoryManager

Set a memory manager

Declaration

Source position: heaph.inc line 55

procedure SetMemoryManager(

  const MemMgr: TMemoryManager

);

Description

SetMemoryManager sets the current memory manager record to MemMgr.

For an example, see the programmer's guide.

Errors

None.

See also

GetMemoryManager | Return current memory manager
IsMemoryManagerSet | Is the memory manager set


SetMultiByteConversionCodePage

Set codepage for conversions from multi-byte strings to single-byte strings

Declaration

Source position: systemh.inc line 1145

procedure SetMultiByteConversionCodePage(

  CodePage: TSystemCodePage

);

Description

SetMultiByteConversionCodePage sets DefaultSystemCodePage to CodePage. The effect of this change is that the default codepage used to translate multi-byte (UTF-16) strings to single-byte codepage-aware strings changes, and code page conversions will be done to the new codepage.

Do not set DefaultSystemCodePage directly, as additional actions may need to be done when changing the code page.

When the DefaultSystemCodePage changes and you use the TEncoding classes, you must call TEncoding.FreeEncodings to regenerate the default encoding using the new code page.

See also

DefaultSystemCodePage | Current system codepage.
SetMultiByteFileSystemCodePage | Set codepage used when passing strings to OS single-byte filesystem APIs
SetMultiByteRTLFileSystemCodePage | Set codepage used when interpreting strings from OS single-byte filesystem APIs


SetMultiByteFileSystemCodePage

Set codepage used when passing strings to OS single-byte filesystem APIs

Declaration

Source position: systemh.inc line 1146

procedure SetMultiByteFileSystemCodePage(

  CodePage: TSystemCodePage

);

Description

SetMultiByteFileSystemCodePage sets the codepage used in single-byte OS filesystem APIs to CodePage. The effect of this change is that the default codepage used to translate multi-byte (UTF-16) strings to single-byte codepage-aware strings used in Filesystem APIs changes, and strings passed to the codepage-aware filesystem APIs will be passed using the new codepage.

This constant is not used if the filesystem API of the OS is multi-byte (such as on Windows).

Do not set DefaultFileSystemCodePage directly, as additional actions may need to be done when changing the code page.

See also

DefaultFileSystemCodePage | Codepage to use for filenames
SetMultiByteConversionCodePage | Set codepage for conversions from multi-byte strings to single-byte strings
SetMultiByteRTLFileSystemCodePage | Set codepage used when interpreting strings from OS single-byte filesystem APIs


SetMultiByteRTLFileSystemCodePage

Set codepage used when interpreting strings from OS single-byte filesystem APIs

Declaration

Source position: systemh.inc line 1147

procedure SetMultiByteRTLFileSystemCodePage(

  CodePage: TSystemCodePage

);

Description

SetMultiByteRTLFileSystemCodePage sets the codepage used to interprete strings returned by single-byte OS filesystem APIs to CodePage.

The effect of this change is that the default codepage used to translate single byte strings obtained from the OS to single-byte codepage-aware strings or multi-byte strings changes, and strings obtained from the codepage-aware filesystem APIs will be interpreted using the new codepage.

his constant is not used if the filesystem API of the OS is multi-byte (such as on Windows).

Do not set DefaultRTLFileSystemCodePage directly, as additional actions may need to be done when changing the code page.

See also

SetMultiByteFileSystemCodePage | Set codepage used when passing strings to OS single-byte filesystem APIs
SetMultiByteConversionCodePage | Set codepage for conversions from multi-byte strings to single-byte strings
SetMultiByteRTLFileSystemCodePage | Set codepage used when interpreting strings from OS single-byte filesystem APIs


SetMXCSR

Declaration

Source position: mathh.inc line 29

procedure SetMXCSR(

  w: DWord

);


SetResourceManager

Set the resource manager

Declaration

Source position: resh.inc line 88

procedure SetResourceManager(

  const New: TResourceManager

);

Description

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.

Errors

None.

See also

TResourceManager | Resource manager definition
GetResourceManager | Return the currently active resource manager


SetSSECSR

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'System' (#rtl)

SetSSECSR (deprecated)

Declaration

Source position: mathh.inc line 31

procedure SetSSECSR(

  w: DWord

);


SetString

Set length of a string and copy buffer.

Declaration

Source position: systemh.inc line 1094

procedure SetString(

  out S: AnsiString;

  Buf: PAnsiChar;

  Len: SizeInt

);

procedure SetString(

  out S: AnsiString;

  Buf: PWideChar;

  Len: SizeInt

);

procedure SetString(

  out S: Shortstring;

  Buf: PChar;

  Len: SizeInt

);

procedure SetString(

  out S: UnicodeString;

  Buf: PUnicodeChar;

  Len: SizeInt

);

procedure SetString(

  out S: UnicodeString;

  Buf: PChar;

  Len: SizeInt

);

procedure SetString(

  out S: WideString;

  Buf: PWideChar;

  Len: SizeInt

);

procedure SetString(

  out S: WideString;

  Buf: PChar;

  Len: SizeInt

);

Description

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.

Errors

None.

See also

SetLength

Set length of a string.


SetTextBuf

Set size of text file internal buffer

Declaration

Source position: systemh.inc line 1259

procedure SetTextBuf(

  var f: Text;

  var Buf

);

procedure SetTextBuf(

  var f: Text;

  var Buf;

  Size: SizeInt

);

Description

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.

Remark:
  • Never assign a new buffer to an opened file. A new buffer can be assigned immediately after a call to Rewrite, Reset 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.

Errors

No checking on Size is done.

See also

Assign | Assign a name to a file
Reset | Open file for reading
Rewrite | Open file for writing
Append | Open a file in append mode

Example

Program Example61;

{ Program to demonstrate the SetTextBuf function. }

Var
  Fin,Fout : Text;
  Ch : Char;
  Bufin,Bufout : Array[1..10000] of byte;

begin
  Assign (Fin,paramstr(1));
  Reset (Fin);
  Assign (Fout,paramstr(2));
  Rewrite (Fout);
  { This is harmless before IO has begun }
  { Try this program again on a big file,
    after commenting out the following 2
    lines and recompiling it. }
  SetTextBuf (Fin,Bufin);
  SetTextBuf (Fout,Bufout);
  While not eof(Fin) do
    begin
    Read (Fin,ch);
    write (Fout,ch);
    end;
  Close (Fin);
  Close (Fout);
end.


SetTextCodePage

Set the codepage used in a text file.

Declaration

Source position: systemh.inc line 1263

procedure SetTextCodePage(

  var T: Text;

  CodePage: TSystemCodePage

);

Description

GetTextCodePage sets the codepage that the text file T uses. All strings written to the file will be converted to the indicated codepage. By default, the codepage is set to CP_ACP.

Errors

None.

See also

TextRec | Text file type
GetTextCodePage | Get the codepage used in a text file.


SetTextLineEnding

Set the end-of-line character for the given text file.

Declaration

Source position: systemh.inc line 1261

procedure SetTextLineEnding(

  var f: Text;

  Ending: string

);

Description

SetTextLineEnding sets the end-of-line character for the text file F to Ending. By default, this is the string indicated by DefaultTextLineBreakStyle.

Errors

None.

See also

DefaultTextLineBreakStyle | Default line ending style.
TTextLineBreakStyle | Text line break style. (end of line character)


SetThreadManager

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

Declaration

Source position: threadh.inc line 114

function SetThreadManager(

  const NewTM: TThreadManager;

  var OldTM: TThreadManager

):Boolean;

function SetThreadManager(

  const NewTM: TThreadManager

):Boolean;

Description

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.

Errors

If an error occurred cleaning up the previous manager, or an error occurred initializing the new manager, False is returned.

See also

GetThreadManager | Return the current thread manager
TThreadManager | Thread manager record.


SetUnicodeStringManager

Set the unicodestring manager

Declaration

Source position: ustringh.inc line 148

procedure SetUnicodeStringManager(

  const New: TUnicodeStringManager

);

procedure SetUnicodeStringManager(

  const New: TUnicodeStringManager;

  var Old: TUnicodeStringManager

);

Description

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.

See also

TUnicodeStringManager

Unicode string manager


SetVariantManager

Set the current variant manager.

Declaration

Source position: varianth.inc line 220

procedure SetVariantManager(

  const VarMgr: tvariantmanager

);

Description

SetVariantManager sets the variant manager to varmgr.

See also

GetVariantManager

Return the current variant manager.


SetWideStringManager

Set the widestring manager

Declaration

Source position: ustringh.inc line 144

procedure SetWideStringManager(

  const New: TUnicodeStringManager

);

procedure SetWideStringManager(

  const New: TUnicodeStringManager;

  var Old: TUnicodeStringManager

);

Description

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.

See also

TWideStringManager

Record containing the various callbacks of the widestring manager.


ShortCompareText

Compare 2 shortstrings

Declaration

Source position: systemh.inc line 1099

function ShortCompareText(

  const S1: shortstring;

  const S2: shortstring

):SizeInt;

Description

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.

Errors

None.

See also

CompareText

Compare 2 ansistrings case insensitive.


sin

Calculate sine of angle

Declaration

Source position: mathh.inc line 95

function sin(

  d: ValReal

):ValReal;

Description

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.

Errors

None.

See also

Cos | Calculate cosine of angle
Pi | Return the value of PI.
Exp | Exponentiate
Ln | Calculate logarithm

Example

Program Example62;

{ Program to demonstrate the Sin function. }

begin
  Writeln (Sin(Pi):0:1);   { Prints 0.0 }
  Writeln (Sin(Pi/2):0:1); { Prints 1.0 }
end.


SizeOf

Return size of a variable or type.

Declaration

Source position: system.fpd line 60

function SizeOf(

  X: TAnyType

):LongInt;

Description

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

Remark: This isn't really a RTL function. Its result is calculated at compile-time, and hard-coded in the executable.

Errors

None.

See also

Addr

Return address of a variable

Example

Program Example63;

{ Program to demonstrate the SizeOf function. }
Var
  I : Longint;
  S : String [10];

begin
  Writeln (SizeOf(I));  { Prints 4  }
  Writeln (SizeOf(S));  { Prints 11 }
end.


SizeofResource

Return the size of a particular resource

Declaration

Source position: resh.inc line 63

function SizeofResource(

  ModuleHandle: TFPResourceHMODULE;

  ResHandle: TFPResourceHandle

):LongWord;

Description

SizeOfResource returns the size of the resource identified by ResHandle in module identified by ModuleHandle. ResHandle should be obtained from a call to LoadResource

Errors

In case of an error, 0 is returned.

See also

FindResource | Locate a resource and return a handle to it.
FreeResource | Free a loaded resource
LoadResource | Load a resource for use
LockResource | Lock a resource
UnlockResource | Unlock a previously locked resource
FreeResource | Free a loaded resource


Space

Return a string of spaces

Declaration

Source position: systemh.inc line 1102

function Space(

  b: Byte

):shortstring;

Description

Space returns a shortstring with length B, consisting of spaces.

See also

StringOfChar

Return a string consisting of 1 character repeated N times.


Sptr

Return current stack pointer

Declaration

Source position: systemh.inc line 1321

function Sptr: Pointer;

Description

Sptr returns the current stack pointer.

Errors

None.

See also

SSeg

Return stack segment register value.

Example

program Example64;

{ Program to demonstrate the sptr function. }

var p:ptruint;

begin
  p:=ofs(stackbottom); { P Contains now the current stack position. }
end.


sqr

Calculate the square of a value.

Declaration

Source position: systemh.inc line 814

function sqr(

  l: LongInt

):LongInt;

function sqr(

  l: Int64

):Int64;

function sqr(

  l: QWord

):QWord;

function sqr(

  d: ValReal

):ValReal;

Description

Sqr returns the square of its argument X.

Errors

None.

See also

Sqrt | Calculate the square root of a value
Ln | Calculate logarithm
Exp | Exponentiate

Example

Program Example65;

{ Program to demonstrate the Sqr function. }
Var i : Integer;

begin
  For i:=1 to 10 do
    writeln (Sqr(i):3);
end.


sqrt

Calculate the square root of a value

Declaration

Source position: mathh.inc line 92

function sqrt(

  d: ValReal

):ValReal;

Description

Sqrt returns the square root of its argument X, which must be positive.

Errors

If X is negative, then a run-time error is generated.

See also

Sqr | Calculate the square of a value.
Ln | Calculate logarithm
Exp | Exponentiate

Example

Program Example66;

{ Program to demonstrate the Sqrt function. }

begin
  Writeln (Sqrt(4):0:3); { Prints 2.000 }
  Writeln (Sqrt(2):0:3); { Prints 1.414 }
end.


Sseg

Return stack segment register value.

Declaration

Source position: systemh.inc line 1064

function Sseg: Word;

Description

SSeg returns the Stack Segment. This function is only supported for compatibility reasons, as Sptr returns the correct contents of the stackpointer.

Errors

None.

See also

Sptr

Return current stack pointer

Example

Program Example67;

{ Program to demonstrate the SSeg function. }
Var W : Longint;

begin
  W:=SSeg;
end.


StackTop

Top location of the stack.

Declaration

Source position: systemh.inc line 721

function StackTop: Pointer;

Description

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.

See also

StackBottom | Current stack bottom.
StackLength | Maximum stack length.


Str

Convert a numerical or enumeration value to a string.

Declaration

Source position: system.fpd line 61

procedure Str(

  var X: TNumericType;

  var S: string

);

Description

Str returns a string which represents the value of X. X can be any numerical or enumerated 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.

Str can also be used to convert an enumerated type value to a string representation of the declared enumeration value. That means that the following will work:

Type
  TMyEnum = (OnE);

Var
  S : String;
begin
  Str(one, s);
  Writeln(S);
end.

This will write OnE on the screen, which is consistent with the following - equivalent - program:

Type
  TMyEnum = (OnE);

Var
  S : String;
  E : TMyEnum;
begin
  E:=one;
  Str(E,s);
  Writeln(S);
end.

For scoped enumerated types, only the value is written, which means the following program will have the same output:

{$SCOPEDENUMS+}
Type
  TMyEnum = (OnE);

Var
  S : String;

begin
  Str(one, s);
  Writeln(S);
end.

Errors

None.

See also

Val

Calculate numerical/enumerated value of a string.

Example

Program Example68;

{ Program to demonstrate the Str function. }
Var S : String;

Function IntToStr (I : Longint) : String;

Var S : String;

begin
 Str (I,S);
 IntToStr:=S;
end;

begin
  S:='*'+IntToStr(-233)+'*';
  Writeln (S);
end.


StringCodePage

Get the code page of a string

Declaration

Source position: systemh.inc line 1141

function StringCodePage(

  const S: RawByteString

):TSystemCodePage; overload;

function StringCodePage(

  const S: UnicodeString

):TSystemCodePage; overload;

Description

StringCodePage returns the code page of a string (S), regardless of the string type. It accesses the internal structures of the string to retrieve this information. For an empty string, DefaultSystemCodePage is returned.

See also

DefaultSystemCodePage | Current system codepage.
StringElementSize | Get the character size of a string.
StringRefCount | Get the reference count of a string
SetCodePage | Set the codepage of a string


StringElementSize

Get the character size of a string.

Declaration

Source position: systemh.inc line 1142

function StringElementSize(

  const S: RawByteString

):Word; overload;

function StringElementSize(

  const S: UnicodeString

):Word; overload;

Description

StringCodePage returns the character size of a string (S), regardless of the string type. It accesses the internal structures of the string to retrieve this information. For an empty string, SizeOf(AnsiChar) (normally 1) is returned.

See also

StringCodePage | Get the code page of a string
StringRefCount | Get the reference count of a string


StringOfChar

Return a string consisting of 1 character repeated N times.

Declaration

Source position: systemh.inc line 1137

function StringOfChar(

  c: AnsiChar;

  l: SizeInt

):AnsiString;

Description

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);

Errors

None.

See also

SetLength

Set length of a string.

Example

Program Example97;

{$H+}

{ Program to demonstrate the StringOfChar function. }

Var S : String;

begin
  S:=StringOfChar(' ',40)+'Aligned at column 41.';
  Writeln(s);
end.


StringRefCount

Get the reference count of a string

Declaration

Source position: systemh.inc line 1143

function StringRefCount(

  const S: RawByteString

):SizeInt; overload;

function StringRefCount(

  const S: UnicodeString

):SizeInt; overload;

Description

StringRefCount returns the reference count of a string (S), regardless of the string type. It accesses the internal structures of the string to retrieve this information. For an empty string, 0 is returned.

See also

StringCodePage | Get the code page of a string
StringElementSize | Get the character size of a string.


StringToPPChar

Split string in list of null-terminated strings

Declaration

Source position: systemh.inc line 1436

function StringToPPChar(

  var S: AnsiString;

  ReserveEntries: Integer

):PPChar;

function StringToPPChar(

  S: PChar;

  ReserveEntries: Integer

):PPChar;

Description

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.

Errors

None.

See also

ArrayStringToPPchar

Concert an array of string to an array of null-terminated strings


StringToUnicodeChar

Convert an ansistring to a null-terminated array of unicode characters.

Declaration

Source position: ustringh.inc line 45

function StringToUnicodeChar(

  const Src: RawByteString;

  Dest: PUnicodeChar;

  DestSize: SizeInt

):PUnicodeChar;

Description

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.

Errors

No check is performed to see whether Dest points to a valid memory location.

See also

UnicodeCharToString | Convert unicode character to string
UnicodeCharLenToString | Convert a memory buffer with unicode characters to an ansistring


StringToWideChar

Convert a string to an array of widechars.

Declaration

Source position: ustringh.inc line 37

function StringToWideChar(

  const Src: RawByteString;

  Dest: PWideChar;

  DestSize: SizeInt

):PWideChar;

Description

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.

Errors

No validity checking is performed on Dest.

See also

WideCharToString | Convert a null-terminated array of widechar to an ansistring
WideCharToStrVar | Convert a null-terminated array of widechar to an ansistring
WideCharLenToStrVar | Convert a length-limited array of widechar to an ansistring
WideCharLenToString | Convert a length-limited array of widechar to an ansistring


strlen

Length of a null-terminated string.

Declaration

Source position: systemh.inc line 1071

function strlen(

  p: PChar

):SizeInt;

Description

Returns the length of the null-terminated string P.

Errors

None.


strpas

Convert a null-terminated string to a shortstring.

Declaration

Source position: systemh.inc line 1070

function strpas(

  p: PChar

):shortstring;

Description

Converts a null terminated string in P to a Pascal string, and returns this string. The string is truncated at 255 characters.

Errors

None.


subtract(variant,variant):variant

Implement subtraction (-) operation on variants.

Declaration

Source position: varianth.inc line 366

operator operator -(

  const op1: variant;

  const op2: variant

):variant;

Description

The implementation of the subtraction - operation is delegated to the variant manager with operation opSubtract.

Errors

Execution of this operator may result in an exception if no variant manager is installed or if the types of the operand are not suitable for the operation.

See also

operator -(variant, variant): variant

Implement subtraction (-) operation on variants.


Succ

Return next element of ordinal type.

Declaration

Source position: system.fpd line 62

function Succ(

  X: TOrdinal

):TOrdinal;

Description

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

Errors

Run-time error 201 is generated when the result is out of range.

See also

Ord | Return ordinal value of an ordinal type.
Pred | Return previous element for an ordinal type.
High | Return highest index of open array or enumerated
Low | Return lowest index of open array or enumerated


SuspendThread

Suspend a running thread.

Declaration

Source position: threadh.inc line 146

function SuspendThread(

  threadHandle: TThreadID

):DWord;

Description

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.

Errors

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

See also

ResumeThread | Resume a suspended thread.
KillThread | Kill a running thread


Swap

Swap high and low bytes/words of a variable

Declaration

Source position: systemh.inc line 783

function swap(

  X: Word

):Word;

function Swap(

  X: Integer

):Integer;

function swap(

  X: LongInt

):LongInt;

function Swap(

  X: Cardinal

):Cardinal;

function Swap(

  X: QWord

):QWord;

function swap(

  X: Int64

):Int64;

Description

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

Errors

None.

See also

Lo | Return low nibble/byte/word of value.
Hi | Return high byte/word/nibble of value.

Example

Program Example69;

{ Program to demonstrate the Swap function. }
Var W : Word;
    L : Longint;

begin
  W:=$1234;
  W:=Swap(W);
  if W<>$3412 then
    writeln ('Error when swapping word !');
  L:=$12345678;
  L:=Swap(L);
  if L<>$56781234 then
    writeln ('Error when swapping Longint !');
end.


SwapEndian

Swap endianness of the argument

Declaration

Source position: systemh.inc line 822

function SwapEndian(

  const AValue: SmallInt

):SmallInt;

function SwapEndian(

  const AValue: Word

):Word;

function SwapEndian(

  const AValue: LongInt

):LongInt;

function SwapEndian(

  const AValue: DWord

):DWord;

function SwapEndian(

  const AValue: Int64

):Int64;

function SwapEndian(

  const AValue: QWord

):QWord;

Description

SwapEndian will swap the endianness of the bytes in its argument.

Errors

None.

See also

hi | Return high byte/word/nibble of value.
lo | Return low nibble/byte/word of value.
swap | Swap high and low bytes/words of a variable
BEToN | Convert Big Endian-ordered integer to Native-ordered integer
NToBE | Convert Native-ordered integer to a Big Endian-ordered integer
NToLE | Convert Native-ordered integer to a Little Endian-ordered integer
LEToN | Convert Little Endian-ordered integer to Native-ordered integer


SysAllocMem

System memory manager: Allocate memory

Declaration

Source position: heaph.inc line 74

function SysAllocMem(

  size: PtrUInt

):Pointer;

Description

SysFreemSize is the system memory manager implementation for AllocMem

See also

AllocMem

Allocate and clear memory.


SysAssert

Standard Assert failure implementation

Declaration

Source position: systemh.inc line 1445

procedure SysAssert(

  const Msg: ShortString;

  const FName: ShortString;

  LineNo: LongInt;

  ErrorAddr: Pointer

);

Description

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.

See also

AssertErrorProc

Custom assert error handling procedure


SysBackTraceStr

Format an address suitable for inclusion in a backtrace

Declaration

Source position: systemh.inc line 1444

function SysBackTraceStr(

  Addr: CodePointer

):ShortString;

Description

SysBackTraceStr will create a string representation of the address Addr, suitable for inclusion in a stack backtrace.

Errors

None.


SysFlushStdIO

Flush all standard IO file descriptors

Declaration

Source position: systemh.inc line 1421

procedure SysFlushStdIO;

Description

SysFlushStdIO calls flush on all standard file descriptors: output, stdout, stderr, erroutput

See also

output | Standard output text file.
stdout | Alias for Output.
stderr | Standard diagnostic output text file.
erroutput | Alias for StdErr
flush | Write file buffers to disk


SysFreemem

System memory manager free routine.

Declaration

Source position: heaph.inc line 71

function SysFreemem(

  p: pointer

):PtrUInt;

Description

SysFreeem is the system memory manager implementation for FreeMem

See also

FreeMem

Release allocated memory


SysFreememSize

System memory manager free routine.

Declaration

Source position: heaph.inc line 72

function SysFreememSize(

  p: pointer;

  Size: PtrUInt

):PtrUInt;

Description

SysFreemSize is the system memory manager implementation for FreeMem

See also

MemSize

Return the size of a memory block.


SysGetFPCHeapStatus

Return the status of the FPC heapmanager

Declaration

Source position: heaph.inc line 78

function SysGetFPCHeapStatus: TFPCHeapStatus;

Description

SysGetFPCHeapStatus returns the status of the default FPC heapmanager. It is set as the default value of the corresponding GetFPCHeapStatus function.

Errors

None. The result of this function is bogus information if the current heapmanager is not the standard FPC heapmanager.

See also

GetFPCHeapStatus

Return FPC heap manager status information


SysGetHeapStatus

System implementation of GetHeapStatus

Declaration

Source position: heaph.inc line 77

function SysGetHeapStatus: THeapStatus;

Description

SysGetHeapStatus is the system implementation of the GetHeapStatus call.

See also

GetHeapStatus

Return the memory manager heap status.


SysGetmem

System memory manager memory allocator.

Declaration

Source position: heaph.inc line 70

function SysGetmem(

  Size: PtrUInt

):Pointer;

Description

SysGetmem is the system memory manager implementation for GetMem

See also

GetMem | Allocate new memory on the heap
GetMemory | Alias for GetMem


SysInitExceptions

Initialize exceptions.

Declaration

Source position: systemh.inc line 1416

procedure SysInitExceptions;

Description

SysInitExceptions initializes the exception system. This procedure should never be called directly, it is taken care of by the RTL.


SysInitFPU

Initialize the FPU

Declaration

Source position: systemh.inc line 1426

procedure SysInitFPU;

Description

SysInitFPU initializes (resets) the floating point unit, if one is available. It is called for instance when a new thread is started.

See also

BeginThread

Start a new thread.


SysInitStdIO

Initialize standard input and output.

Declaration

Source position: systemh.inc line 1420

procedure SysInitStdIO;

Description

SysInitStdIO initializes the standard input and output files: Output, Input and StdErr. This routine is called by the initialization code of the system unit, there should be no need to call it directly.


SysMemSize

System memory manager: free size.

Declaration

Source position: heaph.inc line 73

function SysMemSize(

  p: pointer

):PtrUInt;

Description

SysFreemSize is the system memory manager implementation for MemSize

See also

MemSize

Return the size of a memory block.


SysReAllocMem

System memory manager: Reallocate memory

Declaration

Source position: heaph.inc line 76

function SysReAllocMem(

  var p: pointer;

  size: PtrUInt

):Pointer;

Description

SysReallocMem is a help routine for the system memory manager implementation for ReAllocMem.

See also

ReAllocMem

Re-allocate memory on the heap


SysResetFPU

Reset the floating point unit.

Declaration

Source position: systemh.inc line 1425

procedure SysResetFPU;

Description

SysResetFPU resets the floating point unit. There should normally be no need to call this unit; the compiler itself takes care of this.


SysSetCtrlBreakHandler

System CTRL-C handler

Declaration

Source position: systemh.inc line 1449

function SysSetCtrlBreakHandler(

  Handler: TCtrlBreakHandler

):TCtrlBreakHandler;

Description

SysSetCtrlBreakHandler sets the CTRL-C handler to the Handler callback, and returns the previous value of the handler.

See also

TCtrlBreakHandler

CTRL-C Handler prototype


SysTryResizeMem

System memory manager: attempt to resize memory.

Declaration

Source position: heaph.inc line 75

function SysTryResizeMem(

  var p: pointer;

  size: PtrUInt

):Boolean;

Description

SysTryResizeMem is a help routine for the system memory manager implementation for ReAllocMem, SysReAllocMem

See also

SysReAllocMem | System memory manager: Reallocate memory
ReAllocMem | Re-allocate memory on the heap


ThreadGetPriority

Return the priority of a thread.

Declaration

Source position: threadh.inc line 153

function ThreadGetPriority(

  threadHandle: TThreadID

):LongInt;

Description

ThreadGetPriority returns the priority of thread TThreadID to Prio. The returned priority is a value between -15 and 15.

Errors

None.

See also

ThreadSetPriority

Set the priority of a thread.


ThreadSetPriority

Set the priority of a thread.

Declaration

Source position: threadh.inc line 152

function ThreadSetPriority(

  threadHandle: TThreadID;

  Prio: LongInt

):Boolean;

Description

ThreadSetPriority sets the priority of thread TThreadID to Prio. Priority is a value between -15 and 15.

Errors

None.

See also

ThreadGetPriority

Return the priority of a thread.


ThreadSwitch

Signal possibility of thread switch

Declaration

Source position: threadh.inc line 149

procedure ThreadSwitch;

Description

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.

See also

SuspendThread | Suspend a running thread.
ResumeThread | Resume a suspended thread.
KillThread | Kill a running thread


ToSingleByteFileSystemEncodedFileName

Convert string to encoding for use in single-byte filesystem API

Declaration

Source position: ustringh.inc line 155

function ToSingleByteFileSystemEncodedFileName(

  const Str: UnicodeString

):RawByteString;

function ToSingleByteFileSystemEncodedFileName(

  const arr: array of WideChar

):RawByteString;

function ToSingleByteFileSystemEncodedFileName(

  const Str: RawByteString

):RawByteString;

Description

ToSingleByteFileSystemEncodedFileName converts the argument (Str or Arr) to a single-byte string, encoded using the codepage used by the single-byte filesystem API.

This routine is simply an auxiliary routine, which converts the argument to a single-byte string using DefaultFileSystemCodePage as a codepage.

See also

DefaultFileSystemCodePage

Codepage to use for filenames


trunc

Truncate a floating point value.

Declaration

Source position: mathh.inc line 101

function trunc(

  d: ValReal

):Int64;

Description

Trunc returns the integer part of X, which is always smaller than (or equal to) X in absolute value.

Errors

None.

See also

Frac | Return fractional part of floating point value.
Int | Calculate integer part of floating point value.
Round | Round floating point value to nearest integer number.

Example

Program Example70;

{ Program to demonstrate the Trunc function. }

begin
  Writeln (Trunc(123.456));  { Prints 123  }
  Writeln (Trunc(-123.456)); { Prints -123 }
  Writeln (Trunc(12.3456));  { Prints 12   }
  Writeln (Trunc(-12.3456)); { Prints -12  }
end.


Truncate

Truncate the file at position

Declaration

Source position: systemh.inc line 1204

procedure Truncate(

  var F: file

);

Description

Truncate truncates the (opened) file F at the current file position.

Errors

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.

See also

Append | Open a file in append mode
Filepos | Get position in file
Seek | Set file position

Example

Program Example71;

{ Program to demonstrate the Truncate function. }

Var F : File of longint;
    I,L : Longint;

begin
  Assign (F,'test.tmp');
  Rewrite (F);
  For I:=1 to 10 Do
    Write (F,I);
  Writeln ('Filesize before Truncate : ',FileSize(F));
  Close (f);
  Reset (F);
  Repeat
    Read (F,I);
  Until i=5;
  Truncate (F);
  Writeln ('Filesize after Truncate  : ',Filesize(F));
  Close (f);
end.


TryEnterCriticalsection

Try entering a critical section

Declaration

Source position: threadh.inc line 164

function TryEnterCriticalsection(

  var cs: TRTLCriticalSection

):LongInt;

Description

TryEnterCriticalsection attempts to enter critical section cs. It returns at once. The return value is zero if another thread owns the critical section, or nonzero if the current thread already owns or succesfully obtained the critical section.


UCS4StringToUnicodeString

Convert a UCS-4 encoded string to a unicode string

Declaration

Source position: ustringh.inc line 139

function UCS4StringToUnicodeString(

  const s: UCS4String

):UnicodeString;

Description

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

This function requires the widestring manager.

See also

UnicodeStringToUCS4String

Convert a unicode string to a UCS-4 string.


UCS4StringToWideString

Declaration

Source position: ustringh.inc line 141

function UCS4StringToWideString(

  const s: UCS4String

):WideString;


Unassigned

Unassigned variant.

Declaration

Source position: varianth.inc line 224

function Unassigned: Variant;


UnicodeCharLenToString

Convert a memory buffer with unicode characters to an ansistring

Declaration

Source position: ustringh.inc line 46

function UnicodeCharLenToString(

  S: PUnicodeChar;

  Len: SizeInt

):UnicodeString;

Description

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.

Errors

No checking is done to see if the pointer S or length len are valid.

See also

StringToUnicodeChar | Convert an ansistring to a null-terminated array of unicode characters.
UnicodeCharToString | Convert unicode character to string


UnicodeCharLenToStrVar

Convert a memory buffer with unicode characters to an ansistring

Declaration

Source position: ustringh.inc line 47

procedure UnicodeCharLenToStrVar(

  Src: PUnicodeChar;

  Len: SizeInt;

  out Dest: UnicodeString

);

procedure UnicodeCharLenToStrVar(

  Src: PUnicodeChar;

  Len: SizeInt;

  out Dest: AnsiString

);

Description

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

Errors

No checking is done to see if the pointer S or length len are valid.

See also

StringToUnicodeChar | Convert an ansistring to a null-terminated array of unicode characters.
UnicodeCharToString | Convert unicode character to string
UnicodeCharLenToString | Convert a memory buffer with unicode characters to an ansistring
UnicodeCharToStrVar | Convert a null-terminated memory buffer with unicode characters to an ansistring


UnicodeCharToString

Convert unicode character to string

Declaration

Source position: ustringh.inc line 44

function UnicodeCharToString(

  S: PUnicodeChar

):UnicodeString;

Description

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

This function requires the use of a widestring manager.

Errors

No checking is done to see if the pointer S is valid.

See also

StringToUnicodeChar | Convert an ansistring to a null-terminated array of unicode characters.
UnicodeCharLenToString | Convert a memory buffer with unicode characters to an ansistring
WidestringManager | Current widestring manager.


UnicodeCharToStrVar

Convert a null-terminated memory buffer with unicode characters to an ansistring

Declaration

Source position: ustringh.inc line 49

procedure UnicodeCharToStrVar(

  S: PUnicodeChar;

  out Dest: AnsiString

);

Description

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

Errors

No checking is done to see if the pointer S is valid.

See also

StringToUnicodeChar | Convert an ansistring to a null-terminated array of unicode characters.
UnicodeCharToString | Convert unicode character to string
UnicodeCharLenToString | Convert a memory buffer with unicode characters to an ansistring
UnicodeCharToString | Convert unicode character to string


UnicodeStringToUCS4String

Convert a unicode string to a UCS-4 string.

Declaration

Source position: ustringh.inc line 138

function UnicodeStringToUCS4String(

  const s: UnicodeString

):UCS4String;

Description

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

This function requires the widestring manager.

See also

UCS4StringToUnicodeString

Convert a UCS-4 encoded string to a unicode string


UnicodeToUtf8

Declaration

Source position: ustringh.inc line 129

function UnicodeToUtf8(

  Dest: PChar;

  Source: PUnicodeChar;

  MaxBytes: SizeInt

):SizeInt;

function UnicodeToUtf8(

  Dest: PChar;

  MaxDestBytes: SizeUInt;

  Source: PUnicodeChar;

  SourceChars: SizeUInt

):SizeUInt;


UniqueString

Make sure reference count of string is 1

Declaration

Source position: systemh.inc line 1132

procedure UniqueString(

  var S: RawByteString

);

procedure UniqueString(

  var S: UnicodeString

);

procedure UniqueString(

  var S: WideString

);

Description

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

Errors

None.


UnlockResource

Unlock a previously locked resource

Declaration

Source position: resh.inc line 65

function UnlockResource(

  ResData: TFPResourceHGLOBAL

):LongBool;

Description

UnlockResource unlocks a previously locked resource. Note that this function does not exist on windows, it's only needed on other platforms.

Errors

The function returns False if it failed.

See also

FindResource | Locate a resource and return a handle to it.
FreeResource | Free a loaded resource
SizeofResource | Return the size of a particular resource
LoadResource | Load a resource for use
lockResource | Lock a resource
FreeResource | Free a loaded resource


upCase

Convert a string to all uppercase.

Declaration

Source position: systemh.inc line 1100

function upCase(

  const s: shortstring

):shortstring;

function upCase(

  c: Char

):Char;

function upcase(

  const s: ansistring

):ansistring;

function UpCase(

  const s: UnicodeString

):UnicodeString;

function UpCase(

  c: UnicodeChar

):UnicodeChar;

function UpCase(

  const s: WideString

):WideString;

Description

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.

UpCase does not change the number of characters in the string.

Errors

None.

See also

Lowercase

Return lowercase version of a string.

Example

program Example72;

{ Program to demonstrate the upcase function. }

var c:char;

begin
  for c:='a' to 'z' do
    write(upcase(c));
  Writeln;
  { This doesn't work in TP, but it does in Free Pascal }
  Writeln(upcase('abcdefghijklmnopqrstuvwxyz'));
end.


Utf8CodePointLen

Length of an UTF-8 codepoint.

Declaration

Source position: systemh.inc line 1079

function Utf8CodePointLen(

  P: PAnsiChar;

  MaxLookAhead: SizeInt;

  IncludeCombiningDiacriticalMarks: Boolean

):SizeInt;

Description

Utf8CodePointLen returns the length of the UTF-8 codepoint starting at the beginning of P. It will look at at most MaxLookAhead bytes to do create this codepoint. If IncludeCombiningDiacriticalMarks is true, combining diacritical marks trailing the first codepoint (which itself can also be such a mark) will be considered to be part of the codepoint.

If the function returns a value > 0, then this is the number of bytes occupied by the codepoint and, if requested, the trailing combining diacritical marks. If the result = 0, this means that all bytes within the requested MaxLookAhead could be part of a single valid codepoint and, if requested, its trailing diacritical marks, but that the codepoint is incomplete and more bytes need to be looked at. If the result is < 0, then the function determined that the codepoint was invalid after processing the number of bytes equal to the absolute value of the function result.

If IncludeCombiningDiacriticalMarks is True, then

  • If the function processes all MaxLookAhead bytes, it will return the value MaxLookAhead rather than 0, even though in theory more combining diacritical marks might follow if more bytes would be looked at. Therefore, in order to ascertain that all combining diacritical marks are processed, pass all bytes at once to this function.
  • If an invalid sequence is detected while processing a potential combining diacritical mark after a valid codepoint has been found already, the function will return the length of this valid codepoint (plus that of any preceding valid combining diacritical marks) as a positive value. The idea is that this invalid sequence at the end is by definition not a combining diacritical mark (since all of those are valid sequences) and hence should not render the preceding codepoint invalid.

Errors

None.


UTF8Decode

Convert an UTF-8 encoded ansistring to a unicodestring

Declaration

Source position: ustringh.inc line 135

function UTF8Decode(

  const s: RawByteString

):UnicodeString;

Description

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

See also

UTF8Encode | Convert a widestring or unicodestring to an UTF-8 encoded ansistring
Utf8ToAnsi | Convert a UTF-8 encoded unicode string to an ansistring
SetWideStringManager | Set the widestring manager
Utf8ToUnicode | Convert a buffer with UTF-8 characters to widestring characters


UTF8Encode

Convert a widestring or unicodestring to an UTF-8 encoded ansistring

Declaration

Source position: ustringh.inc line 133

function UTF8Encode(

  const s: RawByteString

):RawByteString;

function UTF8Encode(

  const s: UnicodeString

):RawByteString;

function UTF8Encode(

  const s: WideString

):RawByteString;

Description

UTF8Encode converts an ansistring or widestring S to the equivalent UTF-8 encoded unicode string and returns this resulting string. It calls the low-level UnicodeToUTF8 function to do the actual work.

The resulting string has code page CP_UTF8.

See also

UTF8Decode | Convert an UTF-8 encoded ansistring to a unicodestring
Utf8ToAnsi | Convert a UTF-8 encoded unicode string to an ansistring
UnicodeToUtf8 |
SetWideStringManager | Set the widestring manager


Utf8ToAnsi

Convert a UTF-8 encoded unicode string to an ansistring

Declaration

Source position: ustringh.inc line 137

function Utf8ToAnsi(

  const s: RawByteString

):RawByteString;

Description

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.

See also

UTF8Encode | Convert a widestring or unicodestring to an UTF-8 encoded ansistring
UTF8Decode | Convert an UTF-8 encoded ansistring to a unicodestring
SetWideStringManager | Set the widestring manager


Utf8ToUnicode

Convert a buffer with UTF-8 characters to widestring characters

Declaration

Source position: ustringh.inc line 131

function Utf8ToUnicode(

  Dest: PUnicodeChar;

  Source: PChar;

  MaxChars: SizeInt

):SizeInt;

function Utf8ToUnicode(

  Dest: PUnicodeChar;

  MaxDestChars: SizeUInt;

  Source: PChar;

  SourceBytes: SizeUInt

):SizeUInt;

Description

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.

Errors

On error, -1 is returned.

See also

UTF8Encode | Convert a widestring or unicodestring to an UTF-8 encoded ansistring
UTF8Decode | Convert an UTF-8 encoded ansistring to a unicodestring
Utf8ToAnsi | Convert a UTF-8 encoded unicode string to an ansistring
SetWideStringManager | Set the widestring manager


Val

Calculate numerical/enumerated value of a string.

Declaration

Source position: system.fpd line 63

procedure Val(

  const S: string;

  var V;

  var Code: Word

);

Description

Val converts the value represented in the string S to a numerical value or an enumerated value, 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.

For hexadecimal values, the prefix '0x' or 'x' (case insensitive) may be used as well.

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

Errors

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.

See also

Str

Convert a numerical or enumeration value to a string.

Example

Program Example74;

{ Program to demonstrate the Val function. }
Var I, Code : Integer;

begin
  Val (ParamStr (1),I,Code);
  If Code<>0 then
    Writeln ('Error at position ',code,' : ',Paramstr(1)[Code])
  else
    Writeln ('Value : ',I);
end.


ValReal

Largest available floating point type

Declaration

Source position: systemh.inc line 186

type ValReal = Extended;

Description

ValReal is an alias for the largest available floating point type on the architecture the program runs on. On most processors, it should be one of Double or Extended.


ValSInt

Val-Signed integer.

Declaration

Source position: systemh.inc line 340

type ValSInt = Int64;

Description

Integer with the same size as the return code of the Val function.

See also

Val | Calculate numerical/enumerated value of a string.
ValUInt | Val-unsigned integer


ValSInt

Val-Signed integer.

Declaration

Source position: systemh.inc line 352

type ValSInt = LongInt;

Description

Integer with the same size as the return code of the Val function.

See also

Val | Calculate numerical/enumerated value of a string.
ValUInt | Val-unsigned integer


ValUInt

Val-unsigned integer

Declaration

Source position: systemh.inc line 341

type ValUInt = QWord;

Description

Integer with the same size as the return code of the Val function.

See also

Val | Calculate numerical/enumerated value of a string.
ValUInt | Val-unsigned integer


ValUInt

Val-unsigned integer

Declaration

Source position: systemh.inc line 353

type ValUInt = Cardinal;

Description

Integer with the same size as the return code of the Val function.

See also

Val | Calculate numerical/enumerated value of a string.
ValUInt | Val-unsigned integer


VarArrayGet

Declaration

Source position: varianth.inc line 382

function VarArrayGet(

  const A: Variant;

  const Indices: array of LongInt

):Variant;


VarArrayPut

Put a value in a single cell of a variant array

Declaration

Source position: varianth.inc line 381

procedure VarArrayPut(

  var A: Variant;

  const Value: Variant;

  const Indices: array of LongInt

);

Description

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.

Errors

If the number of indices is wrong (or out of range) an exception may be raised.

See also

VarArrayGet


VarArrayRedim

Redimension a variant array

Declaration

Source position: varianth.inc line 380

procedure VarArrayRedim(

  var A: Variant;

  HighBound: SizeInt

);

Description

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.


VarCast

Cast a variant to a certain type

Declaration

Source position: varianth.inc line 383

procedure VarCast(

  var dest: variant;

  const source: variant;

  vartype: LongInt

);

Description

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.

Errors

If the conversion is not possible because the value cannot be correctly casted, then a run-time error or an exception may occur.


WaitForThreadTerminate

Wait for a thread to terminate.

Declaration

Source position: threadh.inc line 151

function WaitForThreadTerminate(

  threadHandle: TThreadID;

  TimeoutMs: LongInt

):DWord;

Description

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.

Not all platforms support the timeout parameter: the Unix platforms (with threads support based on pthreads) do not support timeout, and will wait indefinitely for the thread to exit.

See also

EndThread | End the current thread.
KillThread | Kill a running thread


WideCharLenToString

Convert a length-limited array of widechar to an ansistring

Declaration

Source position: ustringh.inc line 38

function WideCharLenToString(

  S: PWideChar;

  Len: SizeInt

):UnicodeString;

Description

WideCharLenToString converts at most Len widecharacters from the null-terminated widechar array S to an ansistring, and returns the ansistring.

Errors

No validity checking is performed on S. Passing an invalid pointer may lead to access violations.

See also

StringToWideChar | Convert a string to an array of widechars.
WideCharToString | Convert a null-terminated array of widechar to an ansistring
WideCharToStrVar | Convert a null-terminated array of widechar to an ansistring
WideCharLenToStrVar | Convert a length-limited array of widechar to an ansistring


WideCharLenToStrVar

Convert a length-limited array of widechar to an ansistring

Declaration

Source position: ustringh.inc line 39

procedure WideCharLenToStrVar(

  Src: PWideChar;

  Len: SizeInt;

  out Dest: UnicodeString

);

procedure WideCharLenToStrVar(

  Src: PWideChar;

  Len: SizeInt;

  out Dest: AnsiString

);

Description

WideCharLenToString converts at most Len widecharacters from the null-terminated widechar array Src to an ansistring, and returns the ansistring in Dest.

Errors

No validity checking is performed on Src. Passing an invalid pointer may lead to access violations.

See also

StringToWideChar | Convert a string to an array of widechars.
WideCharToString | Convert a null-terminated array of widechar to an ansistring
WideCharToStrVar | Convert a null-terminated array of widechar to an ansistring
WideCharLenToString | Convert a length-limited array of widechar to an ansistring


WideCharToString

Convert a null-terminated array of widechar to an ansistring

Declaration

Source position: ustringh.inc line 36

function WideCharToString(

  S: PWideChar

):UnicodeString;

Description

WideCharToString converts the null-terminated widechar array S to an ansistring, and returns the ansistring.

Errors

No validity checking is performed on Src. Passing an invalid pointer, or an improperly terminated array may lead to access violations.

See also

StringToWideChar | Convert a string to an array of widechars.
WideCharToStrVar | Convert a null-terminated array of widechar to an ansistring
WideCharLenToStrVar | Convert a length-limited array of widechar to an ansistring
WideCharLenToString | Convert a length-limited array of widechar to an ansistring


WideCharToStrVar

Convert a null-terminated array of widechar to an ansistring

Declaration

Source position: ustringh.inc line 41

procedure WideCharToStrVar(

  S: PWideChar;

  out Dest: UnicodeString

);

procedure WideCharToStrVar(

  S: PWideChar;

  out Dest: AnsiString

);

Description

WideCharToString converts the null-terminated widechar array S to an ansistring, and returns the ansistring in Dest.

Errors

No validity checking is performed on S. Passing an invalid pointer, or an improperly terminated array may lead to access violations.

See also

StringToWideChar | Convert a string to an array of widechars.
WideCharToString | Convert a null-terminated array of widechar to an ansistring
WideCharToStrVar | Convert a null-terminated array of widechar to an ansistring
WideCharLenToString | Convert a length-limited array of widechar to an ansistring


WideStringToUCS4String

Convert a widestring to a UCS-4 encoded string.

Declaration

Source position: ustringh.inc line 140

function WideStringToUCS4String(

  const s: WideString

):UCS4String;


WriteBarrier

Memory write barrier

Declaration

Source position: systemh.inc line 761

procedure WriteBarrier;

Description

WriteBarrier is a low-level instruction to force a write barrier in the CPU: write (store) operations before and after the barrier are separate.

See also

ReadBarrier | Memory Read Barrier
ReadDependencyBarrier | Memory Read Dependency Barrier
ReadWriteBarrier | Memory read/write barrier


AbandonSignalHandler

Abandon the signal handler

Declaration

Source position: sysutils.pp line 79

procedure AbandonSignalHandler(

  RtlSigNum: Integer

);

Description

AbandonSignalHandler tells the system routines that they should not re-install the signal handler for signal RtlSigNum under any circumstances. Normally, signal handlers are re-set when they are called. If AbandonSignalHandler has been called for a signal that is handled by the system code, the signal will not be re-set again.


Abort

Abort program execution.

Declaration

Source position: sysutilh.inc line 235

procedure Abort;

Description

Abort raises an EAbort exception.

See also

EAbort

Abort error.


AddDisk

Add a disk to the list of known disks (Unix only)

Declaration

Source position: sysutils.pp line 61

function AddDisk(

  const path: string

):Byte;

Description

On Unix-like platforms both the DiskFree and DiskSize functions need a file on the specified drive, since is required for the statfs system call.

These filenames are set in drivestr[0..26], and the first 4 have been preset to :

Disk 0
'.' default drive - hence current directory is used.
Disk 1
'/fd0/.' floppy drive 1.
Disk 2
'/fd1/.' floppy drive 2.
Disk 3
'/'C: equivalent of DOS is the root partition.

Drives 4..26 can be set by your own applications with the AddDisk call.

The AddDisk call adds Path to the names of drive files, and returns the number of the disk that corresponds to this drive. If you add more than 21 drives, the count is wrapped to 4.

Errors

None.

See also

DiskFree | Return the amount of free diskspace
DiskSize | Return the total amount of diskspace.


AddTerminateProc

Add a procedure to the exit chain.

Declaration

Source position: sysutilh.inc line 258

procedure AddTerminateProc(

  TermProc: TTerminateProc

);

Description

AddTerminateProc adds TermProc to the list of exit procedures. When the program exits, the list of exit procedures is run over, and all procedures are called one by one, in the reverse order that they were added to the exit chain.

Errors

If no memory is available on the heap, an exception may be raised.

See also

TTerminateProc | Terminate procedure procedural variable.
CallTerminateProcs | Call the exit chain procedures.


AdjustLineBreaks

Convert possible line-endings to the currently valid line ending.

Declaration

Source position: sysstrh.inc line 105

function AdjustLineBreaks(

  const S: string

):string;

function AdjustLineBreaks(

  const S: string;

  Style: TTextLineBreakStyle

):string;

Description

AdjustLineBreaks will change all occurrences of #13 and #10 characters with the correct line-ending characters for the current platform. This is #13#10 on Windows and Dos. On Unix-like platforms, this is #10 and for Mac OS X it is #13.

Errors

None.

See also

AnsiCompareStr | Compare 2 ansistrings, case sensitive, ignoring accents characters.
AnsiCompareText | Compare 2 ansistrings, case insensitive, ignoring accents characters.

Example

Program Example48;

{ This program demonstrates the AdjustLineBreaks function }

Uses sysutils;

Const
  S = 'This is a string'#13'with embedded'#10'linefeed and'+
       #13'CR characters';

Begin
  Writeln (AdjustLineBreaks(S));
End.


AnsiCompareFileName

Compare 2 filenames.

Declaration

Source position: sysansih.inc line 14

function AnsiCompareFileName(

  const S1: string;

  const S2: string

):SizeInt;

Description

AnsiCompareFileName compares 2 filenames S1 and S2, and returns

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

The function actually checks FileNameCaseSensitive and returns the result of AnsiCompareStr or AnsiCompareText depending on whether FileNameCaseSensitive is True or False

Errors

None.

See also

AnsiCompareStr | Compare 2 ansistrings, case sensitive, ignoring accents characters.
AnsiCompareText | Compare 2 ansistrings, case insensitive, ignoring accents characters.
AnsiLowerCaseFileName | Convert filename to lowercase.


AnsiCompareStr

Compare 2 ansistrings, case sensitive, ignoring accents characters.

Declaration

Source position: sysstrh.inc line 85

function AnsiCompareStr(

  const S1: string;

  const S2: string

):Integer;

Description

AnsiCompareStr compares two strings and returns the following result:

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

The comparision takes into account Ansi characters, i.e. it takes care of strange accented characters. Contrary to AnsiCompareText, the comparision is case sensitive.

Remark: A widestring manager must be installed in order for this function to work correctly with various character sets.

Errors

None.

See also

AdjustLineBreaks | Convert possible line-endings to the currently valid line ending.
AnsiCompareText | Compare 2 ansistrings, case insensitive, ignoring accents characters.

Example

Program Example49;

{ This program demonstrates the AnsiCompareStr function }
{$H+}

Uses sysutils;

Procedure TestIt (S1,S2 : String);

Var R : Longint;

begin
  R:=AnsiCompareStr(S1,S2);
  Write ('"',S1,'" is ');
  If R<0 then
    write ('less than ')
  else If R=0 then
    Write ('equal to ')
  else
    Write ('larger than ');
  Writeln ('"',S2,'"');
end;

Begin
  Testit('One string','One smaller string');
  Testit('One string','one string');
  Testit('One string','One string');
  Testit('One string','One tall string');
End.


AnsiCompareText

Compare 2 ansistrings, case insensitive, ignoring accents characters.

Declaration

Source position: sysstrh.inc line 86

function AnsiCompareText(

  const S1: string;

  const S2: string

):Integer;

Description

AnsiCompareText compares two strings and returns the following result:

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

the comparision takes into account Ansi characters, i.e. it takes care of strange accented characters. Contrary to AnsiCompareStr, the comparision is case insensitive.

Remark: A widestring manager must be installed in order for this function to work correctly with various character sets.

Errors

None.

See also

AdjustLineBreaks | Convert possible line-endings to the currently valid line ending.
AnsiCompareText | Compare 2 ansistrings, case insensitive, ignoring accents characters.

Example

Program Example49;

{ This program demonstrates the AnsiCompareText function }
{$H+}

Uses sysutils;

Procedure TestIt (S1,S2 : String);

Var R : Longint;

begin
  R:=AnsiCompareText(S1,S2);
  Write ('"',S1,'" is ');
  If R<0 then
    write ('less than ')
  else If R=0 then
    Write ('equal to ')
  else
    Write ('larger than ');
  Writeln ('"',S2,'"');
end;

Begin
  Testit('One string','One smaller string');
  Testit('One string','one string');
  Testit('One string','One string');
  Testit('One string','One tall string');
End.


AnsiDequotedStr

Extract string without quotes

Declaration

Source position: sysstrh.inc line 103

function AnsiDequotedStr(

  const S: string;

  AQuote: Char

):string;

Description

AnsiDequotedStr is, similar to AnsiExtractQuotedStr, a method to extract a string that was quoted using AnsiQuotedStr. The string S must start and end with the quote character AQuote (they will be removed from the result) and all double occurrences of the quote character AQuote will be reduced to a single quote character.

Errors

If the string does not start and end with the quote character or has length less than 2, the original string is returned.

See also

AnsiExtractQuotedStr | Removes the first quoted string from a string.
AnsiQuotedStr | Return a quoted version of a string.


AnsiExtractQuotedStr

Removes the first quoted string from a string.

Declaration

Source position: sysstrh.inc line 104

function AnsiExtractQuotedStr(

  var Src: PChar;

  Quote: Char

):string;

Description

AnsiExtractQuotedStr returns the first quoted string in Src, and deletes the result from Src. The resulting string has with Quote characters removed from the beginning and end of the string (if they are present), and double Quote characters replaced by a single Quote characters. As such, it revereses the action of AnsiQuotedStr.

Errors

None.

See also

AnsiQuotedStr

Return a quoted version of a string.

Example

Program Example51;
{ This program demonstrates the AnsiQuotedStr function }
Uses sysutils;

Var
  S : AnsiString;
  P : PChar;

Begin
 S:='He said "Hello" and walked on';
 P:=Pchar(S);
 S:=AnsiQuotedStr(P,'"');
 Writeln (S);
 P:=Pchar(S);
 Writeln(AnsiExtractQuotedStr(P,'"'));
End.


AnsiLastChar

Return a pointer to the last character of a string.

Declaration

Source position: sysstrh.inc line 95

function AnsiLastChar(

  const S: string

):PChar;

Description

This function returns a pointer to the last character of S.

Remark: A widestring manager must be installed in order for this function to work correctly with various character sets. If none is installed, this function is the same as @S[Length[S]].

Errors

None.

See also

AnsiStrLastChar

Return a pointer to the last character of a string.

Example

Program Example52;

{ This program demonstrates the AnsiLastChar function }

Uses sysutils;

Var S : AnsiString;
    L : Longint;

Begin
  S:='This is an ansistring.';
  Writeln ('Last character of S is : ',AnsiLastChar(S));
  L:=Longint(AnsiLastChar(S))-Longint(@S[1])+1;
  Writeln ('Length of S is : ',L);
End.


AnsiLowerCase

Return a lowercase version of a string.

Declaration

Source position: sysstrh.inc line 84

function AnsiLowerCase(

  const s: string

):string;

Description

AnsiLowerCase converts the string S to lowercase characters and returns the resulting string. It takes into account the operating system language settings when doing this, so special characters are converted correctly as well.

Remark: A widestring manager must be installed in order for this function to work correctly with various character sets.

Errors

None.

See also

AnsiUpperCase | Return an uppercase version of a string, taking into account special characters.
AnsiStrLower | Convert a null-terminated string to all-lowercase characters.
AnsiStrUpper | Convert a null-terminated string to all-uppercase characters.

Example

Program Example53;

{ This program demonstrates the AnsiLowerCase function }

Uses sysutils;

Procedure Testit (S : String);

begin
 Writeln (S,' -> ',AnsiLowerCase(S))
end;

Begin
  Testit('AN UPPERCASE STRING');
  Testit('Some mixed STring');
  Testit('a lowercase string');
End.


AnsiLowerCaseFileName

Convert filename to lowercase.

Declaration

Source position: sysansih.inc line 16

function AnsiLowerCaseFileName(

  const s: string

):string;

Description

AnsiLowerCaseFileName simply returns the result of

AnsiLowerCase(S);

See also

AnsiLowerCase | Return a lowercase version of a string.
AnsiCompareFileName | Compare 2 filenames.
AnsiUpperCaseFileName | Convert filename to uppercase.


AnsiPos

Return Position of one ansistring in another.

Declaration

Source position: sysansih.inc line 18

function AnsiPos(

  const substr: string;

  const s: string

):SizeInt;

Description

AnsiPos does the same as the standard Pos function.

See also

AnsiStrPos | Return position of one null-terminated substring in another
AnsiStrScan | Find first occurrence of a character in a null-terminated string.
AnsiStrRScan | Find last occurrence of a character in a null-terminated string.


AnsiQuotedStr

Return a quoted version of a string.

Declaration

Source position: sysstrh.inc line 102

function AnsiQuotedStr(

  const S: string;

  Quote: Char

):string;

Description

AnsiQuotedString quotes the string S and returns the result. This means that it puts the Quote character at both the beginning and end of the string and replaces any occurrence of Quote in S with 2 Quote characters. The action of AnsiQuotedString can be reversed by AnsiExtractQuotedStr.

For an example, see AnsiExtractQuotedStr

Errors

None.

See also

AnsiExtractQuotedStr

Removes the first quoted string from a string.


AnsiSameStr

Checks whether 2 strings are the same (case sensitive)

Declaration

Source position: sysstrh.inc line 88

function AnsiSameStr(

  const s1: string;

  const s2: string

):Boolean;

Description

SameText calls AnsiCompareStr with S1 and S2 as parameters and returns True if the result of that call is zero, or False otherwise.

Remark: A widestring manager must be installed in order for this function to work correctly with various character sets.

Errors

None.

See also

AnsiCompareStr | Compare 2 ansistrings, case sensitive, ignoring accents characters.
SameText | Checks whether 2 strings are the same (case insensitive)
AnsiSameText | Checks whether 2 strings are the same (case insensitive)


AnsiSameText

Checks whether 2 strings are the same (case insensitive)

Declaration

Source position: sysstrh.inc line 87

function AnsiSameText(

  const s1: string;

  const s2: string

):Boolean;

Description

SameText calls AnsiCompareText with S1 and S2 as parameters and returns True if the result of that call is zero, or False otherwise.

See also

AnsiCompareText | Compare 2 ansistrings, case insensitive, ignoring accents characters.
SameText | Checks whether 2 strings are the same (case insensitive)
AnsiSameStr | Checks whether 2 strings are the same (case sensitive)


AnsiStrComp

Compare two null-terminated strings. Case sensitive.

Declaration

Source position: sysstrh.inc line 89

function AnsiStrComp(

  S1: PChar;

  S2: PChar

):Integer;

Description

AnsiStrComp compares 2 PChar strings, 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-sensitive.

Remark: A widestring manager must be installed in order for this function to work correctly with various character sets.

Errors

None.

See also

AnsiCompareText | Compare 2 ansistrings, case insensitive, ignoring accents characters.
AnsiCompareStr | Compare 2 ansistrings, case sensitive, ignoring accents characters.

Example

Program Example54;

{ This program demonstrates the AnsiStrComp function }

Uses sysutils;

Procedure TestIt (S1,S2 : Pchar);

Var R : Longint;

begin
  R:=AnsiStrComp(S1,S2);
  Write ('"',S1,'" is ');
  If R<0 then
    write ('less than ')
  else If R=0 then
    Write ('equal to ')
  else
    Write ('larger than ');
  Writeln ('"',S2,'"');
end;

Begin
  Testit('One string','One smaller string');
  Testit('One string','one string');
  Testit('One string','One string');
  Testit('One string','One tall string');
End.


AnsiStrIComp

Compare two null-terminated strings. Case insensitive.

Declaration

Source position: sysstrh.inc line 90

function AnsiStrIComp(

  S1: PChar;

  S2: PChar

):Integer;

Description

AnsiStrIComp compares 2 PChar strings, 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.

Remark: A widestring manager must be installed in order for this function to work correctly with various character sets.

Errors

None.

See also

AnsiCompareText | Compare 2 ansistrings, case insensitive, ignoring accents characters.
AnsiCompareStr | Compare 2 ansistrings, case sensitive, ignoring accents characters.

Example

Program Example55;

{ This program demonstrates the AnsiStrIComp function }

Uses sysutils;

Procedure TestIt (S1,S2 : Pchar);

Var R : Longint;

begin
  R:=AnsiStrIComp(S1,S2);
  Write ('"',S1,'" is ');
  If R<0 then
    write ('less than ')
  else If R=0 then
    Write ('equal to ')
  else
    Write ('larger than ');
  Writeln ('"',S2,'"');
end;

Begin
  Testit('One string','One smaller string');
  Testit('One string','one string');
  Testit('One string','One string');
  Testit('One string','One tall string');
End.


AnsiStrLastChar

Return a pointer to the last character of a string.

Declaration

Source position: sysstrh.inc line 96

function AnsiStrLastChar(

  Str: PChar

):PChar;

Description

Return a pointer to the last character of the null-terminated string.

Remark: A widestring manager must be installed in order for this function to work correctly with various character sets. If none is installed, this function is the same as @S[Length[S]].

Errors

None.

See also

AnsiCompareText | Compare 2 ansistrings, case insensitive, ignoring accents characters.
AnsiCompareStr | Compare 2 ansistrings, case sensitive, ignoring accents characters.

Example

Program Example56;

{ This program demonstrates the AnsiStrLComp function }

Uses sysutils;

Procedure TestIt (S1,S2 : Pchar; L : longint);

Var R : Longint;

begin
  R:=AnsiStrLComp(S1,S2,L);
  Write ('First ',L,' characters of "',S1,'" are ');
  If R<0 then
    write ('less than ')
  else If R=0 then
    Write ('equal to ')
  else
    Write ('larger than ');
  Writeln ('those of "',S2,'"');
end;

Begin
  Testit('One string','One smaller string',255);
  Testit('One string','One String',4);
  Testit('One string','1 string',0);
  Testit('One string','One string.',9);
End.


AnsiStrLComp

Compare a limited number of characters of 2 strings

Declaration

Source position: sysstrh.inc line 91

function AnsiStrLComp(

  S1: PChar;

  S2: PChar;

  MaxLen: Cardinal

):Integer;

Description

AnsiStrLComp functions the same as AnsiStrComp, but compares at most MaxLen characters. If the first MaxLen characters in both strings are the same, then zero is returned.

Note that this function processes embedded null characters, treating them as a normal character.

Errors

None.

See also

AnsiStrComp | Compare two null-terminated strings. Case sensitive.
AnsiStrIComp | Compare two null-terminated strings. Case insensitive.
AnsiStrLIComp | Compares a given number of characters of a string, case insensitive.


AnsiStrLIComp

Compares a given number of characters of a string, case insensitive.

Declaration

Source position: sysstrh.inc line 92

function AnsiStrLIComp(

  S1: PChar;

  S2: PChar;

  MaxLen: Cardinal

):Integer;

Description

AnsiStrLIComp compares the first Maxlen characters of 2 PChar strings, 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.

Remark: A widestring manager must be installed in order for this function to work correctly with various character sets.

Errors

None.

See also

AnsiCompareText | Compare 2 ansistrings, case insensitive, ignoring accents characters.
AnsiCompareStr | Compare 2 ansistrings, case sensitive, ignoring accents characters.

Example

Program Example57;

{ This program demonstrates the AnsiStrLIComp function }

Uses sysutils;

Procedure TestIt (S1,S2 : Pchar; L : longint);

Var R : Longint;

begin
  R:=AnsiStrLIComp(S1,S2,L);
  Write ('First ',L,' characters of "',S1,'" are ');
  If R<0 then
    write ('less than ')
  else If R=0 then
    Write ('equal to ')
  else
    Write ('larger than ');
  Writeln ('those of "',S2,'"');
end;

Begin
  Testit('One string','One smaller string',255);
  Testit('ONE STRING','one String',4);
  Testit('One string','1 STRING',0);
  Testit('One STRING','one string.',9);
End.


AnsiStrLower

Convert a null-terminated string to all-lowercase characters.

Declaration

Source position: sysstrh.inc line 93

function AnsiStrLower(

  Str: PChar

):PChar;

Description

AnsiStrLower converts the PChar Str to lowercase characters and returns the resulting pchar. Note that Str itself is modified, not a copy, as in the case of AnsiLowerCase. It takes into account the operating system language settings when doing this, so special characters are converted correctly as well.

Remark: A widestring manager must be installed in order for this function to work correctly with various character sets.

Errors

None.

See also

AnsiStrUpper | Convert a null-terminated string to all-uppercase characters.
AnsiLowerCase | Return a lowercase version of a string.

Example

Program Example59;

{ This program demonstrates the AnsiStrLower function }

Uses sysutils;

Procedure Testit (S : Pchar);

begin
 Writeln (S,' -> ',AnsiStrLower(S))
end;

Begin
  Testit('AN UPPERCASE STRING');
  Testit('Some mixed STring');
  Testit('a lowercase string');
End.


AnsiStrPos

Return position of one null-terminated substring in another

Declaration

Source position: sysansih.inc line 19

function AnsiStrPos(

  str: PChar;

  substr: PChar

):PChar;

Description

AnsiStrPos returns a pointer to the first occurrence of SubStr in Str. If SubStr does not occur in Str then Nil is returned.

Errors

An access violation may occur if either Str or SubStr point to invalid memory.

See also

AnsiPos | Return Position of one ansistring in another.
AnsiStrScan | Find first occurrence of a character in a null-terminated string.
AnsiStrRScan | Find last occurrence of a character in a null-terminated string.


AnsiStrRScan

Find last occurrence of a character in a null-terminated string.

Declaration

Source position: sysansih.inc line 20

function AnsiStrRScan(

  Str: PChar;

  Chr: Char

):PChar;

Description

AnsiStrPos returns a pointer to the last occurrence of the character Chr in Str. If Chr does not occur in Str then Nil is returned.

Errors

An access violation may occur if Str points to invalid memory.

See also

AnsiPos | Return Position of one ansistring in another.
AnsiStrScan | Find first occurrence of a character in a null-terminated string.
AnsiStrPos | Return position of one null-terminated substring in another


AnsiStrScan

Find first occurrence of a character in a null-terminated string.

Declaration

Source position: sysansih.inc line 21

function AnsiStrScan(

  Str: PChar;

  Chr: Char

):PChar;

Description

AnsiStrPos returns a pointer to the first occurrence of the character Chr in Str. If Chr does not occur in Str then Nil is returned.

Errors

An access violation may occur if Str points to invalid memory.

See also

AnsiPos | Return Position of one ansistring in another.
AnsiStrScan | Find first occurrence of a character in a null-terminated string.
AnsiStrPos | Return position of one null-terminated substring in another


AnsiStrUpper

Convert a null-terminated string to all-uppercase characters.

Declaration

Source position: sysstrh.inc line 94

function AnsiStrUpper(

  Str: PChar

):PChar;

Description

AnsiStrUpper converts the PCharStr to uppercase characters and returns the resulting string. Note that Str itself is modified, not a copy, as in the case of AnsiUpperCase. It takes into account the operating system language settings when doing this, so special characters are converted correctly as well.

Remark: A widestring manager must be installed in order for this function to work correctly with various character sets.

Errors

None.

See also

AnsiUpperCase | Return an uppercase version of a string, taking into account special characters.
AnsiStrLower | Convert a null-terminated string to all-lowercase characters.
AnsiLowerCase | Return a lowercase version of a string.

Example

Program Example60;

{ This program demonstrates the AnsiStrUpper function }

Uses sysutils;

Procedure Testit (S : Pchar);

begin
 Writeln (S,' -> ',AnsiStrUpper(S))
end;

Begin
  Testit('AN UPPERCASE STRING');
  Testit('Some mixed STring');
  Testit('a lowercase string');
End.


AnsiUpperCase

Return an uppercase version of a string, taking into account special characters.

Declaration

Source position: sysstrh.inc line 83

function AnsiUpperCase(

  const s: string

):string;

Description

AnsiUpperCase converts the string S to uppercase characters and returns the resulting string. It takes into account the operating system language settings when doing this, so special characters are converted correctly as well.

Remark: A widestring manager must be installed in order for this function to work correctly with various character sets.

Errors

None.

See also

AnsiStrUpper | Convert a null-terminated string to all-uppercase characters.
AnsiStrLower | Convert a null-terminated string to all-lowercase characters.
AnsiLowerCase | Return a lowercase version of a string.

Example

Program Example60;

{ This program demonstrates the AnsiUpperCase function }

Uses sysutils;

Procedure Testit (S : String);

begin
 Writeln (S,' -> ',AnsiUpperCase(S))
end;

Begin
  Testit('AN UPPERCASE STRING');
  Testit('Some mixed STring');
  Testit('a lowercase string');
End.


AnsiUpperCaseFileName

Convert filename to uppercase.

Declaration

Source position: sysansih.inc line 17

function AnsiUpperCaseFileName(

  const s: string

):string;

Description

AnsiUpperCaseFileName simply returns the result of

AnsiUpperCase(S);

See also

AnsiUpperCase | Return an uppercase version of a string, taking into account special characters.
AnsiCompareFileName | Compare 2 filenames.
AnsiLowerCaseFileName | Convert filename to lowercase.


AppendStr

Append one ansistring to another.

Declaration

Source position: sysstrh.inc line 70

procedure AppendStr(

  var Dest: string;

  const S: string

);

Description

AppendStr appends S to Dest.

This function is provided for Delphi compatibility only, since it is completely equivalent to Dest:=Dest+S.

Errors

None.

See also

AssignStr | Assigns an ansistring to a null-terminated string.
NewStr | Allocate a new ansistring on the heap.
DisposeStr | Dispose an ansistring from the heap.

Example

Program Example62;

{ This program demonstrates the AppendStr function }

Uses sysutils;

Var S : AnsiString;

Begin
  S:='This is an ';
  AppendStr(S,'AnsiString');
  Writeln ('S = "',S,'"');
End.


ApplicationName

Return a default application name

Declaration

Source position: osutilsh.inc line 46

function ApplicationName: string;

Description

ApplicationName returns the name of the current application. Standard this is equal to the filename part minus extension of ParamStr(0), but it can be customized by setting the OnGetApplicationName callback.

Note that the returned value is only the name portion. It does not contain any path or file extension.

Errors

None.

See also

GetAppConfigDir | Return the appropriate directory for the application's configuration files.
OnGetApplicationName | Callback to get a customized application name.
GetAppConfigFile | Return an appropriate name for an application configuration file.
ConfigExtension | Default application configuration file extension.


AssignStr

Assigns an ansistring to a null-terminated string.

Declaration

Source position: sysstrh.inc line 69

procedure AssignStr(

  var P: PString;

  const S: string

);

Description

AssignStr allocates S to P. The old value of P is disposed of.

This function is provided for Delphi compatibility only. AnsiStrings are managed on the heap and should be preferred to the mechanism of dynamically allocated strings.

Errors

None.

See also

NewStr | Allocate a new ansistring on the heap.
AppendStr | Append one ansistring to another.
DisposeStr | Dispose an ansistring from the heap.

Example

Program Example63;

{ This program demonstrates the AssignStr function }
{$H+}

Uses sysutils;

Var P : PString;

Begin
 P:=NewStr('A first AnsiString');
 Writeln ('Before: P = "',P^,'"');
 AssignStr(P,'A Second ansistring');
 Writeln ('After : P = "',P^,'"');
 DisposeStr(P);
End.


BCDToInt

Convert a BCD coded integer to a normal integer.

Declaration

Source position: sysstrh.inc line 265

function BCDToInt(

  Value: Integer

):Integer;

Description

BCDToInt converts a BCD coded integer to a normal integer.

Errors

None.

See also

StrToInt | Convert a string to an integer value.
IntToStr | Convert an integer value to a decimal string.

Example

Program Example64;

{ This program demonstrates the BCDToInt function }

Uses sysutils;

Procedure Testit ( L : longint);
begin
  Writeln (L,' -> ',BCDToInt(L));
end;

Begin
  Testit(10);
  Testit(100);
  TestIt(23);
End.


Beep

Sound the system bell.

Declaration

Source position: sysutilh.inc line 245

procedure Beep;

Description

Beep sounds the system bell, if one is available. The actual beep is produced by the OnBeep callback. The Sysutils unit itself contains no implementation of this call.


BoolToStr

Convert a boolean value to a string.

Declaration

Source position: sysstrh.inc line 216

function BoolToStr(

  B: Boolean;

  UseBoolStrs: Boolean = False

):string;

function BoolToStr(

  B: Boolean;

  const TrueS: string;

  const FalseS: string

):string;

Description

BoolToStr converts the boolean B to one of the strings 'TRUE' or 'FALSE'

Errors

None.

See also

StrToBool

Convert a string to a boolean value


ByteLength

Length (in bytes) of a unicodestring

Declaration

Source position: sysunih.inc line 69

function ByteLength(

  const S: UnicodeString

):Integer;

Description

ByteLength returns the length of a unicodestring in bytes. This equals the character length of the string (Length) multiplied by the number of bytes per character (2).

See also

Length

Returns length of a string or array.


BytesOf

Return the bytes in a string

Declaration

Source position: sysansih.inc line 24

function BytesOf(

  const Val: RawByteString

):TBytes;

function BytesOf(

  const Val: AnsiChar

):TBytes;

function BytesOf(

  const Val: UnicodeString

):TBytes; overload;

function BytesOf(

  const Val: WideChar

):TBytes; overload;

Description

BytesOf returns a copy of the string's content as an array of bytes. For an empty string, zero bytes are returned (i.e. length(BytesOf(S))=0).

See also

TBytes

Array of byte


ByteToCharIndex

Convert a character index in Bytes to an Index in characters

Declaration

Source position: sysstrh.inc line 235

function ByteToCharIndex(

  const S: string;

  Index: Integer

):Integer;

Description

ByteToCharIndex returns the index (in characters) of the Index-th byte in S.

Errors

This function does not take into account MBCS yet.

See also

CharToByteLen | Convert a length in characters to a length in bytes.
ByteToCharLen | Convert a length in bytes to a length in characters.


ByteToCharLen

Convert a length in bytes to a length in characters.

Declaration

Source position: sysstrh.inc line 233

function ByteToCharLen(

  const S: string;

  MaxLen: Integer

):Integer;

Description

ByteToCharLen returns the number of bytes in S, but limits the result to MaxLen

Errors

This function does not take into account MBCS yet.

See also

CharToByteLen | Convert a length in characters to a length in bytes.
ByteToCharIndex | Convert a character index in Bytes to an Index in characters


ByteType

Return the type of byte in an ansistring for a multi-byte character set

Declaration

Source position: sysstrh.inc line 231

function ByteType(

  const S: string;

  Index: Integer

):TMbcsByteType;

Description

ByteType returns the type of byte in the ansistring S at (1-based) position Index.

Errors

No checking on the index is performed.

See also

TMbcsByteType | Type of multi-byte character set.
StrByteType | Return the type of byte in a null-terminated string for a multi-byte character set


CallTerminateProcs

Call the exit chain procedures.

Declaration

Source position: sysutilh.inc line 259

function CallTerminateProcs: Boolean;

Description

CallTerminateProcs is run on program exit. It executes all terminate procedures that were added to the exit chain with AddTerminateProc, and does this in reverse order.

Errors

If one of the exit procedure raises an exception, it is not caught, and the remaining exit procedures will not be executed.

See also

TTerminateProc | Terminate procedure procedural variable.
AddTerminateProc | Add a procedure to the exit chain.


ChangeFileExt

Change the extension of a filename.

Declaration

Source position: finah.inc line 22

function ChangeFileExt(

  const FileName: UnicodeString;

  const Extension: UnicodeString

):UnicodeString;

function ChangeFileExt(

  const FileName: RawByteString;

  const Extension: RawByteString

):RawByteString;

Description

ChangeFileExt changes the file extension in FileName to Extension. The extension Extension includes the starting . (dot). The previous extension of FileName are all characters after the last ., the . character included.

If FileName doesn't have an extension, Extension is just appended.

Errors

None.

See also

ExtractFileExt | Return the extension from a filename.
ExtractFileName | Extract the filename part from a full path filename.
ExtractFilePath | Extract the path from a filename.
ExpandFileName | Expand a relative filename to an absolute filename.


CharInSet

Check whether a char is in a set of characters

Declaration

Source position: sysansih.inc line 27

function CharInSet(

  Ch: AnsiChar;

  const CSet: TSysCharSet

):Boolean;

function CharInSet(

  Ch: WideChar;

  const CSet: TSysCharSet

):Boolean;

Description

CharInSet returns True if Ch matches one of the characters in CSet, it returns False otherwise. It is equivalent to

Ch in CSet

Later versions of this function may take WideChar into account.


CharToByteLen

Convert a length in characters to a length in bytes.

Declaration

Source position: sysstrh.inc line 234

function CharToByteLen(

  const S: string;

  MaxLen: Integer

):Integer;

Description

CharToByteLen returns the number of bytes in S, but limits the result to MaxLen

Errors

This function does not take into account MBCS yet.

See also

ByteToCharLen | Convert a length in bytes to a length in characters.
ByteToCharIndex | Convert a character index in Bytes to an Index in characters


CodePageNameToCodePage

Return a numeric identifier for the codepage.

Declaration

Source position: syscodepagesh.inc line 16

function CodePageNameToCodePage(

  const cpname: AnsiString

):TSystemCodePage;

Description

CodePageNameToCodePage returns the code page number for the specified codepage cpname.

Errors

If the code page is not found in the list of code pages, $FFFF is returned.

See also

CodePageToCodePageName

Convert a numeric codepage identifier to a codepage name


CodePageToCodePageName

Convert a numeric codepage identifier to a codepage name

Declaration

Source position: syscodepagesh.inc line 15

function CodePageToCodePageName(

  cp: TSystemCodePage

):AnsiString;

Description

CodePageToCodePageName returns the name of the codepage cp.

Errors

If no matching codepage is found in the list of codepages, an empty string is returned.

See also

CodePageNameToCodePage

Return a numeric identifier for the codepage.


CompareMem

Compare two memory areas.

Declaration

Source position: sysstrh.inc line 78

function CompareMem(

  P1: Pointer;

  P2: Pointer;

  Length: PtrUInt

):Boolean;

Description

CompareMem compares, byte by byte, 2 memory areas pointed to by P1 and P2, for a length of L bytes.

The function returns True if all L bytes are the same, and False otherwise.


CompareMemRange

Compare 2 memory locations

Declaration

Source position: sysstrh.inc line 77

function CompareMemRange(

  P1: Pointer;

  P2: Pointer;

  Length: PtrUInt

):Integer;

Description

CompareMemRange compares the 2 memory locations pointed to by P1 and P2 byte per byte. It stops comparing after Length bytes have been compared, or when it has encountered 2 different bytes. The result is then

>0
if a byte in range P1 was found that is bigger than the corresponding byte in range P2.
0
if all bytes in range P1 are the same as the corresponding bytes in range P2.
<0
if a byte in range P1 was found that is less than the corresponding byte in range P2.

Errors

None.

See also

SameText

Checks whether 2 strings are the same (case insensitive)


CompareStr

Compare 2 ansistrings case-sensitively, ignoring special characters.

Declaration

Source position: sysstrh.inc line 76

function CompareStr(

  const S1: string;

  const S2: string

):Integer; overload;

Description

CompareStr compares two strings, 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-sensitive. The function does not take internationalization settings into account, it simply compares ASCII values.

Errors

None.

See also

AnsiCompareText | Compare 2 ansistrings, case insensitive, ignoring accents characters.
AnsiCompareStr | Compare 2 ansistrings, case sensitive, ignoring accents characters.
CompareText | Compare 2 ansistrings case insensitive.

Example

Program Example65;

{ This program demonstrates the CompareStr function }
{$H+}

Uses sysutils;

Procedure TestIt (S1,S2 : String);

Var R : Longint;

begin
  R:=CompareStr(S1,S2);
  Write ('"',S1,'" is ');
  If R<0 then
    write ('less than ')
  else If R=0 then
    Write ('equal to ')
  else
    Write ('larger than ');
  Writeln ('"',S2,'"');
end;

Begin
  Testit('One string','One smaller string');
  Testit('One string','one string');
  Testit('One string','One string');
  Testit('One string','One tall string');
End.


CompareText

Compare 2 ansistrings case insensitive.

Declaration

Source position: sysstrh.inc line 79

function CompareText(

  const S1: string;

  const S2: string

):Integer;

Description

CompareText compares two strings, 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.

Errors

None.

See also

AnsiCompareText | Compare 2 ansistrings, case insensitive, ignoring accents characters.
AnsiCompareStr | Compare 2 ansistrings, case sensitive, ignoring accents characters.
CompareStr | Compare 2 ansistrings case-sensitively, ignoring special characters.

Example

Program Example66;

{ This program demonstrates the CompareText function }
{$H+}

Uses sysutils;

Procedure TestIt (S1,S2 : String);

Var R : Longint;

begin
  R:=CompareText(S1,S2);
  Write ('"',S1,'" is ');
  If R<0 then
    write ('less than ')
  else If R=0 then
    Write ('equal to ')
  else
    Write ('larger than ');
  Writeln ('"',S2,'"');
end;

Begin
  Testit('One string','One smaller string');
  Testit('One string','one string');
  Testit('One string','One string');
  Testit('One string','One tall string');
End.


ComposeDateTime

Add a date and time

Declaration

Source position: datih.inc line 119

function ComposeDateTime(

  Date: TDateTime;

  Time: TDateTime

):TDateTime;

Description

ComposeDateTime correctly adds Date and Time, also for dates before 1899-12-31. For dates after this date, it is just the mathematical addition.

Errors

None.

See also

#rtl.dateutils.EncodeDateTime

Encodes a DateTime value from all its parts


ConcatPaths

Concatenate an array of paths to form a single path

Declaration

Source position: finah.inc line 43

function ConcatPaths(

  const Paths: array of UnicodeString

):UnicodeString;

function ConcatPaths(

  const Paths: array of RawByteString

):RawByteString;

Description

ConcatPaths will concatenate the different path components in Paths to a single path. It will insert directory separators between the various components of the path as needed. No directory separators will be added to the beginning or the end of the path, and none will be taken away.

See also

IncludeTrailingPathDelimiter | Add trailing directory separator to a pathname, if needed.
IncludeLeadingPathDelimiter | Prepend a path delimiter if there is not already one.
ExcludeTrailingPathDelimiter | Strip trailing directory separator from a pathname, if needed.
IncludeTrailingPathDelimiter | Add trailing directory separator to a pathname, if needed.

Example

program ex96;

{ This program demonstrates the Concatpaths function }

uses sysutils;

begin
  // will write /this/path/more/levels/
  Writeln(ConcatPaths(['/this/','path','more/levels/']));
  // will write this/path/more/levels/
  Writeln(ConcatPaths(['this/','path','more/levels/']));
  // will write this/path/more/levels
  Writeln(ConcatPaths(['this/','path','more/levels']));
end.


CreateDir

Create a new directory

Declaration

Source position: diskh.inc line 21

function CreateDir(

  const NewDir: RawByteString

):Boolean;

function CreateDir(

  const NewDir: UnicodeString

):Boolean;

Description

CreateDir creates a new directory with name NewDir. If the directory doesn't contain an absolute path, then the directory is created below the current working directory.

The function returns True if the directory was successfully created, False otherwise.

Errors

In case of an error, the function returns False.

See also

RemoveDir

Remove a directory from the filesystem.

Example

Program Example26;

{ This program demonstrates the CreateDir and RemoveDir functions }
{ Run this program twice in the same directory }

Uses sysutils;

Begin
  If Not DirectoryExists('NewDir') then
    If Not CreateDir ('NewDir') Then
      Writeln ('Failed to create directory !')
    else
      Writeln ('Created "NewDir" directory')
  Else
    If Not RemoveDir ('NewDir') Then
      Writeln ('Failed to remove directory !')
    else
      Writeln ('Removed "NewDir" directory');
End.


CreateGUID

Create a new GUID

Declaration

Source position: sysutilh.inc line 253

function CreateGUID(

  out GUID: TGuid

):Integer;

Description

CreateGUID can be called to create a new GUID (Globally Unique Identifier) value. The function returns the new GUID value in GUID and returns zero in case the GUID was created succesfully. If no GUID was created, a nonzero error code is returned.

The default mechanism for creating a new GUID is system dependent. If operating system support is available, it is used. If none is available, a default implementation using random numbers is used.

The OnCreateGUID callback can be set to hook a custom mechanism behind the CreateGUID function. This can be used to lt the GUID be created by an external GUID creation library.

Errors

On error, a nonzero return value is returned.

See also

GUIDCase | Return the index of a GUID in an array of GUID values
IsEqualGUID | Check whether two TGUID variables are equal.
StringToGUID | Convert a string to a native TGUID type.
TryStringToGUID | Try to transform a string to a GUID
GUIDToString | Convert a TGUID to a string representation.


CurrentYear

Return the current year

Declaration

Source position: datih.inc line 192

function CurrentYear: Word;

Description

CurrentYear returns the current year as a 4-digit number.

Errors

None.

See also

Date | Return the current date.
Time | Returns the current time.
Now | Returns the current date and time.


CurrToStr

Convert a currency value to a string.

Declaration

Source position: sysstrh.inc line 195

function CurrToStr(

  Value: Currency

):string;

function CurrToStr(

  Value: Currency;

  const FormatSettings: TFormatSettings

):string;

Description

CurrToStr will convert a currency value to a string with a maximum of 15 digits, and precision 2. Calling CurrToStr is equivalent to calling FloatToStrF:

FloatToStrF(Value,ffNumber,15,2);

Errors

None.

See also

FloatToStrF | Convert a float value to a string using a given format.
StrToCurr | Convert a string to a currency value


CurrToStrF

Format a currency to a string

Declaration

Source position: sysstrh.inc line 155

function CurrToStrF(

  Value: Currency;

  Format: TFloatFormat;

  Digits: Integer

):string;

function CurrToStrF(

  Value: Currency;

  Format: TFloatFormat;

  Digits: Integer;

  const FormatSettings: TFormatSettings

):string;

Description

CurrToStrF formats the currency Value according to the value in Format, using the number of digits specified in Digits, and a precision of 19. This function simply calls FloatToStrF.

See also

FloatToStrF

Convert a float value to a string using a given format.


Date

Return the current date.

Declaration

Source position: datih.inc line 126

function Date: TDateTime;

Description

Date returns the current date in TDateTime format.

Errors

None.

See also

Time | Returns the current time.
Now | Returns the current date and time.

Example

Program Example1;

{ This program demonstrates the Date function }

uses sysutils;

Var YY,MM,DD : Word;

Begin
 Writeln ('Date : ',Date);
 DeCodeDate (Date,YY,MM,DD);
 Writeln (format ('Date is (DD/MM/YY): %d/%d/%d ',[dd,mm,yy]));
End.


DateDelta

Days between 1/1/0001 and 12/31/1899

Declaration

Source position: datih.inc line 38

const DateDelta = 693594;


DateSeparator

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

DateSeparator (deprecated)

Date separator character (subject to locale).

Declaration

Source position: sysinth.inc line 90

var DateSeparator: Char = ;

Description

DateSeparator is the character used by various date/time conversion routines as the character that separates the day from the month and the month from the year in a date notation. It is used by the date formatting routines. The initialization routines of the SysUtils unit initialize this string with a value conforming to the regional preferences of the user or system regional default.

This constant is deprecated. You should use DefaultFormatSettings.DateSeparator instead.

See also

LongDateFormat | Long date format string (subject to locale).
FormatDateTime | Return a string representation of a TDateTime value with a given format.
DateSeparator | Date separator character (subject to locale).
DefaultFormatSettings | Storage for default settings


Date/time routines

Functions for date and time handling.

Name | Description
DateTimeToFileDate | Convert DateTime type to file date
DateTimeToStr | Construct string representation of DateTime
DateTimeToString | Construct string representation of DateTime
DateTimeToSystemTime | Convert DateTime to system time
DateTimeToTimeStamp | Convert DateTime to timestamp
DateToStr | Construct string representation of date
Date | Get current date
DayOfWeek | Get day of week
DecodeDate | Decode DateTime to year month and day
DecodeTime | Decode DateTime to hours, minutes and seconds
EncodeDate | Encode year, day and month to DateTime
EncodeTime | Encode hours, minutes and seconds to DateTime
FormatDateTime | Return string representation of DateTime
IncMonth | Add 1 to month
IsLeapYear | Determine if year is leap year
MSecsToTimeStamp | Convert nr of milliseconds to timestamp
Now | Get current date and time
StrToDateTime | Convert string to DateTime
StrToDate | Convert string to date
StrToTime | Convert string to time
SystemTimeToDateTime | Convert system time to datetime
TimeStampToDateTime | Convert time stamp to DateTime
TimeStampToMSecs | Convert Timestamp to number of millicseconds
TimeToStr | return string representation of Time
Time | Get current time


DateTimeToFileDate

Convert a TDateTime value to a file age (integer)

Declaration

Source position: datih.inc line 159

function DateTimeToFileDate(

  DateTime: TDateTime

):LongInt;

Description

DateTimeToFileDate function converts a date/time indication in TDateTime format to a filedate function, such as returned for instance by the FileAge function.

Errors

None.

See also

Time | Returns the current time.
Date | Return the current date.
FileDateToDateTime | Convert a FileDate value to a TDateTime value.
DateTimeToSystemTime | Converts a TDateTime value to a systemtime structure.
DateTimeToTimeStamp | Converts a TDateTime value to a TimeStamp structure.

Example

Program Example2;

{ This program demonstrates the DateTimeToFileDate function }

Uses sysutils;

Begin
  Writeln ('FileTime of now would be: ',DateTimeToFileDate (Now));
End.


DateTimeToStr

Converts a TDateTime value to a string using a predefined format.

Declaration

Source position: datih.inc line 136

function DateTimeToStr(

  DateTime: TDateTime;

  ForceTimeIfZero: Boolean = False

):string;

function DateTimeToStr(

  DateTime: TDateTime;

  const FormatSettings: TFormatSettings;

  ForceTimeIfZero: Boolean = False

):string;

Description

DateTimeToStr returns a string representation of DateTime using the formatting specified in LongDateTimeFormat. It corresponds to a call to FormatDateTime('c',DateTime) (see formatchars).

Note that if the time part is 0 (i.e. midnight), no time is appended.

Errors

None.

See also

FormatDateTime

Return a string representation of a TDateTime value with a given format.

Example

Program Example3;

{ This program demonstrates the DateTimeToStr function }

Uses sysutils;

Begin
  Writeln ('Today is : ',DateTimeToStr(Now));
  Writeln ('Today is : ',FormatDateTime('c',Now));
End.


DateTimeToString

Converts a TDateTime value to a string with a given format.

Declaration

Source position: datih.inc line 157

procedure DateTimeToString(

  out Result: string;

  const FormatStr: string;

  const DateTime: TDateTime;

  Options: TFormatDateTimeOptions = []

);

procedure DateTimeToString(

  out Result: string;

  const FormatStr: string;

  const DateTime: TDateTime;

  const FormatSettings: TFormatSettings;

  Options: TFormatDateTimeOptions = []

);

Description

DateTimeToString returns in Result a string representation of DateTime using the formatting specified in FormatStr.

for a list of characters that can be used in the FormatStr formatting string, see formatchars.

Note that for 'c', if the time part is 0 (i.e. midnight), no time is appended.

Errors

In case a wrong formatting character is found, an EConvertError is raised.

See also

FormatDateTime | Return a string representation of a TDateTime value with a given format.
formatchars | Date and time formatting characters
EConvertError | Conversion error.

Example

Program Example4;

{ This program demonstrates the DateTimeToString function }

Uses sysutils;

Procedure today (Fmt : string);

Var S : AnsiString;

begin
  DateTimeToString (S,Fmt,Date);
  Writeln (S);
end;

Procedure Now (Fmt : string);

Var S : AnsiString;

begin
  DateTimeToString (S,Fmt,Time);
  Writeln (S);
end;

Begin
  Today ('"Today is "dddd dd mmmm y');
  Today ('"Today is "d mmm yy');
  Today ('"Today is "d/mmm/yy');
  Now ('''The time is ''am/pmh:n:s');
  Now ('''The time is ''hh:nn:ssam/pm');
  Now ('''The time is ''tt');
End.


DateTimeToSystemTime

Converts a TDateTime value to a systemtime structure.

Declaration

Source position: datih.inc line 123

procedure DateTimeToSystemTime(

  DateTime: TDateTime;

  out SystemTime: TSystemTime

);

Description

DateTimeToSystemTime converts a date/time pair in DateTime, with TDateTime format to a system time SystemTime.

Errors

None.

See also

DateTimeToFileDate | Convert a TDateTime value to a file age (integer)
SystemTimeToDateTime | Convert a system time to a TDateTime value.
DateTimeToTimeStamp | Converts a TDateTime value to a TimeStamp structure.

Example

Program Example5;

{ This program demonstrates the DateTimeToSystemTime function }

Uses sysutils;

Var ST : TSystemTime;

Begin
  DateTimeToSystemTime(Now,ST);
  With St do
    begin
    Writeln ('Today is    ',year,'/',month,'/',Day);
    Writeln ('The time is ',Hour,':',minute,':',Second,'.',MilliSecond);
    end;
End.


DateTimeToTimeStamp

Converts a TDateTime value to a TimeStamp structure.

Declaration

Source position: datih.inc line 111

function DateTimeToTimeStamp(

  DateTime: TDateTime

):TTimeStamp;

Description

DateTimeToSystemTime converts a date/time pair in DateTime, with TDateTime format to a TTimeStamp format.

Errors

None.

See also

DateTimeToFileDate | Convert a TDateTime value to a file age (integer)
SystemTimeToDateTime | Convert a system time to a TDateTime value.
DateTimeToSystemTime | Converts a TDateTime value to a systemtime structure.

Example

Program Example6;

{ This program demonstrates the DateTimeToTimeStamp function }

Uses sysutils;

Var TS : TTimeStamp;

Begin
  TS:=DateTimeToTimeStamp (Now);
  With TS do
    begin
    Writeln ('Now is ',time,' millisecond past midnight');
    Writeln ('Today is ' ,Date,' days past 1/1/0001');
    end;
End.


DateToStr

Converts a TDateTime value to a date string with a predefined format.

Declaration

Source position: datih.inc line 132

function DateToStr(

  Date: TDateTime

):string;

function DateToStr(

  Date: TDateTime;

  const FormatSettings: TFormatSettings

):string;

Description

DateToStr converts Date to a string representation. It uses ShortDateFormat as it's formatting string. It is hence completely equivalent to a FormatDateTime('ddddd', Date).

Errors

None.

See also

TimeToStr | Convert a TDateTime time to a string using a predefined format.
DateTimeToStr | Converts a TDateTime value to a string using a predefined format.
FormatDateTime | Return a string representation of a TDateTime value with a given format.
StrToDate | Convert a date string to a TDateTime value.

Example

Program Example7;

{ This program demonstrates the DateToStr function }

Uses sysutils;

Begin
  Writeln(Format ('Today is: %s',[DateToStr(Date)]));
End.


DayOfWeek

Returns the day of the week.

Declaration

Source position: datih.inc line 125

function DayOfWeek(

  DateTime: TDateTime

):Integer;

Description

DayOfWeek returns the day of the week from DateTime. Sunday is counted as day 1, Saturday is counted as day 7. The result of DayOfWeek can serve as an index to the LongDayNames constant array, to retrieve the name of the day.

Errors

None.

See also

Date | Return the current date.
DateToStr | Converts a TDateTime value to a date string with a predefined format.

Example

Program Example8;

{ This program demonstrates the DayOfWeek function }

Uses sysutils;

Begin
  Writeln ('Today''s day is ',LongDayNames[DayOfWeek(Date)]);
End.


DecodeDate

Decode a TDateTime to a year,month,day triplet

Declaration

Source position: datih.inc line 120

procedure DecodeDate(

  Date: TDateTime;

  out Year: Word;

  out Month: Word;

  out Day: Word

);

Description

DecodeDate decodes the Year, Month and Day stored in Date, and returns them in the Year, Month and Day variables.

Errors

None.

See also

EncodeDate | Encode a Year,Month,Day to a TDateTime value.
DecodeTime | Decode a TDateTime to a hour,minute,second,millisec quartet

Example

Program Example9;

{ This program demonstrates the DecodeDate function }

Uses sysutils;

Var YY,MM,DD : Word;

Begin
  DecodeDate(Date,YY,MM,DD);
  Writeln (Format ('Today is %d/%d/%d',[dd,mm,yy]));
End.


DecodeDateFully

Decode a date with additional date of the week.

Declaration

Source position: datih.inc line 121

function DecodeDateFully(

  const DateTime: TDateTime;

  out Year: Word;

  out Month: Word;

  out Day: Word;

  out DOW: Word

):Boolean;

Description

DecodeDateFully, like DecodeDate, decodes DateTime in its parts and returns these in Year, Month, Day but in addition returns the day of the week in DOW.

Errors

None.

See also

EncodeDate | Encode a Year,Month,Day to a TDateTime value.
TryEncodeDate | Try to encode a date, and indicate success.
DecodeDate | Decode a TDateTime to a year,month,day triplet


DecodeTime

Decode a TDateTime to a hour,minute,second,millisec quartet

Declaration

Source position: datih.inc line 122

procedure DecodeTime(

  Time: TDateTime;

  out Hour: Word;

  out Minute: Word;

  out Second: Word;

  out MilliSecond: Word

);

Description

DecodeTime decodes the hours, minutes, second and milliseconds stored in Time, and returns them in the Hour, Minute and Second and MilliSecond variables.

Errors

None.

See also

EncodeTime | Encode a Hour,Min,Sec,millisec to a TDateTime value.
DecodeDate | Decode a TDateTime to a year,month,day triplet

Example

Program Example10;

{ This program demonstrates the DecodeTime function }

Uses sysutils;

Var HH,MM,SS,MS: Word;

Begin
  DecodeTime(Time,HH,MM,SS,MS);
  Writeln (format('The time is %d:%d:%d.%d',[hh,mm,ss,ms]));
End.


DeleteFile

Delete a file from the filesystem.

Declaration

Source position: filutilh.inc line 135

function DeleteFile(

  const FileName: UnicodeString

):Boolean;

function DeleteFile(

  const FileName: RawByteString

):Boolean;

Description

DeleteFile deletes file FileName from disk. The function returns True if the file was successfully removed, False otherwise.

Errors

On error, False is returned.

See also

FileCreate | Create a new file and return a handle to it.
FileExists | Check whether a particular file exists in the filesystem.

Example

Program Example31;

{ This program demonstrates the DeleteFile function }

Uses sysutils;

Var
  Line : String;
  F,I : Longint;

Begin
  F:=FileCreate('test.txt');
  Line:='Some string line.'#10;
  For I:=1 to 10 do
    FileWrite (F,Line[1],Length(Line));
  FileClose(F);
  DeleteFile('test.txt');
End.


DirectoryExists

Check whether a directory exists in the file system.

Declaration

Source position: filutilh.inc line 131

function DirectoryExists(

  const Directory: UnicodeString

):Boolean;

function DirectoryExists(

  const Directory: RawByteString

):Boolean;

Description

DirectoryExists checks whether Directory exists in the filesystem and is actually a directory. If this is the case, the function returns True, otherwise False is returned.

See also

FileExists

Check whether a particular file exists in the filesystem.


DiskFree

Return the amount of free diskspace

Declaration

Source position: diskh.inc line 16

function DiskFree(

  drive: Byte

):Int64;

Description

DiskFree returns the free space (in bytes) on disk Drive. Drive is the number of the disk drive:

0
for the current drive.
1
for the first floppy drive.
2
for the second floppy drive.
3
for the first hard-disk partition.
4-26
for all other drives and partitions.
Remark: Under Linux, and Unix in general, the concept of disk is different than the dos one, since the filesystem is seen as one big directory tree. For this reason, the DiskFree and DiskSize functions must be mimicked using filenames that reside on the partitions. For more information, see AddDisk.

Errors

On error, -1 is returned.

See also

DiskSize | Return the total amount of diskspace.
AddDisk | Add a disk to the list of known disks (Unix only)

Example

Program Example27;

{ This program demonstrates the DiskFree function }

Uses sysutils;

Begin
  Write ('Size of current disk       : ',DiskSize(0));
  Writeln (' (= ',DiskSize(0) div 1024,'k)');
  Write ('Free space of current disk : ',Diskfree(0));
  Writeln (' (= ',Diskfree(0) div 1024,'k)');
End.


DiskSize

Return the total amount of diskspace.

Declaration

Source position: diskh.inc line 17

function DiskSize(

  drive: Byte

):Int64;

Description

DiskSize returns the size (in bytes) of disk Drive. Drive is the number of the disk drive:

0
for the current drive.
1
for the first floppy drive.
2
for the second floppy drive.
3
for the first hard-disk parttion.
4-26
for all other drives and partitions.
Remark: Under Linux, and Unix in general, the concept of disk is different than the dos one, since the filesystem is seen as one big directory tree. For this reason, the DiskFree and DiskSize functions must be mimicked using filenames that reside on the partitions. For more information, see AddDisk

For an example, see DiskFree.

Errors

On error, -1 is returned.

See also

DiskFree | Return the amount of free diskspace
AddDisk | Add a disk to the list of known disks (Unix only)


DisposeStr

Dispose an ansistring from the heap.

Declaration

Source position: sysstrh.inc line 67

procedure DisposeStr(

  S: PString

); overload;

procedure DisposeStr(

  S: PShortString

); overload;

Description

DisposeStr removes the dynamically allocated string S from the heap, and releases the occupied memory.

This function is provided for Delphi compatibility only. AnsiStrings are managed on the heap and should be preferred to the mechanism of dynamically allocated strings.

For an example, see DisposeStr.

Errors

None.

See also

NewStr | Allocate a new ansistring on the heap.
AppendStr | Append one ansistring to another.
AssignStr | Assigns an ansistring to a null-terminated string.


DoDirSeparators

Convert known directory separators to the current directory separator.

Declaration

Source position: finah.inc line 40

procedure DoDirSeparators(

  var FileName: UnicodeString

);

procedure DoDirSeparators(

  var FileName: RawByteString

);

Description

This function replaces all known directory separators in FileName to the directory separator character for the current system. The list of known separators is specified in the AllowDirectorySeparators constant.

Errors

None.

See also

ExtractFileName | Extract the filename part from a full path filename.
ExtractFilePath | Extract the path from a filename.

Example

Program Example32;

{ This program demonstrates the DoDirSeparators function }
{$H+}

Uses sysutils;

Procedure Testit (F : String);

begin
  Writeln ('Before : ',F);
  DoDirSeparators (F);
  Writeln ('After  : ',F);
end;

Begin
  Testit (GetCurrentDir);
  Testit ('c:\pp\bin\win32');
  Testit ('/usr/lib/fpc');
  Testit ('\usr\lib\fpc');
End.


EncodeDate

Encode a Year,Month,Day to a TDateTime value.

Declaration

Source position: datih.inc line 117

function EncodeDate(

  Year: Word;

  Month: Word;

  Day: Word

):TDateTime;

Description

EncodeDate encodes the Year, Month and Day variables to a date in TDateTime format. It does the opposite of the DecodeDate procedure.

The parameters must lie withing valid ranges (boundaries included):

Year
must be between 1 and 9999.
Month
must be within the range 1-12.
Day
msut be between 1 and 31.

Errors

In case one of the parameters is out of it's valid range, an EConvertError exception is raised.

See also

EncodeTime | Encode a Hour,Min,Sec,millisec to a TDateTime value.
DecodeDate | Decode a TDateTime to a year,month,day triplet

Example

Program Example11;

{ This program demonstrates the EncodeDate function }

Uses sysutils;

Var YY,MM,DD : Word;

Begin
  DecodeDate (Date,YY,MM,DD);
  WriteLn ('Today is : ',FormatDateTime ('dd mmmm yyyy',EnCodeDate(YY,Mm,Dd)));
End.


EncodeTime

Encode a Hour,Min,Sec,millisec to a TDateTime value.

Declaration

Source position: datih.inc line 118

function EncodeTime(

  Hour: Word;

  Minute: Word;

  Second: Word;

  MilliSecond: Word

):TDateTime;

Description

EncodeTime encodes the Hour, Minute, Second, MilliSecond variables to a TDateTime format result. It does the opposite of the DecodeTime procedure.

The parameters must have a valid range (boundaries included):

Hour
must be between 0 and 23.
Minute,second
must both be between 0 and 59.
Millisecond
must be between 0 and 999.

Errors

In case one of the parameters is out of it's valid range, an EConvertError exception is raised.

See also

EncodeDate | Encode a Year,Month,Day to a TDateTime value.
DecodeTime | Decode a TDateTime to a hour,minute,second,millisec quartet

Example

Program Example12;

{ This program demonstrates the EncodeTime function }

Uses sysutils;

Var Hh,MM,SS,MS : Word;

Begin
  DeCodeTime (Time,Hh,MM,SS,MS);
  Writeln ('Present Time is : ',FormatDateTime('hh:mm:ss',EnCodeTime (HH,MM,SS,MS)));
End.


ExceptAddr

Current exception address.

Declaration

Source position: sysutilh.inc line 229

function ExceptAddr: CodePointer;

Description

ExceptAddr returns the address from the currently treated exception object when an exception is raised, and the stack is unwound.

See also

ExceptObject | Current Exception object.
ExceptionErrorMessage | Return a message describing the exception.
ShowException | Show the current exception to the user.


ExceptFrameCount

Number of frames included in an exception backtrace

Declaration

Source position: sysutilh.inc line 230

function ExceptFrameCount: LongInt;

Description

ExceptFrameCount returns the number of frames that are included in an exception stack frame backtrace. The function returns 0 if there is currently no exception being handled. (i.e. it only makes sense to call this function in an finally..end or except..end block.

Errors

None.

See also

ExceptFrames | Return the current exception stack frames
ExceptAddr | Current exception address.
ExceptObject | Current Exception object.
#rtl.system.ExceptProc | Current exception handling procedure.


ExceptFrames

Return the current exception stack frames

Declaration

Source position: sysutilh.inc line 231

function ExceptFrames: PCodePointer;

Description

ExceptFrames returns the current list frames on the exception stack. If there is no exception in progress, Nil is returned.

See also

ExceptFrameCount | Number of frames included in an exception backtrace
ExceptAddr | Current exception address.
ExceptObject | Current Exception object.
#rtl.system.ExceptProc | Current exception handling procedure.


ExceptionErrorMessage

Return a message describing the exception.

Declaration

Source position: sysutilh.inc line 232

function ExceptionErrorMessage(

  ExceptObject: TObject;

  ExceptAddr: Pointer;

  Buffer: PChar;

  Size: Integer

):Integer;

Description

ExceptionErrorMessage creates a string that describes the exception object ExceptObject at address ExceptAddr. It can be used to display exception messages. The string will be stored in the memory pointed to by Buffer, and will at most have Size characters.

The routine checks whether ExceptObject is a Exception object or not, and adapts the output accordingly.

See also

ExceptObject | Current Exception object.
ExceptAddr | Current exception address.
ShowException | Show the current exception to the user.


ExceptObject

Current Exception object.

Declaration

Source position: sysutilh.inc line 228

function ExceptObject: TObject;

Description

ExceptObject returns the currently treated exception object when an exception is raised, and the stack is unwound.

Errors

If there is no exception, the function returns Nil

See also

ExceptAddr | Current exception address.
ExceptionErrorMessage | Return a message describing the exception.
ShowException | Show the current exception to the user.


ExcludeLeadingPathDelimiter

Strip the leading path delimiter of a path

Declaration

Source position: finah.inc line 38

function ExcludeLeadingPathDelimiter(

  const Path: UnicodeString

):UnicodeString;

function ExcludeLeadingPathDelimiter(

  const Path: RawByteString

):RawByteString;

Description

ExcludeLeadingPathDelimiter will remove any path delimiter on the first position of Path if there is one. if there is none (or the path is empty), it is left untouched.

See also

IncludeTrailingPathDelimiter | Add trailing directory separator to a pathname, if needed.
IncludeLeadingPathDelimiter | Prepend a path delimiter if there is not already one.
ExcludeTrailingPathDelimiter | Strip trailing directory separator from a pathname, if needed.
ConcatPaths | Concatenate an array of paths to form a single path

Example

Program Example95;

{ This program demonstrates the IncludeLeadingPathDelimiter function }

Uses sysutils;

Begin
  // Will print "/this/path"
  Writeln(IncludeLeadingPathDelimiter('this/path'));
  // The same result
  Writeln(IncludeLeadingPathDelimiter('/this/path'));
End.


ExcludeTrailingBackslash

Strip trailing directory separator from a pathname, if needed.

Declaration

Source position: finah.inc line 35

function ExcludeTrailingBackslash(

  const Path: UnicodeString

):UnicodeString;

function ExcludeTrailingBackslash(

  const Path: RawByteString

):RawByteString;

Description

ExcludeTrailingBackslash is provided for backwards compatibility with Delphi. Use ExcludeTrailingPathDelimiter instead.

See also

IncludeTrailingPathDelimiter | Add trailing directory separator to a pathname, if needed.
ExcludeTrailingPathDelimiter | Strip trailing directory separator from a pathname, if needed.
PathDelim | Path (directory) delimiter.
IsPathDelimiter | Is the character at the given position a pathdelimiter ?


ExcludeTrailingPathDelimiter

Strip trailing directory separator from a pathname, if needed.

Declaration

Source position: finah.inc line 36

function ExcludeTrailingPathDelimiter(

  const Path: UnicodeString

):UnicodeString;

function ExcludeTrailingPathDelimiter(

  const Path: RawByteString

):RawByteString;

Description

ExcludeTrailingPathDelimiter removes the trailing path delimiter character (PathDelim) from Path if it is present, and returns the result.

See also

ExcludeTrailingBackslash | Strip trailing directory separator from a pathname, if needed.
IncludeTrailingPathDelimiter | Add trailing directory separator to a pathname, if needed.
PathDelim | Path (directory) delimiter.
IsPathDelimiter | Is the character at the given position a pathdelimiter ?


ExecuteProcess

Execute another process (program).

Declaration

Source position: osutilsh.inc line 32

function ExecuteProcess(

  const Path: AnsiString;

  const ComLine: AnsiString;

  Flags: TExecuteFlags = []

):Integer;

function ExecuteProcess(

  const Path: AnsiString;

  const ComLine: array of AnsiString;

  Flags: TExecuteFlags = []

):Integer;

Description

ExecuteProcess will execute the program in Path, passing it the arguments in ComLine. ExecuteProcess will then wait for the program to finish, and will return the exit code of the executed program. In case ComLine is a single string, it will be split out in an array of strings, taking into account common whitespace and quote rules.

The program specified in Path is not searched in the searchpath specified in the PATH environment variable, so the full path to the executable must be specified in Path, although some operating systems may perform this search anyway (notably, windows)

Flags can be used to control the passing of file handles: if ExecInheritsHandles is included, the file handles of the current process will be passed on to the newly executed process.

Errors

In case the program could not be executed or an other error occurs, an EOSError exception will be raised.

See also

TExecuteFlags | Flags for ExecuteProcess
EOSError | Operating system error.


ExeSearch

Search for an executable

Declaration

Source position: filutilh.inc line 142

function ExeSearch(

  const Name: UnicodeString;

  const DirList: UnicodeString = ''

):UnicodeString;

function ExeSearch(

  const Name: RawByteString;

  const DirList: RawByteString = ''

):RawByteString;

Description

ExeSearch searches for an executable Name in the list of directories DirList (a list of directories, separator by PathSeparator. If the current OS also searches implicitly in the current working directory, the current directory is searched in the first place.

If the executable is found, then the full path of the executable is returned. If it is not found, an empty string is returned.

No check is performed whether the found file is actually executable.

See also

FileSearch

Search for a file in a path.


ExpandFileName

Expand a relative filename to an absolute filename.

Declaration

Source position: finah.inc line 29

function ExpandFileName(

  const FileName: UnicodeString

):UnicodeString;

function ExpandFileName(

  const FileName: RawByteString

):RawByteString;

Description

ExpandFileName expands the filename to an absolute filename. It changes all directory separator characters to the one appropriate for the system first.

If an empty filename is passed, it is expanded to the current directory.

Errors

None.

See also

ExpandFileNameCase | Expand a filename entered as case insensitive to the full path as stored on the disk.
ExtractFileName | Extract the filename part from a full path filename.
ExtractFilePath | Extract the path from a filename.
ExtractFileDir | Extract the drive and directory part of a filename.
ExtractFileDrive | Extract the drive part from a filename.
ExtractFileExt | Return the extension from a filename.
ExtractRelativePath | Extract a relative path from a filename, given a base directory.

Example

Program Example33;

{ This program demonstrates the ExpandFileName function }

Uses sysutils;

Procedure Testit (F : String);

begin
  Writeln (F,' expands to : ',ExpandFileName(F));
end;

Begin
  Testit('ex33.pp');
  Testit(ParamStr(0));
  Testit('/pp/bin/win32/ppc386');
  Testit('\pp\bin\win32\ppc386');
  Testit('.');
End.


ExpandFileNameCase

Expand a filename entered as case insensitive to the full path as stored on the disk.

Declaration

Source position: finah.inc line 30

function ExpandFileNameCase(

  const FileName: UnicodeString;

  out MatchFound: TFilenameCaseMatch

):UnicodeString;

function ExpandFileNameCase(

  const FileName: RawByteString;

  out MatchFound: TFilenameCaseMatch

):RawByteString;

Description

On case insensitive platforms, ExpandFileNameCase behaves similarly to ExpandFileName except for the fact that it returns the final part of the path with the same case of letters as found on the disk (if it exists - otherwise the case equals the one provided on input). On case sensitive platforms it also checks whether one or more full paths exist on disk which would correspond to the provided input if treated case insensitively and returns the first such match found and information whether the match is unique or not.

Note that the behaviour is basically undefined if the input includes wildcards characters. Normally, wildcards in the last part of path provided on input are resolved to the first corresponding item found on the disk, but it is better not to rely on that and use other more suitable functions if working with wildcards like FindFirst/FindNext.

Errors

None.

See also

ExpandFileName | Expand a relative filename to an absolute filename.
ExtractFileName | Extract the filename part from a full path filename.
ExtractFilePath | Extract the path from a filename.
ExtractFileDir | Extract the drive and directory part of a filename.
ExtractFileDrive | Extract the drive part from a filename.
ExtractFileExt | Return the extension from a filename.
ExtractRelativePath | Extract a relative path from a filename, given a base directory.

Example

Program Example33;

{ This program demonstrates the ExpandFileName function }

Uses sysutils;

Procedure Testit (F : String);

begin
  Writeln (F,' expands to : ',ExpandFileName(F));
end;

Begin
  Testit('ex33.pp');
  Testit(ParamStr(0));
  Testit('/pp/bin/win32/ppc386');
  Testit('\pp\bin\win32\ppc386');
  Testit('.');
End.


ExpandUNCFileName

Expand a relative filename to an absolute UNC filename.

Declaration

Source position: finah.inc line 31

function ExpandUNCFileName(

  const FileName: UnicodeString

):UnicodeString;

function ExpandUNCFileName(

  const FileName: RawByteString

):RawByteString;

Description

ExpandUNCFileName runs ExpandFileName on FileName and then attempts to replace the drive letter by the name of a shared disk.

Errors

None.

See also

ExpandFileName | Expand a relative filename to an absolute filename.
ExtractFileName | Extract the filename part from a full path filename.
ExtractFilePath | Extract the path from a filename.
ExtractFileDir | Extract the drive and directory part of a filename.
ExtractFileDrive | Extract the drive part from a filename.
ExtractFileExt | Return the extension from a filename.
ExtractRelativePath | Extract a relative path from a filename, given a base directory.


ExtractFileDir

Extract the drive and directory part of a filename.

Declaration

Source position: finah.inc line 27

function ExtractFileDir(

  const FileName: UnicodeString

):UnicodeString;

function ExtractFileDir(

  const FileName: RawByteString

):RawByteString;

Description

ExtractFileDir returns only the directory part of FileName, including a driveletter. The directory name has NO ending directory separator, in difference with ExtractFilePath.

Errors

None.

See also

ExtractFileName | Extract the filename part from a full path filename.
ExtractFilePath | Extract the path from a filename.
ExtractFileDir | Extract the drive and directory part of a filename.
ExtractFileDrive | Extract the drive part from a filename.
ExtractFileExt | Return the extension from a filename.
ExtractRelativePath | Extract a relative path from a filename, given a base directory.

Example

Program Example34;

{ This program demonstrates the ExtractFileName function }
{$H+}
Uses sysutils;

Procedure Testit(F : String);

begin
 Writeln ('FileName      : ',F);
 Writeln ('Has Name      : ',ExtractFileName(F));
 Writeln ('Has Path      : ',ExtractFilePath(F));
 Writeln ('Has Extension : ',ExtractFileExt(F));
 Writeln ('Has Directory : ',ExtractFileDir(F));
 Writeln ('Has Drive     : ',ExtractFileDrive(F));
end;

Begin
  Testit (Paramstr(0));
  Testit ('/usr/local/bin/mysqld');
  Testit ('c:\pp\bin\win32\ppc386.exe');
  Testit ('/pp/bin/win32/ppc386.exe');
End.


ExtractFileDrive

Extract the drive part from a filename.

Declaration

Source position: finah.inc line 24

function ExtractFileDrive(

  const FileName: UnicodeString

):UnicodeString;

function ExtractFileDrive(

  const FileName: RawByteString

):RawByteString;

Description

Extracts the drive letter from a filename. Note that some operating systems do not support drive letters.

For an example, see ExtractFileDir.

See also

ExtractFileName | Extract the filename part from a full path filename.
ExtractFilePath | Extract the path from a filename.
ExtractFileDir | Extract the drive and directory part of a filename.
ExtractFileDrive | Extract the drive part from a filename.
ExtractFileExt | Return the extension from a filename.
ExtractRelativePath | Extract a relative path from a filename, given a base directory.


ExtractFileExt

Return the extension from a filename.

Declaration

Source position: finah.inc line 26

function ExtractFileExt(

  const FileName: UnicodeString

):UnicodeString;

function ExtractFileExt(

  const FileName: RawByteString

):RawByteString;

Description

ExtractFileExt returns the extension (including the .(dot) character) of FileName.

For an example, see ExtractFileDir.

Errors

None.

See also

ChangeFileExt | Change the extension of a filename.
ExtractFileName | Extract the filename part from a full path filename.
ExtractFilePath | Extract the path from a filename.
ExtractFileDir | Extract the drive and directory part of a filename.
ExtractFileDrive | Extract the drive part from a filename.
ExtractFileExt | Return the extension from a filename.
ExtractRelativePath | Extract a relative path from a filename, given a base directory.


ExtractFileName

Extract the filename part from a full path filename.

Declaration

Source position: finah.inc line 25

function ExtractFileName(

  const FileName: UnicodeString

):UnicodeString;

function ExtractFileName(

  const FileName: RawByteString

):RawByteString;

Description

ExtractFileName returns the filename part from FileName. The filename consists of all characters after the last directory separator character ('/' or '\') or drive letter.

The full filename can always be reconstucted by concatenating the result of ExtractFilePath and ExtractFileName.

For an example, see ExtractFileDir.

Errors

None.

See also

ExtractFileName | Extract the filename part from a full path filename.
ExtractFilePath | Extract the path from a filename.
ExtractFileDir | Extract the drive and directory part of a filename.
ExtractFileDrive | Extract the drive part from a filename.
ExtractFileExt | Return the extension from a filename.
ExtractRelativePath | Extract a relative path from a filename, given a base directory.


ExtractFilePath

Extract the path from a filename.

Declaration

Source position: finah.inc line 23

function ExtractFilePath(

  const FileName: UnicodeString

):UnicodeString;

function ExtractFilePath(

  const FileName: RawByteString

):RawByteString;

Description

ExtractFilePath returns the path part (including driveletter) from FileName. The path consists of all characters before the last directory separator character ('/' or '\'), including the directory separator itself. In case there is only a drive letter, that will be returned.

The full filename can always be reconstucted by concatenating the result of ExtractFilePath and ExtractFileName.

For an example, see ExtractFileDir.

Errors

None.

See also

ExtractFileName | Extract the filename part from a full path filename.
ExtractFilePath | Extract the path from a filename.
ExtractFileDir | Extract the drive and directory part of a filename.
ExtractFileDrive | Extract the drive part from a filename.
ExtractFileExt | Return the extension from a filename.
ExtractRelativePath | Extract a relative path from a filename, given a base directory.


ExtractRelativepath

Extract a relative path from a filename, given a base directory.

Declaration

Source position: finah.inc line 32

function ExtractRelativepath(

  const BaseName: UnicodeString;

  const DestNAme: UnicodeString

):UnicodeString;

function ExtractRelativepath(

  const BaseName: RawByteString;

  const DestNAme: RawByteString

):RawByteString;

Description

ExtractRelativePath constructs a relative path to go from BaseName to DestName. If DestName is on another drive (Not on Unix-like platforms) then the whole Destname is returned.

Note that directories must end on a path delimiter for this function to work correctly. If not, the last part is stripped and treated as a file name.

Errors

None.

See also

ExtractFileName | Extract the filename part from a full path filename.
ExtractFilePath | Extract the path from a filename.
ExtractFileDir | Extract the drive and directory part of a filename.
ExtractFileDrive | Extract the drive part from a filename.
ExtractFileExt | Return the extension from a filename.

Example

Program Example35;

{ This program demonstrates the ExtractRelativePath function }

Uses sysutils;

Procedure Testit (FromDir,ToDir : String);

begin
  Write ('From "',FromDir,'" to "',ToDir,'" via "');
  Writeln (ExtractRelativePath(FromDir,ToDir),'"');
end;

Begin
 Testit ('/pp/src/compiler/','/pp/bin/win32/ppc386/');
 Testit ('/pp/bin/win32/ppc386/','/pp/src/compiler/');
 Testit ('/pp/bin/win32/','/pp/src/compiler/ppcx386/');
 Testit ('/pp/bin/win32/','/pp/src/compiler/ppcx386');
 Testit ('/pp/bin/win32','/pp/src/compiler/ppcx386');
 Testit ('e:/pp/bin/win32/ppc386/','d:/pp/src/compiler/');
 Testit ('e:\pp\bin\win32\ppc386/','d:\pp\src\compiler/');
 Testit ('C:\FPC\3.0.2\','C:\FPC\3.0.2\');
 Testit ('C:\FPC\3.0.2\','C:\FPC\3.0.4rc1\');
 Testit ('Q:\','Q:\FPC\3.0.4rc1\');
End.


ExtractShortPathName

Returns a 8.3 path name

Declaration

Source position: finah.inc line 28

function ExtractShortPathName(

  const FileName: UnicodeString

):UnicodeString;

function ExtractShortPathName(

  const FileName: RawByteString

):RawByteString;

Description

ExtractShortPathName returns a 8.3 compliant filename that represents the same file as FileName. On platforms other than windows, this is FileName itself.

See also

ExtractFilePath | Extract the path from a filename.
ExtractFileName | Extract the filename part from a full path filename.


FileAge

Return the timestamp of a file.

Declaration

Source position: filutilh.inc line 128

function FileAge(

  const FileName: UnicodeString

):LongInt;

function FileAge(

  const FileName: UnicodeString;

  out FileDateTime: TDateTime;

  FollowLink: Boolean = True

):Boolean;

function FileAge(

  const FileName: RawByteString;

  out FileDateTime: TDateTime;

  FollowLink: Boolean = True

):Boolean;

function FileAge(

  const FileName: RawByteString

):LongInt;

Description

FileAge returns the last modification time of file FileName. The FileDate format can be transformed to TDateTime format with the FileDateToDateTime function.

Fileage cannot be used on directories, it will return -1 if FileName indicates a directory.

Errors

In case of errors, -1 is returned.

See also

FileDateToDateTime | Convert a FileDate value to a TDateTime value.
FileExists | Check whether a particular file exists in the filesystem.
FileGetAttr | Return attributes of a file.

Example

Program Example36;

{ This program demonstrates the FileAge function }

Uses sysutils;

Var S : TDateTime;
    fa : Longint;
Begin
  fa:=FileAge('ex36.pp');
  If Fa<>-1 then
    begin
    S:=FileDateTodateTime(fa);
    Writeln ('I''m from ',DateTimeToStr(S))
    end;
End.


FileClose

Close a file handle.

Declaration

Source position: filutilh.inc line 172

procedure FileClose(

  Handle: THandle

);

Description

FileClose closes the file handle Handle. After this call, attempting to read or write from the handle will result in an error.

For an example, see FileCreate

Errors

None.

See also

FileCreate | Create a new file and return a handle to it.
FileWrite | Write data from a buffer to a given filehandle.
FileOpen | Open an existing file and return a filehandle
FileRead | Read data from a filehandle in a buffer.
FileTruncate | Truncate an open file to a given size.
FileSeek | Set the current file position on a file handle.


FileCreate

Create a new file and return a handle to it.

Declaration

Source position: filutilh.inc line 124

function FileCreate(

  const FileName: UnicodeString

):THandle;

function FileCreate(

  const FileName: UnicodeString;

  Rights: Integer

):THandle;

function FileCreate(

  const FileName: UnicodeString;

  ShareMode: Integer;

  Rights: Integer

):THandle;

function FileCreate(

  const FileName: RawByteString

):THandle;

function FileCreate(

  const FileName: RawByteString;

  Rights: Integer

):THandle;

function FileCreate(

  const FileName: RawByteString;

  ShareMode: Integer;

  Rights: Integer

):THandle;

Description

FileCreate creates a new file with name FileName on the disk and returns a file handle which can be used to read or write from the file with the FileRead and FileWrite functions.

If a file with name FileName already existed on the disk, it is overwritten.

The optional Mode parameter only has an effect under unix, where it can be used to set the mode (read, write, execute, sticky bit, setgid and setuid flags) of the created file to the specified custom value. On other platfors, the Mode parameter is ignored.

Errors

If an error occurs (e.g. disk full or non-existent path), the function returns THandle(-1).

See also

FileClose | Close a file handle.
FileWrite | Write data from a buffer to a given filehandle.
FileOpen | Open an existing file and return a filehandle
FileRead | Read data from a filehandle in a buffer.
FileTruncate | Truncate an open file to a given size.
FileSeek | Set the current file position on a file handle.

Example

Program Example37;

{ This program demonstrates the FileCreate/FileSeek/FileReed/FileTruncate functions }

Uses sysutils;

Var I,J,F : Longint;

Begin
  F:=FileCreate ('test.dat');
  If F=-1 then
    Halt(1);
  For I:=0 to 100 do
    FileWrite(F,I,SizeOf(i));
  FileClose(f);
  F:=FileOpen ('test.dat',fmOpenRead);
  For I:=0 to 100 do
    begin
    FileRead (F,J,SizeOF(J));
    If J<>I then
      Writeln ('Mismatch at file position ',I)
    end;
  FileSeek(F,0,fsFromBeginning);
  Randomize;
  Repeat
    FileSeek(F,Random(100)*4,fsFromBeginning);
    FileRead (F,J,SizeOf(J));
    Writeln ('Random read : ',j);
  Until J>80;
  FileClose(F);
  F:=FileOpen('test.dat',fmOpenWrite);
  I:=50*SizeOf(Longint);
  If FileTruncate(F,I) then
    Writeln('SuccessFully truncated file to ',I,' bytes.');
  FileClose(F);
End.


FileDateToDateTime

Convert a FileDate value to a TDateTime value.

Declaration

Source position: datih.inc line 160

function FileDateToDateTime(

  Filedate: LongInt

):TDateTime;

Description

FileDateToDateTime converts the date/time encoded in filedate to a TDateTime encoded form. It can be used to convert date/time values returned by the FileAge or FindFirst/FindNext functions to TDateTime form.

Errors

None.

See also

DateTimeToFileDate

Convert a TDateTime value to a file age (integer)

Example

Program Example13;

{ This program demonstrates the FileDateToDateTime function }

Uses sysutils;

Var
  ThisAge : Longint;

Begin
 Write ('ex13.pp created on :');
 ThisAge:=FileAge('ex13.pp');
 Writeln (DateTimeToStr(FileDateToDateTime(ThisAge)));
End.


FileExists

Check whether a particular file exists in the filesystem.

Declaration

Source position: filutilh.inc line 130

function FileExists(

  const FileName: UnicodeString

):Boolean;

function FileExists(

  const FileName: RawByteString

):Boolean;

Description

FileExists returns True if a file with name FileName exists on the disk, False otherwise. On windows, this function will return False if a directory is passed as FileName. On unices, passing a directory name will result in True. The rationale is that on unix, a directory is a file as well.

Note that this function accepts a single filename as an argument, without wildcards. To check for the existence of multiple files, see the FindFirst function.

Errors

None.

See also

FindFirst | Start a file search and return a findhandle
FileAge | Return the timestamp of a file.
FileGetAttr | Return attributes of a file.
FileSetAttr | Set the attributes of a file.

Example

Program Example38;

{ This program demonstrates the FileExists function }

Uses sysutils;

Begin
  If FileExists(ParamStr(0)) Then
    Writeln ('All is well, I seem to exist.');
End.


FileFlush

Declaration

Source position: filutilh.inc line 171

function FileFlush(

  Handle: THandle

):Boolean;


FileGetAttr

Return attributes of a file.

Declaration

Source position: filutilh.inc line 133

function FileGetAttr(

  const FileName: UnicodeString

):LongInt;

function FileGetAttr(

  const FileName: RawByteString

):LongInt;

Description

FileGetAttr returns the attribute settings of file FileName. The attribute is a OR-ed combination of the following constants:

faReadOnly
The file is read-only.
faHidden
The file is hidden. (On unix, this means that the filename starts with a dot)
faSysFile
The file is a system file (On unix, this means that the file is a character, block or FIFO file).
faVolumeId
Volume Label. Only for DOS/Windows on a plain FAT (not VFAT or Fat32) filesystem.
faDirectory
File is a directory.
faArchive
file should be archived. Not possible on Unix

Errors

In case of error, -1 is returned.

See also

FileSetAttr | Set the attributes of a file.
FileAge | Return the timestamp of a file.
FileGetDate | Return the file time of an opened file.

Example

Program Example40;

{ This program demonstrates the FileGetAttr function }

Uses sysutils;

Procedure Testit (Name : String);

Var F : Longint;

Begin
  F:=FileGetAttr(Name);
  If F<>-1 then
    begin
    Writeln ('Testing : ',Name);
    If (F and faReadOnly)<>0 then
      Writeln ('File is ReadOnly');
    If (F and faHidden)<>0 then
      Writeln ('File is hidden');
    If (F and faSysFile)<>0 then
      Writeln ('File is a system file');
    If (F and faVolumeID)<>0 then
      Writeln ('File is a disk label');
    If (F and faArchive)<>0 then
      Writeln ('File is artchive file');
    If (F and faDirectory)<>0 then
      Writeln ('File is a directory');
    end
  else
   Writeln ('Error reading attributes of ',Name);
end;

begin
  testit ('ex40.pp');
  testit (ParamStr(0));
  testit ('.');
  testit ('/');
End.


FileGetDate

Return the file time of an opened file.

Declaration

Source position: filutilh.inc line 176

function FileGetDate(

  Handle: THandle

):LongInt;

Description

FileGetdate returns the filetime of the opened file with filehandle Handle. It is the same as FileAge, with this difference that FileAge only needs the file name, while FilegetDate needs an open file handle.

Errors

On error, -1 is returned.

See also

FileAge

Return the timestamp of a file.

Example

Program Example39;

{ This program demonstrates the FileGetDate function }

Uses sysutils;

Var F,D : Longint;

Begin
  F:=FileCreate('test.dat');
  D:=FileGetDate(F);
  Writeln ('File created on ',DateTimeToStr(FileDateToDateTime(D)));
  FileClose(F);
  DeleteFile('test.dat');
End.


FileIsReadOnly

Check whether a file is read-only.

Declaration

Source position: filutilh.inc line 143

function FileIsReadOnly(

  const FileName: UnicodeString

):Boolean;

function FileIsReadOnly(

  const FileName: RawByteString

):Boolean;

Description

FileIsReadOnly checks whether FileName exists in the filesystem and is a read-only file. If this is the case, the function returns True, otherwise False is returned.

See also

FileExists

Check whether a particular file exists in the filesystem.


FileOpen

Open an existing file and return a filehandle

Declaration

Source position: filutilh.inc line 123

function FileOpen(

  const FileName: UnicodeString;

  Mode: Integer

):THandle;

function FileOpen(

  const FileName: RawByteString;

  Mode: Integer

):THandle;

Description

FileOpen opens a file with name FileName with mode Mode. Mode can be one of the following constants:

fmOpenRead
Open file in read-only mode
fmOpenWrite
Open file in write-only mode
fmOpenReadWrite
Open file in read/write mode.

Under Windows and Unix, the above mode can be or-ed with one of the following sharing/locking flags:

fmShareCompat
Open file in DOS share-compatibility mode
fmShareExclusive
Lock file for exclusive use
fmShareDenyWrite
Lock file so other processes can only read.
fmShareDenyRead
Lock file so other processes cannot read.
fmShareDenyNone
Do not lock file.

If the file has been successfully opened, it can be read from or written to (depending on the Mode parameter) with the FileRead and FileWrite functions.

Remark: Remark that you cannot open a file if it doesn't exist yet, i.e. it will not be created for you. If you want tp create a new file, or overwrite an old one, use the FileCreate function.

There are some limitations to the sharing modes.

  1. Sharing modes are only available on Unix and Windows platforms.
  2. Unix only support sharing modes as of 2.4.0.
  3. fmShareDenyRead only works under Windows at this time, and will always result in an error on Unix platforms because its file locking APIs do not support this concept.
  4. File locking is advisory on Unix platforms. This means that the locks are only checked when a file is opened using a file locking mode. In other cases, existing locks are simply ignored. In particular, this means that fmShareDenyNone has no effect under Unix, because this can only be implemented as ``use no locking'' on those platforms. As a result, opening a file using this mode will always succeed under Unix as far as the locking is concerned, even if the file has already been opened using fmShareExclusive.
  5. Under Solaris, closing a single file handle associated with a file will result in all locks on that file (even via other handles) being destroyed due to the behaviour of the underlying API (fcntl). Because of the same reason, on Solaris you cannot use fmShareDenyWrite in combination with fmOpenWrite, nor fmShareExclusive in combination with fmOpenRead although both work with fmOpenReadWrite.

For an example, see FileCreate

Errors

On Error, THandle(-1) is returned.

See also

fmOpenRead | Open file in read-only mode
fmOpenWrite | Open file in write-only mode
fmOpenReadWrite | Open file in read/write mode.
fmShareDenyWrite | Lock file so other processes can only read.
fmShareExclusive | Lock file for exclusive use
fmShareDenyRead | Lock file so other processes cannot read.
fmShareDenyNone | Do not lock file.
fmShareCompat | Open file in DOS share-compatibility mode
FileClose | Close a file handle.
FileWrite | Write data from a buffer to a given filehandle.
FileCreate | Create a new file and return a handle to it.
FileRead | Read data from a filehandle in a buffer.
FileTruncate | Truncate an open file to a given size.
FileSeek | Set the current file position on a file handle.


FileRead

Read data from a filehandle in a buffer.

Declaration

Source position: filutilh.inc line 167

function FileRead(

  Handle: THandle;

  out Buffer;

  Count: LongInt

):LongInt;

Description

FileRead reads Count bytes from file-handle Handle and stores them into Buffer. Buffer must be at least Count bytes long. No checking on this is performed, so be careful not to overwrite any memory. Handle must be the result of a FileOpen call.

The function returns the number of bytes actually read, or -1 on error.

For an example, see FileCreate

Errors

On error, -1 is returned.

See also

FileClose | Close a file handle.
FileWrite | Write data from a buffer to a given filehandle.
FileCreate | Create a new file and return a handle to it.
FileOpen | Open an existing file and return a filehandle
FileTruncate | Truncate an open file to a given size.
FileSeek | Set the current file position on a file handle.


FileSearch

Search for a file in a path.

Declaration

Source position: filutilh.inc line 140

function FileSearch(

  const Name: UnicodeString;

  const DirList: UnicodeString;

  Options: TFileSearchOptions = [sfoImplicitCurrentDir]

):UnicodeString;

function FileSearch(

  const Name: UnicodeString;

  const DirList: UnicodeString;

  ImplicitCurrentDir: Boolean

):UnicodeString;

function FileSearch(

  const Name: RawByteString;

  const DirList: RawByteString;

  Options: TFileSearchOptions = [sfoImplicitCurrentDir]

):RawByteString;

function FileSearch(

  const Name: RawByteString;

  const DirList: RawByteString;

  ImplicitCurrentDir: Boolean

):RawByteString;

Description

FileSearch looks for the file Name in DirList, where dirlist is a list of directories, separated by semicolons or colons. It returns the full filename of the first match found. The optional Options parameter may be specified to influence the behaviour of the search algorithm. It is a set of the following options:

sfoImplicitCurrentDir
Always search the current directory first, even if it is not specified.
sfoStripQuotes
Strip quotes from the components in the search path.

A deprecated form of the function allowed to specify using the boolean ImplicitCurrentDir parameter whether the current directory was searched implicitly or not. By default, the current directory is searched.

Errors

On error, an empty string is returned.

See also

ExpandFileName | Expand a relative filename to an absolute filename.
FindFirst | Start a file search and return a findhandle

Example

Program Example41;

{ Program to demonstrate the FileSearch function. }

Uses Sysutils;

Const
{$ifdef unix}
  FN = 'find';
  P = '.:/bin:/usr/bin';
{$else}
  FN = 'find.exe';
  P = 'c:\dos;c:\windows;c:\windows\system;c:\windows\system32';
{$endif}

begin
  Writeln ('find is in : ',FileSearch (FN,P));
end.


FileSeek

Set the current file position on a file handle.

Declaration

Source position: filutilh.inc line 169

function FileSeek(

  Handle: THandle;

  FOffset: LongInt;

  Origin: LongInt

):LongInt;

function FileSeek(

  Handle: THandle;

  FOffset: Int64;

  Origin: LongInt

):Int64;

Description

FileSeek sets the file pointer on position Offset, starting from Origin. Origin can be one of the following values:

fsFromBeginning
Offset is relative to the first byte of the file. This position is zero-based. i.e. the first byte is at offset 0.
fsFromCurrent
Offset is relative to the current position.
fsFromEnd
Offset is relative to the end of the file. This means that Offset can only be zero or negative in this case.

If successfull, the function returns the new file position, relative to the beginning of the file.

Remark: The abovementioned constants do not exist in Delphi.

Errors

On error, -1 is returned.

See also

FileClose | Close a file handle.
FileWrite | Write data from a buffer to a given filehandle.
FileCreate | Create a new file and return a handle to it.
FileOpen | Open an existing file and return a filehandle
FileRead | Read data from a filehandle in a buffer.
FileTruncate | Truncate an open file to a given size.

Example

Program Example37;

{ This program demonstrates the FileCreate/FileSeek/FileReed/FileTruncate functions }

Uses sysutils;

Var I,J,F : Longint;

Begin
  F:=FileCreate ('test.dat');
  If F=-1 then
    Halt(1);
  For I:=0 to 100 do
    FileWrite(F,I,SizeOf(i));
  FileClose(f);
  F:=FileOpen ('test.dat',fmOpenRead);
  For I:=0 to 100 do
    begin
    FileRead (F,J,SizeOF(J));
    If J<>I then
      Writeln ('Mismatch at file position ',I)
    end;
  FileSeek(F,0,fsFromBeginning);
  Randomize;
  Repeat
    FileSeek(F,Random(100)*4,fsFromBeginning);
    FileRead (F,J,SizeOf(J));
    Writeln ('Random read : ',j);
  Until J>80;
  FileClose(F);
  F:=FileOpen('test.dat',fmOpenWrite);
  I:=50*SizeOf(Longint);
  If FileTruncate(F,I) then
    Writeln('SuccessFully truncated file to ',I,' bytes.');
  FileClose(F);
End.


FileSetAttr

Set the attributes of a file.

Declaration

Source position: filutilh.inc line 134

function FileSetAttr(

  const Filename: UnicodeString;

  Attr: LongInt

):LongInt;

function FileSetAttr(

  const Filename: RawByteString;

  Attr: LongInt

):LongInt;

Description

FileSetAttr sets the attributes of FileName to Attr. If the function was successful, 0 is returned, -1 otherwise. Attr can be set to an OR-ed combination of the pre-defined faXXX constants.

This function is not implemented on Unixes.

Errors

On error, -1 is returned (always on Unixes).

See also

FileGetAttr | Return attributes of a file.
FileGetDate | Return the file time of an opened file.
FileSetDate | Set the date of a file.


FileSetDate

Set the date of a file.

Declaration

Source position: filutilh.inc line 132

function FileSetDate(

  const FileName: UnicodeString;

  Age: LongInt

):LongInt;

function FileSetDate(

  const FileName: RawByteString;

  Age: LongInt

):LongInt;

function FileSetDate(

  Handle: THandle;

  Age: LongInt

):LongInt;

Description

FileSetDate sets the file date of the open file with handle Handle or to Age, where Age is a DOS date-and-time stamp value.

Alternatively, the filename may be specified with the FileName argument. This variant of the call is mandatory on unices, since there is no OS support for setting a file timestamp based on a handle. (the handle may not be a real file at all).

The function returns zero if successfull.

Errors

On Unix, the handle variant always returns -1, since this is impossible to implement. On Windows and DOS, a negative error code is returned.


FileTruncate

Truncate an open file to a given size.

Declaration

Source position: filutilh.inc line 173

function FileTruncate(

  Handle: THandle;

  Size: Int64

):Boolean;

Description

FileTruncate truncates the file with handle Handle to Size bytes. The file must have been opened for writing prior to this call. The function returns True is successful, False otherwise.

For an example, see FileCreate.

Errors

On error, the function returns False.

See also

FileClose | Close a file handle.
FileWrite | Write data from a buffer to a given filehandle.
FileCreate | Create a new file and return a handle to it.
FileOpen | Open an existing file and return a filehandle
FileRead | Read data from a filehandle in a buffer.
FileSeek | Set the current file position on a file handle.


FileWrite

Write data from a buffer to a given filehandle.

Declaration

Source position: filutilh.inc line 168

function FileWrite(

  Handle: THandle;

  const Buffer;

  Count: LongInt

):LongInt;

Description

FileWrite writes Count bytes from Buffer to the file with handle Handle. Prior to this call, the file must have been opened for writing. Buffer must be at least Count bytes large, or a memory access error may occur.

The function returns the number of bytes written, or -1 in case of an error.

For an example, see FileCreate.

Errors

In case of error, -1 is returned.

See also

FileClose | Close a file handle.
FileCreate | Create a new file and return a handle to it.
FileOpen | Open an existing file and return a filehandle
FileRead | Read data from a filehandle in a buffer.
FileTruncate | Truncate an open file to a given size.
FileSeek | Set the current file position on a file handle.


FindClose

Close a find handle

Declaration

Source position: filutilh.inc line 139

procedure FindClose(

  var F: TUnicodeSearchRec

);

procedure FindClose(

  var F: TRawbyteSearchRec

);

Description

FindClose ends a series of FindFirst/FindNext calls, and frees any memory used by these calls. It is absolutely necessary to do this call, or huge memory losses may occur.

For an example, see FindFirst.

Errors

None.

See also

FindFirst | Start a file search and return a findhandle
FindNext | Find the next entry in a findhandle.


FindCmdLineSwitch

Check whether a certain switch is present on the command-line.

Declaration

Source position: sysstrh.inc line 251

function FindCmdLineSwitch(

  const Switch: string;

  const Chars: TSysCharSet;

  IgnoreCase: Boolean

):Boolean;

function FindCmdLineSwitch(

  const Switch: string;

  IgnoreCase: Boolean

):Boolean;

function FindCmdLineSwitch(

  const Switch: string

):Boolean;

Description

FindCmdLineSwitch will check all command-line arguments for the presence of the option Switch. It will return True if it was found, False otherwise. Characters that appear in Chars (default is SwitchChars) are assumed to indicate an option (switch). If the parameter IgnoreCase is True, case will be ignored when looking for the switch. Default is to search case sensitive.

Errors

None.

See also

SwitchChars

Characters which start a command-line switch


FindFirst

Start a file search and return a findhandle

Declaration

Source position: filutilh.inc line 137

function FindFirst(

  const Path: UnicodeString;

  Attr: LongInt;

  out Rslt: TUnicodeSearchRec

):LongInt;

function FindFirst(

  const Path: RawByteString;

  Attr: LongInt;

  out Rslt: TRawbyteSearchRec

):LongInt;

Description

FindFirst looks for files that match the name (possibly with wildcards) in Path and extra attributes Attr. It then fills up the Rslt record with data gathered about the file. It returns 0 if a file matching the specified criteria is found, a nonzero value (-1 on Unix-like platforms) otherwise.

Attr is an or-ed combination of the following constants:

faReadOnly
The file is read-only.
faHidden
The file is hidden. (On unix, this means that the filename starts with a dot)
faSysFile
The file is a system file (On unix, this means that the file is a character, block or FIFO file).
faVolumeId
Drive volume Label. Not possible under unix, and on Windows-like systems, this works only for plan FAT (not Fat32 of VFAT) filesystems.
faDirectory
File is a directory.
faArchive
file needs to be archived. Not possible on Unix

It is a common misconception that Attr specifies a set of attributes which must be matched in order for a file to be included in the list. This is not so: The value of Attr specifies additional attributes, this means that the returned files are either normal files or have an attribute which is present in Attr.

Specifically: specifying faDirectory as a value for Attr does not mean that only directories will be returned. Normal files and directories will be returned.

The Rslt record can be fed to subsequent calls to FindNext, in order to find other files matching the specifications.

Remark: A successful FindFirst call must always be followed by a FindClose call with the same Rslt record. Failure to do so will result in memory leaks. If the findfirst call failed (i.e. returned a nonzero handle) there is no need to call FindClose.

Errors

On error the function returns -1 on Unix-like platforms, a nonzero error code on Windows.

See also

FindClose | Close a find handle
FindNext | Find the next entry in a findhandle.

Example

Program Example43;

{ This program demonstrates the FindFirst function }

Uses SysUtils;

Var Info : TSearchRec;
    Count : Longint;

Begin
  Count:=0;
  If FindFirst ('*',faAnyFile,Info)=0 then
    begin
    Repeat
      Inc(Count);
      With Info do
        begin
        If (Attr and faDirectory) = faDirectory then
          Write('Dir : ');
        Writeln (Name:40,Size:15);
        end;
    Until FindNext(info)<>0;
    end;
  FindClose(Info);
  Writeln ('Finished search. Found ',Count,' matches');

End.


FindNext

Find the next entry in a findhandle.

Declaration

Source position: filutilh.inc line 138

function FindNext(

  var Rslt: TUnicodeSearchRec

):LongInt;

function FindNext(

  var Rslt: TRawbyteSearchRec

):LongInt;

Description

FindNext finds a next occurrence of a search sequence initiated by FindFirst. If another record matching the criteria in Rslt is found, 0 is returned, a nonzero constant is returned otherwise.

Remark: The last FindNext call must always be followed by a FindClose call with the same Rslt record. Failure to do so will result in memory loss.

For an example, see FindFirst

Errors

On error (no more file is found), a nonzero constant is returned.

See also

FindFirst | Start a file search and return a findhandle
FindClose | Close a find handle


FloattoCurr

Convert a float to a Currency value.

Declaration

Source position: sysstrh.inc line 192

function FloattoCurr(

  const Value: Extended

):Currency;

Description

FloatToCurr converts the Value floating point value to a Currency value. It checks whether Value is in the valid range of currencies (determined by MinCurrency and MaxCurrency). If not, an EConvertError exception is raised.

Errors

If Value is out of range, an EConvertError exception is raised.

See also

EConvertError | Conversion error.
TryFloatToCurr | Try to convert a float value to a currency value and report on success.
MinCurrency | Minimum Currency value
MaxCurrency | Maximum currency value


FloatToDateTime

Convert a float to a TDateTime value.

Declaration

Source position: sysstrh.inc line 191

function FloatToDateTime(

  const Value: Extended

):TDateTime;

Description

FloatToDateTime converts the Value floating point value to a TDateTime value. It checks whether Value is in the valid range of dates (determined by MinDateTime and MaxDateTime). If not, an EConvertError exception is raised.

Errors

If Value is out of range, an EConvertError exception is raised.

See also

EConvertError | Conversion error.
MinDateTime | Minimum TDateTime value.
MaxDateTime | Maximum TDateTime value.


FloatToDecimal

Convert a float value to a TFloatRec value.

Declaration

Source position: sysstrh.inc line 206

procedure FloatToDecimal(

  out Result: TFloatRec;

  const Value;

  ValueType: TFloatValue;

  Precision: Integer;

  Decimals: Integer

);

procedure FloatToDecimal(

  out Result: TFloatRec;

  Value: Extended;

  Precision: Integer;

  Decimals: Integer

);

Description

FloatToDecimal converts the float Value to a float description in the Result TFloatRec format. It will store Precision digits in the Digits field, of which at most Decimal decimals.

Errors

None.

See also

TFloatRec

Record descriing a float value


FloatToStr

Convert a float value to a string using a fixed format.

Declaration

Source position: sysstrh.inc line 158

function FloatToStr(

  Value: Extended

):string;

function FloatToStr(

  Value: Extended;

  const FormatSettings: TFormatSettings

):string;

function FloatToStr(

  Value: Double

):string;

function FloatToStr(

  Value: Double;

  const FormatSettings: TFormatSettings

):string;

function FloatToStr(

  Value: Single

):string;

function FloatToStr(

  Value: Single;

  const FormatSettings: TFormatSettings

):string;

function FloatToStr(

  Value: Currency

):string;

function FloatToStr(

  Value: Currency;

  const FormatSettings: TFormatSettings

):string;

function FloatToStr(

  Value: Comp

):string;

function FloatToStr(

  Value: Comp;

  const FormatSettings: TFormatSettings

):string;

function FloatToStr(

  Value: Int64

):string;

function FloatToStr(

  Value: Int64;

  const FormatSettings: TFormatSettings

):string;

Description

FloatToStr converts the floating point variable Value to a string representation. It will choose the shortest possible notation of the two following formats:

Fixed format
will represent the string in fixed notation,
Decimal format
will represent the string in scientific notation.

More information on these formats can be found in FloatToStrF. FloatToStr is completely equivalent to the following call:

FloatToStrF(Value, ffGeneral,15, 0);

Errors

None.

See also

FloatToStrF | Convert a float value to a string using a given format.
FormatFloat | Format a float according to a certain mask.
StrToFloat | Convert a string to a floating-point value.

Example

Program Example67;

{ This program demonstrates the FloatToStr function }

Uses sysutils;

Procedure Testit (Value : Extended);

begin
  Writeln (Value,' -> ',FloatToStr(Value));
  Writeln (-Value,' -> ',FloatToStr(-Value));
end;

Begin
  Testit (0.0);
  Testit (1.1);
  Testit (1.1e-3);
  Testit (1.1e-20);
  Testit (1.1e-200);
  Testit (1.1e+3);
  Testit (1.1e+20);
  Testit (1.1e+200);
End.


FloatToStrF

Convert a float value to a string using a given format.

Declaration

Source position: sysstrh.inc line 140

function FloatToStrF(

  Value: Extended;

  format: TFloatFormat;

  Precision: Integer;

  Digits: Integer

):string;

function FloatToStrF(

  Value: Extended;

  format: TFloatFormat;

  Precision: Integer;

  Digits: Integer;

  const FormatSettings: TFormatSettings

):string;

function FloatToStrF(

  Value: Double;

  format: TFloatFormat;

  Precision: Integer;

  Digits: Integer

):string;

function FloatToStrF(

  Value: Double;

  format: TFloatFormat;

  Precision: Integer;

  Digits: Integer;

  const FormatSettings: TFormatSettings

):string;

function FloatToStrF(

  Value: Single;

  format: TFloatFormat;

  Precision: Integer;

  Digits: Integer

):string;

function FloatToStrF(

  Value: Single;

  format: TFloatFormat;

  Precision: Integer;

  Digits: Integer;

  const FormatSettings: TFormatSettings

):string;

function FloatToStrF(

  Value: Comp;

  format: TFloatFormat;

  Precision: Integer;

  Digits: Integer

):string;

function FloatToStrF(

  Value: Comp;

  format: TFloatFormat;

  Precision: Integer;

  Digits: Integer;

  const FormatSettings: TFormatSettings

):string;

function FloatToStrF(

  Value: Currency;

  format: TFloatFormat;

  Precision: Integer;

  Digits: Integer

):string;

function FloatToStrF(

  Value: Currency;

  format: TFloatFormat;

  Precision: Integer;

  Digits: Integer;

  const FormatSettings: TFormatSettings

):string;

function FloatToStrF(

  Value: Int64;

  format: TFloatFormat;

  Precision: Integer;

  Digits: Integer

):string;

function FloatToStrF(

  Value: Int64;

  format: TFloatFormat;

  Precision: Integer;

  Digits: Integer;

  const FormatSettings: TFormatSettings

):string;

Description

FloatToStrF converts the floating point number value to a string representation, according to the settings of the parameters Format, Precision and Digits.

The meaning of the Precision and Digits parameter depends on the Format parameter. The format is controlled mainly by the Format parameter. It can have one of the following values:

ffcurrency
Money format. Value is converted to a string using the global variables CurrencyString, CurrencyFormat and NegCurrFormat. The Digits paramater specifies the number of digits following the decimal point and should be in the range -1 to 18. If Digits equals -1, CurrencyDecimals is assumed. The Precision parameter is ignored.
ffExponent
Scientific format. Value is converted to a string using scientific notation: 1 digit before the decimal point, possibly preceded by a minus sign if Value is negative. The number of digits after the decimal point is controlled by Precision and must lie in the range 0 to 15.
ffFixed
Fixed point format. Value is converted to a string using fixed point notation. The result is composed of all digits of the integer part of Value, preceded by a minus sign if Value is negative. Following the integer part is DecimalSeparator and then the fractional part of Value, rounded off to Digits numbers. If the number is too large then the result will be in scientific notation.
ffGeneral
General number format. The argument is converted to a string using ffExponent or ffFixed format, depending on wich one gives the shortest string. There will be no trailing zeroes. If Value is less than 0.00001 or if the number of decimals left of the decimal point is larger than Precision then scientific notation is used, and Digits is the minimum number of digits in the exponent. Otherwise Digits is ignored.
ffnumber
Is the same as ffFixed, except that thousand separators are inserted in the resulting string.

Errors

None.

See also

FloatToStr | Convert a float value to a string using a fixed format.
FloatToText | Return a string representation of a float, with a given format.

Example

Program Example68;

{ This program demonstrates the FloatToStrF function }

Uses sysutils;

Const Fmt : Array [TFloatFormat] of string[10] =
         ('general','exponent','fixed','number','Currency');

Procedure Testit (Value :  Extended);

Var I,J : longint;
    FF : TFloatFormat;

begin
  For I:=5 to 15 do
    For J:=1 to 4 do
      For FF:=ffgeneral to ffcurrency do
        begin
        Write (Value,'(Prec: ',I:2,', Dig: ',J,', fmt : ',Fmt[ff],') : ');
        Writeln (FloatToStrf(Value,FF,I,J));
        Write (-Value,'(Prec: ',I:2,', Dig: ',J,', fmt : ',Fmt[ff],') : ');
        Writeln (FloatToStrf(-Value,FF,I,J));
        end;
end;

Begin
  Testit (1.1);
  Testit (1.1E1);
  Testit (1.1E-1);
  Testit (1.1E5);
  Testit (1.1E-5);
  Testit (1.1E10);
  Testit (1.1E-10);
  Testit (1.1E15);
  Testit (1.1E-15);
  Testit (1.1E100);
  Testit (1.1E-100);
End.


FloatToText

Return a string representation of a float, with a given format.

Declaration

Source position: sysstrh.inc line 189

function FloatToText(

  Buffer: PChar;

  Value: Extended;

  format: TFloatFormat;

  Precision: Integer;

  Digits: Integer

):LongInt;

function FloatToText(

  Buffer: PChar;

  Value: Extended;

  format: TFloatFormat;

  Precision: Integer;

  Digits: Integer;

  const FormatSettings: TFormatSettings

):LongInt;

Description

FloatToText converts the floating point variable Value to a string representation and stores it in Buffer. The conversion is governed by format, Precisison and Digits. more information on these parameters can be found in FloatToStrF. Buffer should point to enough space to hold the result. No checking on this is performed.

The result is the number of characters that was copied in Buffer.

Errors

None.

See also

FloatToStr | Convert a float value to a string using a fixed format.
FloatToStrF | Convert a float value to a string using a given format.

Example

Program Example68;

{ This program demonstrates the FloatToStrF function }

Uses sysutils;

Const Fmt : Array [TFloatFormat] of string[10] =
         ('general','exponent','fixed','number','Currency');

Procedure Testit (Value :  Extended);

Var I,J : longint;
    FF : TFloatFormat;
    S : ShortString;

begin
  For I:=5 to 15 do
    For J:=1 to 4 do
      For FF:=ffgeneral to ffcurrency do
        begin
        Write (Value,'(Prec: ',I:2,', Dig: ',J,', fmt : ',Fmt[ff],') : ');
        SetLength(S,FloatToText (@S[1],Value,FF,I,J));
        Writeln (S);
        Write (-Value,'(Prec: ',I:2,', Dig: ',J,', fmt : ',Fmt[ff],') : ');
        SetLength(S,FloatToText (@S[1],-Value,FF,I,J));
        Writeln (S);
        end;
end;

Begin
  Testit (1.1);
  Testit (1.1E1);
  Testit (1.1E-1);
  Testit (1.1E5);
  Testit (1.1E-5);
  Testit (1.1E10);
  Testit (1.1E-10);
  Testit (1.1E15);
  Testit (1.1E-15);
  Testit (1.1E100);
  Testit (1.1E-100);
End.


FloatToTextFmt

Convert a float value to a string using a given mask.

Declaration

Source position: sysstrh.inc line 204

function FloatToTextFmt(

  Buffer: PChar;

  Value: Extended;

  format: PChar;

  FormatSettings: TFormatSettings

):Integer;

function FloatToTextFmt(

  Buffer: PChar;

  Value: Extended;

  format: PChar

):Integer;

Description

FloatToTextFmt returns a textual representation of Value in the memory location pointed to by Buffer. it uses the formatting specification in Format to do this. The return value is the number of characters that were written in the buffer.

For a list of valid formatting characters, see FormatFloat

Errors

No length checking is performed on the buffer. The buffer should point to enough memory to hold the complete string. If this is not the case, an access violation may occur.

See also

FormatFloat

Format a float according to a certain mask.


FmtStr

Format a string with given arguments.

Declaration

Source position: sysstrh.inc line 136

procedure FmtStr(

  var Res: string;

  const Fmt: string;

  const args: array of Const

);

procedure FmtStr(

  var Res: string;

  const Fmt: string;

  const args: array of Const;

  const FormatSettings: TFormatSettings

);

Description

FmtStr calls Format with Fmt and Args as arguments, and stores the result in Res. For more information on how the resulting string is composed, see Format.

Errors

In case of error, a EConvertError exception is raised.

See also

Format | Format a string with given arguments.
FormatBuf | Format a string with given arguments and store the result in a buffer.
EConvertError | Conversion error.

Example

Program Example70;

{ This program demonstrates the FmtStr function }

Uses sysutils;

Var S : AnsiString;

Begin
  S:='';
  FmtStr (S,'For some nice examples of fomatting see %s.',['Format']);
  Writeln (S);
End.


ForceDirectories

Create a chain of directories

Declaration

Source position: diskh.inc line 23

function ForceDirectories(

  const Dir: RawByteString

):Boolean;

function ForceDirectories(

  const Dir: UnicodeString

):Boolean;

Description

ForceDirectories tries to create any missing directories in Dir till the whole path in Dir exists. It returns True if Dir already existed or was created succesfully. If it failed to create any of the parts, False is returned.


Format

Format a string with given arguments.

Declaration

Source position: sysstrh.inc line 128

function Format(

  const Fmt: string;

  const Args: array of Const

):string;

function Format(

  const Fmt: string;

  const Args: array of Const;

  const FormatSettings: TFormatSettings

):string;

Description

Format replaces all placeholders inFmt with the arguments passed in Args and returns the resulting string. A placeholder looks as follows:

'%' [[Index]':'] ['-'] [Width] ['.' Precision] ArgType

elements between single quotes must be typed as shown without the quotes, and elements between square brackets [ ] are optional. The meaning of the different elements are shown below:

'%'
starts the placeholder. If you want to insert a literal % character, then you must insert two of them : %%.
Index ':'
takes the Index-th element in the argument array as the element to insert. If index is omitted, then the zeroth argument is taken.
'-'
tells Format to left-align the inserted text. The default behaviour is to right-align inserted text. This can only take effect if the Width element is also specified.
Width
the inserted string must have at least Width characters. If not, the inserted string will be padded with spaces. By default, the string is left-padded, resulting in a right-aligned string. This behaviour can be changed by the usage of the '-' character.
'.' Precision
Indicates the precision to be used when converting the argument. The exact meaning of this parameter depends on ArgType.

The Index, Width and Precision parameters can be replaced by *, in which case their value will be read from the next element in the Args array. This value must be an integer, or an EConvertError exception will be raised.

The argument type is determined from ArgType. It can have one of the following values (case insensitive):

D
Decimal format. The next argument in the Args array should be an integer. The argument is converted to a decimal string. If precision is specified, then the string will have at least Precision digits in it. If needed, the string is (left) padded with zeroes.
E

Scientific format. The next argument in the Args array should be a Floating point value. The argument is converted to a decimal string using scientific notation, using FloatToStrF, where the optional precision is used to specify the total number of decimals. (defalt a valueof 15 is used). The exponent is formatted using maximally 3 digits.

In short, the E specifier formats it's argument as follows:

FloatToStrF(Argument,ffexponent,Precision,3)
F

Fixed point format. The next argument in the Args array should be a floating point value. The argument is converted to a decimal string, using fixed notation (see FloatToStrF). Precision indicates the number of digits following the decimal point.

In short, the F specifier formats it's argument as follows:

FloatToStrF(Argument,ffFixed,ffixed,9999,Precision)
G

General number format. The next argument in the Args array should be a floating point value. The argument is converted to a decimal string using fixed point notation or scientific notation, depending on which gives the shortest result. Precision is used to determine the number of digits after the decimal point.

In short, the G specifier formats it's argument as follows:

FloatToStrF(Argument,ffGeneral,Precision,3)
M

Currency format. the next argument in the Args array must be a floating point value. The argument is converted to a decimal string using currency notation. This means that fixed-point notation is used, but that the currency symbol is appended. If precision is specified, then then it overrides the CurrencyDecimals global variable used in the FloatToStrF

In short, the M specifier formats it's argument as follows:

FloatToStrF(Argument,ffCurrency,9999,Precision)
N
Number format. This is the same as fixed point format, except that thousand separators are inserted in the resulting string.
P
Pointer format. The next argument in the Args array must be a pointer (typed or untyped). The pointer value is converted to a string of length 8, representing the hexadecimal value of the pointer.
S
String format. The next argument in the Args array must be a string. The argument is simply copied to the result string. If Precision is specified, then only Precision characters are copied to the result string.
U
Unsigned decimal format. The next argument in the Args array should be an unsigned integer. The argument is converted to a decimal string. If precision is specified, then the string will have at least Precision digits in it. If needed, the string is (left) padded with zeroes.
X
hexadecimal format. The next argument in the Args array must be an integer. The argument is converted to a hexadecimal string with just enough characters to contain the value of the integer. If Precision is specified then the resulting hexadecimal representation will have at least Precision characters in it (with a maximum value of 32).

Errors

In case of error, an EConvertError exception is raised. Possible errors are:

  1. Errors in the format specifiers.
  2. The next argument is not of the type needed by a specifier.
  3. The number of arguments is not sufficient for all format specifiers.

See also

FormatBuf | Format a string with given arguments and store the result in a buffer.
EConvertError | Conversion error.

Example

Program example71;

{$mode objfpc}

{ This program demonstrates the Format function }

Uses sysutils;

Var P : Pointer;
    fmt,S : string;

{ Expected output:
        [%d] => [10]
        [%%] => [%]
      [%10d] => [        10]
      [%.4d] => [0010]
    [%10.4d] => [      0010]
      [%0:d] => [10]
    [%0:10d] => [        10]
  [%0:10.4d] => [      0010]
   [%0:-10d] => [10        ]
 [%0:-10.4d] => [0010      ]
    [%-*.*d] => [00010]
}
Procedure TestInteger;
begin
  Try
    Fmt:='[%d]';S:=Format (Fmt,[10]);writeln(Fmt:12,' => ',s);
    Fmt:='[%%]';S:=Format (Fmt,[10]);writeln(Fmt:12,' => ',s);
    Fmt:='[%10d]';S:=Format (Fmt,[10]);writeln(Fmt:12,' => ',s);
    fmt:='[%.4d]';S:=Format (fmt,[10]);writeln(Fmt:12,' => ',s);
    Fmt:='[%10.4d]';S:=Format (Fmt,[10]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:d]';S:=Format (Fmt,[10]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:10d]';S:=Format (Fmt,[10]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:10.4d]';S:=Format (Fmt,[10]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:-10d]';S:=Format (Fmt,[10]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:-10.4d]';S:=Format (fmt,[10]);writeln(Fmt:12,' => ',s);
    Fmt:='[%-*.*d]';S:=Format (fmt,[4,5,10]);writeln(Fmt:12,' => ',s);
  except
    On E : Exception do
      begin
      Writeln ('Exception caught : ',E.Message);
      end;
  end;
  writeln ('Press enter');
  readln;
end;

{ Expected output:
        [%x] => [A]
      [%10x] => [         A]
    [%10.4x] => [      000A]
      [%0:x] => [A]
    [%0:10x] => [         A]
  [%0:10.4x] => [      000A]
   [%0:-10x] => [A         ]
 [%0:-10.4x] => [000A      ]
    [%-*.*x] => [0000A]
}
Procedure TestHexaDecimal;
begin
  try
    Fmt:='[%x]';S:=Format (Fmt,[10]);writeln(Fmt:12,' => ',s);
    Fmt:='[%10x]';S:=Format (Fmt,[10]);writeln(Fmt:12,' => ',s);
    Fmt:='[%10.4x]';S:=Format (Fmt,[10]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:x]';S:=Format (Fmt,[10]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:10x]';S:=Format (Fmt,[10]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:10.4x]';S:=Format (Fmt,[10]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:-10x]';S:=Format (Fmt,[10]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:-10.4x]';S:=Format (fmt,[10]);writeln(Fmt:12,' => ',s);
    Fmt:='[%-*.*x]';S:=Format (fmt,[4,5,10]);writeln(Fmt:12,' => ',s);
  except
    On E : Exception do
      begin
      Writeln ('Exception caught : ',E.Message);
      end;
  end;
  writeln ('Press enter');
  readln;
end;

{ Expected output:
      [0x%p] => [0x0012D687]
    [0x%10p] => [0x  0012D687]
  [0x%10.4p] => [0x  0012D687]
    [0x%0:p] => [0x0012D687]
  [0x%0:10p] => [0x  0012D687]
[0x%0:10.4p] => [0x  0012D687]
 [0x%0:-10p] => [0x0012D687  ]
[0x%0:-10.4p] => [0x0012D687  ]
    [%-*.*p] => [0012D687]
}
Procedure TestPointer;
begin
  P:=Pointer(1234567);
  try
    Fmt:='[0x%p]';S:=Format (Fmt,[P]);writeln(Fmt:12,' => ',s);
    Fmt:='[0x%10p]';S:=Format (Fmt,[P]);writeln(Fmt:12,' => ',s);
    Fmt:='[0x%10.4p]';S:=Format (Fmt,[P]);writeln(Fmt:12,' => ',s);
    Fmt:='[0x%0:p]';S:=Format (Fmt,[P]);writeln(Fmt:12,' => ',s);
    Fmt:='[0x%0:10p]';S:=Format (Fmt,[P]);writeln(Fmt:12,' => ',s);
    Fmt:='[0x%0:10.4p]';S:=Format (Fmt,[P]);writeln(Fmt:12,' => ',s);
    Fmt:='[0x%0:-10p]';S:=Format (Fmt,[P]);writeln(Fmt:12,' => ',s);
    Fmt:='[0x%0:-10.4p]';S:=Format (fmt,[P]);writeln(Fmt:12,' => ',s);
    Fmt:='[%-*.*p]';S:=Format (fmt,[4,5,P]);writeln(Fmt:12,' => ',s);
  except
    On E : Exception do
      begin
      Writeln ('Exception caught : ',E.Message);
      end;
  end;
  writeln ('Press enter');
  readln;
end;

{ Expected output:
        [%s]=> [This is a string]
      [%0:s]=> [This is a string]
    [%0:18s]=> [  This is a string]
   [%0:-18s]=> [This is a string  ]
 [%0:18.12s]=> [      This is a st]
    [%-*.*s]=> [This is a st      ]
}
Procedure TestString;
begin
  try
    Fmt:='[%s]';S:=Format(fmt,['This is a string']);Writeln(fmt:12,'=> ',s);
    fmt:='[%0:s]';s:=Format(fmt,['This is a string']);Writeln(fmt:12,'=> ',s);
    fmt:='[%0:18s]';s:=Format(fmt,['This is a string']);Writeln(fmt:12,'=> ',s);
    fmt:='[%0:-18s]';s:=Format(fmt,['This is a string']);Writeln(fmt:12,'=> ',s);
    fmt:='[%0:18.12s]';s:=Format(fmt,['This is a string']);Writeln(fmt:12,'=> ',s);
    fmt:='[%-*.*s]';s:=Format(fmt,[18,12,'This is a string']);Writeln(fmt:12,'=> ',s);
  except
    On E : Exception do
      begin
      Writeln ('Exception caught : ',E.Message);
      end;
  end;
  writeln ('Press enter');
  readln;
end;

{ Expected output:
        [%e] => [1.2340000000000000E+000]
      [%10e] => [1.2340000000000000E+000]
    [%10.4e] => [1.234E+000]
      [%0:e] => [1.2340000000000000E+000]
    [%0:10e] => [1.2340000000000000E+000]
  [%0:10.4e] => [1.234E+000]
   [%0:-10e] => [1.2340000000000000E+000]
 [%0:-10.4e] => [1.234E+000]
    [%-*.*e] => [1.2340E+000]
}
Procedure TestExponential;
begin
  Try
    Fmt:='[%e]';S:=Format (Fmt,[1.234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%10e]';S:=Format (Fmt,[1.234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%10.4e]';S:=Format (Fmt,[1.234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:e]';S:=Format (Fmt,[1.234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:10e]';S:=Format (Fmt,[1.234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:10.4e]';S:=Format (Fmt,[1.234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:-10e]';S:=Format (Fmt,[1.234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:-10.4e]';S:=Format (fmt,[1.234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%-*.*e]';S:=Format (fmt,[4,5,1.234]);writeln(Fmt:12,' => ',s);
  except
    On E : Exception do
      begin
      Writeln ('Exception caught : ',E.Message);
      end;
  end;
  writeln ('Press enter');
  readln;
end;

{ Expected output:
        [%e] => [-1.2340000000000000E+000]
      [%10e] => [-1.2340000000000000E+000]
    [%10.4e] => [-1.234E+000]
      [%0:e] => [-1.2340000000000000E+000]
    [%0:10e] => [-1.2340000000000000E+000]
  [%0:10.4e] => [-1.234E+000]
   [%0:-10e] => [-1.2340000000000000E+000]
 [%0:-10.4e] => [-1.234E+000]
    [%-*.*e] => [-1.2340E+000]
}
Procedure TestNegativeExponential;
begin
  Try
    Fmt:='[%e]';S:=Format (Fmt,[-1.234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%10e]';S:=Format (Fmt,[-1.234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%10.4e]';S:=Format (Fmt,[-1.234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:e]';S:=Format (Fmt,[-1.234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:10e]';S:=Format (Fmt,[-1.234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:10.4e]';S:=Format (Fmt,[-1.234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:-10e]';S:=Format (Fmt,[-1.234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:-10.4e]';S:=Format (fmt,[-1.234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%-*.*e]';S:=Format (fmt,[4,5,-1.234]);writeln(Fmt:12,' => ',s);
  except
    On E : Exception do
      begin
      Writeln ('Exception caught : ',E.Message);
      end;
  end;
  writeln ('Press enter');
  readln;
end;

{ Expected output:
        [%e] => [1.2340000000000000E-002]
      [%10e] => [1.2340000000000000E-002]
    [%10.4e] => [1.234E-002]
      [%0:e] => [1.2340000000000000E-002]
    [%0:10e] => [1.2340000000000000E-002]
  [%0:10.4e] => [1.234E-002]
   [%0:-10e] => [1.2300000000000000E-002]
 [%0:-10.4e] => [1.234E-002]
    [%-*.*e] => [1.2340E-002]
}
Procedure TestSmallExponential;
begin
  Try
    Fmt:='[%e]';S:=Format (Fmt,[0.01234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%10e]';S:=Format (Fmt,[0.01234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%10.4e]';S:=Format (Fmt,[0.01234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:e]';S:=Format (Fmt,[0.01234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:10e]';S:=Format (Fmt,[0.01234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:10.4e]';S:=Format (Fmt,[0.01234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:-10e]';S:=Format (Fmt,[0.0123]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:-10.4e]';S:=Format (fmt,[0.01234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%-*.*e]';S:=Format (fmt,[4,5,0.01234]);writeln(Fmt:12,' => ',s);
  except
    On E : Exception do
      begin
      Writeln ('Exception caught : ',E.Message);
      end;
  end;
  writeln ('Press enter');
  readln;
end;

{ Expected output:
        [%e] => [-1.2340000000000000E-002]
      [%10e] => [-1.2340000000000000E-002]
    [%10.4e] => [-1.234E-002]
      [%0:e] => [-1.2340000000000000E-002]
    [%0:10e] => [-1.2340000000000000E-002]
  [%0:10.4e] => [-1.234E-002]
   [%0:-10e] => [-1.2340000000000000E-002]
 [%0:-10.4e] => [-1.234E-002]
    [%-*.*e] => [-1.2340E-002]
}
Procedure TestSmallNegExponential;
begin
  Try
    Fmt:='[%e]';S:=Format (Fmt,[-0.01234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%10e]';S:=Format (Fmt,[-0.01234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%10.4e]';S:=Format (Fmt,[-0.01234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:e]';S:=Format (Fmt,[-0.01234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:10e]';S:=Format (Fmt,[-0.01234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:10.4e]';S:=Format (Fmt,[-0.01234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:-10e]';S:=Format (Fmt,[-0.01234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%0:-10.4e]';S:=Format (fmt,[-0.01234]);writeln(Fmt:12,' => ',s);
    Fmt:='[%-*.*e]';S:=Format (fmt,[4,5,-0.01234]);writeln(Fmt:12,' => ',s);
  except
    On E : Exception do
      begin
      Writeln ('Exception caught : ',E.Message);
      end;
  end;
  writeln ('Press enter');
  readln;
end;

begin
  TestInteger;
  TestHexadecimal;
  TestPointer;
  teststring;
  TestExponential;
  TestNegativeExponential;
  TestSmallExponential;
  TestSmallNegExponential;
end.


FormatBuf

Format a string with given arguments and store the result in a buffer.

Declaration

Source position: sysstrh.inc line 130

function FormatBuf(

  var Buffer;

  BufLen: Cardinal;

  const Fmt;

  fmtLen: Cardinal;

  const Args: array of Const

):Cardinal;

function FormatBuf(

  var Buffer;

  BufLen: Cardinal;

  const Fmt;

  fmtLen: Cardinal;

  const Args: array of Const;

  const FormatSettings: TFormatSettings

):Cardinal;

Description

FormatBuf calls Format and stores the result in Buf.

See also

Format

Format a string with given arguments.

Example

Program Example72;

{ This program demonstrates the FormatBuf function }

Uses sysutils;

Var
  S : ShortString;

Const
  Fmt : ShortString =  'For some nice examples of fomatting see %s.';

Begin
  S:='';
  SetLength(S,FormatBuf (S[1],255,Fmt[1],Length(Fmt),['Format']));
  Writeln (S);
End.


FormatCurr

Format a currency

Declaration

Source position: sysstrh.inc line 211

function FormatCurr(

  const Format: string;

  Value: Currency

):string;

function FormatCurr(

  const Format: string;

  Value: Currency;

  const FormatSettings: TFormatSettings

):string;

Description

FormatCurr formats the currency Value according to the formatting rule in the Format parameter, and returns the resulting string.

For an explanation of the formatting characters usable in the Format parameter, see FormatFloat.

See also

FormatFloat | Format a float according to a certain mask.
FloatToText | Return a string representation of a float, with a given format.


FormatDateTime

Return a string representation of a TDateTime value with a given format.

Declaration

Source position: datih.inc line 155

function FormatDateTime(

  const FormatStr: string;

  DateTime: TDateTime;

  Options: TFormatDateTimeOptions = []

):string;

function FormatDateTime(

  const FormatStr: string;

  DateTime: TDateTime;

  const FormatSettings: TFormatSettings;

  Options: TFormatDateTimeOptions = []

):string;

Description

FormatDateTime formats the date and time encoded in DateTime according to the formatting given in FormatStr. The complete list of formatting characters can be found in formatchars.

Errors

On error (such as an invalid character in the formatting string), and EConvertError exception is raised.

See also

DateTimeToStr | Converts a TDateTime value to a string using a predefined format.
DateToStr | Converts a TDateTime value to a date string with a predefined format.
TimeToStr | Convert a TDateTime time to a string using a predefined format.
StrToDateTime | Convert a date/time string to a TDateTime value.
EConvertError | Conversion error.

Example

Program Example14;

{ This program demonstrates the FormatDateTime function }

Uses sysutils;

Var ThisMoment : TDateTime;

Begin
  ThisMoment:=Now;
  Writeln ('Now : ',FormatDateTime('hh:nn',ThisMoment));
  Writeln ('Now : ',FormatDateTime('DD MM YYYY',ThisMoment));
  Writeln ('Now : ',FormatDateTime('c',ThisMoment));
End.


FormatFloat

Format a float according to a certain mask.

Declaration

Source position: sysstrh.inc line 208

function FormatFloat(

  const Format: string;

  Value: Extended

):string;

function FormatFloat(

  const Format: string;

  Value: Extended;

  const FormatSettings: TFormatSettings

):string;

Description

FormatFloat formats the floating-point value given by Value using the format specifications in Format. The format specifier can give format specifications for positive, negative or zero values (separated by a semicolon).

If the formatspecifier is empty or the value needs more than 18 digits to be correctly represented, the result is formatted with a call to FloatToStrF with the ffGeneral format option.

The following format specifiers are supported:

0
is a digit place holder. If there is a corresponding digit in the value being formatted, then it replaces the 0. If not, the 0 is left as-is.
#
is also a digit place holder. If there is a corresponding digit in the value being formatted, then it replaces the #. If not, it is removed. by a space.
.
determines the location of the decimal point. Only the first '.' character is taken into account. If the value contains digits after the decimal point, then it is replaced by the value of the DecimalSeparator character.
,
determines the use of the thousand separator character in the output string. If the format string contains one or more ',' charactes, then thousand separators will be used. The ThousandSeparator character is used.
E+
determines the use of scientific notation. If 'E+' or 'E-' (or their lowercase counterparts) are present then scientific notation is used. The number of digits in the output string is determined by the number of 0 characters after the 'E+'
;
This character separates sections for positive, negative, and zero numbers in the format string.

Errors

If an error occurs, an exception is raised.

See also

FloatToStr

Convert a float value to a string using a fixed format.

Example

Program Example89;

{ This program demonstrates the FormatFloat function }

Uses sysutils;

Const
  NrFormat=9;
  FormatStrings : Array[1..NrFormat] of string = (
        '',
        '0',
        '0.00',
        '#.##',
        '#,##0.00',
        '#,##0.00;(#,##0.00)',
        '#,##0.00;;Zero',
        '0.000E+00',
        '#.###E-0');
  NrValue = 5;
  FormatValues : Array[1..NrValue] of Double =
    (1234,-1234,0.5,0,-0.5);

  Width  = 12;
  FWidth = 20;

Var
  I,J : Integer;
  S : String;

begin
  Write('Format':FWidth);
  For I:=1 to NrValue do
    Write(FormatValues[i]:Width:2);
  Writeln;
  For I:=1 to NrFormat do
    begin
    Write(FormatStrings[i]:FWidth);
    For J:=1 to NrValue do
      begin
      S:=FormatFloat(FormatStrings[I],FormatValues[j]);
      Write(S:Width);
      end;
    Writeln;
    end;
End.


FreeAndNil

Free object if needed, and set object reference to Nil

Declaration

Source position: sysutilh.inc line 320

procedure FreeAndNil(

  var obj

);

Description

FreeAndNil will free the object in Obj and will set the reference in Obj to Nil. The reference is set to Nil first, so if an exception occurs in the destructor of the object, the reference will be Nil anyway.

Errors

Exceptions that occur during the destruction of Obj are not caught.


FreeMemAndNil

Free the heap memory pointed to by a pointer and set pointer to nil.

Declaration

Source position: sysutilh.inc line 321

procedure FreeMemAndNil(

  var p

);

Description

FreeMemAndNil will free the memory pointed to by P and will set P to Nil. Note that this function is not type safe; the programmer is responsible for ensuring that this function is called with a correct pointer parameter. Failure to do so may result in run-time errors.

See also

FreeAndNil

Free object if needed, and set object reference to Nil


GetAppConfigDir

Return the appropriate directory for the application's configuration files.

Declaration

Source position: osutilsh.inc line 41

function GetAppConfigDir(

  Global: Boolean

):string;

Description

GetAppConfigDir returns the name of a directory in which the application should store its configuration files on the current OS. If the parameter Global is True then the directory returned is a global directory, i.e. valid for all users on the system. If the parameter Global is false, then the directory is specific for the user who is executing the program. On systems that do not support multi-user environments, these two directories may be the same.

The directory which is returned is the name of the directory where the application is supposed to store files. This does not mean that the directory exists, or that the user can write in this directory (especially if Global=True). It just returns the name of the appropriate location. Also note that the returned name always contains an ending path delimiter.

On systems where the operating system provides a call to determine this location, this call will be used. On systems where there is no such call, an algorithm is used which reflects common practice on that system.

The application name is deduced from the binary name via the ApplicationName call, but can be configured by means of the OnGetApplicationName callback.

If VendorName is not-empty, then VendorName will also be inserted before the application-specific directory.

Errors

None.

See also

GetAppConfigFile | Return an appropriate name for an application configuration file.
ApplicationName | Return a default application name
OnGetApplicationName | Callback to get a customized application name.
CreateDir | Create a new directory
SysConfigDir | System configuration directory.
VendorName | Return Application vendor Name


GetAppConfigFile

Return an appropriate name for an application configuration file.

Declaration

Source position: osutilsh.inc line 42

function GetAppConfigFile(

  Global: Boolean

):string;

function GetAppConfigFile(

  Global: Boolean;

  SubDir: Boolean

):string;

Description

GetAppConfigFile returns the name of a file in which the application can store its configuration parameters. The exact name and location of the file depends on the customs of the operating system.

The Global parameter determines whether it is a global configuration file (value True) or a personal configuration file (value False).

The parameter SubDir, in case it is set to True, will insert the name of a directory before the filename. This can be used in case the application needs to store other data than configuration data in an application-specific directory. Default behaviour is to set this to False.

Note that on Windows, even when Subdir is False, a subdirectory is created for the application configuration files, as per the windows specifications. Specifying true will create a subdirectory of the application settings subdirectory.

The default file extension of the returned file is: .cfg

No assumptions should be made about the existence or writeability of this file, or the directory where the file should reside. It is best to call ForceDirectories prior to opening a file with the resulting filename.

On systems where the operating system provides a call to determine the location of configuration files, this call will be used. On systems where there is no such call, an algorithm is used which reflects common practice on that system.

The application name is deduced from the binary name via the ApplicationName call, but can be configured by means of the OnGetApplicationName callback.

If VendorName is not-empty, then VendorName will be inserted in the path for the config file directory.

Errors

None.

See also

GetAppConfigDir | Return the appropriate directory for the application's configuration files.
OnGetApplicationName | Callback to get a customized application name.
ApplicationName | Return a default application name
CreateDir | Create a new directory
ConfigExtension | Default application configuration file extension.
SysConfigDir | System configuration directory.
VendorName | Return Application vendor Name


GetCurrentDir

Return the current working directory of the application.

Declaration

Source position: diskh.inc line 18

function GetCurrentDir: AnsiString;

Description

GetCurrentDir returns the current working directory.

Errors

None.

See also

SetCurrentDir | Set the current directory of the application.
DiskFree | Return the amount of free diskspace
DiskSize | Return the total amount of diskspace.

Example

Program Example28;

{ This program demonstrates the GetCurrentDir function }

Uses sysutils;

Begin
  Writeln ('Current Directory is : ',GetCurrentDir);
End.


GetDirs

Return a list of directory names from a path.

Declaration

Source position: finah.inc line 42

function GetDirs(

  var DirName: UnicodeString;

  var Dirs: array of PWideChar

):LongInt;

function GetDirs(

  var DirName: RawByteString;

  var Dirs: array of PAnsiChar

):LongInt;

Description

GetDirs splits DirName in a null-byte separated list of directory names, Dirs is an array of PChars, pointing to these directory names. The function returns the number of directories found, or -1 if none were found. DirName must contain only OSDirSeparator as Directory separator chars.

Errors

None.

See also

ExtractRelativePath

Extract a relative path from a filename, given a base directory.

Example

Program Example45;

{ This program demonstrates the GetDirs function }
{$H+}

Uses sysutils;

Var Dirs : Array[0..127] of pchar;
    I,Count : longint;
    Dir,NewDir : String;

Begin
  Dir:=GetCurrentDir;
  Writeln ('Dir : ',Dir);
  NewDir:='';
  count:=GetDirs(Dir,Dirs);
  For I:=0 to Count-1 do
    begin
    NewDir:=NewDir+'/'+StrPas(Dirs[I]);
    Writeln (NewDir);
    end;
End.


GetDriveIDFromLetter

Return the drive ID based on a drive letter

Declaration

Source position: diskh.inc line 24

function GetDriveIDFromLetter(

  const ADrive: RawByteString

):Byte;

function GetDriveIDFromLetter(

  const ADrive: UnicodeString

):Byte;

Description

GetDriveIDFromLetter returns the drive ID based on a drive letter. The drive ID can then be used in the DiskSize and DiskFree calls.

See also

DiskSize | Return the total amount of diskspace.
DiskFree | Return the amount of free diskspace


GetEnvironmentString

Return an environment variable by index.

Declaration

Source position: osutilsh.inc line 27

function GetEnvironmentString(

  Index: Integer

):AnsiString;

Description

GetEnvironmentString returns the Index-th environment variable. The index is 1 based, and is bounded from above by the result of GetEnvironmentVariableCount.

For an example, GetEnvironmentVariableCount.

Remark: Note that on Windows, environment strings can start with an equal sign (=). This is a trick used to pass the current working directory to a newly created proces. In this case, extracting the variable name as the characters before the first equal sign will result in an empty name.

Errors

If there is no environment, an empty string is returned.

See also

GetEnvironmentVariable | Return the value of an environment variable.
GetEnvironmentVariableCount | Return the number of variables in the environment.


GetEnvironmentVariable

Return the value of an environment variable.

Declaration

Source position: osutilsh.inc line 25

function GetEnvironmentVariable(

  const EnvVar: AnsiString

):AnsiString;

function GetEnvironmentVariable(

  const EnvVar: UnicodeString

):UnicodeString;

Description

GetEnvironmentVariable returns the value of the EnvVar environment variable. If the specified variable does not exist or EnvVar is empty, an empty string is returned.

See also

GetEnvironmentString | Return an environment variable by index.
GetEnvironmentVariableCount | Return the number of variables in the environment.


GetEnvironmentVariableCount

Return the number of variables in the environment.

Declaration

Source position: osutilsh.inc line 28

function GetEnvironmentVariableCount: Integer;

Description

GetEnvironmentVariableCount returns the number of variables in the environment. The number is 1 based, but the result may be zero if there are no environment variables.

Errors

If there is no environment, -1 may be returned.

See also

GetEnvironmentString | Return an environment variable by index.
GetEnvironmentVariable | Return the value of an environment variable.

Example

{$h+}
program example92;

{ This program demonstrates the
  GetEnvironmentVariableCount function }

uses sysutils;

Var
  I : Integer;

begin
  For I:=1 to GetEnvironmentVariableCount do
    Writeln(i:3,' : ',GetEnvironmentString(i));
end.


GetFileHandle

Extract OS handle from an untyped file or text file.

Declaration

Source position: filutilh.inc line 178

function GetFileHandle(

  var f: file

):THandle;

function GetFileHandle(

  var f: Text

):THandle;

Description

GetFileHandle returns the operating system handle for the file descriptor F. It can be used in various file operations which are not directly supported by the pascal language.


GetLastOSError

Return the last code from the OS.

Declaration

Source position: osutilsh.inc line 20

function GetLastOSError: Integer;

Description

GetLastOSError returns the error code from the last operating system call. It does not reset this code. In general, it should be called when an operating system call reported an error condition. In that case, GetLastOSError gives extended information about the error.

No assumptions should be made about the resetting of the error code by subsequent OS calls. This may be platform dependent.

See also

RaiseLastOSError

Raise an exception with the last Operating System error code.


GetLocalTime

Get the local time.

Declaration

Source position: datih.inc line 194

procedure GetLocalTime(

  var SystemTime: TSystemTime

);

Description

GetLocalTime returns the system time in a TSystemTime format.

Errors

None.

See also

Now | Returns the current date and time.
Date | Return the current date.
Time | Returns the current time.
TSystemTime | System time structure


GetLocalTimeOffset

Return local timezone offset

Declaration

Source position: datih.inc line 198

function GetLocalTimeOffset: Integer;

Description

GetLocalTimeOffset returns the local timezone offset in minutes. This is the difference between UTC time and local time:

UTC = LocalTime + GetLocalTimeOffset

Note that on Linux/Unix, this information may be inaccurate around the DST time changes (for optimization). In that case, the unix.ReReadLocalTime unit must be used to re-initialize the timezone information.

See also

unix.ReReadLocalTime | Re-Read the local time files.
Date | Return the current date.
Time | Returns the current time.
Now | Returns the current date and time.


GetModuleName

Return the name of the current module

Declaration

Source position: sysutilh.inc line 329

function GetModuleName(

  Module: HMODULE

):string;

Description

GetModuleName returns the name of the current module. On windows, this is the name of the executable when executed in an executable, or the name of the library when executed in a library.

On all other platforms, the result is always empty, since they provide no such functionality.


GetTempDir

Return name of system's temporary directory

Declaration

Source position: osutilsh.inc line 35

function GetTempDir(

  Global: Boolean

):string;

function GetTempDir: string;

Description

GetTempDir returns the temporary directory of the system. If Global is True (the default value) it returns the system temporary directory, if it is False then a directory private to the user is returned. The returned name will end with a directory delimiter character.

These directories may be the same. No guarantee is made that this directory exists or is writeable by the user.

The OnGetTempDir handler may be set to provide custom handling of this routine: One could implement callbacks which take into consideration frameworks like KDE or GNOME, and return a different value from the default system implementation.

Errors

On error, an empty string is returned.

See also

OnGetTempDir | Handler for GetTempDir function.
GetTempFileName | Return the name of a temporary file.


GetTempFileName

Return the name of a temporary file.

Declaration

Source position: osutilsh.inc line 37

function GetTempFileName(

  const Dir: string;

  const Prefix: string

):string;

function GetTempFileName: string;

function GetTempFileName(

  Dir: PChar;

  Prefix: PChar;

  uUnique: DWord;

  TempFileName: PChar

):DWord;

Description

GetTempFileName returns the name of a temporary file in directory Dir. The name of the file starts with Prefix.

If Dir is empty, the value returned by GetTempDir is used, and if Prefix is empty, 'TMP' is used.

The OnGetTempFile handler may be set to provide custom handling of this routine: One could implement callbacks which take into consideration frameworks like KDE or GNOME, and return a different value from the default system implementation.

Errors

On error, an empty string is returned.

See also

GetTempDir | Return name of system's temporary directory
OnGetTempFile | Handler for GetTempFileName function.


GetTickCount

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

GetTickCount (deprecated)

Get tick count (32-bit, deprecated)

Declaration

Source position: sysutilh.inc line 28

function GetTickCount: LongWord;

Description

GetTickCount returns an increasing clock tick count. It is useful for time measurements, but no assumtions should be made as to the interval between the ticks. This function is provided for Delphi compatibility, use GetTickCount64 instead.

See also

GetTickCount64 | Get tick count (64-bit)
Now | Returns the current date and time.
Time | Returns the current time.
Sleep | Suspend execution of a program for a certain time.


GetTickCount64

Get tick count (64-bit)

Declaration

Source position: sysutilh.inc line 29

function GetTickCount64: QWord;

Description

GetTickCount64 returns an increasing clock tick count. It is useful for time measurements, but no assumtions should be made as to the interval between the ticks.

See also

Now | Returns the current date and time.
Time | Returns the current time.
Sleep | Suspend execution of a program for a certain time.


GetUserDir

Returns the current user's home directory.

Declaration

Source position: osutilsh.inc line 44

function GetUserDir: string;

Description

GetUserDir returns the home directory of the current user. On Unix-like systems (that includes Mac OS X), this is the value of the HOME environment variable. On Windows, this is the PROFILE special folder. On all other platforms, the application installation directory is returned.

If non-empty, it contains a trailing path delimiter.

See also

GetAppConfigDir

Return the appropriate directory for the application's configuration files.


GuidCase

Return the index of a GUID in an array of GUID values

Declaration

Source position: intfh.inc line 36

function GuidCase(

  const GUID: TGuid;

  const List: array of TGuid

):Integer;

Description

GuidCase returns the index of GUID in the array List, where 0 denotes the first element in the list. If GUID is not present in the list, -1 is returned.

See also

IsEqualGUID

Check whether two TGUID variables are equal.


GUIDToString

Convert a TGUID to a string representation.

Declaration

Source position: intfh.inc line 34

function GUIDToString(

  const GUID: TGuid

):string;

Description

GUIDToString converts the GUID identifier in GUID to a string representation in the form

{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}

Where each X is a hexadecimal digit.

Errors

None.

See also

Supports | Check whether a class or given interface supports an interface
#rtl.system.TGUID | Standard GUID representation type.
StringToGUID | Convert a string to a native TGUID type.
IsEqualGuid | Check whether two TGUID variables are equal.


HashName

Calculate a hash from a null-terminated string

Declaration

Source position: sysansih.inc line 22

function HashName(

  Name: PAnsiChar

):LongWord;

Description

HashName calculates a hash value from a null terminated string. The hash value is calculated in such a way that it returns the same value for strings that only differ in case.


HookSignal

Hook a specified signal

Declaration

Source position: sysutils.pp line 80

procedure HookSignal(

  RtlSigNum: Integer

);

Description

HookSignal installs the RTL default signal handler for signal RtlSigNum. It does not check whether the signal is already handled, and should therefor only be called if InquireSignal returns ssNotHooked.


IncAMonth

Increase a date with a certain amount of months

Declaration

Source position: datih.inc line 130

procedure IncAMonth(

  var Year: Word;

  var Month: Word;

  var Day: Word;

  NumberOfMonths: Integer = 1

);

Description

IncAMonth increases the date as specified by Year, Month, Day with NumberOfMonths. It takes care of the number of days in a month when calculating the result.

This function does the same as IncMonth, but operates on an already decoded date.

See also

IncMonth

Increases the month in a TDateTime value with a given amount.


IncludeLeadingPathDelimiter

Prepend a path delimiter if there is not already one.

Declaration

Source position: finah.inc line 37

function IncludeLeadingPathDelimiter(

  const Path: UnicodeString

):UnicodeString;

function IncludeLeadingPathDelimiter(

  const Path: RawByteString

):RawByteString;

Description

IncludeLeadingPathDelimiter will insert a path delimiter (#rtl.system.DirectorySeparator) in the first position of Path, if there is not already a directory separator at that position. It will return the resulting string. If the path is empty, a DirectorySeparator character is returned.

See also

IncludeTrailingPathDelimiter | Add trailing directory separator to a pathname, if needed.
ExcludeLeadingPathDelimiter | Strip the leading path delimiter of a path
ExcludeTrailingPathDelimiter | Strip trailing directory separator from a pathname, if needed.
ConcatPaths | Concatenate an array of paths to form a single path

Example

Program Example94;

{ This program demonstrates the IncludeLeadingPathDelimiter function }

Uses sysutils;

Begin
End.


IncludeTrailingBackslash

Add trailing directory separator to a pathname, if needed.

Declaration

Source position: finah.inc line 34

function IncludeTrailingBackslash(

  const Path: UnicodeString

):UnicodeString;

function IncludeTrailingBackslash(

  const Path: RawByteString

):RawByteString;

Description

IncludeTrailingBackslash is provided for backwards compatibility with Delphi. Use IncludeTrailingPathDelimiter instead.

See also

IncludeTrailingPathDelimiter | Add trailing directory separator to a pathname, if needed.
ExcludeTrailingPathDelimiter | Strip trailing directory separator from a pathname, if needed.
PathDelim | Path (directory) delimiter.
IsPathDelimiter | Is the character at the given position a pathdelimiter ?


IncludeTrailingPathDelimiter

Add trailing directory separator to a pathname, if needed.

Declaration

Source position: finah.inc line 33

function IncludeTrailingPathDelimiter(

  const Path: UnicodeString

):UnicodeString;

function IncludeTrailingPathDelimiter(

  const Path: RawByteString

):RawByteString;

Description

IncludeTrailingPathDelimiter adds a trailing path delimiter character (PathDelim) to Path if none is present yet, and returns the result.

If Path is empty, a path delimiter is returned, for Delphi compatibility.

See also

IncludeTrailingBackslash | Add trailing directory separator to a pathname, if needed.
ExcludeTrailingPathDelimiter | Strip trailing directory separator from a pathname, if needed.
PathDelim | Path (directory) delimiter.
IsPathDelimiter | Is the character at the given position a pathdelimiter ?


IncMonth

Increases the month in a TDateTime value with a given amount.

Declaration

Source position: datih.inc line 129

function IncMonth(

  const DateTime: TDateTime;

  NumberOfMonths: Integer = 1

):TDateTime;

Description

IncMonth increases the month number in DateTime with NumberOfMonths. It wraps the result as to get a month between 1 and 12, and updates the year accordingly. NumberOfMonths can be negative, and can be larger than 12 (in absolute value).

Errors

None.

See also

Date | Return the current date.
Time | Returns the current time.
Now | Returns the current date and time.

Example

Program Example15;

{ This program demonstrates the IncMonth function }

Uses sysutils;

Var ThisDay : TDateTime;

Begin
  ThisDay:=Date;
  Writeln ('ThisDay : ',DateToStr(ThisDay));
  Writeln ('6 months ago :',DateToStr(IncMonth(ThisDay,-6)));
  Writeln ('6 months from now :' ,DateToStr(IncMonth(ThisDay,6)));
  Writeln ('12 months ago :',DateToStr(IncMonth(ThisDay,-12)));
  Writeln ('12 months from now :' ,DateToStr(IncMonth(ThisDay,12)));
  Writeln ('18 months ago :',DateToStr(IncMonth(ThisDay,-18)));
  Writeln ('18 months from now :' ,DateToStr(IncMonth(ThisDay,18)));
End.


InquireSignal

Check whether a signal handler is set (unix only)

Declaration

Source position: sysutils.pp line 78

function InquireSignal(

  RtlSigNum: Integer

):TSignalState;

Description

RtlSigNum will check whether the signal RtlSigNum is being handled, and by whom. It returns a TSignalState result to report the state of the signal, which can be one of the following values:

ssNotHooked
No signal handler is set for the signal.
ssHooked
A signal handler is set by the RTL code for the signal.
ssOverridden
A signal handler was set for the signal by third-party code.

This routine works by resetting the signal handlers, so it is risky to call.


IntToHex

Convert an integer value to a hexadecimal string.

Declaration

Source position: sysstrh.inc line 111

function IntToHex(

  Value: LongInt;

  Digits: Integer

):string;

function IntToHex(

  Value: Int64;

  Digits: Integer

):string;

function IntToHex(

  Value: QWord;

  Digits: Integer

):string;

Description

IntToHex converts Value to a hexadecimal string representation. The result will contain at least Digits characters. If Digits is less than the needed number of characters, the string will NOT be truncated. If Digits is larger than the needed number of characters, the result is padded with zeroes.

Errors

None.

See also

IntToStr

Convert an integer value to a decimal string.

Example

Program Example73;

{ This program demonstrates the IntToHex function }

Uses sysutils;

Var I : longint;

Begin
  For I:=0 to 31 do
      begin
      Writeln (IntToHex(1 shl I,8));
      Writeln (IntToHex(15 shl I,8))
      end;
End.


IntToStr

Convert an integer value to a decimal string.

Declaration

Source position: sysstrh.inc line 108

function IntToStr(

  Value: LongInt

):string;

function IntToStr(

  Value: Int64

):string;

function IntToStr(

  Value: QWord

):string;

Description

IntToStr coverts Value to it's string representation. The resulting string has only as much characters as needed to represent the value. If the value is negative a minus sign is prepended to the string.

Errors

None.

See also

IntToHex | Convert an integer value to a hexadecimal string.
StrToInt | Convert a string to an integer value.

Example

Program Example74;

{ This program demonstrates the IntToStr function }

Uses sysutils;

Var I : longint;

Begin
  For I:=0 to 31 do
      begin
      Writeln (IntToStr(1 shl I));
      Writeln (IntToStr(15 shl I));
      end;
End.


IsDelimiter

Check whether a given string is a delimiter character.

Declaration

Source position: sysstrh.inc line 223

function IsDelimiter(

  const Delimiters: string;

  const S: string;

  Index: Integer

):Boolean;

Description

IsDelimiter checks whether the Index-th character in the string S is a delimiter character as passed in Delimiters. If Index is out of range, False is returned.

Errors

None.

See also

LastDelimiter

Return the last occurrence of a set of delimiters in a string.


IsEqualGUID

Check whether two TGUID variables are equal.

Declaration

Source position: intfh.inc line 35

function IsEqualGUID(

  const guid1: TGuid;

  const guid2: TGuid

):Boolean;

Description

IsEqualGUID checks whether guid1 and guid2 are equal, and returns True if this is the case, or False otherwise.

See also

Supports | Check whether a class or given interface supports an interface
#rtl.system.TGUID | Standard GUID representation type.
StringToGUID | Convert a string to a native TGUID type.
GuidToString | Convert a TGUID to a string representation.


IsLeapYear

Determine whether a year is a leap year.

Declaration

Source position: datih.inc line 131

function IsLeapYear(

  Year: Word

):Boolean;

Description

IsLeapYear returns True if Year is a leap year, False otherwise.

Errors

None.

See also

IncMonth | Increases the month in a TDateTime value with a given amount.
Date | Return the current date.

Example

Program Example16;

{ This program demonstrates the IsLeapYear function }

Uses sysutils;

Var YY,MM,dd : Word;

Procedure TestYear (Y : Word);

begin
  Writeln (Y,' is leap year : ',IsLeapYear(Y));
end;

Begin
  DeCodeDate(Date,YY,mm,dd);
  TestYear(yy);
  TestYear(2000);
  TestYear(1900);
  TestYear(1600);
  TestYear(1992);
  TestYear(1995);
End.


IsPathDelimiter

Is the character at the given position a pathdelimiter ?

Declaration

Source position: finah.inc line 39

function IsPathDelimiter(

  const Path: UnicodeString;

  Index: Integer

):Boolean;

function IsPathDelimiter(

  const Path: RawByteString;

  Index: Integer

):Boolean;

Description

IsPathDelimiter returns True if the character at position Index equals PathDelim, i.e. if it is a path delimiter character for the current platform.

Errors

IncludeTrailingPathDelimiter ExcludeTrailingPathDelimiter PathDelim


IsValidIdent

Check whether a string is a valid identifier name.

Declaration

Source position: sysstrh.inc line 107

function IsValidIdent(

  const Ident: string;

  AllowDots: Boolean = False;

  StrictDots: Boolean = False

):Boolean;

Description

IsValidIdent returns True if Ident can be used as a compoent name. It returns False otherwise. Ident must consist of a letter or underscore, followed by a combination of letters, numbers or underscores to be a valid identifier.

Errors

None.

Example

Program Example75;

{ This program demonstrates the IsValidIdent function }

Uses sysutils;

Procedure Testit (S : String);

begin
  Write ('"',S,'" is ');
  If not IsVAlidIdent(S) then
    Write('NOT ');
  Writeln ('a valid identifier');
end;

Begin
  Testit ('_MyObj');
  Testit ('My__Obj1');
  Testit ('My_1_Obj');
  Testit ('1MyObject');
  Testit ('My@Object');
  Testit ('M123');
End.


LastDelimiter

Return the last occurrence of a set of delimiters in a string.

Declaration

Source position: sysstrh.inc line 221

function LastDelimiter(

  const Delimiters: string;

  const S: string

):Integer;

Description

LastDelimiter returns the last occurrence of any character in the set Delimiters in the string S.

Example

Program example88;

{ This program demonstrates the LastDelimiter function }

uses SysUtils;

begin
  Writeln(LastDelimiter('\.:','c:\filename.ext'));
end.


LeftStr

Return a number of characters starting at the left of a string.

Declaration

Source position: sysstrh.inc line 263

function LeftStr(

  const S: string;

  Count: Integer

):string;

Description

LeftStr returns the Count leftmost characters of S. It is equivalent to a call to Copy(S,1,Count).

Errors

None.

See also

RightStr | Return a number of characters from a string, starting at the end.
TrimLeft | Trim whitespace from the beginning of a string.
TrimRight | Trim whitespace from the end of a string.
Trim | Trim whitespace from the ends of a string.

Example

Program Example76;

{ This program demonstrates the LeftStr function }

Uses sysutils;

Begin
  Writeln (LeftStr('abcdefghijklmnopqrstuvwxyz',20));
  Writeln (LeftStr('abcdefghijklmnopqrstuvwxyz',15));
  Writeln (LeftStr('abcdefghijklmnopqrstuvwxyz',1));
  Writeln (LeftStr('abcdefghijklmnopqrstuvwxyz',200));
End.


LoadStr

Load a string from the resource tables.

Declaration

Source position: sysstrh.inc line 126

function LoadStr(

  Ident: Integer

):string;

Description

This function is not yet implemented. resources are not yet supported.


LowerCase

Return a lowercase version of a string.

Declaration

Source position: sysstrh.inc line 72

function LowerCase(

  const s: string

):string; overload;

function LowerCase(

  const V: variant

):string; overload;

function LowerCase(

  const s: UnicodeString

):UnicodeString; overload;

Description

LowerCase returns the lowercase equivalent of S. Ansi characters are not taken into account, only ASCII codes below 127 are converted. It is completely equivalent to the lowercase function of the system unit, and is provided for compatibility only.

Lowercase does not change the number of characters (or bytes) in an ansistring or shortstring.

Errors

None.

See also

AnsiLowerCase | Return a lowercase version of a string.
UpperCase | Return an uppercase version of a string.
AnsiUpperCase | Return an uppercase version of a string, taking into account special characters.

Example

Program Example77;

{ This program demonstrates the LowerCase function }

Uses sysutils;

Begin
  Writeln (LowerCase('THIS WILL COME out all LoWeRcAsE !'));
End.


MSecsToTimeStamp

Convert a number of milliseconds to a TDateTime value.

Declaration

Source position: datih.inc line 113

function MSecsToTimeStamp(

  MSecs: Comp

):TTimeStamp;

Description

MSecsToTimeStamp converts the given number of milliseconds to a TTimeStamp date/time notation.

Use TTimeStamp variables if you need to keep very precise track of time.

Errors

None.

See also

TimeStampToMSecs | Converts a timestamp to a number of milliseconds.
DateTimeToTimeStamp | Converts a TDateTime value to a TimeStamp structure.

Example

Program Example17;

{ This program demonstrates the MSecsToTimeStamp function }

Uses sysutils;

Var MS : Comp;
    TS : TTimeStamp;
    DT : TDateTime;
Begin
  TS:=DateTimeToTimeStamp(Now);
  Writeln ('Now in days since 1/1/0001      : ',TS.Date);
  Writeln ('Now in millisecs since midnight : ',TS.Time);
  MS:=TimeStampToMSecs(TS);
  Writeln ('Now in millisecs since 1/1/0001 : ',MS);
  MS:=MS-1000*3600*2;
  TS:=MSecsToTimeStamp(MS);
  DT:=TimeStampToDateTime(TS);
  Writeln ('Now minus 1 day : ',DateTimeToStr(DT));
End.


NewStr

Allocate a new ansistring on the heap.

Declaration

Source position: sysstrh.inc line 66

function NewStr(

  const S: string

):PString; overload;

Description

NewStr assigns a new dynamic string on the heap, copies S into it, and returns a pointer to the newly assigned string.

This function is obsolete, and shouldn't be used any more. The AnsiString mechanism also allocates ansistrings on the heap, and should be preferred over this mechanism.

For an example, see AssignStr.

Errors

If not enough memory is present, an EOutOfMemory exception will be raised.

See also

AssignStr | Assigns an ansistring to a null-terminated string.
DisposeStr | Dispose an ansistring from the heap.


Now

Returns the current date and time.

Declaration

Source position: datih.inc line 128

function Now: TDateTime;

Description

Now returns the current date and time. It is equivalent to Date+Time.

Errors

None.

See also

Date | Return the current date.
Time | Returns the current time.

Example

Program Example18;

{ This program demonstrates the Now function }

Uses sysutils;

Begin
  Writeln ('Now : ',DateTimeToStr(Now));
End.


OutOfMemoryError

Raise an EOutOfMemory exception

Declaration

Source position: sysutilh.inc line 236

procedure OutOfMemoryError;

Description

OutOfMemoryError raises an EOutOfMemory exception, with an exception object that has been allocated on the heap at program startup. The program should neved create an EOutOfMemory exception, but always call this routine.

See also

EOutOfMemory

Out of memory error.


QuotedStr

Return a quotes version of a string.

Declaration

Source position: sysstrh.inc line 101

function QuotedStr(

  const S: string

):string;

Description

QuotedStr returns the string S, quoted with single quotes. This means that S is enclosed in single quotes, and every single quote in S is doubled. It is equivalent to a call to AnsiQuotedStr(s, '''').

Errors

None.

See also

AnsiQuotedStr | Return a quoted version of a string.
AnsiExtractQuotedStr | Removes the first quoted string from a string.

Example

Program Example78;

{ This program demonstrates the QuotedStr function }

Uses sysutils;

Var S : AnsiString;

Begin
  S:='He said ''Hello'' and walked on';
  Writeln (S);
  Writeln ('  becomes');
  Writeln (QuotedStr(S));
End.


RaiseLastOSError

Raise an exception with the last Operating System error code.

Declaration

Source position: osutilsh.inc line 22

procedure RaiseLastOSError; overload;

procedure RaiseLastOSError(

  LastError: Integer

); overload;

Description

RaiseLastOSError raises an EOSError exception with the error code returned by GetLastOSError. If the Error code is nonzero, then the corresponding error message will be returned. If the error code is zero, a standard message will be returned.

Errors

This procedure may not be implemented on all platforms. If it is not, then a normal Exception will be raised.

See also

EOSError | Operating system error.
GetLastOSError | Return the last code from the OS.
Exception | Base class of all exceptions.


RemoveDir

Remove a directory from the filesystem.

Declaration

Source position: diskh.inc line 22

function RemoveDir(

  const Dir: RawByteString

):Boolean;

function RemoveDir(

  const Dir: UnicodeString

):Boolean;

Description

RemoveDir removes directory Dir from the disk. If the directory is not absolue, it is appended to the current working directory.

For an example, see CreateDir.

Errors

In case of error (e.g. the directory isn't empty) the function returns False. If successful, True is returned.


RenameFile

Rename a file.

Declaration

Source position: filutilh.inc line 136

function RenameFile(

  const OldName: UnicodeString;

  const NewName: UnicodeString

):Boolean;

function RenameFile(

  const OldName: RawByteString;

  const NewName: RawByteString

):Boolean;

Description

RenameFile renames a file from OldName to NewName. The function returns True if successful, False otherwise. For safety, the new name must be a full path specification, including the directory, otherwise it will be assumed to be a filename relative to the current working directory. Remark: The implementation of RenameFile relies on the undelying OS's support for renaming/moving a file. Whether or not a file can be renamed accros disks or partitions depends entirely on the OS. On unix-like OS-es, the rename function will fail when used accross partitions. On Windows, it will work.

Errors

On Error, False is returned.

See also

DeleteFile

Delete a file from the filesystem.

Example

Program Example44;

{ This program demonstrates the RenameFile function }

Uses sysutils;

Var F : Longint;
    S : String;

Begin
  S:='Some short file.';
  F:=FileCreate ('test.dap');
  FileWrite(F,S[1],Length(S));
  FileClose(F);
  If RenameFile ('test.dap','test.dat') then
    Writeln ('Successfully renamed files.');
End.


ReplaceDate

Replace the date part of a date/time stamp

Declaration

Source position: datih.inc line 197

procedure ReplaceDate(

  var DateTime: TDateTime;

  const NewDate: TDateTime

);

Description

ReplaceDate replaces the date part of DateTime with NewDate. The time part is left unchanged.

See also

ReplaceTime

Replace the time part


ReplaceTime

Replace the time part

Declaration

Source position: datih.inc line 196

procedure ReplaceTime(

  var dati: TDateTime;

  NewTime: TDateTime

);

Description

ReplaceTime replaces the time part in dati with NewTime. The date part remains untouched.


RightStr

Return a number of characters from a string, starting at the end.

Declaration

Source position: sysstrh.inc line 264

function RightStr(

  const S: string;

  Count: Integer

):string;

Description

RightStr returns the Count rightmost characters of S. It is equivalent to a call to Copy(S,Length(S)+1-Count,Count).

If Count is larger than the actual length of S only the real length will be used.

Errors

None.

See also

LeftStr | Return a number of characters starting at the left of a string.
Trim | Trim whitespace from the ends of a string.
TrimLeft | Trim whitespace from the beginning of a string.
TrimRight | Trim whitespace from the end of a string.

Example

Program Example79;

{ This program demonstrates the RightStr function }

Uses sysutils;

Begin
  Writeln (RightStr('abcdefghijklmnopqrstuvwxyz',20));
  Writeln (RightStr('abcdefghijklmnopqrstuvwxyz',15));
  Writeln (RightStr('abcdefghijklmnopqrstuvwxyz',1));
  Writeln (RightStr('abcdefghijklmnopqrstuvwxyz',200));
End.


SafeLoadLibrary

Load a library safely

Declaration

Source position: sysutilh.inc line 326

function SafeLoadLibrary(

  const FileName: AnsiString;

  ErrorMode: DWord = 0

):HMODULE;

Description

SafeLoadLibrary saves and restores some registers before and after issuing a call to LoadLibrary.

Errors

None.


SameFileName

Are two filenames referring to the same file ?

Declaration

Source position: sysansih.inc line 15

function SameFileName(

  const S1: string;

  const S2: string

):Boolean;

Description

SameFileName returns True if calling AnsiCompareFileName with arguments S1 and S2 returns 0, and returns False otherwise.

Errors

None.

See also

AnsiCompareFileName

Compare 2 filenames.


SameStr

Check whether 2 strings are the same, case insensitive

Declaration

Source position: sysstrh.inc line 81

function SameStr(

  const s1: string;

  const s2: string

):Boolean;

Description

SameStr checks whether S1 and S2 are the same. This is equivalent to checking that CompareStr returns 0.

Errors

None.

See also

CompareStr

Compare 2 ansistrings case-sensitively, ignoring special characters.


SameText

Checks whether 2 strings are the same (case insensitive)

Declaration

Source position: sysstrh.inc line 80

function SameText(

  const s1: string;

  const s2: string

):Boolean;

Description

SameText calls CompareText with S1 and S2 as parameters and returns True if the result of that call is zero, or False otherwise.

Errors

None.

See also

CompareText | Compare 2 ansistrings case insensitive.
AnsiSameText | Checks whether 2 strings are the same (case insensitive)
AnsiSameStr | Checks whether 2 strings are the same (case sensitive)


SetCurrentDir

Set the current directory of the application.

Declaration

Source position: diskh.inc line 20

function SetCurrentDir(

  const NewDir: RawByteString

):Boolean;

function SetCurrentDir(

  const NewDir: UnicodeString

):Boolean;

Description

SetCurrentDir sets the current working directory of your program to NewDir. It returns True if the function was successfull, False otherwise.

Errors

In case of error, False is returned.

See also

GetCurrentDir

Return the current working directory of the application.


SetDirSeparators

Set the directory separators to the known directory separators.

Declaration

Source position: finah.inc line 41

function SetDirSeparators(

  const FileName: UnicodeString

):UnicodeString;

function SetDirSeparators(

  const FileName: RawByteString

):RawByteString;

Description

SetDirSeparators returns FileName with all possible DirSeparators replaced by OSDirSeparator.

Errors

None.

See also

ExpandFileName | Expand a relative filename to an absolute filename.
ExtractFilePath | Extract the path from a filename.
ExtractFileDir | Extract the drive and directory part of a filename.

Example

Program Example47;

{ This program demonstrates the SetDirSeparators function }

Uses sysutils;

Begin
  Writeln (SetDirSeparators('/pp\bin/win32\ppc386'));
End.


ShowException

Show the current exception to the user.

Declaration

Source position: sysutilh.inc line 234

procedure ShowException(

  ExceptObject: TObject;

  ExceptAddr: Pointer

);

Description

ShowException shows a message stating that a ExceptObject was raised at address ExceptAddr. It uses ExceptionErrorMessage to create the message, and is aware of the fact whether the application is a console application or a GUI application. For a console application, the message is written to standard error output. For a GUI application, OnShowException is executed.

Errors

If, for a GUI application, OnShowException is not set, no message will be displayed to the user.

The exception message can be at most 255 characters long: It is possible that no memory can be allocated on the heap, so ansistrings are not available, so a shortstring is used to display the message.

See also

ExceptObject | Current Exception object.
ExceptAddr | Current exception address.
ExceptionErrorMessage | Return a message describing the exception.


Sleep

Suspend execution of a program for a certain time.

Declaration

Source position: osutilsh.inc line 30

procedure Sleep(

  milliseconds: Cardinal

);

Description

Sleep suspends the execution of the program for the specified number of milliseconds (milliseconds). After the specified period has expired, program execution resumes.

Remark: The indicated time is not exact, i.e. it is a minimum time. No guarantees are made as to the exact duration of the suspension.


SScanf

Scan a string for substrings and return the substrings

Declaration

Source position: sysstrh.inc line 225

function SScanf(

  const s: string;

  const fmt: string;

  const Pointers: array of Pointer

):Integer;

Description

SSCanF scans the string S for the elements specified in Fmt, and returns the elements in the pointers in Pointers. The Fmt can contain placeholders of the form %X where X can be one of the following characters:

d
Placeholder for a decimal number.
f
Placeholder for a floating point number (an extended)
s
Placeholder for a string of arbitrary length.
c
Placeholder for a single character

The Pointers array contains a list of pointers, each pointer should point to a memory location of a type that corresponds to the type of placeholder in that position:

d
A pointer to an integer.
f
A pointer to an extended.
s
A pointer to an ansistring.
c
A pointer to a single character.

Errors

No error checking is performed on the type of the memory location.

See also

Format

Format a string with given arguments.


StrAlloc

Allocate a null-terminated string on the heap.

Declaration

Source position: syspchh.inc line 41

function StrAlloc(

  Size: Cardinal

):PChar;

Description

StrAlloc reserves memory on the heap for a string with length Len, terminating #0 included, and returns a pointer to it.

Additionally, StrAlloc allocates 4 extra bytes to store the size of the allocated memory. Therefore this function is NOT compatible with the StrAlloc function of the Strings unit.

For an example, see StrBufSize.

Errors

None.

See also

StrBufSize | Return the size of a null-terminated string allocated on the heap.
StrDispose | Dispose of a null-terminated string on the heap.
StrAlloc | Allocate memory for a new null-terminated string on the heap


StrBufSize

Return the size of a null-terminated string allocated on the heap.

Declaration

Source position: syspchh.inc line 42

function StrBufSize(

  Str: PChar

):Cardinal;

function StrBufSize(

  str: PWideChar

):Cardinal;

Description

StrBufSize returns the memory allocated for Str. This function ONLY gives the correct result if Str was allocated using StrAlloc.

Errors

If no more memory is available, a runtime error occurs.

See also

StrAlloc | Allocate a null-terminated string on the heap.
StrDispose | Dispose of a null-terminated string on the heap.

Example

Program Example46;

{ This program demonstrates the StrBufSize function }
{$H+}

Uses sysutils;

Const S  = 'Some nice string';

Var P : Pchar;

Begin
   P:=StrAlloc(Length(S)+1);
   StrPCopy(P,S);
   Write (P, ' has length ',length(S));
   Writeln (' and  buffer size ',StrBufSize(P));
   StrDispose(P);
End.


StrByteType

Return the type of byte in a null-terminated string for a multi-byte character set

Declaration

Source position: sysstrh.inc line 232

function StrByteType(

  Str: PChar;

  Index: Cardinal

):TMbcsByteType;

Description

StrByteType returns the type of byte in the null-terminated string Str at (0-based) position Index.

Errors

No checking on the index is performed.

See also

TMbcsByteType | Type of multi-byte character set.
ByteType | Return the type of byte in an ansistring for a multi-byte character set


strcat

Concatenate 2 null-terminated strings.

Declaration

Source position: syspchh.inc line 23

function strcat(

  dest: PChar;

  source: PChar

):PChar;

function strcat(

  dest: PWideChar;

  source: PWideChar

):PWideChar;

Description

Attaches Source to Dest and returns Dest.

Errors

No length checking is performed.

See also

StrLCat

Concatenate 2 null-terminated strings, with length boundary.

Example

Program Example11;

Uses strings;

{ Program to demonstrate the StrCat function. }

Const P1 : PChar = 'This is a PChar String.';

Var P2 : PChar;

begin
  P2:=StrAlloc (StrLen(P1)*2+1);
  StrMove (P2,P1,StrLen(P1)+1); { P2=P1 }
  StrCat (P2,P1);               { Append P2 once more }
  Writeln ('P2 : ',P2);
  StrDispose(P2);
end.


StrCharLength

Return the length of a null-terminated string in characters.

Declaration

Source position: sysstrh.inc line 236

function StrCharLength(

  const Str: PChar

):Integer;

Description

StrCharLength returns the length of the null-terminated string Str (a widestring) in characters (not in bytes). It uses the widestring manager to do this.


strcomp

Compare 2 null-terminated strings, case sensitive.

Declaration

Source position: syspchh.inc line 24

function strcomp(

  str1: PChar;

  str2: PChar

):SizeInt;

function strcomp(

  str1: PWideChar;

  str2: PWideChar

):SizeInt;

Description

Compares the null-terminated strings S1 and S2. The result is

  • A negative Longint when S1<S2.
  • 0 when S1=S2.
  • A positive Longint when S1>S2.

For an example, see StrLComp.

Errors

None.

See also

StrLComp | Compare limited number of characters of 2 null-terminated strings
StrIComp | Compare 2 null-terminated strings, case insensitive.
StrLIComp | Compare limited number of characters in 2 null-terminated strings, ignoring case.


StrCopy

Copy a null-terminated string

Declaration

Source position: syspchh.inc line 19

function strcopy(

  dest: PChar;

  source: PChar

):PChar; overload;

function StrCopy(

  Dest: PWideChar;

  Source: PWideChar

):PWideChar; overload;

Description

Copy the null terminated string in Source to Dest, and returns a pointer to Dest. Dest needs enough room to contain Source, i.e. StrLen(Source)+1 bytes.

Errors

No length checking is performed.

See also

StrPCopy | Copy an ansistring to a null-terminated string.
StrLCopy | Copy a null-terminated string, limited in length.
StrECopy | Copy a null-terminated string, return a pointer to the end.

Example

Program Example4;

Uses strings;

{ Program to demonstrate the StrCopy function. }

Const P : PCHar = 'This is a PCHAR string.';

var PP : PChar;

begin
  PP:=StrAlloc(Strlen(P)+1);
  STrCopy (PP,P);
  If StrComp (PP,P)<>0 then
    Writeln ('Oh-oh problems...')
  else
    Writeln ('All is well : PP=',PP);
  StrDispose(PP);
end.


StrDispose

Dispose of a null-terminated string on the heap.

Declaration

Source position: syspchh.inc line 43

procedure StrDispose(

  Str: PChar

);

procedure StrDispose(

  str: PWideChar

);

Description

StrDispose frees any memory allocated for Str. This function will only function correctly if Str has been allocated on the heap, for example using StrAlloc or StrNew from the SysUtils unit.

For an example, see StrBufSize.

Errors

If an invalid pointer is passed, or a pointer not allocated with StrAlloc, an error may occur.

See also

StrBufSize | Return the size of a null-terminated string allocated on the heap.
StrAlloc | Allocate a null-terminated string on the heap.
StrNew | Allocate room for new null-terminated string.


strecopy

Copy a null-terminated string, return a pointer to the end.

Declaration

Source position: syspchh.inc line 21

function strecopy(

  dest: PChar;

  source: PChar

):PChar;

function strecopy(

  dest: PWideChar;

  source: PWideChar

):PWideChar;

Description

Copies the Null-terminated string in Source to Dest, and returns a pointer to the end (i.e. the terminating Null-character) of the copied string.

Errors

No length checking is performed.

See also

StrLCopy | Copy a null-terminated string, limited in length.
StrCopy | Copy a null-terminated string

Example

Program Example6;

Uses strings;

{ Program to demonstrate the StrECopy function. }

Const P : PChar = 'This is a PCHAR string.';

Var PP : PChar;

begin
  PP:=StrAlloc (StrLen(P)+1);
  If Longint(StrECopy(PP,P))-Longint(PP)<>StrLen(P) then
    Writeln('Something is wrong here !')
  else
    Writeln ('PP= ',PP);
  StrDispose(PP);
end.


strend

Return a pointer to the end of a null-terminated string

Declaration

Source position: syspchh.inc line 22

function strend(

  p: PChar

):PChar;

function strend(

  p: PWideChar

):PWideChar;

Description

Returns a pointer to the end of P. (i.e. to the terminating null-character.

Errors

None.

See also

StrLen

Length of a null-terminated string.

Example

Program Example6;

Uses strings;

{ Program to demonstrate the StrEnd function. }

Const P : PChar = 'This is a PCHAR string.';

begin
  If Longint(StrEnd(P))-Longint(P)<>StrLen(P) then
    Writeln('Something is wrong here !')
  else
    Writeln ('All is well..');
end.


StrFmt

Format a string with given arguments, store the result in a buffer.

Declaration

Source position: sysstrh.inc line 132

function StrFmt(

  Buffer: PChar;

  Fmt: PChar;

  const args: array of Const

):PChar;

function StrFmt(

  Buffer: PChar;

  Fmt: PChar;

  const Args: array of Const;

  const FormatSettings: TFormatSettings

):PChar;

Description

StrFmt will format fmt with Args, as the Format function does, and it will store the result in Buffer. The function returns Buffer. Buffer should point to enough space to contain the whole result.

Errors

for a list of errors, see Format.

See also

StrLFmt | Format a string with given arguments, but with limited length.
FmtStr | Format a string with given arguments.
Format | Format a string with given arguments.
FormatBuf | Format a string with given arguments and store the result in a buffer.

Example

Program Example80;

{ This program demonstrates the StrFmt function }

Uses sysutils;

Var S : AnsiString;

Begin
  SetLEngth(S,80);
  Writeln (StrFmt (@S[1],'For some nice examples of fomatting see %s.',['Format']));
End.


stricomp

Compare 2 null-terminated strings, case insensitive.

Declaration

Source position: syspchh.inc line 26

function stricomp(

  str1: PChar;

  str2: PChar

):SizeInt;

function stricomp(

  str1: PWideChar;

  str2: PWideChar

):SizeInt;

Description

Compares the null-terminated strings S1 and S2, ignoring case. The result is

  • A negative Longint when S1<S2.
  • 0 when S1=S2.
  • A positive Longint when S1>S2.

Errors

None.

See also

StrLComp | Compare limited number of characters of 2 null-terminated strings
StrComp | Compare 2 null-terminated strings, case sensitive.
StrLIComp | Compare limited number of characters in 2 null-terminated strings, ignoring case.

Example

Program Example8;

Uses strings;

{ Program to demonstrate the StrLComp function. }

Const P1 : PChar = 'This is the first string.';
      P2 : PCHar = 'This is the second string.';

Var L : Longint;

begin
  Write ('P1 and P2 are ');
  If StrComp (P1,P2)<>0 then write ('NOT ');
  write ('equal. The first ');
  L:=1;
  While StrLComp(P1,P2,L)=0 do inc (L);
  dec(l);
  Writeln (l,' characters are the same.');
end.


StringOf

Create a unicode string from an array of bytes

Declaration

Source position: sysunih.inc line 66

function StringOf(

  const Bytes: TBytes

):UnicodeString;

Description

StringOf converts an array of bytes (Bytes) to a unicode string. It interprets the bytes as a single-byte string, using the default codepage.

To create a string where the bytes are interpreted as wide chars, use WideStringOf instead.

Errors

None.

See also

WideBytesOf | Returns the contents of a widestring as an array of bytes
WideStringOf | Create unicode string from array of bytes


StringReplace

Replace occurrences of one substring with another in a string.

Declaration

Source position: sysstrh.inc line 222

function StringReplace(

  const S: string;

  const OldPattern: string;

  const NewPattern: string;

  Flags: TReplaceFlags

):string;

Description

StringReplace searches the string S for occurrences of the string OldPattern and, if it is found, replaces it with NewPattern. It returns the resulting string. The behaviour of StringReplace can be runed with Flags, which is of type TReplaceFlags. Standard behaviour is to replace only the first occurrence of OldPattern, and to search case sensitively.

Errors

None.

See also

TReplaceFlags | Flags for StringReplace function
WideStringReplace | Replace occurrences of one substring with another in a widestring.


StringToGUID

Convert a string to a native TGUID type.

Declaration

Source position: intfh.inc line 33

function StringToGUID(

  const S: string

):TGuid;

Description

StringToGUID converts the string S to a valid GUID. The string S should be of the form

{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}

Where each X is a hexadecimal digit. The dashes and braces are required.

Errors

In case S contains an invalid GUID representation, a EConvertError exception is raised.

See also

Supports | Check whether a class or given interface supports an interface
#rtl.system.TGUID | Standard GUID representation type.
GUIDToString | Convert a TGUID to a string representation.
IsEqualGuid | Check whether two TGUID variables are equal.


strlcat

Concatenate 2 null-terminated strings, with length boundary.

Declaration

Source position: syspchh.inc line 28

function strlcat(

  dest: PChar;

  source: PChar;

  l: SizeInt

):PChar;

function strlcat(

  dest: PWideChar;

  source: PWideChar;

  l: SizeInt

):PWideChar;

Description

Adds MaxLen characters from Source to Dest, and adds a terminating null-character. Returns Dest.

Errors

None.

See also

StrCat

Concatenate 2 null-terminated strings.

Example

Program Example12;

Uses strings;

{ Program to demonstrate the StrLCat function. }

Const P1 : PChar = '1234567890';

Var P2 : PChar;

begin
  P2:=StrAlloc (StrLen(P1)*2+1);
  P2^:=#0; { Zero length }
  StrCat (P2,P1);
  StrLCat (P2,P1,5);
  Writeln ('P2 = ',P2);
  StrDispose(P2)
end.


strlcomp

Compare limited number of characters of 2 null-terminated strings

Declaration

Source position: syspchh.inc line 25

function strlcomp(

  str1: PChar;

  str2: PChar;

  l: SizeInt

):SizeInt;

function strlcomp(

  str1: PWideChar;

  str2: PWideChar;

  l: SizeInt

):SizeInt;

Description

Compares maximum L characters of the null-terminated strings S1 and S2. The result is

  • A negative Longint when S1<S2.
  • 0 when S1=S2.
  • A positive Longint when S1>S2.

Errors

None.

See also

StrComp | Compare 2 null-terminated strings, case sensitive.
StrIComp | Compare 2 null-terminated strings, case insensitive.
StrLIComp | Compare limited number of characters in 2 null-terminated strings, ignoring case.

Example

Program Example8;

Uses strings;

{ Program to demonstrate the StrLComp function. }

Const P1 : PChar = 'This is the first string.';
      P2 : PCHar = 'This is the second string.';

Var L : Longint;

begin
  Write ('P1 and P2 are ');
  If StrComp (P1,P2)<>0 then write ('NOT ');
  write ('equal. The first ');
  L:=1;
  While StrLComp(P1,P2,L)=0 do inc (L);
  dec(l);
  Writeln (l,' characters are the same.');
end.


StrLCopy

Copy a null-terminated string, limited in length.

Declaration

Source position: syspchh.inc line 20

function strlcopy(

  dest: PChar;

  source: PChar;

  maxlen: SizeInt

):PChar; overload;

function StrLCopy(

  Dest: PWideChar;

  Source: PWideChar;

  MaxLen: SizeInt

):PWideChar; overload;

Description

Copies MaxLen characters from Source to Dest, and makes Dest a null terminated string.

Errors

No length checking is performed.

See also

StrCopy | Copy a null-terminated string
StrECopy | Copy a null-terminated string, return a pointer to the end.

Example

Program Example5;

Uses strings;

{ Program to demonstrate the StrLCopy function. }

Const P : PCHar = '123456789ABCDEF';

var PP : PCHar;

begin
  PP:=StrAlloc(11);
  Writeln ('First 10 characters of P : ',StrLCopy (PP,P,10));
  StrDispose(PP);
end.


StrLen

Length of a null-terminated string.

Declaration

Source position: syspchh.inc line 18

function strlen(

  p: PChar

):SizeInt; overload;

function StrLen(

  p: PWideChar

):SizeInt; overload;

Description

Returns the length of the null-terminated string P. If P equals Nil then zero (0) is returned.

Errors

None.

See also

StrNew

Allocate room for new null-terminated string.

Example

Program Example1;

Uses strings;

{ Program to demonstrate the StrLen function. }

Const P : PChar = 'This is a constant pchar string';

begin
  Writeln ('P         : ',p);
  Writeln ('length(P) : ',StrLen(P));
end.


StrLFmt

Format a string with given arguments, but with limited length.

Declaration

Source position: sysstrh.inc line 134

function StrLFmt(

  Buffer: PChar;

  Maxlen: Cardinal;

  Fmt: PChar;

  const args: array of Const

):PChar;

function StrLFmt(

  Buffer: PChar;

  Maxlen: Cardinal;

  Fmt: PChar;

  const args: array of Const;

  const FormatSettings: TFormatSettings

):PChar;

Description

StrLFmt will format fmt with Args, as the Format function does, and it will store maximally Maxlen characters of the result in Buffer. The function returns Buffer. Buffer should point to enough space to contain MaxLen characters.

Errors

for a list of errors, see Format.

See also

StrFmt | Format a string with given arguments, store the result in a buffer.
FmtStr | Format a string with given arguments.
Format | Format a string with given arguments.
FormatBuf | Format a string with given arguments and store the result in a buffer.

Example

Program Example80;

{ This program demonstrates the StrFmt function }

Uses sysutils;

Var S : AnsiString;

Begin
  SetLEngth(S,80);
  Writeln (StrLFmt (@S[1],80,'For some nice examples of fomatting see %s.',['Format']));
End.


strlicomp

Compare limited number of characters in 2 null-terminated strings, ignoring case.

Declaration

Source position: syspchh.inc line 33

function strlicomp(

  str1: PChar;

  str2: PChar;

  l: SizeInt

):SizeInt;

function strlicomp(

  str1: PWideChar;

  str2: PWideChar;

  l: SizeInt

):SizeInt;

Description

Compares maximum L characters of the null-terminated strings S1 and S2, ignoring case. The result is

  • A negative Longint when S1<S2.
  • 0 when S1=S2.
  • A positive Longint when S1>S2.

For an example, see StrIComp

Errors

None.

See also

StrLComp | Compare limited number of characters of 2 null-terminated strings
StrComp | Compare 2 null-terminated strings, case sensitive.
StrIComp | Compare 2 null-terminated strings, case insensitive.


strlower

Convert null-terminated string to all-lowercase.

Declaration

Source position: syspchh.inc line 31

function strlower(

  p: PChar

):PChar;

function strlower(

  p: PWideChar

):PWideChar;

Description

Converts P to an all-lowercase string. Returns P.

Errors

None.

See also

StrUpper

Convert null-terminated string to all-uppercase

Example

Program Example14;

Uses strings;

{ Program to demonstrate the StrLower and StrUpper functions. }

Const
    P1 : PChar = 'THIS IS AN UPPERCASE PCHAR STRING';
    P2 : PChar = 'this is a lowercase string';

begin
  Writeln ('Uppercase : ',StrUpper(P2));
  StrLower (P1);
  Writeln ('Lowercase : ',P1);
end.


StrMove

Move a null-terminated string to new location.

Declaration

Source position: syspchh.inc line 27

function strmove(

  dest: PChar;

  source: PChar;

  l: SizeInt

):PChar; overload;

function StrMove(

  dest: PWideChar;

  source: PWideChar;

  l: SizeInt

):PWideChar; overload;

Description

Copies MaxLen characters from Source to Dest. No terminating null-character is copied. Returns Dest

Errors

None.

See also

StrLCopy | Copy a null-terminated string, limited in length.
StrCopy | Copy a null-terminated string

Example

Program Example10;

Uses strings;

{ Program to demonstrate the StrMove function. }

Const P1 : PCHAR = 'This is a pchar string.';

Var P2 : Pchar;

begin
  P2:=StrAlloc(StrLen(P1)+1);
  StrMove (P2,P1,StrLen(P1)+1); { P2:=P1 }
  Writeln ('P2 = ',P2);
  StrDispose(P2);
end.


strnew

Allocate room for new null-terminated string.

Declaration

Source position: syspchh.inc line 35

function strnew(

  p: PChar

):PChar; overload;

function strnew(

  p: PWideChar

):PWideChar; overload;

Description

Copies P to the Heap, and returns a pointer to the copy.

Errors

Returns Nil if no memory was available for the copy.

See also

StrCopy | Copy a null-terminated string
StrDispose | Dispose of a null-terminated string on the heap.

Example

Program Example16;

Uses strings;

{ Program to demonstrate the StrNew function. }

Const P1 : PChar = 'This is a PChar string';

var P2 : PChar;

begin
  P2:=StrNew (P1);
  If P1=P2 then
    writeln ('This can''t be happening...')
  else
    writeln ('P2 : ',P2);
  StrDispose(P2);
end.


StrNextChar

Returns a pointer to the location of the next empty character in a null-terminated string

Declaration

Source position: sysstrh.inc line 237

function StrNextChar(

  const Str: PChar

):PChar;

Description

StrNextChar returns a pointer to the null-character that terminates the string Str

Errors

if Str is not properly terminated, an access violation may occur.


StrPas

Convert a null-terminated string to an ansistring.

Declaration

Source position: syspchh.inc line 38

function StrPas(

  Str: PChar

):string; overload;

function StrPas(

  Str: PWideChar

):UnicodeString; overload;

Description

Converts a null terminated string in Str to an Ansitring, and returns this string. This string is NOT truncated at 255 characters as is the system unit's version.

Errors

None.

See also

StrPCopy | Copy an ansistring to a null-terminated string.
StrPLCopy | Copy a limited number of characters from an ansistring to a null-terminated string.


StrPCopy

Copy an ansistring to a null-terminated string.

Declaration

Source position: syspchh.inc line 39

function StrPCopy(

  Dest: PChar;

  const Source: string

):PChar; overload;

function StrPCopy(

  Dest: PWideChar;

  const Source: UnicodeString

):PWideChar; overload;

Description

StrPCopy Converts the Ansistring in Source to a Null-terminated string, and copies it to Dest. Dest needs enough room to contain the string Source, i.e. Length(Source)+1 bytes.

Errors

No checking is performed to see whether Dest points to enough memory to contain Source.

See also

StrPLCopy | Copy a limited number of characters from an ansistring to a null-terminated string.
StrPas | Convert a null-terminated string to an ansistring.


StrPLCopy

Copy a limited number of characters from an ansistring to a null-terminated string.

Declaration

Source position: syspchh.inc line 40

function StrPLCopy(

  Dest: PChar;

  const Source: string;

  MaxLen: SizeUInt

):PChar; overload;

function StrPLCopy(

  Dest: PWideChar;

  const Source: UnicodeString;

  MaxLen: SizeUInt

):PWideChar; overload;

Description

StrPLCopy Converts maximally MaxLen characters of the Ansistring in Source to a Null-terminated string, and copies it to Dest. Dest needs enough room to contain the characters.

Errors

No checking is performed to see whether Dest points to enough memory to contain L characters of Source.

See also

StrPCopy

Copy an ansistring to a null-terminated string.


strpos

Find position of one null-terminated substring in another.

Declaration

Source position: syspchh.inc line 34

function strpos(

  str1: PChar;

  str2: PChar

):PChar;

function strpos(

  str1: PWideChar;

  str2: PWideChar

):PWideChar;

Description

Returns a pointer to the first occurrence of S2 in S1. If S2 does not occur in S1, returns Nil.

Errors

None.

See also

StrScan | Find first occurrence of a character in a null-terminated string.
StrRScan | Find last occurrence of a character in a null-terminated string.

Example

Program Example15;

Uses strings;

{ Program to demonstrate the StrPos function. }

Const P : PChar = 'This is a PChar string.';
      S : Pchar = 'is';
begin
  Writeln ('Position of ''is'' in P : ',sizeint(StrPos(P,S))-sizeint(P));
end.


strrscan

Find last occurrence of a character in a null-terminated string.

Declaration

Source position: syspchh.inc line 30

function strrscan(

  p: PChar;

  c: Char

):PChar;

function strrscan(

  p: PWideChar;

  c: WideChar

):PWideChar;

Description

Returns a pointer to the last occurrence of the character C in the null-terminated string P. If C does not occur, returns Nil.

For an example, see StrScan.

Errors

None.

See also

StrScan | Find first occurrence of a character in a null-terminated string.
StrPos | Find position of one null-terminated substring in another.


StrScan

Find first occurrence of a character in a null-terminated string.

Declaration

Source position: syspchh.inc line 29

function strscan(

  p: PChar;

  c: Char

):PChar; overload;

function StrScan(

  P: PWideChar;

  C: WideChar

):PWideChar; overload;

Description

Returns a pointer to the first occurrence of the character C in the null-terminated string P. If C does not occur, returns Nil.

Errors

None.

See also

StrRScan | Find last occurrence of a character in a null-terminated string.
StrPos | Find position of one null-terminated substring in another.

Example

Program Example13;

Uses strings;

{ Program to demonstrate the StrScan and StrRScan functions. }

Const P : PChar = 'This is a PCHAR string.';
      S : Char = 's' ;

begin
  Writeln ('P, starting from first ''s'' : ',StrScan(P,s));
  Writeln ('P, starting from last ''s'' : ',StrRScan(P,s));
end.


StrToBool

Convert a string to a boolean value

Declaration

Source position: sysstrh.inc line 215

function StrToBool(

  const S: string

):Boolean;

Description

StrToBool will convert the string S to a boolean value. The string S can contain one of 'True', 'False' (case is ignored) or a numerical value. If it contains a numerical value, 0 is converted to False, all other values result in True. If the string S contains no valid boolean, then an EConvertError exception is raised.

Errors

On error, an EConvertError exception is raised.

See also

BoolToStr

Convert a boolean value to a string.


StrToBoolDef

Convert string to boolean value, returning default in case of error

Declaration

Source position: sysstrh.inc line 218

function StrToBoolDef(

  const S: string;

  Default: Boolean

):Boolean;

Description

StrToBoolDef tries to convert the string S to a boolean value, and returns the boolean value in case of success. In case S does not contain a valid boolean string, Default is returned.

See also

StrToBool | Convert a string to a boolean value
TryStrToBool | Try to convert a string to a boolean value


StrToCurr

Convert a string to a currency value

Declaration

Source position: sysstrh.inc line 197

function StrToCurr(

  const S: string

):Currency;

function StrToCurr(

  const S: string;

  const FormatSettings: TFormatSettings

):Currency;

Description

StrToCurr converts a string to a currency value and returns the value. The string should contain a valid currency amount, without currency symbol. If the conversion fails, an EConvertError exception is raised.

Errors

On error, an EConvertError exception is raised.

See also

CurrToStr | Convert a currency value to a string.
StrToCurrDef | Convert a string to a currency value, using a default value


StrToCurrDef

Convert a string to a currency value, using a default value

Declaration

Source position: sysstrh.inc line 201

function StrToCurrDef(

  const S: string;

  Default: Currency

):Currency;

function StrToCurrDef(

  const S: string;

  Default: Currency;

  const FormatSettings: TFormatSettings

):Currency;

Description

StrToCurrDef converts a string to a currency value and returns the value. The string should contain a valid currency amount, without currency symbol. If the conversion fails, the fallback Default value is returned.

Errors

On error, the Default value is returned.

See also

CurrToStr | Convert a currency value to a string.
StrToCurr | Convert a string to a currency value


StrToDate

Convert a date string to a TDateTime value.

Declaration

Source position: datih.inc line 138

function StrToDate(

  const S: ShortString

):TDateTime;

function StrToDate(

  const S: Ansistring

):TDateTime;

function StrToDate(

  const S: ShortString;

  separator: Char

):TDateTime;

function StrToDate(

  const S: AnsiString;

  separator: Char

):TDateTime;

function StrToDate(

  const S: string;

  FormatSettings: TFormatSettings

):TDateTime;

function StrToDate(

  const S: ShortString;

  const useformat: string;

  separator: Char = #0

):TDateTime;

function StrToDate(

  const S: AnsiString;

  const useformat: string;

  separator: Char = #0

):TDateTime;

function StrToDate(

  const S: PChar;

  Len: Integer;

  const useformat: string;

  separator: Char = #0

):TDateTime;

Description

StrToDate converts the string S to a TDateTime date value. The Date must consist of 1 to three digits, separated by the DateSeparator character. If two numbers are given, they are supposed to form the day and month of the current year. If only one number is given, it is supposed to represent the day of the current month. (This is not supported in Delphi)

The order of the digits (y/m/d, m/d/y, d/m/y) is determined from the ShortDateFormat variable.

Errors

On error (e.g. an invalid date or invalid character), an EConvertError exception is raised.

See also

StrToTime | Convert a time string to a TDateTime value.
DateToStr | Converts a TDateTime value to a date string with a predefined format.
TimeToStr | Convert a TDateTime time to a string using a predefined format.
EConvertError | Conversion error.

Example

Program Example19;

{ This program demonstrates the StrToDate function }

Uses sysutils;

Procedure TestStr (S : String);

begin
  Writeln (S,' : ',DateToStr(StrToDate(S)));
end;

Begin

  Writeln ('ShortDateFormat ',ShortDateFormat);
  TestStr(DateTimeToStr(Date));
  TestStr('05'+DateSeparator+'05'+DateSeparator+'1999');
  TestStr('5'+DateSeparator+'5');
  TestStr('5');
End.


StrToDateDef

Convert string to date, returning a default value

Declaration

Source position: datih.inc line 180

function StrToDateDef(

  const S: ShortString;

  const Defvalue: TDateTime

):TDateTime;

function StrToDateDef(

  const S: ShortString;

  const Defvalue: TDateTime;

  separator: Char

):TDateTime;

function StrToDateDef(

  const S: AnsiString;

  const Defvalue: TDateTime

):TDateTime;

function StrToDateDef(

  const S: AnsiString;

  const Defvalue: TDateTime;

  separator: Char

):TDateTime;

Description

StrToDateDef tries to convert the string S to a valid TDateTime date value, and returns DefValue if S does not contain a valid date indication.

Errors

None.

See also

StrToDate | Convert a date string to a TDateTime value.
TryStrToDate | Try to convert a string with a date indication to a TDateTime value
StrToTimeDef | Convert string to time, returning a default value


StrToDateTime

Convert a date/time string to a TDateTime value.

Declaration

Source position: datih.inc line 152

function StrToDateTime(

  const S: AnsiString

):TDateTime;

function StrToDateTime(

  const s: ShortString;

  const FormatSettings: TFormatSettings

):TDateTime;

function StrToDateTime(

  const s: AnsiString;

  const FormatSettings: TFormatSettings

):TDateTime;

Description

StrToDateTime converts the string S to a TDateTime date and time value. The date and time parts must be separated by a space.

For the date part, the same restrictions apply as for the StrToDate function: The Date must consist of 1 to three numbers, separated by the DateSeparator character. If two numbers are given, they are supposed to form the day and month of the current year. If only one number is given, it is supposed to represent the day of the current month. (This is not supported in Delphi)

The order of the 3 numbers (y/m/d, m/d/y, d/m/y) is determined from the ShortDateFormat variable.

Errors

On error (e.g. an invalid date or invalid character), an EConvertError exception is raised.

See also

StrToDate | Convert a date string to a TDateTime value.
StrToTime | Convert a time string to a TDateTime value.
DateTimeToStr | Converts a TDateTime value to a string using a predefined format.
EConvertError | Conversion error.

Example

Program Example20;

{ This program demonstrates the StrToDateTime function }

Uses sysutils;

Procedure TestStr (S : String);

begin
  Writeln (S,' : ',DateTimeToStr(StrToDateTime(S)));
end;

Begin

  Writeln ('ShortDateFormat ',ShortDateFormat);
  TestStr(DateTimeToStr(Now));
  TestStr('05-05-1999 15:50');
  TestStr('5-5 13:30');
  TestStr('5 1:30PM');
End.


StrToDateTimeDef

Convert string to date/time, returning a default value

Declaration

Source position: datih.inc line 184

function StrToDateTimeDef(

  const S: ShortString;

  const Defvalue: TDateTime

):TDateTime;

function StrToDateTimeDef(

  const S: AnsiString;

  const Defvalue: TDateTime

):TDateTime;

Description

StrToDateTimeDef tries to convert the string S to a valid TDateTime date and time value, and returns DefValue if S does not contain a valid date-time indication.

Errors

None.

See also

StrToTimeDef | Convert string to time, returning a default value
StrToDateDef | Convert string to date, returning a default value
TryStrToDateTime | Try to convert a string with date/time indication to a TDateTime value
StrToDateTime | Convert a date/time string to a TDateTime value.


StrToDWord

Convert string to DWord (cardinal)

Declaration

Source position: sysstrh.inc line 115

function StrToDWord(

  const s: string

):DWord;

Description

StrToDWord will convert the string S to a DWord value, and returns the value.

Errors

In case the string S is not a valid number, or is a value outside the DWord range, an EConvertError exception will be raised.

See also

TryStrToDWord | Try to convert a string to DWord (cardinal)
StrToDWordDef | Convert string to DWord (cardinal), using default


StrToDWordDef

Convert string to DWord (cardinal), using default

Declaration

Source position: sysstrh.inc line 123

function StrToDWordDef(

  const S: string;

  Default: DWord

):DWord;

Description

StrToDWordDef will try to convert the string S to a DWord value. If the conversion was succesful, it returns the value.

If the conversion failed, the fallback value in Default is returned.

See also

TryStrToDWord | Try to convert a string to DWord (cardinal)
StrToDWord | Convert string to DWord (cardinal)


StrToFloat

Convert a string to a floating-point value.

Declaration

Source position: sysstrh.inc line 173

function StrToFloat(

  const S: string

):Extended;

function StrToFloat(

  const S: string;

  const FormatSettings: TFormatSettings

):Extended;

Description

StrToFloat converts the string S to a floating point value. S should contain a valid string representation of a floating point value (either in decimal or scientific notation). The thousandseparator character may however not be used.

Up to and including version 2.2.2 of the compiler, if the string contains a decimal value, then the decimal separator character can either be a '.' or the value of the DecimalSeparator variable.

As of version 2.3.1, the string may contain only the DecimalSeparator character. The dot ('.') can no longer be used instead of the DecimalSeparator.

Errors

If the string S doesn't contain a valid floating point string, then an exception will be raised.

See also

TextToFloat | Convert a buffer to a float value.
FloatToStr | Convert a float value to a string using a fixed format.
FormatFloat | Format a float according to a certain mask.
StrToInt | Convert a string to an integer value.

Example

Program Example90;

{ This program demonstrates the StrToFloat function }
{$mode objfpc}
{$h+ }

Uses SysUtils;

Const
  NrValues = 5;
  TestStr : Array[1..NrValues] of string =
           ('1,1','-0,2','1,2E-4','0','1E4');

Procedure Testit;

Var
  I : Integer;
  E : Extended;

begin
  Writeln('Using DecimalSeparator : ',DecimalSeparator);
  For I:=1 to NrValues do
    begin
    Writeln('Converting : ',TestStr[i]);
    Try
      E:=StrToFloat(TestStr[i]);
      Writeln('Converted value : ',E);
    except
      On E : Exception do
        Writeln('Exception when converting : ',E.Message);
    end;
    end;
end;

Begin
  DecimalSeparator:=',';
  Testit;
  DecimalSeparator:='.';
  Testit;
End.


StrToFloatDef

Convert a string to a float, with a default value.

Declaration

Source position: sysstrh.inc line 175

function StrToFloatDef(

  const S: string;

  const Default: Extended

):Extended;

function StrToFloatDef(

  const S: string;

  const Default: Extended;

  const FormatSettings: TFormatSettings

):Extended;

Description

StrToFloatDef tries to convert the string S to a floating point value, and returns this value. If the conversion fails for some reason, the value Default is returned instead.

Errors

None. On error, the Default value is returned.


StrToInt

Convert a string to an integer value.

Declaration

Source position: sysstrh.inc line 114

function StrToInt(

  const s: string

):LongInt;

Description

StrToInt will convert the string Sto an integer. If the string contains invalid characters or has an invalid format, then an EConvertError is raised.

To be successfully converted, a string can contain a combination of numerical characters, possibly preceded by a minus sign (-). Spaces are not allowed.

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.

For hexadecimal values, the prefix '0x' or 'x' (case insensitive) may be used as well.

Errors

In case of error, an EConvertError is raised.

See also

IntToStr | Convert an integer value to a decimal string.
StrToIntDef | Convert a string to an integer value, with a default value.
EConvertError | Conversion error.

Example

Program Example82;

{$mode objfpc}

{ This program demonstrates the StrToInt function }

Uses sysutils;

Begin
  Writeln (StrToInt('1234'));
  Writeln (StrToInt('-1234'));
  Writeln (StrToInt('0'));
  Try
    Writeln (StrToInt('12345678901234567890'));
  except
    On E : EConvertError do
      Writeln ('Invalid number encountered');
  end;
End.


StrToInt64

Convert a string to an Int64 value.

Declaration

Source position: sysstrh.inc line 116

function StrToInt64(

  const s: string

):Int64;

Description

StrToInt64 converts the string S to a Int64 value, and returns this value. The string can only contain numerical characters, and optionally a minus sign as the first character. Whitespace is not allowed.

Hexadecimal values (starting with the $ character) are supported.

Errors

On error, a EConvertError exception is raised.

See also

TryStrToInt64 | Try to convert a string to an int64 value, and report on success.
StrToInt64Def | Convert a string to an Int64 value, with a default value
StrToInt | Convert a string to an integer value.
TryStrToInt | Try to convert a string to an integer, and report on success.
StrToIntDef | Convert a string to an integer value, with a default value.


StrToInt64Def

Convert a string to an Int64 value, with a default value

Declaration

Source position: sysstrh.inc line 124

function StrToInt64Def(

  const S: string;

  Default: Int64

):Int64;

Description

StrToInt64Def tries to convert the string S to a Int64 value, and returns this value. If the conversion fails for some reason, the value Default is returned instead.

Errors

None. On error, the Default value is returned.

See also

StrToInt64 | Convert a string to an Int64 value.
TryStrToInt64 | Try to convert a string to an int64 value, and report on success.
StrToInt | Convert a string to an integer value.
TryStrToInt | Try to convert a string to an integer, and report on success.
StrToIntDef | Convert a string to an integer value, with a default value.


StrToIntDef

Convert a string to an integer value, with a default value.

Declaration

Source position: sysstrh.inc line 122

function StrToIntDef(

  const S: string;

  Default: LongInt

):LongInt;

Description

StrToIntDef will convert a string to an integer. If the string contains invalid characters or has an invalid format, then Default is returned.

To be successfully converted, a string can contain a combination of numerical characters, possibly preceded by a minus sign (-). Spaces are not allowed.

Errors

None.

See also

IntToStr | Convert an integer value to a decimal string.
StrToInt | Convert a string to an integer value.

Example

Program Example82;

{$mode objfpc}

{ This program demonstrates the StrToInt function }

Uses sysutils;

Begin
  Writeln (StrToIntDef('1234',0));
  Writeln (StrToIntDef('-1234',0));
  Writeln (StrToIntDef('0',0));
  Try
    Writeln (StrToIntDef('12345678901234567890',0));
  except
    On E : EConvertError do
      Writeln ('Invalid number encountered');
  end;
End.


StrToQWord

Convert a string to a QWord.

Declaration

Source position: sysstrh.inc line 117

function StrToQWord(

  const s: string

):QWord;

Description

TryStrToQWord converts the string S to a valid QWord (unsigned 64-bit) value, and returns the result.

Errors

If the string S does not contain a valid QWord value, a EConvertError exception is raised.

See also

TryStrToQWord | Try to convert a string to a QWord value, and report on success
StrToQWordDef | Try to convert a string to a QWord, returning a default value in case of failure.
StrToInt64 | Convert a string to an Int64 value.
StrToInt | Convert a string to an integer value.


StrToQWordDef

Try to convert a string to a QWord, returning a default value in case of failure.

Declaration

Source position: sysstrh.inc line 125

function StrToQWordDef(

  const S: string;

  Default: QWord

):QWord;

Description

StrToQWordDef tries to convert the string S to a valid QWord (unsigned 64-bit) value, and returns the result. If the conversion fails, the function returns the value passed in Def.

See also

StrToQWord | Convert a string to a QWord.
TryStrToQWord | Try to convert a string to a QWord value, and report on success
StrToInt64Def | Convert a string to an Int64 value, with a default value
StrToIntDef | Convert a string to an integer value, with a default value.


StrToTime

Convert a time string to a TDateTime value.

Declaration

Source position: datih.inc line 143

function StrToTime(

  const S: Shortstring

):TDateTime;

function StrToTime(

  const S: Ansistring

):TDateTime;

function StrToTime(

  const S: ShortString;

  separator: Char

):TDateTime;

function StrToTime(

  const S: AnsiString;

  separator: Char

):TDateTime;

function StrToTime(

  const S: string;

  FormatSettings: TFormatSettings

):TDateTime;

function StrToTime(

  const S: PChar;

  Len: Integer;

  separator: Char = #0

):TDateTime;

Description

StrToTime converts the string S to a TDateTime time value. The time must consist of 1 to 4 digits, separated by the TimeSeparator character. If two numbers are given, they are supposed to form the hour and minutes.

Errors

On error (e.g. an invalid date or invalid character), an EConvertError exception is raised.

See also

StrToDate | Convert a date string to a TDateTime value.
StrToDateTime | Convert a date/time string to a TDateTime value.
TimeToStr | Convert a TDateTime time to a string using a predefined format.
EConvertError | Conversion error.

Example

Program Example21;

{ This program demonstrates the StrToTime function }

Uses sysutils;

Procedure TestStr (S : String);

begin
  Writeln (S,' : ',TimeToStr(StrToTime(S)));
end;

Begin
  teststr (TimeToStr(Time));
  teststr ('12:00');
  teststr ('15:30');
  teststr ('3:30PM');
End.


StrToTimeDef

Convert string to time, returning a default value

Declaration

Source position: datih.inc line 182

function StrToTimeDef(

  const S: ShortString;

  const Defvalue: TDateTime

):TDateTime;

function StrToTimeDef(

  const S: ShortString;

  const Defvalue: TDateTime;

  separator: Char

):TDateTime;

function StrToTimeDef(

  const S: AnsiString;

  const Defvalue: TDateTime

):TDateTime;

function StrToTimeDef(

  const S: AnsiString;

  const Defvalue: TDateTime;

  separator: Char

):TDateTime;

Description

StrToTimeDef tries to convert the string S to a valid TDateTime time value, and returns DefValue if S does not contain a valid time indication.

Errors

None.

See also

StrToTime | Convert a time string to a TDateTime value.
TryStrToTime | Try to convert a string with a time indication to a TDateTime value
StrToDateDef | Convert string to date, returning a default value


strupper

Convert null-terminated string to all-uppercase

Declaration

Source position: syspchh.inc line 32

function strupper(

  p: PChar

):PChar;

function strupper(

  p: PWideChar

):PWideChar;

Description

Converts P to an all-uppercase string. Returns P.

For an example, see StrLower

Errors

None.

See also

StrLower

Convert null-terminated string to all-lowercase.


Supports

Check whether a class or given interface supports an interface

Declaration

Source position: intfh.inc line 18

function Supports(

  const Instance: IInterface;

  const AClass: TClass;

  out Obj

):Boolean; overload;

function Supports(

  const Instance: IInterface;

  const IID: TGuid;

  out Intf

):Boolean; overload;

function Supports(

  const Instance: TObject;

  const IID: TGuid;

  out Intf

):Boolean; overload;

function Supports(

  const Instance: TObject;

  const IID: Shortstring;

  out Intf

):Boolean; overload;

function Supports(

  const Instance: IInterface;

  const AClass: TClass

):Boolean; overload;

function Supports(

  const Instance: IInterface;

  const IID: TGuid

):Boolean; overload;

function Supports(

  const Instance: TObject;

  const IID: TGuid

):Boolean; overload;

function Supports(

  const Instance: TObject;

  const IID: Shortstring

):Boolean; overload;

function Supports(

  const AClass: TClass;

  const IID: TGuid

):Boolean; overload;

function Supports(

  const AClass: TClass;

  const IID: Shortstring

):Boolean; overload;

Description

Supports checks whether Instance supports the interface identified by IID. It returns True if it is supported, False. Optionally, a pointer to the interface is returned to Intf.

Errors

None.

See also

StringToGUID

Convert a string to a native TGUID type.


SysErrorMessage

Format a system error message.

Declaration

Source position: sysutilh.inc line 246

function SysErrorMessage(

  ErrorCode: Integer

):string;

Description

SysErrorMessage returns a string that describes the operating system error code ErrorCode.

Errors

This routine may not be implemented on all platforms.

See also

EOSError

Operating system error.


SystemTimeToDateTime

Convert a system time to a TDateTime value.

Declaration

Source position: datih.inc line 124

function SystemTimeToDateTime(

  const SystemTime: TSystemTime

):TDateTime;

Description

SystemTimeToDateTime converts a TSystemTime record to a TDateTime style date/time indication.

Errors

None.

See also

DateTimeToSystemTime

Converts a TDateTime value to a systemtime structure.

Example

Program Example22;

{ This program demonstrates the SystemTimeToDateTime function }

Uses sysutils;

Var ST : TSystemTime;

Begin
  DateTimeToSystemTime(Now,ST);
  With St do
    begin
    Writeln ('Today is    ',year,'/',month,'/',Day);
    Writeln ('The time is ',Hour,':',minute,':',Second,'.',MilliSecond);
    end;
  Writeln ('Converted : ',DateTimeToStr(SystemTimeToDateTime(ST)));
End.


TextToFloat

Convert a buffer to a float value.

Declaration

Source position: sysstrh.inc line 185

function TextToFloat(

  Buffer: PChar;

  out Value: Extended

):Boolean;

function TextToFloat(

  Buffer: PChar;

  out Value: Extended;

  const FormatSettings: TFormatSettings

):Boolean;

function TextToFloat(

  Buffer: PChar;

  out Value;

  ValueType: TFloatValue

):Boolean;

function TextToFloat(

  Buffer: PChar;

  out Value;

  ValueType: TFloatValue;

  const FormatSettings: TFormatSettings

):Boolean;

Description

TextToFloat converts the string in Buffer to a floating point value. Buffer should contain a valid stroing representation of a floating point value (either in decimal or scientific notation).

If the buffer contains a decimal value, then the decimal separator character must be the value of the DecimalSeparator variable.

Remark: Note that this behaviour has changed, earlier implementations also allowed the use of '.' in addition to the decimal separator character.

The function returns True if the conversion was successful.

Errors

If there is an invalid character in the buffer, then the function returns False

See also

StrToFloat | Convert a string to a floating-point value.
FloatToStr | Convert a float value to a string using a fixed format.
FormatFloat | Format a float according to a certain mask.

Example

Program Example91;

{ This program demonstrates the TextToFloat function }
{$mode objfpc}
{$h+ }

Uses SysUtils;

Const
  NrValues = 5;
  TestStr : Array[1..NrValues] of pchar =
           ('1,1','-0,2','1,2E-4','0','1E4');

Procedure Testit;

Var
  I : Integer;
  E : Extended;

begin
  Writeln('Using DecimalSeparator : ',DecimalSeparator);
  For I:=1 to NrValues do
    begin
    Writeln('Converting : ',TestStr[i]);
    If TextToFloat(TestStr[i],E) then
      Writeln('Converted value : ',E)
    else
      Writeln('Unable to convert value.');
    end;
end;

Begin
  DecimalSeparator:=',';
  Testit;
  DecimalSeparator:='.';
  Testit;
End.


Time

Returns the current time.

Declaration

Source position: datih.inc line 127

function Time: TDateTime;

Description

Time returns the current time in TDateTime format. The date part of the TDateTimeValue is set to zero.

Errors

None.

See also

Now | Returns the current date and time.
Date | Return the current date.

Example

Program Example23;

{ This program demonstrates the Time function }

Uses sysutils;

Begin
  Writeln ('The time is : ',TimeToStr(Time));
End.


TimeAMString

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

TimeAMString (deprecated)

AM indicator string.

Declaration

Source position: sysinth.inc line 121

var TimeAMString: string = ;

Description

TimeAMString is used to display the AM symbol in the time formatting routines. It is used by the time formatting routines. The initialization routines of the SysUtils unit initialize this string with a value conforming to the regional preferences of the user or system regional default.

This constant is deprecated. You should use DefaultFormatSettings.TimeAMString instead.

See also

ShortTimeFormat | Short time format string (subject to locale).
FormatDateTime | Return a string representation of a TDateTime value with a given format.
LongTimeFormat | Long time format string (subject to locale)
TimePMString | PM indicator string.
DefaultFormatSettings | Storage for default settings


TimePMString

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

TimePMString (deprecated)

PM indicator string.

Declaration

Source position: sysinth.inc line 124

var TimePMString: string = ;

Description

TimePMString is used to display the PM symbol in the time formatting routines. It is used by the time formatting routines. The initialization routines of the SysUtils unit initialize this string with a value conforming to the regional preferences of the user or system regional default.

This constant is deprecated. You should use DefaultFormatSettings.TimePMString instead.

See also

ShortTimeFormat | Short time format string (subject to locale).
FormatDateTime | Return a string representation of a TDateTime value with a given format.
LongTimeFormat | Long time format string (subject to locale)
TimeAMString | AM indicator string.
DefaultFormatSettings | Storage for default settings


TimeSeparator

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

TimeSeparator (deprecated)

Time separator character.

Declaration

Source position: sysinth.inc line 118

var TimeSeparator: Char = ;

Description

TimeSeparator is used by the time formatting routines to separate the hours from the minutes and the minutes from the seconds. It is used by the time formatting routines. The initialization routines of the SysUtils unit initialize this string with a value conforming to the regional preferences of the user or system regional default.

See also

ShortTimeFormat | Short time format string (subject to locale).
FormatDateTime | Return a string representation of a TDateTime value with a given format.
LongTimeFormat | Long time format string (subject to locale)
TimeAMString | AM indicator string.
TimePMString | PM indicator string.


TimeStampToDateTime

Convert a TimeStamp value to a TDateTime value.

Declaration

Source position: datih.inc line 112

function TimeStampToDateTime(

  const TimeStamp: TTimeStamp

):TDateTime;

Description

TimeStampToDateTime converts TimeStamp to a TDateTime format variable. It is the inverse operation of DateTimeToTimeStamp.

Errors

None.

See also

DateTimeToTimeStamp | Converts a TDateTime value to a TimeStamp structure.
TimeStampToMSecs | Converts a timestamp to a number of milliseconds.

Example

Program Example24;

{ This program demonstrates the TimeStampToDateTime function }

Uses sysutils;

Var TS : TTimeStamp;
    DT : TDateTime;

Begin
  TS:=DateTimeToTimeStamp (Now);
  With TS do
    begin
    Writeln ('Now is ',time,' millisecond past midnight');
    Writeln ('Today is ' ,Date,' days past 1/1/0001');
    end;
  DT:=TimeStampToDateTime(TS);
  Writeln ('Together this is : ',DateTimeToStr(DT));
End.


TimeStampToMSecs

Converts a timestamp to a number of milliseconds.

Declaration

Source position: datih.inc line 114

function TimeStampToMSecs(

  const TimeStamp: TTimeStamp

):comp;

Description

TimeStampToMSecs converts TimeStamp to the number of milliseconds since 1/1/0001.

Use TTimeStamp variables if you need to keep very precise track of time.

For an example, see MSecsToTimeStamp.

Errors

None.

See also

MSecsToTimeStamp | Convert a number of milliseconds to a TDateTime value.
TimeStampToDateTime | Convert a TimeStamp value to a TDateTime value.


TimeToStr

Convert a TDateTime time to a string using a predefined format.

Declaration

Source position: datih.inc line 134

function TimeToStr(

  Time: TDateTime

):string;

function TimeToStr(

  Time: TDateTime;

  const FormatSettings: TFormatSettings

):string;

Description

TimeToStr converts the time in Time to a string. It uses the LongTimeFormat variable to see what formatting needs to be applied. It is therefor entirely equivalent to a FormatDateTime('tt',Time) call.

Errors

None.

Example

Program Example25;

{ This program demonstrates the TimeToStr function }

Uses sysutils;

Begin
  Writeln ('The current time is : ',TimeToStr(Time));
End.


Trim

Trim whitespace from the ends of a string.

Declaration

Source position: sysstrh.inc line 98

function Trim(

  const S: string

):string;

function Trim(

  const S: WideString

):WideString;

function Trim(

  const S: UnicodeString

):UnicodeString;

Description

Trim strips blank characters (spaces and control characters) at the beginning and end of S and returns the resulting string. All characters with ordinal values less than or equal to 32 (a space) are stripped.

If the string contains only spaces, an empty string is returned.

Errors

None.

See also

TrimLeft | Trim whitespace from the beginning of a string.
TrimRight | Trim whitespace from the end of a string.

Example

Program Example84;

{ This program demonstrates the Trim function }

Uses sysutils;
{$H+}

Procedure Testit (S : String);

begin
  Writeln ('"',Trim(S),'"');
end;

Begin
  Testit ('  ha ha what gets lost ? ');
  Testit (#10#13'haha ');
  Testit ('              ');
End.


TrimLeft

Trim whitespace from the beginning of a string.

Declaration

Source position: sysstrh.inc line 99

function TrimLeft(

  const S: string

):string;

function TrimLeft(

  const S: WideString

):WideString;

function TrimLeft(

  const S: UnicodeString

):UnicodeString;

Description

Trim strips blank characters (spaces and control characters) at the beginning of S and returns the resulting string. All characters with ordinal values less than or equal to 32 (a space) are stripped.

If the string contains only spaces, an empty string is returned.

Errors

None.

See also

Trim | Trim whitespace from the ends of a string.
TrimRight | Trim whitespace from the end of a string.

Example

Program Example85;

{ This program demonstrates the TrimLeft function }

Uses sysutils;
{$H+}

Procedure Testit (S : String);

begin
  Writeln ('"',TrimLeft(S),'"');
end;

Begin
  Testit ('  ha ha what gets lost ? ');
  Testit (#10#13'haha ');
  Testit ('              ');
End.


TrimRight

Trim whitespace from the end of a string.

Declaration

Source position: sysstrh.inc line 100

function TrimRight(

  const S: string

):string;

function TrimRight(

  const S: WideString

):WideString;

function TrimRight(

  const S: UnicodeString

):UnicodeString;

Description

Trim strips blank characters (spaces and control characters) at the end of S and returns the resulting string. All characters with ordinal values less than or equal to 32 (a space) are stripped.

If the string contains only spaces, an empty string is returned.

Errors

None.

See also

Trim | Trim whitespace from the ends of a string.
TrimLeft | Trim whitespace from the beginning of a string.

Example

Program Example86;

{ This program demonstrates the TrimRight function }

Uses sysutils;
{$H+}

Procedure Testit (S : String);

begin
  Writeln ('"',TrimRight(S),'"');
end;

Begin
  Testit ('  ha ha what gets lost ? ');
  Testit (#10#13'haha ');
  Testit ('              ');
End.


TryEncodeDate

Try to encode a date, and indicate success.

Declaration

Source position: datih.inc line 115

function TryEncodeDate(

  Year: Word;

  Month: Word;

  Day: Word;

  out Date: TDateTime

):Boolean;

Description

TryEncodeDate will check the validity of the Year, Month and Day arguments, and if they are all valid, then they will be encoded as a TDateTime value and returned in Date. The function will return True in this case. If an invalid argument is passed, then False will be returned.

Errors

None. If an error occurs during the encoding, False is returned.

See also

EncodeDate | Encode a Year,Month,Day to a TDateTime value.
DecodeDateFully | Decode a date with additional date of the week.
DecodeDate | Decode a TDateTime to a year,month,day triplet
TryEncodeTime | Try to encode a time, and indicate success.


TryEncodeTime

Try to encode a time, and indicate success.

Declaration

Source position: datih.inc line 116

function TryEncodeTime(

  Hour: Word;

  Min: Word;

  Sec: Word;

  MSec: Word;

  out Time: TDateTime

):Boolean;

Description

TryEncodeTime will check the validity of the Hour, Min, Sec and MSec arguments, and will encode them in a TDateTime value which is returned in Time. If the arguments are valid, then True is returned, otherwise False is returned.

Errors

None. If an error occurs during the encoding, False is returned.

See also

EncodeTime | Encode a Hour,Min,Sec,millisec to a TDateTime value.
DecodeTime | Decode a TDateTime to a hour,minute,second,millisec quartet
TryEncodeDate | Try to encode a date, and indicate success.


TryFloatToCurr

Try to convert a float value to a currency value and report on success.

Declaration

Source position: sysstrh.inc line 193

function TryFloatToCurr(

  const Value: Extended;

  var AResult: Currency

):Boolean;

Description

TryFloatToCurr tries convert the Value floating point value to a Currency value. If successful, the function returns True and the resulting currency value is returned in AResult. It checks whether Value is in the valid range of currencies (determined by MinCurrency and MaxCurrency). If not, False is returned.

Errors

If Value is out of range, False is returned.

See also

FloatToCurr | Convert a float to a Currency value.
MinCurrency | Minimum Currency value
MaxCurrency | Maximum currency value


TryStringToGUID

Try to transform a string to a GUID

Declaration

Source position: intfh.inc line 32

function TryStringToGUID(

  const S: string;

  out Guid: TGuid

):Boolean;

Description

TryStringToGUID tries to convert the string S to a TGUID value, returned in GUID. It returns True if the conversion succeeds, and False if the string S does not contain a valid GUID notation. The string S must be 38 characters long, must start with { and end on }, and contain a valid GUID string (hex number grouped using 8-4-4-4-12 digits).

Errors

In case S does not contain a valid GUID number, False is returned.

See also

StringToGUID

Convert a string to a native TGUID type.


TryStrToBool

Try to convert a string to a boolean value

Declaration

Source position: sysstrh.inc line 219

function TryStrToBool(

  const S: string;

  out Value: Boolean

):Boolean;

Description

TryStrToBool tries to convert the string S to a boolean value, and returns this value in Value. In this case, the function returns True. If S does not contain a valid boolean string, the function returns False, and the contents of Value is indetermined.

Valid boolean string constants are in the FalseBoolStrs (for False values) and TrueBoolStrs (for True values) variables.

See also

StrToBool | Convert a string to a boolean value
StrToBoolDef | Convert string to boolean value, returning default in case of error


TryStrToCurr

Try to convert a string to a currency

Declaration

Source position: sysstrh.inc line 199

function TryStrToCurr(

  const S: string;

  out Value: Currency

):Boolean;

function TryStrToCurr(

  const S: string;

  out Value: Currency;

  const FormatSettings: TFormatSettings

):Boolean;

Description

TryStrToCurr converts the string S to a currency value and returns the value in Value. The function returns True if it was successful, False if not. This is contrary to StrToCurr, which raises an exception when the conversion fails.

The function takes into account locale information.

See also

StrToCurr | Convert a string to a currency value
TextToFloat | Convert a buffer to a float value.


TryStrToDate

Try to convert a string with a date indication to a TDateTime value

Declaration

Source position: datih.inc line 161

function TryStrToDate(

  const S: ShortString;

  out Value: TDateTime

):Boolean;

function TryStrToDate(

  const S: AnsiString;

  out Value: TDateTime

):Boolean;

function TryStrToDate(

  const S: ShortString;

  out Value: TDateTime;

  separator: Char

):Boolean;

function TryStrToDate(

  const S: AnsiString;

  out Value: TDateTime;

  separator: Char

):Boolean;

function TryStrToDate(

  const S: ShortString;

  out Value: TDateTime;

  const useformat: string;

  separator: Char = #0

):Boolean;

function TryStrToDate(

  const S: AnsiString;

  out Value: TDateTime;

  const useformat: string;

  separator: Char = #0

):Boolean;

function TryStrToDate(

  const S: string;

  out Value: TDateTime;

  const FormatSettings: TFormatSettings

):Boolean;

Description

TryStrToDate tries to convert the string S to a TDateTime date value, and stores the date in Value. The Date must consist of 1 to three digits, separated by the DateSeparator character. If two numbers are given, they are supposed to form the day and month of the current year. If only one number is given, it is supposed to represent the day of the current month. (This is not supported in Delphi)

The order of the digits (y/m/d, m/d/y, d/m/y) is determined from the ShortDateFormat variable.

The function returns True if the string contained a valid date indication, False otherwise.

See also

StrToDate | Convert a date string to a TDateTime value.
StrToTime | Convert a time string to a TDateTime value.
TryStrToTime | Try to convert a string with a time indication to a TDateTime value
TryStrToDateTime | Try to convert a string with date/time indication to a TDateTime value
DateToStr | Converts a TDateTime value to a date string with a predefined format.
TimeToStr | Convert a TDateTime time to a string using a predefined format.


TryStrToDateTime

Try to convert a string with date/time indication to a TDateTime value

Declaration

Source position: datih.inc line 173

function TryStrToDateTime(

  const S: ShortString;

  out Value: TDateTime

):Boolean;

function TryStrToDateTime(

  const S: AnsiString;

  out Value: TDateTime

):Boolean;

function TryStrToDateTime(

  const S: string;

  out Value: TDateTime;

  const FormatSettings: TFormatSettings

):Boolean;

Description

TryStrToDateTime tries to convert the string S to a TDateTime date and time value, and stores the result in Value. The date must consist of 1 to three digits, separated by the DateSeparator character. If two numbers are given, they are supposed to form the day and month of the current year. If only one number is given, it is supposed to represent the day of the current month (This is not supported in Delphi). The time must consist of 1 to 4 digits, separated by the TimeSeparator character. If two numbers are given, they are supposed to form the hour and minutes.

The function returns True if the string contained a valid date and time indication, False otherwise.

See also

TryStrToDate | Try to convert a string with a date indication to a TDateTime value
TryStrToTime | Try to convert a string with a time indication to a TDateTime value
StrToDateTime | Convert a date/time string to a TDateTime value.
StrToTime | Convert a time string to a TDateTime value.
DateToStr | Converts a TDateTime value to a date string with a predefined format.
TimeToStr | Convert a TDateTime time to a string using a predefined format.


TryStrToDWord

Try to convert a string to DWord (cardinal)

Declaration

Source position: sysstrh.inc line 119

function TryStrToDWord(

  const s: string;

  out D: DWord

):Boolean;

Description

TryStrToDWord will try to convert the string S to a DWord value. It returns True if the conversion was succesful, and in that case returns the value in D.

If the conversion failed or the value was outside of the valid range for DWord values, False is returned.

See also

StrToDWord | Convert string to DWord (cardinal)
StrToDWordDef | Convert string to DWord (cardinal), using default


TryStrToFloat

Try to convert a string to a float.

Declaration

Source position: sysstrh.inc line 177

function TryStrToFloat(

  const S: string;

  out Value: Single

):Boolean;

function TryStrToFloat(

  const S: string;

  out Value: Single;

  const FormatSettings: TFormatSettings

):Boolean;

function TryStrToFloat(

  const S: string;

  out Value: Double

):Boolean;

function TryStrToFloat(

  const S: string;

  out Value: Double;

  const FormatSettings: TFormatSettings

):Boolean;

function TryStrToFloat(

  const S: string;

  out Value: Extended

):Boolean;

function TryStrToFloat(

  const S: string;

  out Value: Extended;

  const FormatSettings: TFormatSettings

):Boolean;

Description

TryStrToFloat tries to convert the string S to a floating point value, and stores the result in Value. It returns True if the operation was succesful, and False if it failed. This operation takes into account the system settings for floating point representations.

Errors

On error, False is returned.

See also

StrToFloat

Convert a string to a floating-point value.


TryStrToInt

Try to convert a string to an integer, and report on success.

Declaration

Source position: sysstrh.inc line 118

function TryStrToInt(

  const s: string;

  out i: LongInt

):Boolean;

Description

TryStrToInt tries to convert the string S to an integer, and returns True if this was succesful. In that case the converted integer is returned in I. If the conversion failed, (an invalid string, or the value is out of range) then False is returned.

Errors

None. On error, False is returned.

See also

StrToInt | Convert a string to an integer value.
TryStrToInt64 | Try to convert a string to an int64 value, and report on success.
StrToIntDef | Convert a string to an integer value, with a default value.
StrToInt64 | Convert a string to an Int64 value.
StrToInt64Def | Convert a string to an Int64 value, with a default value


TryStrToInt64

Try to convert a string to an int64 value, and report on success.

Declaration

Source position: sysstrh.inc line 120

function TryStrToInt64(

  const s: string;

  out i: Int64

):Boolean;

Description

TryStrToInt64 tries to convert the string S to a Int64 value, and returns this value in I if successful. If the conversion was succesful, the function result is True, or False otherwise. The string can only contain numerical characters, and optionally a minus sign as the first character. Whitespace is not allowed.

Hexadecimal values (starting with the $ character) are supported.

Errors

None. On error, False is returned.

See also

StrToInt64 | Convert a string to an Int64 value.
StrToInt64Def | Convert a string to an Int64 value, with a default value
StrToInt | Convert a string to an integer value.
TryStrToInt | Try to convert a string to an integer, and report on success.
StrToIntDef | Convert a string to an integer value, with a default value.


TryStrToQWord

Try to convert a string to a QWord value, and report on success

Declaration

Source position: sysstrh.inc line 121

function TryStrToQWord(

  const s: string;

  out Q: QWord

):Boolean;

Description

TryStrToQWord tries to convert the string S to a valid QWord (unsigned 64-bit) value, and stores the result in I. If the conversion fails, the function returns False, else it returns True.

See also

StrToQWord | Convert a string to a QWord.
StrToQWordDef | Try to convert a string to a QWord, returning a default value in case of failure.
TryStrToInt64 | Try to convert a string to an int64 value, and report on success.
TryStrToInt | Try to convert a string to an integer, and report on success.


TryStrToTime

Try to convert a string with a time indication to a TDateTime value

Declaration

Source position: datih.inc line 165

function TryStrToTime(

  const S: ShortString;

  out Value: TDateTime

):Boolean;

function TryStrToTime(

  const S: AnsiString;

  out Value: TDateTime

):Boolean;

function TryStrToTime(

  const S: ShortString;

  out Value: TDateTime;

  separator: Char

):Boolean;

function TryStrToTime(

  const S: AnsiString;

  out Value: TDateTime;

  separator: Char

):Boolean;

function TryStrToTime(

  const S: string;

  out Value: TDateTime;

  const FormatSettings: TFormatSettings

):Boolean;

Description

TryStrToTime tries to convert the string S to a TDateTime time value, and stores the result in Value. The time must consist of 1 to 4 digits, separated by the TimeSeparator character. If two numbers are given, they are supposed to form the hour and minutes.

The function returns True if the string contained a valid time indication, False otherwise.

See also

TryStrToDate | Try to convert a string with a date indication to a TDateTime value
TryStrToDateTime | Try to convert a string with date/time indication to a TDateTime value
StrToDate | Convert a date string to a TDateTime value.
StrToTime | Convert a time string to a TDateTime value.
DateToStr | Converts a TDateTime value to a date string with a predefined format.
TimeToStr | Convert a TDateTime time to a string using a predefined format.


UnhookSignal

UnHook a specified signal

Declaration

Source position: sysutils.pp line 81

procedure UnhookSignal(

  RtlSigNum: Integer;

  OnlyIfHooked: Boolean = True

);

Description

UnHookSignal de-installs the RTL default signal handler for signal RtlSigNum. If OnlyIfHooked is True then UnhookSignal will first check if the signal was hooked by the RTL routines, and has not been overridden since.


UnicodeCompareStr

Compare 2 unicode strings

Declaration

Source position: sysunih.inc line 26

function UnicodeCompareStr(

  const s1: UnicodeString;

  const s2: UnicodeString

):PtrInt;

Description

UnicodeCompareStr compares 2 unicode strings S1 and S2 in a case sensitive manner. The result of the function is

< 0
If S1<S2
0
If S1=S2
> 0
If S1>S2

This function relies on a widestring manager to perform the actual comparison, as it will take into account various equivalent code points: it is not a simple byte-by-byte comparison.

See also

UnicodeCompareText | Compare 2 strings case insentivively
CompareStr | Compare 2 ansistrings case-sensitively, ignoring special characters.
CompareText | Compare 2 ansistrings case insensitive.
UnicodeSameStr | Check whether 2 strings are equal


UnicodeCompareText

Compare 2 strings case insentivively

Declaration

Source position: sysunih.inc line 28

function UnicodeCompareText(

  const s1: UnicodeString;

  const s2: UnicodeString

):PtrInt;

Description

UnicodeCompareText compares 2 unicode strings S1 and S2, ignoring case. The result of the function is

< 0
If S1<S2
0
If S1=S2
> 0
If S1>S2

This function relies on a widestring manager to perform the actual comparison, as it will take into account various equivalent code points: it is not a simple byte-by-byte comparison.

See also

UnicodeCompareText | Compare 2 strings case insentivively
CompareStr | Compare 2 ansistrings case-sensitively, ignoring special characters.
CompareText | Compare 2 ansistrings case insensitive.
UnicodeSameStr | Check whether 2 strings are equal


UnicodeFmtStr

Format a string with given arguments, procedural version.

Declaration

Source position: sysunih.inc line 35

procedure UnicodeFmtStr(

  var Res: UnicodeString;

  const Fmt: UnicodeString;

  const args: array of Const

);

procedure UnicodeFmtStr(

  var Res: UnicodeString;

  const Fmt: UnicodeString;

  const args: array of Const;

  const FormatSettings: TFormatSettings

);

Description

UnicodeFmtStr calls UnicodeFormat with Fmt and Args as arguments, and stores the result in Res. For more information on how the resulting string is composed, see UnicodeFormat.

Errors

In case of error, an EConvertError exception is raised.

See also

UnicodeFormat | Format unicode string
UnicodeFormatBuf | Format a unicode string with given arguments and store the result in a unicodebuffer.


UnicodeFormat

Format unicode string

Declaration

Source position: sysunih.inc line 31

function UnicodeFormat(

  const Fmt: UnicodeString;

  const Args: array of Const

):UnicodeString;

function UnicodeFormat(

  const Fmt: UnicodeString;

  const Args: array of Const;

  const FormatSettings: TFormatSettings

):UnicodeString;

Description

UnicodeFormat is the unicode equivalent of Format. It follows the same rules and uses the same formatting strings.

Errors

In case of error, an EConvertError exception is raised.

See also

Format | Format a string with given arguments.
UnicodeFormatBuf | Format a unicode string with given arguments and store the result in a unicodebuffer.


UnicodeFormatBuf

Format a unicode string with given arguments and store the result in a unicodebuffer.

Declaration

Source position: sysunih.inc line 33

function UnicodeFormatBuf(

  var Buffer;

  BufLen: Cardinal;

  const Fmt;

  fmtLen: Cardinal;

  const Args: array of Const

):Cardinal;

function UnicodeFormatBuf(

  var Buffer;

  BufLen: Cardinal;

  const Fmt;

  fmtLen: Cardinal;

  const Args: array of Const;

  const FormatSettings: TFormatSettings

):Cardinal;

Description

UnicodeFormatBuf is the unicode equivalent of FormatBuf. It follows the same rules and uses the same formatting st

Errors

In case of error, an EConvertError exception is raised.

See also

FormatBuf | Format a string with given arguments and store the result in a buffer.
UnicodeFormat | Format unicode string


UnicodeLowerCase

Return lowercase version of a string

Declaration

Source position: sysunih.inc line 25

function UnicodeLowerCase(

  const s: UnicodeString

):UnicodeString;

Description

UnicodeLowerCase returns an all-lowercase version of the unicodestring S. It relies on the unicode manager to do so.

See also

UnicodeUpperCase | Return uppercase version of a string
UpperCase | Return an uppercase version of a string.
LowerCase | Return a lowercase version of a string.


UnicodeSameStr

Check whether 2 strings are equal

Declaration

Source position: sysunih.inc line 27

function UnicodeSameStr(

  const s1: UnicodeString;

  const s2: UnicodeString

):Boolean;

Description

UnicodeSameStr checks whether the unicode strings S1 and S2 are equal, case sensitively. The function returns True if the strings are equal, False if they are not. This function relies on a widestring manager to perform the actual comparison, as it will take into account various equivalent code points: it is not a simple byte-by-byte comparison.

See also

UnicodeCompareText | Compare 2 strings case insentivively
CompareStr | Compare 2 ansistrings case-sensitively, ignoring special characters.
CompareText | Compare 2 ansistrings case insensitive.
UnicodeSameText | Check whether 2 strings are the same, ignoring case
SameStr | Check whether 2 strings are the same, case insensitive


UnicodeSameText

Check whether 2 strings are the same, ignoring case

Declaration

Source position: sysunih.inc line 29

function UnicodeSameText(

  const s1: UnicodeString;

  const s2: UnicodeString

):Boolean;

Description

UnicodeSameText checks whether the unicode strings S1 and S2 are equal, ignoring case. The function returns True if the strings are equal, False if they are not. This function relies on a widestring manager to perform the actual comparison, as it will take into account various equivalent code points: it is not a simple byte-by-byte comparison.

See also

UnicodeCompareText | Compare 2 strings case insentivively
CompareStr | Compare 2 ansistrings case-sensitively, ignoring special characters.
CompareText | Compare 2 ansistrings case insensitive.
UnicodeSameStr | Check whether 2 strings are equal
SameText | Checks whether 2 strings are the same (case insensitive)


UnicodeStringReplace

Replace one occurrence of a string with another

Declaration

Source position: sysunih.inc line 70

function UnicodeStringReplace(

  const S: UnicodeString;

  const OldPattern: UnicodeString;

  const NewPattern: UnicodeString;

  Flags: TReplaceFlags

):UnicodeString;

Description

UnicodeStringReplace is the unicode version of StringReplace; it follows the same rules and has the same behaviour, but operates on unicode strings instead of ansistrings.

See also

StringReplace

Replace occurrences of one substring with another in a string.


UnicodeUpperCase

Return uppercase version of a string

Declaration

Source position: sysunih.inc line 24

function UnicodeUpperCase(

  const s: UnicodeString

):UnicodeString;

Description

UnicodeUpperCase returns an all-uppercase version of the unicodestring S. It relies on the unicode manager to do so.

See also

UnicodeLowerCase | Return lowercase version of a string
LowerCase | Return a lowercase version of a string.
UpperCase | Return an uppercase version of a string.


UpperCase

Return an uppercase version of a string.

Declaration

Source position: sysstrh.inc line 71

function UpperCase(

  const s: string

):string; overload;

function UpperCase(

  const s: UnicodeString

):UnicodeString; overload;

Description

UpperCase returns the uppercase equivalent of S. Ansi characters are not taken into account, only ASCII codes below 127 are converted. It is completely equivalent to the UpCase function of the system unit, and is provided for compatiibility only.

Errors

None.

See also

AnsiLowerCase | Return a lowercase version of a string.
LowerCase | Return a lowercase version of a string.
AnsiUpperCase | Return an uppercase version of a string, taking into account special characters.

Example

Program Example87;

{ This program demonstrates the UpperCase function }

Uses sysutils;

Begin
  Writeln (UpperCase('this will come OUT ALL uPpErCaSe !'));
End.


VendorName

Return Application vendor Name

Declaration

Source position: osutilsh.inc line 45

function VendorName: string;

Description

VendorName returns the application vendor name. In order to set the application vendor name, the OnGetVendorName event must be set, and an appropriate return value must be returned. The Vendor name is used in GetAppConfigDir and GetAppConfigFile to determine the configuration directory.

Errors

If OnGetVendorName is not set, an empty string is returned.

See also

OnGetVendorName | Vendor name callback
GetAppConfigDir | Return the appropriate directory for the application's configuration files.
GetAppConfigFile | Return an appropriate name for an application configuration file.


WideBytesOf

Returns the contents of a widestring as an array of bytes

Declaration

Source position: sysunih.inc line 67

function WideBytesOf(

  const Value: UnicodeString

):TBytes;

Description

WideBytesOf returns the contents of the widestring Value as an array of bytes. The array will have as length twice the length of the wide string, as each wide character contains 2 bytes.

See also

StringOf

Create a unicode string from an array of bytes


WideCompareStr

Compare two widestrings (case sensitive)

Declaration

Source position: syswideh.inc line 20

function WideCompareStr(

  const s1: WideString;

  const s2: WideString

):PtrInt;

Description

WideCompareStr compares two widestrings and returns the following result:

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

The comparision takes into account wide characters, i.e. it takes care of strange accented characters. Contrary to WideCompareText, the comparision is case sensitive.

Errors

None.

See also

WideCompareText | Compare two widestrings (ignoring case).
WideSameStr | Check whether two widestrings are the same (case sensitive)
WideSameText | Check whether two widestrings are the same (ignoring case)


WideCompareText

Compare two widestrings (ignoring case).

Declaration

Source position: syswideh.inc line 22

function WideCompareText(

  const s1: WideString;

  const s2: WideString

):PtrInt;

Description

WideCompareStr compares two widestrings and returns the following result:

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

The comparision takes into account wide characters, i.e. it takes care of strange accented characters. Contrary to WideCompareStr, the comparision is case insensitive.

Errors

None.

See also

WideCompareStr | Compare two widestrings (case sensitive)
WideSameStr | Check whether two widestrings are the same (case sensitive)
WideSameText | Check whether two widestrings are the same (ignoring case)


WideFmtStr

Widestring format

Declaration

Source position: syswideh.inc line 29

procedure WideFmtStr(

  var Res: WideString;

  const Fmt: WideString;

  const args: array of Const

);

procedure WideFmtStr(

  var Res: WideString;

  const Fmt: WideString;

  const args: array of Const;

  const FormatSettings: TFormatSettings

);

Description

WideFmtStr formats Args according to the format string in Fmt and returns the resulting string in Res.

See also

WideFormat | Format a wide string.
WideFormatBuf | Format widestring in a buffer.
Format | Format a string with given arguments.


WideFormat

Format a wide string.

Declaration

Source position: syswideh.inc line 25

function WideFormat(

  const Fmt: WideString;

  const Args: array of Const

):WideString;

function WideFormat(

  const Fmt: WideString;

  const Args: array of Const;

  const FormatSettings: TFormatSettings

):WideString;

Description

WideFormat does the same as Format but accepts as a formatting string a WideString. The resulting string is also a WideString.

For more information about the used formatting characters, see the Format string.

See also

Format

Format a string with given arguments.


WideFormatBuf

Format widestring in a buffer.

Declaration

Source position: syswideh.inc line 27

function WideFormatBuf(

  var Buffer;

  BufLen: Cardinal;

  const Fmt;

  fmtLen: Cardinal;

  const Args: array of Const

):Cardinal;

function WideFormatBuf(

  var Buffer;

  BufLen: Cardinal;

  const Fmt;

  fmtLen: Cardinal;

  const Args: array of Const;

  const FormatSettings: TFormatSettings

):Cardinal;

Description

WideFormatBuf calls simply WideFormat with Fmt (with length FmtLen bytes) and stores maximum BufLen bytes in the buffer buf. It returns the number of copied bytes.

See also

WideFmtStr | Widestring format
WideFormat | Format a wide string.
Format | Format a string with given arguments.
FormatBuf | Format a string with given arguments and store the result in a buffer.


WideLowerCase

Change a widestring to all-lowercase.

Declaration

Source position: syswideh.inc line 19

function WideLowerCase(

  const s: WideString

):WideString;

Description

WideLowerCase converts the string S to lowercase characters and returns the resulting string. It takes into account the operating system language settings when doing this, so special characters are converted correctly as well.

Remark: On Unix-like platforms, a widestring manager must be installed for this function to work correctly.

Errors

None.

See also

WideUpperCase

Change a widestring to all-uppercase.


WideSameStr

Check whether two widestrings are the same (case sensitive)

Declaration

Source position: syswideh.inc line 21

function WideSameStr(

  const s1: WideString;

  const s2: WideString

):Boolean;

Description

WideSameStr returns True if WideCompareStr returns 0 (zero), i.e. when S1 and S2 are the same string (taking into account case).

See also

WideSameText | Check whether two widestrings are the same (ignoring case)
WideCompareStr | Compare two widestrings (case sensitive)
WideCompareText | Compare two widestrings (ignoring case).
AnsiSameStr | Checks whether 2 strings are the same (case sensitive)


WideSameText

Check whether two widestrings are the same (ignoring case)

Declaration

Source position: syswideh.inc line 23

function WideSameText(

  const s1: WideString;

  const s2: WideString

):Boolean;

Description

WideSameText returns True if WideCompareText returns 0 (zero), i.e. when S1 and S2 are the same string (taking into account case).

See also

WideSameStr | Check whether two widestrings are the same (case sensitive)
WideCompareStr | Compare two widestrings (case sensitive)
WideCompareText | Compare two widestrings (ignoring case).
AnsiSameText | Checks whether 2 strings are the same (case insensitive)


WideStrAlloc

Allocate a null-terminated widestring on the heap.

Declaration

Source position: sysunih.inc line 59

function WideStrAlloc(

  size: Cardinal

):PWideChar;

Description

WideStrAlloc reserves memory on the heap for a widestring with length Len, (terminating #0#0 included), and returns a pointer to it.

Additionally, WideStrAlloc allocates 4 extra bytes to store the size of the allocated memory.

Errors

None.

See also

StrBufSize | Return the size of a null-terminated string allocated on the heap.
StrDispose | Dispose of a null-terminated string on the heap.
StrAlloc | Allocate memory for a new null-terminated string on the heap


WideStringOf

Create unicode string from array of bytes

Declaration

Source position: sysunih.inc line 68

function WideStringOf(

  const Value: TBytes

):UnicodeString;

Description

WideStringOf converts an array of bytes (Bytes) to a unicode string. It considers each pair of bytes in the array as a single wide char. The array should have an even length. If the length is uneven, the last byte will be ignored.

This function performs the opposite operation of BytesOf.

To create a string where the bytes are interpreted as ansichars, use StringOf instead.

See also

StringOf | Create a unicode string from an array of bytes
WideBytesOf | Returns the contents of a widestring as an array of bytes
BytesOf | Return the bytes in a string


WideStringReplace

Replace occurrences of one substring with another in a widestring.

Declaration

Source position: syswideh.inc line 37

function WideStringReplace(

  const S: WideString;

  const OldPattern: WideString;

  const NewPattern: WideString;

  Flags: TReplaceFlags

):WideString;

Description

WideStringReplace searches the string S for occurrences of the string OldPattern and, if it is found, replaces it with NewPattern. It returns the resulting string. The behaviour of StringReplace can be runed with Flags, which is of type TReplaceFlags. Standard behaviour is to replace only the first occurrence of OldPattern, and to search case sensitively.

Errors

None.

See also

TReplaceFlags | Flags for StringReplace function
StringReplace | Replace occurrences of one substring with another in a string.


WideUpperCase

Change a widestring to all-uppercase.

Declaration

Source position: syswideh.inc line 18

function WideUpperCase(

  const s: WideString

):WideString;

Description

WideUpperCase converts the string S to uppercase characters and returns the resulting string. It takes into account the operating system language settings when doing this, so special characters are converted correctly as well.

Remark: On Unix-like platforms, a widestring manager must be installed for this function to work correctly.

Errors

None.

See also

WideLowerCase

Change a widestring to all-lowercase.


WrapText

Word-wrap a text.

Declaration

Source position: sysstrh.inc line 255

function WrapText(

  const Line: string;

  const BreakStr: string;

  const BreakChars: TSysCharSet;

  MaxCol: Integer

):string;

function WrapText(

  const Line: string;

  MaxCol: Integer

):string;

Description

WrapText does a wordwrap at column MaxCol of the string in Line. It breaks the string only at characters which are in BreakChars (default whitespace and hyphen) and inserts then the string BreakStr (default the lineending character for the current OS).

Portions of text that are between single or double quotes will be considered single words and the text will not be broken between the quotes.

See also

StringReplace

Replace occurrences of one substring with another in a string.


Bounds

Create a rectangle, given a position and size

Declaration

Source position: types.pp line 315

function Bounds(

  ALeft: Integer;

  ATop: Integer;

  AWidth: Integer;

  AHeight: Integer

):TRect;

Description

Bounds returns a TRect structure with the indicated position (Left=ALeft and Top=ATop) and size (Right=ALeft+AWidth and Bottom=ATop+AHeight)

See also

Rect | Create a rectangle record
PtInRect | Check whether a point is inside a rectangle.
IntersectRect | Return the intersection of 2 rectangles
UnionRect | Return the union of 2 rectangles.


CenterPoint

Return the center point of a rectangle

Declaration

Source position: types.pp line 322

function CenterPoint(

  const Rect: TRect

):TPoint;

Description

CenterPoint returns the center point of the rectangle Rect.

See also

PtinRect | Check whether a point is inside a rectangle.
IntersectRect | Return the intersection of 2 rectangles
IsRectEmpty | Check whether a rectangle is empty
OffsetRect | Offset the rectangle
InflateRect | Increase the rectangle in size, keeping it centered
Size | Return the size of the rectangle
IsRectEmpty | Check whether a rectangle is empty


EqualRect

Check if two rectangles are equal.

Declaration

Source position: types.pp line 313

function EqualRect(

  const r1: TRect;

  const r2: TRect

):Boolean;

Description

EqualRect returns True if the rectangles R1 and R2 are equal (i.e. have the position and size). If the rectangles differ, the function returns False

See also

Rect | Create a rectangle record
Bounds | Create a rectangle, given a position and size
PtInRect | Check whether a point is inside a rectangle.
IntersectRect | Return the intersection of 2 rectangles
UnionRect | Return the union of 2 rectangles.
IsRectEmpty | Check whether a rectangle is empty
OffsetRect | Offset the rectangle
InflateRect | Increase the rectangle in size, keeping it centered
Size | Return the size of the rectangle


InflateRect

Increase the rectangle in size, keeping it centered

Declaration

Source position: types.pp line 323

function InflateRect(

  var Rect: TRect;

  dx: Integer;

  dy: Integer

):Boolean;

Description

InflateRect inflates the rectangle horizontally with dx pixels on each side, and vertically with dy pixels, thus keeping its center point on the same location. It returns true if the operation was succesfully, False if it was not (only possible if the address of Rect is Nil).

See also

PtinRect | Check whether a point is inside a rectangle.
IntersectRect | Return the intersection of 2 rectangles
IsRectEmpty | Check whether a rectangle is empty
OffsetRect | Offset the rectangle
CenterPoint | Return the center point of a rectangle
Size | Return the size of the rectangle
IsRectEmpty | Check whether a rectangle is empty


IntersectRect

Return the intersection of 2 rectangles

Declaration

Source position: types.pp line 318

function IntersectRect(

  var Rect: TRect;

  const R1: TRect;

  const R2: TRect

):Boolean;

Description

IntersectRect returns the intersection of the 2 rectangles R1 and R2 in Rect. It returns True if the 2 rectangles have an intersection, otherwise False is returned, and Rect is filled with zero.

See also

PtinRect | Check whether a point is inside a rectangle.
UnionRect | Return the union of 2 rectangles.
IsRectEmpty | Check whether a rectangle is empty
OffsetRect | Offset the rectangle
InflateRect | Increase the rectangle in size, keeping it centered
Size | Return the size of the rectangle


IsRectEmpty

Check whether a rectangle is empty

Declaration

Source position: types.pp line 320

function IsRectEmpty(

  const Rect: TRect

):Boolean;

Description

IsRectEmpty returns true if the rectangle is empty, i.e. has a zero or negative width or height.

See also

PtinRect | Check whether a point is inside a rectangle.
IntersectRect | Return the intersection of 2 rectangles
IsRectEmpty | Check whether a rectangle is empty
OffsetRect | Offset the rectangle
InflateRect | Increase the rectangle in size, keeping it centered
Size | Return the size of the rectangle


OffsetRect

Offset the rectangle

Declaration

Source position: types.pp line 321

function OffsetRect(

  var Rect: TRect;

  DX: Integer;

  DY: Integer

):Boolean;

Description

OffsetRect offsets the rectangle Rect by a horizontal distance DX and a vertical distance DY. The operation returns True if the operation was successfull, false if it was not (only possible if the address of Rect is Nil).

See also

PtinRect | Check whether a point is inside a rectangle.
IntersectRect | Return the intersection of 2 rectangles
IsRectEmpty | Check whether a rectangle is empty
OffsetRect | Offset the rectangle
InflateRect | Increase the rectangle in size, keeping it centered
Size | Return the size of the rectangle
IsRectEmpty | Check whether a rectangle is empty


Point

Create a point

Declaration

Source position: types.pp line 316

function Point(

  x: Integer;

  y: Integer

):TPoint;

Description

Point returns a TPoint structure with the given position (X, Y).

See also

Rect | Create a rectangle record
PtInRect | Check whether a point is inside a rectangle.


PtInRect

Check whether a point is inside a rectangle.

Declaration

Source position: types.pp line 317

function PtInRect(

  const Rect: TRect;

  const p: TPoint

):Boolean;

Description

PtInRect returns True if p is located inside Rect, and False if it is located outside the rectangle.

Remark: Note that the bottom, right edges are not considered part of the rectangle, therefor a point located on one of these edges will not be considered part of the rectangle, meaning that for a record (10,10,100,100) the point (90,100) will not be considered part of the record, but 90,10 will be.

See also

IntersectRect | Return the intersection of 2 rectangles
UnionRect | Return the union of 2 rectangles.
IsRectEmpty | Check whether a rectangle is empty
OffsetRect | Offset the rectangle
InflateRect | Increase the rectangle in size, keeping it centered
Size | Return the size of the rectangle


Rect

Create a rectangle record

Declaration

Source position: types.pp line 314

function Rect(

  Left: Integer;

  Top: Integer;

  Right: Integer;

  Bottom: Integer

):TRect;

Description

Rect returns a rectangle structure with the 4 members Left, Top, Right and Bottom as passed in the arguments.

See also

Bounds | Create a rectangle, given a position and size
PtInRect | Check whether a point is inside a rectangle.
IntersectRect | Return the intersection of 2 rectangles
UnionRect | Return the union of 2 rectangles.
IsRectEmpty | Check whether a rectangle is empty
OffsetRect | Offset the rectangle
InflateRect | Increase the rectangle in size, keeping it centered
Size | Return the size of the rectangle


Size

Return the size of the rectangle

Declaration

Source position: types.pp line 324

function Size(

  AWidth: Integer;

  AHeight: Integer

):TSize;

function Size(

  const ARect: TRect

):TSize;

Description

Size returns a TSize record with the indicated AWidth, AHeight. In the case ARect is passed, the width and height are calculated (taking into account that the right, bottom are not considered part of the rectangle).

See also

PtinRect | Check whether a point is inside a rectangle.
IntersectRect | Return the intersection of 2 rectangles
IsRectEmpty | Check whether a rectangle is empty
OffsetRect | Offset the rectangle
InflateRect | Increase the rectangle in size, keeping it centered
CenterPoint | Return the center point of a rectangle
IsRectEmpty | Check whether a rectangle is empty


UnionRect

Return the union of 2 rectangles.

Declaration

Source position: types.pp line 319

function UnionRect(

  var Rect: TRect;

  const R1: TRect;

  const R2: TRect

):Boolean;

Description

UnionRect retuns the rectangle that encompasses both R1 and R2 in Rect. It returns True if the resulting rectangle is not empty, False if the result is an empty rectangle (in which case the result is filled with zeroes)

See also

PtinRect | Check whether a point is inside a rectangle.
IntersectRect | Return the intersection of 2 rectangles
IsRectEmpty | Check whether a rectangle is empty
OffsetRect | Offset the rectangle
InflateRect | Increase the rectangle in size, keeping it centered
Size | Return the size of the rectangle


FindPropInfo

Return property information by property name.

Declaration

Source position: typinfo.pp line 321

function FindPropInfo(

  Instance: TObject;

  const PropName: string

):PPropInfo;

function FindPropInfo(

  Instance: TObject;

  const PropName: string;

  AKinds: TTypeKinds

):PPropInfo;

function FindPropInfo(

  AClass: TClass;

  const PropName: string

):PPropInfo;

function FindPropInfo(

  AClass: TClass;

  const PropName: string;

  AKinds: TTypeKinds

):PPropInfo;

Description

FindPropInfo examines the published property information of a class and returns a pointer to the property information for property PropName. The class to be examined can be specified in one of two ways:

AClass
a class pointer.
Instance
an instance of the class to be investigated.

If the property does not exist, a EPropertyError exception will be raised. The GetPropInfo function has the same function as the FindPropInfo function, but returns Nil if the property does not exist.

Errors

Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

GetPropInfo | Return property type information, by property name.
GetPropList | Return a list of a certain type of published properties.
GetPropInfos | Return a list of published properties.

Example

Program example13;

{ This program demonstrates the FindPropInfo function }

{$mode objfpc}

uses
  rttiobj,typinfo,sysutils;

Var
  O : TMyTestObject;
  PT : PTypeData;
  PI : PPropInfo;
  I,J : Longint;
  PP : PPropList;
  prI : PPropInfo;

begin
  O:=TMyTestObject.Create;
  PI:=FindPropInfo(O,'BooleanField');
  Writeln('FindPropInfo(Instance,BooleanField) : ',PI^.Name);
  PI:=FindPropInfo(O.ClassType,'ByteField');
  Writeln('FindPropInfo(Class,ByteField)       : ',PI^.Name);
  Write  ('FindPropInfo(Class,NonExistingProp) : ');
  Try
    PI:=FindPropInfo(O,'NonExistingProp');
  except
    On E: Exception do
      Writeln('Caught exception "',E.ClassName,'" with message : ',E.Message);
  end;
  O.Free;
end.


GetEnumName

Return name of enumeration constant.

Declaration

Source position: typinfo.pp line 424

function GetEnumName(

  TypeInfo: PTypeInfo;

  Value: Integer

):string;

Description

GetEnumName scans the type information for the enumeration type described by TypeInfo and returns the name of the enumeration constant for the element with ordinal value equal to Value.

If Value is out of range, the first element of the enumeration type is returned. The result is returned in the case that was used in the declaration. (In earlier versions of FPC, the name was lowercased).

This can be used in combination with GetOrdProp to stream a property of an enumerated type.

Errors

No check is done to determine whether TypeInfo really points to the type information for an enumerated type.

See also

GetOrdProp | Get the value of an ordinal property
GetEnumValue | Get ordinal value for enumerated type by name

Example

program example9;

{ This program demonstrates the GetEnumName, GetEnumValue functions }

{$mode objfpc}

uses rttiobj,typinfo;

Var
  O : TMyTestObject;
  TI : PTypeInfo;

begin
  O:=TMyTestObject.Create;
  TI:=GetPropInfo(O,'MyEnumField')^.PropType;
  Writeln('GetEnumName           : ',GetEnumName(TI,Ord(O.MyEnumField)));
  Writeln('GetEnumValue(mefirst) : ',GetEnumName(TI,GetEnumValue(TI,'mefirst')));
  O.Free;
end.


GetEnumNameCount

Return number of names in an enumerated type

Declaration

Source position: typinfo.pp line 426

function GetEnumNameCount(

  enum1: PTypeInfo

):SizeInt;

Description

GetEnumNameCount returns the number of values (names) in the enumerated type, described by enum1

Errors

No checking is done to see whether Enum1 is really type information of an enumerated type.

See also

GetEnumValue | Get ordinal value for enumerated type by name
GetEnumName | Return name of enumeration constant.


GetEnumProp

Return the value of an enumeration type property.

Declaration

Source position: typinfo.pp line 350

function GetEnumProp(

  Instance: TObject;

  const PropName: string

):string;

function GetEnumProp(

  Instance: TObject;

  const PropInfo: PPropInfo

):string;

Description

GetEnumProp returns the value of an property of an enumerated type and returns the name of the enumerated value for the objetc Instance. The property whose value must be returned can be specified by its property info in PropInfo or by its name in PropName

Errors

No check is done to determine whether PropInfo really points to the property information for an enumerated type. Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

SetEnumProp | Set value of an enumerated-type property
GetOrdProp | Get the value of an ordinal property
GetStrProp | Return the value of a string property.
GetInt64Prop | return value of an Int64 property
GetMethodProp | Return value of a method property
GetSetProp | Return the value of a set property.
GetObjectProp | Return value of an object-type property.
GetEnumProp | Return the value of an enumeration type property.

Example

program example2;

{ This program demonstrates the GetEnumProp function }

{$mode objfpc}

uses rttiobj,typinfo;

Var
  O : TMyTestObject;
  PI : PPropInfo;
  TI : PTypeInfo;

begin
  O:=TMyTestObject.Create;
  PI:=GetPropInfo(O,'MyEnumField');
  TI:=PI^.PropType;
  Writeln('Enum property    : ');
  Writeln('Value                   : ',GetEnumName(TI,Ord(O.MyEnumField)));
  Writeln('Get (name)              : ',GetEnumProp(O,'MyEnumField'));
  Writeln('Get (propinfo)          : ',GetEnumProp(O,PI));
  SetEnumProp(O,'MyEnumField','meFirst');
  Writeln('Set (name,meFirst)      : ',GetEnumName(TI,Ord(O.MyEnumField)));
  SetEnumProp(O,PI,'meSecond');
  Writeln('Set (propinfo,meSecond) : ',GetEnumName(TI,Ord(O.MyEnumField)));
  O.Free;
end.


GetEnumValue

Get ordinal value for enumerated type by name

Declaration

Source position: typinfo.pp line 425

function GetEnumValue(

  TypeInfo: PTypeInfo;

  const Name: string

):Integer;

Description

GetEnumValue scans the type information for the enumeration type described by TypeInfo and returns the ordinal value for the element in the enumerated type that has identifier Name. The identifier is searched in a case-insensitive manner.

This can be used to set the value of enumerated properties from a stream.

For an example, see GetEnumName.

Errors

If Name is not found in the list of enumerated values, then -1 is returned. No check is done whether TypeInfo points to the type information for an enumerated type.

See also

GetEnumName | Return name of enumeration constant.
SetOrdProp | Set value of an ordinal property


GetFloatProp

Return value of floating point property

Declaration

Source position: typinfo.pp line 377

function GetFloatProp(

  Instance: TObject;

  PropInfo: PPropInfo

):Extended;

function GetFloatProp(

  Instance: TObject;

  const PropName: string

):Extended;

Description

GetFloatProp returns the value of the float property described by PropInfo or with name Propname for the object Instance. All float types are converted to extended.

Errors

No checking is done whether Instance is non-nil, or whether PropInfo describes a valid float property of Instance. Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

SetFloatProp | Set value of a float property.
GetOrdProp | Get the value of an ordinal property
GetStrProp | Return the value of a string property.
GetInt64Prop | return value of an Int64 property
GetMethodProp | Return value of a method property
GetSetProp | Return the value of a set property.
GetObjectProp | Return value of an object-type property.
GetEnumProp | Return the value of an enumeration type property.

Example

program example4;

{ This program demonstrates the GetFloatProp function }

{$mode objfpc}

uses rttiobj,typinfo;

Var
  O : TMyTestObject;
  PI : PPropInfo;

begin
  O:=TMyTestObject.Create;
  Writeln('Real property : ');
  PI:=GetPropInfo(O,'RealField');
  Writeln('Value            : ',O.RealField);
  Writeln('Get (name)       : ',GetFloatProp(O,'RealField'));
  Writeln('Get (propinfo)   : ',GetFloatProp(O,PI));
  SetFloatProp(O,'RealField',system.Pi);
  Writeln('Set (name,pi)    : ',O.RealField);
  SetFloatProp(O,PI,exp(1));
  Writeln('Set (propinfo,e) : ',O.RealField);
  Writeln('Extended property : ');
  PI:=GetPropInfo(O,'ExtendedField');
  Writeln('Value            : ',O.ExtendedField);
  Writeln('Get (name)       : ',GetFloatProp(O,'ExtendedField'));
  Writeln('Get (propinfo)   : ',GetFloatProp(O,PI));
  SetFloatProp(O,'ExtendedField',system.Pi);
  Writeln('Set (name,pi)    : ',O.ExtendedField);
  SetFloatProp(O,PI,exp(1));
  Writeln('Set (propinfo,e) : ',O.ExtendedField);
  O.Free;
end.


GetInt64Prop

return value of an Int64 property

Declaration

Source position: typinfo.pp line 397

function GetInt64Prop(

  Instance: TObject;

  PropInfo: PPropInfo

):Int64;

function GetInt64Prop(

  Instance: TObject;

  const PropName: string

):Int64;

Description

Remark: Publishing of Int64 properties is not yet supported by Free Pascal. This function is provided for Delphi compatibility only at the moment.

GetInt64Prop returns the value of the property of type Int64 that is described by PropInfo or with name Propname for the object Instance.

Errors

No checking is done whether Instance is non-nil, or whether PropInfo describes a valid Int64 property of Instance. Specifying an invalid property name in PropName will result in an EPropertyError exception

See also

SetInt64Prop | Set value of a Int64 property
GetOrdProp | Get the value of an ordinal property
GetStrProp | Return the value of a string property.
GetFloatProp | Return value of floating point property
GetMethodProp | Return value of a method property
GetSetProp | Return the value of a set property.
GetObjectProp | Return value of an object-type property.
GetEnumProp | Return the value of an enumeration type property.

Example

program example15;

{ This program demonstrates the GetInt64Prop function }

{$mode objfpc}

uses rttiobj,typinfo;

Var
  O : TMyTestObject;
  PI : PPropInfo;

begin
  O:=TMyTestObject.Create;
  Writeln('Int64 property : ');
  PI:=GetPropInfo(O,'Int64Field');
  Writeln('Value            : ',O.Int64Field);
  Writeln('Get (name)       : ',GetInt64Prop(O,'Int64Field'));
  Writeln('Get (propinfo)   : ',GetInt64Prop(O,PI));
  SetInt64Prop(O,'Int64Field',12345);
  Writeln('Set (name,12345)    : ',O.Int64Field);
  SetInt64Prop(O,PI,54321);
  Writeln('Set (propinfo,54321) : ',O.Int64Field);
  O.Free;
end.


GetInterfaceProp

Return interface-typed property

Declaration

Source position: typinfo.pp line 413

function GetInterfaceProp(

  Instance: TObject;

  const PropName: string

):IInterface;

function GetInterfaceProp(

  Instance: TObject;

  PropInfo: PPropInfo

):IInterface;

Description

GetInterfaceProp returns the interface which the property described by PropInfo or with name Propname points to for object Instance.

Errors

No checking is done whether Instance is non-nil, or whether PropInfo describes a valid method property of Instance. Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

SetInterfaceProp | Set interface-valued property
GetOrdProp | Get the value of an ordinal property
GetStrProp | Return the value of a string property.
GetFloatProp | Return value of floating point property
GetInt64Prop | return value of an Int64 property
GetSetProp | Return the value of a set property.
GetObjectProp | Return value of an object-type property.
GetEnumProp | Return the value of an enumeration type property.


GetMethodProp

Return value of a method property

Declaration

Source position: typinfo.pp line 392

function GetMethodProp(

  Instance: TObject;

  PropInfo: PPropInfo

):TMethod;

function GetMethodProp(

  Instance: TObject;

  const PropName: string

):TMethod;

Description

GetMethodProp returns the method the property described by PropInfo or with name Propname for object Instance. The return type TMethod is defined in the SysUtils unit as:

TMethod = packed record
  Code, Data: Pointer;
end;

Data points to the instance of the class with the method Code.

Errors

No checking is done whether Instance is non-nil, or whether PropInfo describes a valid method property of Instance. Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

SetMethodProp | Set the value of a method property
GetOrdProp | Get the value of an ordinal property
GetStrProp | Return the value of a string property.
GetFloatProp | Return value of floating point property
GetInt64Prop | return value of an Int64 property
GetSetProp | Return the value of a set property.
GetObjectProp | Return value of an object-type property.
GetEnumProp | Return the value of an enumeration type property.

Example

program example6;

{ This program demonstrates the GetMethodProp function }

{$mode objfpc}

uses rttiobj,typinfo,sysutils;

Type
  TNotifyObject = Class(TObject)
    Procedure Notification1(Sender : TObject);
    Procedure Notification2(Sender : TObject);
  end;

Procedure TNotifyObject.Notification1(Sender : TObject);

begin
  Write('Received notification 1 of object with class: ');
  Writeln(Sender.ClassName);
end;

Procedure TNotifyObject.Notification2(Sender : TObject);

begin
  Write('Received notification 2 of object with class: ');
  Writeln(Sender.ClassName);
end;

Var
  O : TMyTestObject;
  PI : PPropInfo;
  NO : TNotifyObject;
  M : TMethod;

Procedure PrintMethod (Const M : TMethod);

begin
  If (M.Data=Pointer(NO)) Then
    If (M.Code=Pointer(@TNotifyObject.Notification1)) then
      Writeln('Notification1')
    else If (M.Code=Pointer(@TNotifyObject.Notification2)) then
      Writeln('Notification2')
    else
      begin
      Write('Unknown method adress (data:');
      Write(hexStr(Longint(M.data),8));
      Writeln(',code:',hexstr(Longint(M.Code),8),')');
      end;
end;

begin
  O:=TMyTestObject.Create;
  NO:=TNotifyObject.Create;
  O.NotifyEvent:=@NO.Notification1;
  PI:=GetPropInfo(O,'NotifyEvent');
  Writeln('Method property : ');
  Write('Notifying                    : ');
  O.Notify;
  Write('Get (name)                   : ');
  M:=GetMethodProp(O,'NotifyEvent');
  PrintMethod(M);
  Write('Notifying                    : ');
  O.Notify;
  Write('Get (propinfo)               : ');
  M:=GetMethodProp(O,PI);
  PrintMethod(M);
  M:=TMethod(@NO.Notification2);
  SetMethodProp(O,'NotifyEvent',M);
  Write('Set (name,Notification2)     : ');
  M:=GetMethodProp(O,PI);
  PrintMethod(M);
  Write('Notifying                    : ');
  O.Notify;
  Write('Set (propinfo,Notification1) : ');
  M:=TMethod(@NO.Notification1);
  SetMethodProp(O,PI,M);
  M:=GetMethodProp(O,PI);
  PrintMethod(M);
  Write('Notifying                    : ');
  O.Notify;
  O.Free;
end.


GetObjectProp

Return value of an object-type property.

Declaration

Source position: typinfo.pp line 383

function GetObjectProp(

  Instance: TObject;

  const PropName: string

):TObject;

function GetObjectProp(

  Instance: TObject;

  const PropName: string;

  MinClass: TClass

):TObject;

function GetObjectProp(

  Instance: TObject;

  PropInfo: PPropInfo

):TObject;

function GetObjectProp(

  Instance: TObject;

  PropInfo: PPropInfo;

  MinClass: TClass

):TObject;

Description

GetObjectProp returns the object which the property described by PropInfo with name Propname points to for object Instance.

If MinClass is specified, then if the object is not descendent of class MinClass, then Nil is returned.

Errors

No checking is done whether Instance is non-nil, or whether PropInfo describes a valid method property of Instance. Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

SetMethodProp | Set the value of a method property
GetOrdProp | Get the value of an ordinal property
GetStrProp | Return the value of a string property.
GetFloatProp | Return value of floating point property
GetInt64Prop | return value of an Int64 property
GetSetProp | Return the value of a set property.
GetObjectProp | Return value of an object-type property.
GetEnumProp | Return the value of an enumeration type property.

Example

program example5;

{ This program demonstrates the GetObjectProp function }

{$mode objfpc}

uses rttiobj,typinfo;

Var
  O : TMyTestObject;
  PI : PPropInfo;
  NO1,NO2 : TNamedObject;

begin
  O:=TMyTestObject.Create;
  NO1:=TNamedObject.Create;
  NO1.ObjectName:='First named object';
  NO2:=TNamedObject.Create;
  NO2.ObjectName:='Second named object';
  O.ObjField:=NO1;
  Writeln('Object property : ');
  PI:=GetPropInfo(O,'ObjField');
  Write('Property class     : ');
  Writeln(GetObjectPropClass(O,'ObjField').ClassName);
  Write('Value              : ');
  Writeln((O.ObjField as TNamedObject).ObjectName);
  Write('Get (name)         : ');
  Writeln((GetObjectProp(O,'ObjField') As TNamedObject).ObjectName);
  Write('Get (propinfo)     : ');
  Writeln((GetObjectProp(O,PI,TObject) as TNamedObject).ObjectName);
  SetObjectProp(O,'ObjField',NO2);
  Write('Set (name,NO2)     : ');
  Writeln((O.ObjField as TNamedObject).ObjectName);
  SetObjectProp(O,PI,NO1);
  Write('Set (propinfo,NO1) : ');
  Writeln((O.ObjField as TNamedObject).ObjectName);
  O.Free;
end.


GetObjectPropClass

Return class of property.

Declaration

Source position: typinfo.pp line 389

function GetObjectPropClass(

  Instance: TObject;

  const PropName: string

):TClass;

function GetObjectPropClass(

  AClass: TClass;

  const PropName: string

):TClass;

Description

GetObjectPropClass returns the declared class of the property with name PropName. This may not be the actual class of the property value.

For an example, see GetObjectProp.

Errors

No checking is done whether Instance is non-nil. Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

SetMethodProp | Set the value of a method property
GetOrdProp | Get the value of an ordinal property
GetStrProp | Return the value of a string property.
GetFloatProp | Return value of floating point property
GetInt64Prop | return value of an Int64 property


GetOrdProp

Get the value of an ordinal property

Declaration

Source position: typinfo.pp line 345

function GetOrdProp(

  Instance: TObject;

  PropInfo: PPropInfo

):Int64;

function GetOrdProp(

  Instance: TObject;

  const PropName: string

):Int64;

Description

GetOrdProp returns the value of the ordinal property described by PropInfo or with name PropName for the object Instance. The value is returned as a longint, which should be typecasted to the needed type.

Ordinal properties that can be retrieved include:

Integers and subranges of integers
The value of the integer will be returned.
Enumerated types and subranges of enumerated types
The ordinal value of the enumerated type will be returned.
Sets
If the base type of the set has less than 31 possible values. If a bit is set in the return value, then the corresponding element of the base ordinal class of the set type must be included in the set.

Errors

No checking is done whether Instance is non-nil, or whether PropInfo describes a valid ordinal property of Instance Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

SetOrdProp | Set value of an ordinal property
GetStrProp | Return the value of a string property.
GetFloatProp | Return value of floating point property
GetInt64Prop | return value of an Int64 property
GetMethodProp | Return value of a method property
GetSetProp | Return the value of a set property.
GetObjectProp | Return value of an object-type property.
GetEnumProp | Return the value of an enumeration type property.

Example

program example1;

{ This program demonstrates the GetOrdProp function }

{$mode objfpc}

uses rttiobj,typinfo;

Var
  O : TMyTestObject;
  PI : PPropInfo;

begin
  O:=TMyTestObject.Create;
  Writeln('Boolean property    : ');
  Writeln('Value               : ',O.BooleanField);
  Writeln('Ord(Value)          : ',Ord(O.BooleanField));
  Writeln('Get (name)          : ',GetOrdProp(O,'BooleanField'));
  PI:=GetPropInfo(O,'BooleanField');
  Writeln('Get (propinfo)      : ',GetOrdProp(O,PI));
  SetOrdProp(O,'BooleanField',Ord(False));
  Writeln('Set (name,false)    : ',O.BooleanField);
  SetOrdProp(O,PI,Ord(True));
  Writeln('Set (propinfo,true) : ',O.BooleanField);
  O.Free;
end.


GetPropInfo

Return property type information, by property name.

Declaration

Source position: typinfo.pp line 314

function GetPropInfo(

  TypeInfo: PTypeInfo;

  const PropName: string

):PPropInfo;

function GetPropInfo(

  TypeInfo: PTypeInfo;

  const PropName: string;

  AKinds: TTypeKinds

):PPropInfo;

function GetPropInfo(

  Instance: TObject;

  const PropName: string

):PPropInfo;

function GetPropInfo(

  Instance: TObject;

  const PropName: string;

  AKinds: TTypeKinds

):PPropInfo;

function GetPropInfo(

  AClass: TClass;

  const PropName: string

):PPropInfo;

function GetPropInfo(

  AClass: TClass;

  const PropName: string;

  AKinds: TTypeKinds

):PPropInfo;

Description

GetPropInfo returns a pointer to the TPropInfo record for the PropName property of a class. The class to examine can be specified in one of three ways:

Instance
An instance of the class.
AClass
A class pointer to the class.
TypeInfo
A pointer to the type information of the class.

In each of these three ways, if AKinds is specified, if the property has TypeKind which is not included in Akinds, Nil will be returned.

For an example, see most of the other functions.

Errors

If the property PropName does not exist, Nil is returned.

See also

GetPropInfos | Return a list of published properties.
GetPropList | Return a list of a certain type of published properties.


GetPropInfos

Return a list of published properties.

Declaration

Source position: typinfo.pp line 326

procedure GetPropInfos(

  TypeInfo: PTypeInfo;

  PropList: PPropList

);

Description

GetPropInfos stores pointers to the property information of all published properties of a class with class info TypeInfo in the list pointed to by Proplist. The PropList pointer must point to a memory location that contains enough space to hold all properties of the class and its parent classes.

Errors

No checks are done to see whether PropList points to a memory area that is big enough to hold all pointers.

See also

GetPropInfo | Return property type information, by property name.
GetPropList | Return a list of a certain type of published properties.

Example

Program example12;

{ This program demonstrates the GetPropInfos function }

uses
  rttiobj,typinfo;

Var
  O : TMyTestObject;
  PT : PTypeData;
  PI : PTypeInfo;
  I,J : Longint;
  PP : PPropList;
  prI : PPropInfo;

begin
  O:=TMyTestObject.Create;
  PI:=O.ClassInfo;
  PT:=GetTypeData(PI);
  Writeln('Property Count : ',PT^.PropCount);
  GetMem (PP,PT^.PropCount*SizeOf(Pointer));
  GetPropInfos(PI,PP);
  For I:=0 to PT^.PropCount-1 do
    begin
    With PP^[i]^ do
      begin
      Write('Property ',i+1:3,': ',name:30);
      writeln('  Type: ',TypeNames[typinfo.PropType(O,Name)]);
      end;
    end;
  FreeMem(PP);
  O.Free;
end.


GetPropList

Return a list of a certain type of published properties.

Declaration

Source position: typinfo.pp line 327

function GetPropList(

  TypeInfo: PTypeInfo;

  TypeKinds: TTypeKinds;

  PropList: PPropList;

  Sorted: Boolean = True

):LongInt;

function GetPropList(

  TypeInfo: PTypeInfo;

  out PropList: PPropList

):SizeInt;

function GetPropList(

  AClass: TClass;

  out PropList: PPropList

):Integer;

function GetPropList(

  Instance: TObject;

  out PropList: PPropList

):Integer;

Description

GetPropList stores pointers to property information of the class with class info TypeInfo for properties of kind TypeKinds in the list pointed to by Proplist. PropList must contain enough space to hold all properties.

The function returns the number of pointers that matched the criteria and were stored in PropList.

Errors

No checks are done to see whether PropList points to a memory area that is big enough to hold all pointers.

See also

GetPropInfos | Return a list of published properties.
GetPropInfo | Return property type information, by property name.

Example

Program example13;

{ This program demonstrates the GetPropList function }

uses
  rttiobj,typinfo;

Var
  O : TMyTestObject;
  PT : PTypeData;
  PI : PTypeInfo;
  I,J : Longint;
  PP : PPropList;
  prI : PPropInfo;

begin
  O:=TMyTestObject.Create;
  PI:=O.ClassInfo;
  PT:=GetTypeData(PI);
  Writeln('Total property Count : ',PT^.PropCount);
  GetMem (PP,PT^.PropCount*SizeOf(Pointer));
  J:=GetPropList(PI,OrdinalTypes,PP);
  Writeln('Ordinal property Count : ',J);
  For I:=0 to J-1 do
    begin
    With PP^[i]^ do
      begin
      Write('Property ',i+1:3,': ',name:30);
      writeln('  Type: ',TypeNames[typinfo.PropType(O,Name)]);
      end;
    end;
  FreeMem(PP);
  O.Free;
end.


GetPropValue

Get property value as a string.

Declaration

Source position: typinfo.pp line 402

function GetPropValue(

  Instance: TObject;

  const PropName: string

):Variant;

function GetPropValue(

  Instance: TObject;

  const PropName: string;

  PreferStrings: Boolean

):Variant;

function GetPropValue(

  Instance: TObject;

  PropInfo: PPropInfo

):Variant;

function GetPropValue(

  Instance: TObject;

  PropInfo: PPropInfo;

  PreferStrings: Boolean

):Variant;

Description

Due to missing Variant support, GetPropValue is not yet implemented. The declaration is provided for compatibility with Delphi.


GetRawInterfaceProp

Get a raw (CORBA) interface property.

Declaration

Source position: typinfo.pp line 418

function GetRawInterfaceProp(

  Instance: TObject;

  const PropName: string

):Pointer;

function GetRawInterfaceProp(

  Instance: TObject;

  PropInfo: PPropInfo

):Pointer;

Description

GetRawInterfaceProp can be used to retrieve the value of a published CORBA interface property with name PropName from object Instance. Alternatively, the required property information can be specified by PropInfo instead of the property name. In difference with the GetInterfaceProp function, no reference counting is done.

Errors

If the property PropName does not exist, an EPropertyError exception is raised.

See also

GetInterfaceProp | Return interface-typed property
SetRawInterfaceProp | Set a raw (CORBA) interface property.


GetSetProp

Return the value of a set property.

Declaration

Source position: typinfo.pp line 355

function GetSetProp(

  Instance: TObject;

  const PropName: string

):string;

function GetSetProp(

  Instance: TObject;

  const PropName: string;

  Brackets: Boolean

):string;

function GetSetProp(

  Instance: TObject;

  const PropInfo: PPropInfo;

  Brackets: Boolean

):string;

Description

GetSetProp returns the contents of a set property as a string. The property to be returned can be specified by it's name in PropName or by its property information in PropInfo.

The returned set is a string representation of the elements in the set as returned by SetToString. The Brackets option can be used to enclose the string representation in square brackets.

Errors

No checking is done whether Instance is non-nil, or whether PropInfo describes a valid ordinal property of Instance Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

SetSetProp | Set value of set-typed property.
GetStrProp | Return the value of a string property.
GetFloatProp | Return value of floating point property
GetInt64Prop | return value of an Int64 property
GetMethodProp | Return value of a method property

Example

program example7;

{ This program demonstrates the GetSetProp function }

{$mode objfpc}

uses rttiobj,typinfo;

Var
  O : TMyTestObject;
  PI : PPropInfo;

Function SetAsString (ASet : TMyEnums) : String;

Var
  i : TmyEnum;

begin
  result:='';
  For i:=mefirst to methird do
    If i in ASet then
      begin
      If (Result<>'') then
        Result:=Result+',';
      Result:=Result+MyEnumNames[i];
      end;
end;

Var
  S : TMyEnums;

begin
  O:=TMyTestObject.Create;
  O.SetField:=[mefirst,meSecond,meThird];
  Writeln('Set property    : ');
  Writeln('Value                        : ',SetAsString(O.SetField));
  Writeln('Ord(Value)                   : ',Byte(O.SetField));
  Writeln('Get (name)                   : ',GetSetProp(O,'SetField'));
  PI:=GetPropInfo(O,'SetField');
  Writeln('Get (propinfo)               : ',GetSetProp(O,PI,false));
  S:=[meFirst,meThird];
  SetOrdProp(O,'SetField',Byte(S));
  Write('Set (name,[mefirst,methird]) : ');
  Writeln(SetAsString(O.SetField));
  S:=[meSecond];
  SetOrdProp(O,PI,Byte(S));
  Write('Set (propinfo,[meSecond])    : ');
  Writeln(SetAsString(O.SetField));
  O.Free;
end.


GetStrProp

Return the value of a string property.

Declaration

Source position: typinfo.pp line 361

function GetStrProp(

  Instance: TObject;

  PropInfo: PPropInfo

):Ansistring;

function GetStrProp(

  Instance: TObject;

  const PropName: string

):string;

Description

GetStrProp returns the value of the string property described by PropInfo or with name PropName for object Instance.

Errors

No checking is done whether Instance is non-nil, or whether PropInfo describes a valid string property of Instance. Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

SetStrProp | Set value of a string property
SetWideStrProp | Set a widestring property
GetOrdProp | Get the value of an ordinal property
GetFloatProp | Return value of floating point property
GetInt64Prop | return value of an Int64 property
GetMethodProp | Return value of a method property

Example

program example3;

{ This program demonstrates the GetStrProp function }

{$mode objfpc}

uses rttiobj,typinfo;

Var
  O : TMyTestObject;
  PI : PPropInfo;

begin
  O:=TMyTestObject.Create;
  PI:=GetPropInfo(O,'AnsiStringField');
  Writeln('String property : ');
  Writeln('Value                   : ',O.AnsiStringField);
  Writeln('Get (name)              : ',GetStrProp(O,'AnsiStringField'));
  Writeln('Get (propinfo)          : ',GetStrProp(O,PI));
  SetStrProp(O,'AnsiStringField','First');
  Writeln('Set (name,''First'')      : ',O.AnsiStringField);
  SetStrProp(O,PI,'Second');
  Writeln('Set (propinfo,''Second'') : ',O.AnsiStringField);
  O.Free;
end.


GetTypeData

Return a pointer to type data, based on type information.

Declaration

Source position: typinfo.pp line 312

function GetTypeData(

  TypeInfo: PTypeInfo

):PTypeData;

Description

GetTypeData returns a pointer to the TTypeData record that follows after the TTypeInfo record pointed to by TypeInfo. It essentially skips the Kind and Name fields in the TTypeInfo record.

Errors

None.


GetUnicodeStrProp

Get UnicodeString-valued property

Declaration

Source position: typinfo.pp line 371

function GetUnicodeStrProp(

  Instance: TObject;

  PropInfo: PPropInfo

):UnicodeString;

function GetUnicodeStrProp(

  Instance: TObject;

  const PropName: string

):UnicodeString;

Description

GetUnicodeStrProp returns the UnicodeString property from Instance, where the property is identified by the PropInfo pointer or the PropertyName.

Errors

If no property of the indicated name exists, or the value is not a unicode string, an exception will occur.

See also

GetStrProp | Return the value of a string property.
SetUnicodeStrProp | Set UnicodeString-valued property


GetVariantProp

Return the value of a variant property.

Declaration

Source position: typinfo.pp line 408

function GetVariantProp(

  Instance: TObject;

  PropInfo: PPropInfo

):Variant;

function GetVariantProp(

  Instance: TObject;

  const PropName: string

):Variant;

Description

Due to missing Variant support, the GetVariantProp function is not yet implemented. Provided for Delphi compatibility only.

See also

SetVariantProp

Set value of a variant property


GetWideStrProp

Read a widestring property

Declaration

Source position: typinfo.pp line 366

function GetWideStrProp(

  Instance: TObject;

  PropInfo: PPropInfo

):WideString;

function GetWideStrProp(

  Instance: TObject;

  const PropName: string

):WideString;

Description

GetWideStrProp returns the value of the widestring property described by PropInfo or with name PropName for object Instance.

Errors

No checking is done whether Instance is non-nil, or whether PropInfo describes a valid widestring property of Instance. Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

GetStrProp | Return the value of a string property.
SetWideStrProp | Set a widestring property
GetOrdProp | Get the value of an ordinal property
GetFloatProp | Return value of floating point property
GetInt64Prop | return value of an Int64 property
GetMethodProp | Return value of a method property


IsPublishedProp

Check whether a published property exists.

Declaration

Source position: typinfo.pp line 337

function IsPublishedProp(

  Instance: TObject;

  const PropName: string

):Boolean;

function IsPublishedProp(

  AClass: TClass;

  const PropName: string

):Boolean;

Description

IsPublishedProp returns true if a class has a published property with name PropName. The class can be specfied in one of two ways:

AClass
A class pointer to the class.
Instance
An instance of the class.

Errors

No checks are done to ensure Instance or AClass are valid pointers. Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

IsStoredProp | Check whether a property is stored.
PropIsType | Check the type of a published property.

Example

program example10;

{ This program demonstrates the IsPublishedProp function }

{$mode objfpc}

uses rttiobj,typinfo;

Var
  O : TMyTestObject;
  PI : PPropInfo;

begin
  O:=TMyTestObject.Create;
  Writeln('Property tests    : ');
  Write('IsPublishedProp(O,BooleanField)     : ');
  Writeln(IsPublishedProp(O,'BooleanField'));
  Write('IsPublishedProp(Class,BooleanField) : ');
  Writeln(IsPublishedProp(O.ClassType,'BooleanField'));
  Write('IsPublishedProp(O,SomeField)        : ');
  Writeln(IsPublishedProp(O,'SomeField'));
  Write('IsPublishedProp(Class,SomeField)    : ');
  Writeln(IsPublishedProp(O.ClassType,'SomeField'));
  O.Free;
end.


IsStoredProp

Check whether a property is stored.

Declaration

Source position: typinfo.pp line 335

function IsStoredProp(

  Instance: TObject;

  PropInfo: PPropInfo

):Boolean;

function IsStoredProp(

  Instance: TObject;

  const PropName: string

):Boolean;

Description

IsStoredProp returns True if the Stored modifier evaluates to True for the property described by PropInfo or with name PropName for object Instance. It returns False otherwise. If the function returns True, this indicates that the property should be written when streaming the object Instance.

If there was no stored modifier in the declaration of the property, True will be returned.

Errors

No checking is done whether Instance is non-nil, or whether PropInfo describes a valid property of Instance. Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

IsPublishedProp | Check whether a published property exists.
PropIsType | Check the type of a published property.

Example

program example11;

{ This program demonstrates the IsStoredProp function }

{$mode objfpc}

uses rttiobj,typinfo;

Var
  O : TMyTestObject;
  PI : PPropInfo;

begin
  O:=TMyTestObject.Create;
  Writeln('Stored tests    : ');
  Write('IsStoredProp(O,StoredIntegerConstFalse)    : ');
  Writeln(IsStoredProp(O,'StoredIntegerConstFalse'));
  Write('IsStoredProp(O,StoredIntegerConstTrue)     : ');
  Writeln(IsStoredProp(O,'StoredIntegerConstTrue'));
  Write('IsStoredProp(O,StoredIntegerMethod)        : ');
  Writeln(IsStoredProp(O,'StoredIntegerMethod'));
  Write('IsStoredProp(O,StoredIntegerVirtualMethod) : ');
  Writeln(IsStoredProp(O,'StoredIntegerVirtualMethod'));
  O.Free;
end.


PropIsType

Check the type of a published property.

Declaration

Source position: typinfo.pp line 341

function PropIsType(

  Instance: TObject;

  const PropName: string;

  TypeKind: TTypeKind

):Boolean;

function PropIsType(

  AClass: TClass;

  const PropName: string;

  TypeKind: TTypeKind

):Boolean;

Description

PropIsType returns True if the property with name PropName has type TypeKind. It returns False otherwise. The class to be examined can be specified in one of two ways:

AClass
A class pointer.
Instance
An instance of the class.

Errors

No checks are done to ensure Instance or AClass are valid pointers.Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

IsPublishedProp | Check whether a published property exists.
IsStoredProp | Check whether a property is stored.
PropType | Return the type of a property

Example

program example16;

{ This program demonstrates the PropIsType function }

{$mode objfpc}

uses rttiobj,typinfo;

Var
  O : TMyTestObject;

begin
  O:=TMyTestObject.Create;
  Writeln('Property tests    : ');
  Write('PropIsType(O,BooleanField,tkBool)     : ');
  Writeln(PropIsType(O,'BooleanField',tkBool));
  Write('PropIsType(Class,BooleanField,tkBool) : ');
  Writeln(PropIsType(O.ClassType,'BooleanField',tkBool));
  Write('PropIsType(O,ByteField,tkString)      : ');
  Writeln(PropisType(O,'ByteField',tkString));
  Write('PropIsType(Class,ByteField,tkString)  : ');
  Writeln(PropIsType(O.ClassType,'ByteField',tkString));
  O.Free;
end.


PropType

Return the type of a property

Declaration

Source position: typinfo.pp line 339

function PropType(

  Instance: TObject;

  const PropName: string

):TTypeKind;

function PropType(

  AClass: TClass;

  const PropName: string

):TTypeKind;

Description

Proptype returns the type of the property PropName for a class. The class to be examined can be specified in one of 2 ways:

AClass
A class pointer.
Instance
An instance of the class.

Errors

No checks are done to ensure Instance or AClass are valid pointers. Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

IsPublishedProp | Check whether a published property exists.
IsStoredProp | Check whether a property is stored.
PropIsType | Check the type of a published property.

Example

program example17;

{ This program demonstrates the PropType function }

{$mode objfpc}

uses rttiobj,typinfo;

Var
  O : TMyTestObject;

begin
  O:=TMyTestObject.Create;
  Writeln('Property tests    : ');
  Write('PropType(O,BooleanField)     : ');
  Writeln(TypeNames[PropType(O,'BooleanField')]);
  Write('PropType(Class,BooleanField) : ');
  Writeln(TypeNames[PropType(O.ClassType,'BooleanField')]);
  Write('PropType(O,ByteField)        : ');
  Writeln(TypeNames[PropType(O,'ByteField')]);
  Write('PropType(Class,ByteField)    : ');
  Writeln(TypeNames[PropType(O.ClassType,'ByteField')]);
  O.Free;
end.


SetEnumProp

Set value of an enumerated-type property

Declaration

Source position: typinfo.pp line 352

procedure SetEnumProp(

  Instance: TObject;

  const PropName: string;

  const Value: string

);

procedure SetEnumProp(

  Instance: TObject;

  const PropInfo: PPropInfo;

  const Value: string

);

Description

SetEnumProp sets the property described by PropInfo or with name PropName to Value. Value must be a string with the name of the enumerate value, i.e. it can be used as an argument to GetEnumValue.

For an example, see GetEnumProp.

Errors

No checks are done to ensure Instance or PropInfo are valid pointers. Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

GetEnumProp | Return the value of an enumeration type property.
SetStrProp | Set value of a string property
SetFloatProp | Set value of a float property.
SetInt64Prop | Set value of a Int64 property
SetMethodProp | Set the value of a method property


SetFloatProp

Set value of a float property.

Declaration

Source position: typinfo.pp line 379

procedure SetFloatProp(

  Instance: TObject;

  const PropName: string;

  Value: Extended

);

procedure SetFloatProp(

  Instance: TObject;

  PropInfo: PPropInfo;

  Value: Extended

);

Description

SetFloatProp assigns Value to the property described by PropInfo or with name Propname for the object Instance.

For an example, see GetFloatProp.

Errors

No checking is done whether Instance is non-nil, or whether PropInfo describes a valid float property of Instance. Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

GetFloatProp | Return value of floating point property
SetOrdProp | Set value of an ordinal property
SetStrProp | Set value of a string property
SetInt64Prop | Set value of a Int64 property
SetMethodProp | Set the value of a method property


SetInt64Prop

Set value of a Int64 property

Declaration

Source position: typinfo.pp line 399

procedure SetInt64Prop(

  Instance: TObject;

  PropInfo: PPropInfo;

  const Value: Int64

);

procedure SetInt64Prop(

  Instance: TObject;

  const PropName: string;

  const Value: Int64

);

Description

SetInt64Prop assigns Value to the property of type Int64 that is described by PropInfo or with name Propname for the object Instance.

For an example, see GetInt64Prop.

Errors

No checking is done whether Instance is non-nil, or whether PropInfo describes a valid Int64 property of Instance. Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

GetInt64Prop | return value of an Int64 property
GetMethodProp | Return value of a method property
SetOrdProp | Set value of an ordinal property
SetStrProp | Set value of a string property
SetFloatProp | Set value of a float property.


SetInterfaceProp

Set interface-valued property

Declaration

Source position: typinfo.pp line 415

procedure SetInterfaceProp(

  Instance: TObject;

  const PropName: string;

  const Value: IInterface

);

procedure SetInterfaceProp(

  Instance: TObject;

  PropInfo: PPropInfo;

  const Value: IInterface

);

Description

SetInterfaceProp assigns Value to the object property described by PropInfo or with name Propname for the object Instance.

Errors

No checking is done whether Instance is non-nil, or whether PropInfo describes a valid interface property of Instance. Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

GetInterfaceProp | Return interface-typed property
SetObjectProp | Set the value of an object-type property.
SetOrdProp | Set value of an ordinal property
SetStrProp | Set value of a string property
SetFloatProp | Set value of a float property.
SetInt64Prop | Set value of a Int64 property
SetMethodProp | Set the value of a method property


SetMethodProp

Set the value of a method property

Declaration

Source position: typinfo.pp line 394

procedure SetMethodProp(

  Instance: TObject;

  PropInfo: PPropInfo;

  const Value: TMethod

);

procedure SetMethodProp(

  Instance: TObject;

  const PropName: string;

  const Value: TMethod

);

Description

SetMethodProp assigns Value to the method the property described by PropInfo or with name Propname for object Instance.

The type TMethod of the Value parameter is defined in the SysUtils unit as:

TMethod = packed record
  Code, Data: Pointer;
end;

Data should point to the instance of the class with the method Code.

For an example, see GetMethodProp.

Errors

No checking is done whether Instance is non-nil, or whether PropInfo describes a valid method property of Instance. Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

GetMethodProp | Return value of a method property
SetOrdProp | Set value of an ordinal property
SetStrProp | Set value of a string property
SetFloatProp | Set value of a float property.
SetInt64Prop | Set value of a Int64 property


SetObjectProp

Set the value of an object-type property.

Declaration

Source position: typinfo.pp line 387

procedure SetObjectProp(

  Instance: TObject;

  const PropName: string;

  Value: TObject

);

procedure SetObjectProp(

  Instance: TObject;

  PropInfo: PPropInfo;

  Value: TObject

);

Description

SetObjectProp assigns Value to the object property described by PropInfo or with name Propname for the object Instance.

For an example, see GetObjectProp.

Errors

No checking is done whether Instance is non-nil, or whether PropInfo describes a valid object property of Instance. Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

GetObjectProp | Return value of an object-type property.
SetOrdProp | Set value of an ordinal property
SetStrProp | Set value of a string property
SetFloatProp | Set value of a float property.
SetInt64Prop | Set value of a Int64 property
SetMethodProp | Set the value of a method property


SetOrdProp

Set value of an ordinal property

Declaration

Source position: typinfo.pp line 347

procedure SetOrdProp(

  Instance: TObject;

  PropInfo: PPropInfo;

  Value: Int64

);

procedure SetOrdProp(

  Instance: TObject;

  const PropName: string;

  Value: Int64

);

Description

SetOrdProp assigns Value to the ordinal property described by PropInfo or with name Propname for the object Instance.

Ordinal properties that can be set include:

Integers and subranges of integers
The actual value of the integer must be passed.
Enumerated types and subranges of enumerated types
The ordinal value of the enumerated type must be passed.
Subrange types
of integers or enumerated types. Here the ordinal value must be passed.
Sets
If the base type of the set has less than 31 possible values. For each possible value; the corresponding bit of Value must be set.

For an example, see GetOrdProp.

Errors

No checking is done whether Instance is non-nil, or whether PropInfo describes a valid ordinal property of Instance. No range checking is performed. Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

GetOrdProp | Get the value of an ordinal property
SetStrProp | Set value of a string property
SetFloatProp | Set value of a float property.
SetInt64Prop | Set value of a Int64 property
SetMethodProp | Set the value of a method property


SetPropValue

Set property value as variant

Declaration

Source position: typinfo.pp line 406

procedure SetPropValue(

  Instance: TObject;

  const PropName: string;

  const Value: Variant

);

procedure SetPropValue(

  Instance: TObject;

  PropInfo: PPropInfo;

  const Value: Variant

);

Description

Due to missing Variant support, this function is not yet implemented; it is provided for Delphi compatibility only.


SetRawInterfaceProp

Set a raw (CORBA) interface property.

Declaration

Source position: typinfo.pp line 420

procedure SetRawInterfaceProp(

  Instance: TObject;

  const PropName: string;

  const Value: Pointer

);

procedure SetRawInterfaceProp(

  Instance: TObject;

  PropInfo: PPropInfo;

  const Value: Pointer

);

Description

SetRawInterfaceProp can be used to set the value of a published CORBA interface with name PropName from object Instance to Value. Alternatively, the required property information can be specified by PropInfo instead of the property name. In difference with the SetInterfaceProp procedure, no reference counting is done.

Errors

If the property PropName does not exist, an EPropertyError exception is raised.

See also

SetInterfaceProp | Set interface-valued property
GetRawInterfaceProp | Get a raw (CORBA) interface property.


SetSetProp

Set value of set-typed property.

Declaration

Source position: typinfo.pp line 358

procedure SetSetProp(

  Instance: TObject;

  const PropName: string;

  const Value: string

);

procedure SetSetProp(

  Instance: TObject;

  const PropInfo: PPropInfo;

  const Value: string

);

Description

SetSetProp sets the property specified by PropInfo or PropName for object Instance to Value. Value is a string which contains a comma-separated list of values, each value being a string-representation of the enumerated value that should be included in the set. The value should be accepted by the StringToSet function.

The value can be formed using the SetToString function.

For an example, see GetSetProp.

Errors

No checking is done whether Instance is non-nil, or whether PropInfo describes a valid ordinal property of Instance. No range checking is performed. Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

GetSetProp | Return the value of a set property.
SetOrdProp | Set value of an ordinal property
SetStrProp | Set value of a string property
SetFloatProp | Set value of a float property.
SetInt64Prop | Set value of a Int64 property
SetMethodProp | Set the value of a method property
SetToString | Convert set to a string description
StringToSet | Convert string description to a set.


SetStrProp

Set value of a string property

Declaration

Source position: typinfo.pp line 363

procedure SetStrProp(

  Instance: TObject;

  const PropName: string;

  const Value: AnsiString

);

procedure SetStrProp(

  Instance: TObject;

  PropInfo: PPropInfo;

  const Value: Ansistring

);

Description

SetStrProp assigns Value to the string property described by PropInfo or with name Propname for object Instance.

For an example, see GetStrProp

Errors

No checking is done whether Instance is non-nil, or whether PropInfo describes a valid string property of Instance. Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

GetStrProp | Return the value of a string property.
SetWideStrProp | Set a widestring property
SetOrdProp | Set value of an ordinal property
SetFloatProp | Set value of a float property.
SetInt64Prop | Set value of a Int64 property
SetMethodProp | Set the value of a method property


SetToString

Convert set to a string description

Declaration

Source position: typinfo.pp line 428

function SetToString(

  TypeInfo: PTypeInfo;

  Value: Integer;

  Brackets: Boolean

):string;

function SetToString(

  PropInfo: PPropInfo;

  Value: Integer;

  Brackets: Boolean

):string;

function SetToString(

  PropInfo: PPropInfo;

  Value: Integer

):string;

Description

SetToString takes an integer representation of a set (as received e.g. by GetOrdProp) and turns it into a string representing the elements in the set, based on the type information found in the PropInfo property information. By default, the string representation is not surrounded by square brackets. Setting the Brackets parameter to True will surround the string representation with brackets.

The function returns the string representation of the set.

Errors

No checking is done to see whether PropInfo points to valid property information.

See also

GetEnumName | Return name of enumeration constant.
GetEnumValue | Get ordinal value for enumerated type by name
StringToSet | Convert string description to a set.

Example

program example18;

{ This program demonstrates the SetToString function }

{$mode objfpc}

uses rttiobj,typinfo;

Var
  O : TMyTestObject;
  PI : PPropInfo;
  I : longint;

begin
  O:=TMyTestObject.Create;
  PI:=GetPropInfo(O,'SetField');
  O.SetField:=[mefirst,meSecond,meThird];
  I:=GetOrdProp(O,PI);
  Writeln('Set property to string : ');
  Writeln('Value  : ',SetToString(PI,I,False));
  O.SetField:=[mefirst,meSecond];
  I:=GetOrdProp(O,PI);
  Writeln('Value  : ',SetToString(PI,I,True));
  I:=StringToSet(PI,'mefirst');
  SetOrdProp(O,PI,I);
  I:=GetOrdProp(O,PI);
  Writeln('Value  : ',SetToString(PI,I,False));
  I:=StringToSet(PI,'[mesecond,methird]');
  SetOrdProp(O,PI,I);
  I:=GetOrdProp(O,PI);
  Writeln('Value  : ',SetToString(PI,I,True));
  O.Free;
end.


SetUnicodeStrProp

Set UnicodeString-valued property

Declaration

Source position: typinfo.pp line 373

procedure SetUnicodeStrProp(

  Instance: TObject;

  const PropName: string;

  const Value: UnicodeString

);

procedure SetUnicodeStrProp(

  Instance: TObject;

  PropInfo: PPropInfo;

  const Value: UnicodeString

);

Description

SetUnicodeStrProp sets the UnicodeString property from Instance to Value, where the property is identified by the PropInfo pointer or the PropertyName.

Errors

If no property of the indicated name exists, or it is not of type unicodestring, an exception will occur.

See also

SetStrProp | Set value of a string property
GetUnicodeStrProp | Get UnicodeString-valued property


SetVariantProp

Set value of a variant property

Declaration

Source position: typinfo.pp line 410

procedure SetVariantProp(

  Instance: TObject;

  const PropName: string;

  const Value: Variant

);

procedure SetVariantProp(

  Instance: TObject;

  PropInfo: PPropInfo;

  const Value: Variant

);

Description

Due to missing Variant support, this function is not yet implemented. Provided for Delphi compatibility only.


SetWideStrProp

Set a widestring property

Declaration

Source position: typinfo.pp line 368

procedure SetWideStrProp(

  Instance: TObject;

  const PropName: string;

  const Value: WideString

);

procedure SetWideStrProp(

  Instance: TObject;

  PropInfo: PPropInfo;

  const Value: WideString

);

Description

SetWideStrProp assigns Value to the widestring property described by PropInfo or with name Propname for object Instance.

Errors

No checking is done whether Instance is non-nil, or whether PropInfo describes a valid widestring property of Instance. Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

GetWideStrProp | Read a widestring property
SetStrProp | Set value of a string property
SetOrdProp | Set value of an ordinal property
SetFloatProp | Set value of a float property.
SetInt64Prop | Set value of a Int64 property
SetMethodProp | Set the value of a method property


StringToSet

Convert string description to a set.

Declaration

Source position: typinfo.pp line 431

function StringToSet(

  PropInfo: PPropInfo;

  const Value: string

):Integer;

function StringToSet(

  TypeInfo: PTypeInfo;

  const Value: string

):Integer;

Description

StringToSet converts the string representation of a set in Value to a integer representation of the set, using the property information found in PropInfo. This property information should point to the property information of a set property. The function returns the integer representation of the set. (i.e, the set value, typecast to an integer)

The string representation can be surrounded with square brackets, and must consist of the names of the elements of the base type of the set. The base type of the set should be an enumerated type. The elements should be separated by commas, and may be surrounded by spaces. each of the names will be fed to the GetEnumValue function.

For an example, see SetToString.

Errors

No checking is done to see whether PropInfo points to valid property information. If a wrong name is given for an enumerated value, then an EPropertyError will be raised.

See also

GetEnumName | Return name of enumeration constant.
GetEnumValue | Get ordinal value for enumerated type by name
SetToString | Convert set to a string description


CanonicalOrder

Put unicode string in canonical order.

Declaration

Source position: unicodedata.pas line 385

procedure CanonicalOrder(

  var AString: UnicodeString

); overload;

procedure CanonicalOrder(

  AStr: PUnicodeChar;

  const ALength: SizeInt

); overload;

Arguments

AString

Unicode string

Arguments

AStr | Null-terminated string with length specified in ALength.
ALength | Length of null-terminated string AStr.

Description

CanonicalOrder transforms a unicode string AString (or the alternate form using a null-terminated AStr with length Alength) so it is in canonical order (as defined by the unicode specification). A string needs to be in canonical order to be able to compare strings. This function is called as part of NormalizeNFD.

See also

NormalizeNFD

Perform unicode normalization D on a string


CompareSortKey

Compare two sort keys.

Declaration

Source position: unicodedata.pas line 400

function CompareSortKey(

  const A: TUCASortKey;

  const B: TUCASortKey

):Integer; overload;

function CompareSortKey(

  const A: TUCASortKey;

  const B: array of Word

):Integer; overload;

Arguments

A | First key to compare
B | Second key to compare

Function result

A signed number determining how A and B are alphabetically ordered.

Arguments

A | First key to compare
B | Second key to compare

Description

CompareSortKey compares 2 sort keys A and B. It returns

  • a negative number if A comes alphabetically ordered before B.
  • Zero if A is alphabetically identical to B.
  • A positive number iff A is alphabetically ordered after B.

Sort keys can be constructed from unicode strings using ComputeSortKey.

See also

ComputeSortKey

Compute the sort key for a string


ComputeSortKey

Compute the sort key for a string

Declaration

Source position: unicodedata.pas line 391

function ComputeSortKey(

  const AString: UnicodeString;

  const ACollation: PUCA_DataBook

):TUCASortKey; overload;

function ComputeSortKey(

  const AStr: PUnicodeChar;

  const ALength: SizeInt;

  const ACollation: PUCA_DataBook

):TUCASortKey; overload;

Arguments

AString | Unicode string
ACollation | Unicode Collation Algorithm data to use.

Function result

Sort key for the string.

Arguments

AStr | Null-terminated string with length specified in ALength.
ALength | Length of null-terminated string AStr.
ACollation | Unicode Collation Algorithm data to use.

Description

ComputeSortKey computes the sort key for a unicode string AString (or the alternate form using a null-terminated AStr with length Alength) using the Unicode Collation Algorithm dat in ACollation. This key can then be used in CompareSortKey to compare unicode strings.

See also

CompareSortKey

Compare two sort keys.


FindCollation

Find a collation by name

Declaration

Source position: unicodedata.pas line 422

function FindCollation(

  const AName: ansistring

):PUCA_DataBook; overload;

function FindCollation(

  const AIndex: Integer

):PUCA_DataBook; overload;

Arguments

AName

Name of collation to find.

Function result

Pointer to collation data

Arguments

AIndex

Index of collation

Description

FindCollection searches a collation with name AName or index AIndex in the list of known collations and returns a pointer to the collation data. If the requested collation is not known, i.e. the name is not found, or the index is out of range, then Nil is returned. The valid index range is 0 to GetCollationCount-1.

See also

GetCollationCount

Return the number of known collations.


FreeCollation

Free collation data.

Declaration

Source position: unicodedata.pas line 439

procedure FreeCollation(

  AItem: PUCA_DataBook

);

Arguments

AItem

Collation to free

Description

FreeCollation removes all structures in the collation data from memory. It will not do anything when the header field Dynamic is false. (collations loaded and registered using LoadCollation are always dynamic and must be freed).

See also

LoadCollation

Load a binary collation data file from file


FromUCS4

Convert UCS4 to UNicodeChar

Declaration

Source position: unicodedata.pas line 357

procedure FromUCS4(

  const AValue: UCS4Char;

  var AHighS: UnicodeChar;

  var ALowS: UnicodeChar

);

Arguments

AValue | UCS4 encoded unicode character
AHighS | High character of surrogate pair
ALowS | Low character of surrogate pair

Description

FromUCS4 converts the UCS4 encoded unicode character AValue to a set of unicode (surrogate pair) characters encoded in UTF16: AHighS, ALowS.

See also

ToUCS4 | Encode unicode UTF16 surrogate pair to UCS4 character
UnicodeIsHighSurrogate | Check if a UTF16 character is the high character in a surrogate pair.
UnicodeIsLowSurrogate | Check if a UTF16 character is the low character in a surrogate pair.
UnicodeIsSurrogatePair | Check if a pair of UTF16 encoded characters is a valid surrogate pair.


GetCollationCount

Return the number of known collations.

Declaration

Source position: unicodedata.pas line 424

function GetCollationCount: Integer;

Function result

Number of known collations.

Description

GetCollationCount returns the number of registered collations. The collation data can be retrieved by index using the FindCollation. The maximum index is GetCollationCount-1.

See also

FindCollation

Find a collation by name


GetProps

Get unicode character data

Declaration

Source position: unicodedata.pas line 376

function GetProps(

  const ACodePoint: Word

):PUC_Prop; overload;

function GetProps(

  const AHighS: UnicodeChar;

  const ALowS: UnicodeChar

):PUC_Prop; overload;

function GetProps(

  const ACodePoint: Cardinal

):PUC_Prop; overload;

Arguments

ACodePoint

Code point (word or cardinal)

Function result

Pointer to unicode character data

Arguments

AHighS | High character in a UTF16 surrogate pair
ALowS | Low character in a UTF16 surrogate pair

Arguments

ACodePoint

Code point (word or cardinal)

Description

GetProps returns a pointer to a general unicode character property data structure. The character can be specified using a word or cardinal sized codepoint (ACodePoint), or using a UTF16 encoded surrogate pair (AHighS,ALowS).

The returned pointer must not be freed, it points to part of a static structure.

See also

GetPropUCA

Get unicode collation algorithm properties for a unicode character


GetPropUCA

Get unicode collation algorithm properties for a unicode character

Declaration

Source position: unicodedata.pas line 379

function GetPropUCA(

  const AHighS: UnicodeChar;

  const ALowS: UnicodeChar;

  const ABook: PUCA_DataBook

):PUCA_PropItemRec; overload;

function GetPropUCA(

  const AChar: UnicodeChar;

  const ABook: PUCA_DataBook

):PUCA_PropItemRec; overload;

Arguments

AHighS | High character of surrogate pair.
ALowS | Low character of surrogate pair.
ABook | Unicode Collation Algorithm data set.

Function result

UCA data for the character, nil if none is available.

Arguments

AChar | Unicode character
ABook | Unicode Collation Algorithm data set.

Description

GetPropUCA returns UCA data for the unicode character (AChar) or surrogate pair AHighS, ALowS) in the collation data book ABook. If no data is available, Nil is returned.

Errors

if an invalid ABook is specified, an access violation may occur.

See also

GetProps

Get unicode character data


IncrementalCompareString

Compare 2 strings using the specified collation

Declaration

Source position: unicodedata.pas line 402

function IncrementalCompareString(

  const AStrA: PUnicodeChar;

  const ALengthA: SizeInt;

  const AStrB: PUnicodeChar;

  const ALengthB: SizeInt;

  const ACollation: PUCA_DataBook

):Integer; overload;

function IncrementalCompareString(

  const AStrA: UnicodeString;

  const AStrB: UnicodeString;

  const ACollation: PUCA_DataBook

):Integer; overload;

Arguments

AStrA | First string in comparison.
ALengthA | Length of string AStrA.
AStrB | Second string in comparison.
ALengthB | Length of string AStrN
ACollation | Collation to use.

Function result

A signed integer indicating the alphabetic order of AStrA and AStrB.

Arguments

AStrA | First string in comparison.
AStrB | Second string in comparison.
ACollation | Collation to use.

Description

IncrementalCompareString creates 2 compare keys from the strings AStrA and AStrB using collation data in ACollation. The keys are computed only to the point where the two strings differ. This means the keys cannot be reused for other comparisons if the strings differ. The two strings can be specified as a unicode string or as a pointer to a null-terminated character array with a length (ALengthA and ALengthB). It returns then the result of CompareSortKey.

Errors

None.

See also

ComputeSortKey | Compute the sort key for a string
CompareSortKey | Compare two sort keys.


LoadCollation

Load a binary collation data file from file

Declaration

Source position: unicodedata.pas line 430

function LoadCollation(

  const AData: Pointer;

  const ADataLength: Integer

):PUCA_DataBook; overload;

function LoadCollation(

  const AFileName: string

):PUCA_DataBook; overload;

function LoadCollation(

  const ADirectory: string;

  const ALanguage: string

):PUCA_DataBook; overload;

Arguments

AData | Memory area containing encoded collation data
ADataLength | Length of memory area AData.

Function result

Pointer to prepared collation data

Arguments

AFileName

Filename to read data from

Arguments

ADirectory | Directory containing collations.
ALanguage | Language for which to load collation.

Description

LoadCollation loads collation data from file AFileName, or from a memory block AData with length ADataLength. If successful, it returns a pointer which can be used to register the collation using RegisterCollation. if there is a problem with the data, Nil is returned.

The filename can also be specified as a Directory and language name ALanguage. The latter is prepended with collation_ and appended with the native endianness of the current platform, and has extension .bco

Errors

If the file containing data does not exist or has a size which is less than the encoded header size, Nil is returned.

See also

RegisterCollation

Register a new collation


NormalizeNFD

Perform unicode normalization D on a string

Declaration

Source position: unicodedata.pas line 383

function NormalizeNFD(

  const AString: UnicodeString

):UnicodeString; overload;

function NormalizeNFD(

  const AStr: PUnicodeChar;

  ALength: SizeInt

):UnicodeString; overload;

Arguments

AString

Unicode string

Function result

Normalized form (D) of unicode string

Arguments

AStr | Null-terminated string with length specified in ALength.
ALength | Length of null-terminated string AStr.

Description

NormalizeNFD normalizes the string AString (or the alternate form using a null-terminated AStr with length Alength) to Unicode Normalization Form D. The resulting string can be used to determine equivalence of unicode strings.

See also

CanonicalOrder

Put unicode string in canonical order.


PrepareCollation

Prepare a collation for use in the list

Declaration

Source position: unicodedata.pas line 425

procedure PrepareCollation(

  ACollation: PUCA_DataBook;

  const ABaseName: ansistring;

  const AChangedFields: TCollationFields

);

Arguments

ACollation | Collation data to prepare
ABaseName | Base collation to connect to
AChangedFields | Changed fields, which should not be initialized

Description

PrepareCollation will link collation definition ACollation to the base collection with name ABaseName (if empty, it defaults to the root collation). It will also initialize some fields in the definition, copying them from the base collation, but excludes the fields enumerated in AChangedFields.

It should normally not be needed to call this function, it is called as part of LoadCollation.

See also

LoadCollation

Load a binary collation data file from file


RegisterCollation

Register a new collation

Declaration

Source position: unicodedata.pas line 415

function RegisterCollation(

  const ACollation: PUCA_DataBook

):Boolean; overload;

function RegisterCollation(

  const ADirectory: string;

  const ALanguage: string

):Boolean; overload;

Arguments

ACollation

Pointer to collation data in memory

Function result

True if the collation is registered correctly.

Arguments

ADirectory | Directory to search for ALanguage collation data.
ALanguage | Name of language data.

Description

RegisterCollation registers a new collation ACollation in the list of known collations. The collation data can be specified directly (ACollation) or a name of a language (ALanguage) in a directory (ADirectory). The latter option will load the binary encodeded collation from file using LoadCollation.

If the collation is loaded correctly, True is returned, otherwise False is returned (for instance when a collation with the same name is already loaded).

See also

UnRegisterCollation | Remove a collation from the list of known collections.
UnRegisterCollations | Unregister all collations.
LoadCollation | Load a binary collation data file from file


ToUCS4

Encode unicode UTF16 surrogate pair to UCS4 character

Declaration

Source position: unicodedata.pas line 358

function ToUCS4(

  const AHighS: UnicodeChar;

  const ALowS: UnicodeChar

):UCS4Char;

Arguments

AHighS | High character of surrogate pair
ALowS | Low character of surrogate pair

Function result

UCS4 encoded unicode characte

Description

ToUCS4 converts set of unicode (surrogate pair) characters encoded in UTF16: AHighS, ALowS to a UCS4 encoded unicode character.

See also

FromUCS4 | Convert UCS4 to UNicodeChar
UnicodeIsHighSurrogate | Check if a UTF16 character is the high character in a surrogate pair.
UnicodeIsLowSurrogate | Check if a UTF16 character is the low character in a surrogate pair.
UnicodeIsSurrogatePair | Check if a pair of UTF16 encoded characters is a valid surrogate pair.


UnicodeIsHighSurrogate

Check if a UTF16 character is the high character in a surrogate pair.

Declaration

Source position: unicodedata.pas line 363

function UnicodeIsHighSurrogate(

  const AValue: UnicodeChar

):Boolean;

Arguments

AValue

UTF16 character to check

Function result

True if AValue forms the high character of a surrogate pair

Description

UnicodeIsHighSurrogate checks whether AValue is a valid high character of a surrogate pair, and returns True if this is the case. It does this by checking whether the values are within the bounds for high characters in surrogate pairs.

See also

FromUCS4 | Convert UCS4 to UNicodeChar
ToUCS4 | Encode unicode UTF16 surrogate pair to UCS4 character
UnicodeIsHighSurrogate | Check if a UTF16 character is the high character in a surrogate pair.
UnicodeIsLowSurrogate | Check if a UTF16 character is the low character in a surrogate pair.
UnicodeIsSurrogatePair | Check if a pair of UTF16 encoded characters is a valid surrogate pair.


UnicodeIsLowSurrogate

Check if a UTF16 character is the low character in a surrogate pair.

Declaration

Source position: unicodedata.pas line 364

function UnicodeIsLowSurrogate(

  const AValue: UnicodeChar

):Boolean;

Arguments

AValue

UTF16 character to check

Function result

True if AValue forms the low character of a surrogate pair

Description

UnicodeIsHighSurrogate checks whether AValue is a valid high character of a surrogate pair, and returns True if this is the case. It does this by checking whether the values are within the bounds for high characters in surrogate pairs.

See also

FromUCS4 | Convert UCS4 to UNicodeChar
ToUCS4 | Encode unicode UTF16 surrogate pair to UCS4 character
UnicodeIsHighSurrogate | Check if a UTF16 character is the high character in a surrogate pair.
UnicodeIsSurrogatePair | Check if a pair of UTF16 encoded characters is a valid surrogate pair.


UnicodeIsSurrogatePair

Check if a pair of UTF16 encoded characters is a valid surrogate pair.

Declaration

Source position: unicodedata.pas line 359

function UnicodeIsSurrogatePair(

  const AHighSurrogate: UnicodeChar;

  const ALowSurrogate: UnicodeChar

):Boolean;

Arguments

AHighSurrogate | High character in the surrogate pair
ALowSurrogate | Low character in the surrogate pair

Function result

True if AHighSurrogate,ALowSurrogate are a valid surrogate pair

Description

UnicodeIsSurrogatePair checks whether AHighSurrogate,ALowSurrogate constitute a valid surrogate pair, and returns True if this is the case. It does this by checking whether the values are within the bounds for high and low surrogate pairs.

See also

FromUCS4 | Convert UCS4 to UNicodeChar
ToUCS4 | Encode unicode UTF16 surrogate pair to UCS4 character
UnicodeIsHighSurrogate | Check if a UTF16 character is the high character in a surrogate pair.
UnicodeIsLowSurrogate | Check if a UTF16 character is the low character in a surrogate pair.


UnicodeToLower

Transform unicode string to lowercase

Declaration

Source position: unicodedata.pas line 370

function UnicodeToLower(

  const AString: UnicodeString;

  const AIgnoreInvalidSequence: Boolean;

  out AResultString: UnicodeString

):Integer;

Arguments

AString | String to convert to lowercase.
AIgnoreInvalidSequence | Set to true to ignore invalid characters.
AResultString | Lowercase equivalent of AString

Function result

Zero if all went well, nonzero indicates an error.

Description

UnicodeToLower transforms a UTF16 unicode string AString to its lowercase equivalent and returns this in AResultString. If the transformation was succesful, then the function returns 0. A nonzero return value means an error occurred. AResultString will remain untouched in that case.

If a character in AString cannot be found in the unicode data tables, an error will be reported, unless AIgnoreInvalidSequence is set to True, in which case the character will be copied as-is to the output.

Unicode collation data can be loaded using RegisterCollation or LoadCollation

Errors

On error, a nonzero value will be returned.

See also

UnicodeToUpper | Transform unicode string to uppercase
RegisterCollation | Register a new collation
LoadCollation | Load a binary collation data file from file


UnicodeToUpper

Transform unicode string to uppercase

Declaration

Source position: unicodedata.pas line 365

function UnicodeToUpper(

  const AString: UnicodeString;

  const AIgnoreInvalidSequence: Boolean;

  out AResultString: UnicodeString

):Integer;

Arguments

AString | String to convert to uppercase.
AIgnoreInvalidSequence | Set to true to ignore invalid characters.
AResultString | Uppercase equivalent of AString

Function result

Zero if all went well, nonzero indicates an error.

Description

UnicodeToUpper transforms a UTF16 unicode string AString to its uppercase equivalent and returns this in AResultString. If the transformation was succesful, then the function returns 0. A nonzero return value means an error occurred. AResultString will remain untouched in that case.

If a character in AString cannot be found in the unicode data tables, an error will be reported, unless AIgnoreInvalidSequence is set to True, in which case the character will be copied as-is to the output.

Unicode collation data can be loaded using RegisterCollation or LoadCollation

Errors

On error, a nonzero value will be returned.

See also

UnicodeToLower | Transform unicode string to lowercase
RegisterCollation | Register a new collation
LoadCollation | Load a binary collation data file from file


UnregisterCollation

Remove a collation from the list of known collections.

Declaration

Source position: unicodedata.pas line 420

function UnregisterCollation(

  const AName: ansistring

):Boolean;

Arguments

AName

Name of collation to remove.

Function result

True if the collation was found and succesfully removed

Description

UnRegisterCollation removes a collation AName from the list of known collations. It returns True if the collation was found and succesfully removed.

Errors

If the collation was not found, False is returned.

See also

RegisterCollation | Register a new collation
UnRegisterCollations | Unregister all collations.
LoadCollation | Load a binary collation data file from file


UnregisterCollations

Unregister all collations.

Declaration

Source position: unicodedata.pas line 421

procedure UnregisterCollations(

  const AFreeDynamicCollations: Boolean

);

Arguments

AFreeDynamicCollations

Should dynamic collations be freed from memory ?

Description

UnregisterCollations unregisters all known collations. If AFreeDynamicCollations is True, then dynamic collations will be removed from memory using FreeCollation. This must normally be set to true.

See also

RegisterCollation | Register a new collation
UnRegisterCollation | Remove a collation from the list of known collections.
LoadCollation | Load a binary collation data file from file
FreeCollation | Free collation data.


AssignPipe

Create a set of pipe file handlers

Declaration

Source position: unix.pp line 114

function AssignPipe(

  var pipe_in: cint;

  var pipe_out: cint

):cint;

function AssignPipe(

  var pipe_in: text;

  var pipe_out: text

):cint;

function AssignPipe(

  var pipe_in: file;

  var pipe_out: file

):cint;

Description

AssignePipe creates a pipe, i.e. two file objects, one for input, one for output. What is written to Pipe_out, can be read from Pipe_in.

This call is overloaded. The in and out pipe can take three forms: an typed or untyped file, a text file or a file descriptor.

If a text file is passed then reading and writing from/to the pipe can be done through the usual Readln(Pipe_in,...) and Writeln(Pipe_out,...) procedures.

The function returns True if everything went succesfully, False otherwise.

Errors

In case the function fails and returns False, extended error information is returned by the FpGetErrno function:

sys_emfile
Too many file descriptors for this process.
sys_enfile
The system file table is full.

See also

POpen | Pipe file to standard input/output of program
#rtl.baseunix.FpMkFifo | Create FIFO (named pipe) in file system

Example

Program Example36;

{ Program to demonstrate the AssignPipe function. }

Uses BaseUnix,Unix;

Var pipi,pipo : Text;
    s : String;

begin
  Writeln ('Assigning Pipes.');
  If assignpipe(pipi,pipo)<>0 then
    Writeln('Error assigning pipes !',fpgeterrno);
  Writeln ('Writing to pipe, and flushing.');
  Writeln (pipo,'This is a textstring');close(pipo);
  Writeln ('Reading from pipe.');
  While not eof(pipi) do
    begin
    Readln (pipi,s);
    Writeln ('Read from pipe : ',s);
    end;
  close (pipi);
  writeln ('Closed pipes.');
  writeln
end.


AssignStream

Assign stream for in and output to a program

Declaration

Source position: unix.pp line 121

function AssignStream(

  var StreamIn: text;

  var Streamout: text;

  const Prog: ansiString;

  const args: array of ansistring

):cint;

function AssignStream(

  var StreamIn: text;

  var Streamout: text;

  var streamerr: text;

  const Prog: ansiString;

  const args: array of ansistring

):cint;

Description

AssignStream creates a 2 or 3 pipes, i.e. two (or three) file objects, one for input, one for output,(and one for standard error) the other ends of these pipes are connected to standard input and output (and standard error) of Prog. Prog is the path of a program (including path). The options for the program can be specified in Args.

What is written to StreamOut, will go to the standard input of Prog. Whatever is written by Prog to it's standard output can be read from StreamIn. Whatever is written by Prog to it's standard error read from StreamErr, if present.

Reading and writing happens through the usual Readln(StreamIn,...) and Writeln (StreamOut,...) procedures.

Remark: You should not use Reset or Rewrite on a file opened with POpen. This will close the file before re-opening it again, thereby closing the connection with the program.

The function returns the process ID of the spawned process, or -1 in case of error.

Errors

Extended error information is returned by the FpGetErrno function.

sys_emfile
Too many file descriptors for this process.
sys_enfile
The system file table is full.

Other errors include the ones by the fork and exec programs

See also

AssignPipe | Create a set of pipe file handlers
POpen | Pipe file to standard input/output of program

Example

Program Example38;

{ Program to demonstrate the AssignStream function. }

Uses BaseUnix,Unix;

Var Si,So : Text;
    S : String;
    i : longint;

begin
  if not (paramstr(1)='-son') then
    begin
    Writeln ('Calling son');
    Assignstream (Si,So,'./ex38',['-son']);
    if fpgeterrno<>0 then
      begin
      writeln ('AssignStream failed !');
      halt(1);
      end;
    Writeln ('Speaking to son');
    For i:=1 to 10 do
      begin
      writeln (so,'Hello son !');
      if ioresult<>0 then writeln ('Can''t speak to son...');
      end;
    For i:=1 to 3 do writeln (so,'Hello chap !');
    close (so);
    while not eof(si) do
      begin
      readln (si,s);
      writeln ('Father: Son said : ',S);
      end;
    Writeln ('Stopped conversation');
    Close (Si);
    Writeln ('Put down phone');
    end
  Else
    begin
    Writeln ('This is the son ');
    While not eof (input) do
      begin
      readln (s);
      if pos ('Hello son !',S)<>0 then
         Writeln ('Hello Dad !')
      else
         writeln ('Who are you ?');
      end;
    close (output);
    end
end.


FpExecL

Execute process (using argument list, environment)

Declaration

Source position: unix.pp line 84

function FpExecL(

  const PathName: AnsiString;

  const S: array of AnsiString

):cint;

Description

FpExecL replaces the currently running program with the program, specified in PathName. S is an array of command options. The executable in PathName must be an absolute pathname. The current process' environment is passed to the program. On success, FpExecL does not return.

Errors

Extended error information is returned by the FpGetErrno function:

sys_eacces
File is not a regular file, or has no execute permission. A compononent of the path has no search permission.
sys_eperm
The file system is mounted noexec.
sys_e2big
Argument list too big.
sys_enoexec
The magic number in the file is incorrect.
sys_enoent
The file does not exist.
sys_enomem
Not enough memory for kernel, or to split command line.
sys_enotdir
A component of the path is not a directory.
sys_eloop
The path contains a circular reference (via symlinks).

See also

FpExecve | Execute process using environment
FpExecv | Execute process
FpExecvp | Execute process, search path
FpExecle | Execute process (using argument list, environment)
FpExeclp | Execute process (using argument list, environment; search path)
FpFork | Create child process

Example

Program Example77;

{ Program to demonstrate the FPExecL function. }

Uses Unix, strings;

begin
  { Execute 'ls -l', with current environment. }
  { 'ls' is NOT looked for in PATH environment variable.}
  FpExecL ('/bin/ls',['-l']);
end.


FpExecLE

Execute process (using argument list, environment)

Declaration

Source position: unix.pp line 83

function FpExecLE(

  const PathName: AnsiString;

  const S: array of AnsiString;

  MyEnv: PPChar

):cint;

Description

FpExecLE replaces the currently running program with the program, specified in PathName. S is an array of command options. The executable in PathName must be an absolute pathname. The environment in MyEnv is passed to the program. On success, FpExecLE does not return.

Errors

Extended error information is returned by the FpGetErrno function:

sys_eacces
File is not a regular file, or has no execute permission. A compononent of the path has no search permission.
sys_eperm
The file system is mounted noexec.
sys_e2big
Argument list too big.
sys_enoexec
The magic number in the file is incorrect.
sys_enoent
The file does not exist.
sys_enomem
Not enough memory for kernel, or to split command line.
sys_enotdir
A component of the path is not a directory.
sys_eloop
The path contains a circular reference (via symlinks).

See also

FpExecve | Execute process using environment
FpExecv | Execute process
FpExecvp | Execute process, search path
FpExecl | Execute process (using argument list, environment)
FpExeclp | Execute process (using argument list, environment; search path)
FpFork | Create child process

Example

Program Example11;

{ Program to demonstrate the Execle function. }

Uses Unix, strings;

begin
  { Execute 'ls -l', with current environment. }
  { 'ls' is NOT looked for in PATH environment variable.}
  { envp is defined in the system unit.}
  Execle ('/bin/ls -l',envp);
end.


FpExecLP

Execute process (using argument list, environment; search path)

Declaration

Source position: unix.pp line 85

function FpExecLP(

  const PathName: AnsiString;

  const S: array of AnsiString

):cint;

Description

FpExecLP replaces the currently running program with the program, specified in PathName. S is an array of command options. The executable in PathName is searched in the path, if it isn't an absolute filename. The current environment is passed to the program. On success, FpExecLP does not return.

Errors

Extended error information is returned by the FpGetErrno function:

sys_eacces
File is not a regular file, or has no execute permission. A compononent of the path has no search permission.
sys_eperm
The file system is mounted noexec.
sys_e2big
Argument list too big.
sys_enoexec
The magic number in the file is incorrect.
sys_enoent
The file does not exist.
sys_enomem
Not enough memory for kernel, or to split command line.
sys_enotdir
A component of the path is not a directory.
sys_eloop
The path contains a circular reference (via symlinks).

See also

FpExecve | Execute process using environment
FpExecv | Execute process
FpExecvp | Execute process, search path
FpExecle | Execute process (using argument list, environment)
FpExecl | Execute process (using argument list, environment)
FpFork | Create child process

Example

Program Example76;

{ Program to demonstrate the FpExeclp function. }

Uses Unix, strings;

begin
  { Execute 'ls -l', with current environment. }
  { 'ls' is looked for in PATH environment variable.}
  { envp is defined in the system unit.}
  FpExeclp ('ls',['-l']);
end.


FpExecLPE

Execute a program in the path, and pass it an environment

Declaration

Source position: unix.pp line 86

function FpExecLPE(

  const PathName: AnsiString;

  const S: array of AnsiString;

  env: PPChar

):cint;

Description

FpExecLPE does the same as FpExecLP, but additionally it specifies the environment for the new process in env, a pointer to a null-terminated array of null-terminated strings.

Errors

On success, this function does not return.

See also

FpExecLP | Execute process (using argument list, environment; search path)
FpExecLE | Execute process (using argument list, environment)


FpExecV

Execute process

Declaration

Source position: unix.pp line 87

function FpExecV(

  const PathName: AnsiString;

  args: PPChar

):cint;

Description

FpExecV replaces the currently running program with the program, specified in PathName. It gives the program the options in args. This is a pointer to an array of pointers to null-terminated strings. The last pointer in this array should be nil. The current environment is passed to the program. On success, FpExecV does not return.

Errors

Extended error information is returned by the FpGetErrno function:

sys_eacces
File is not a regular file, or has no execute permission. A compononent of the path has no search permission.
sys_eperm
The file system is mounted noexec.
sys_e2big
Argument list too big.
sys_enoexec
The magic number in the file is incorrect.
sys_enoent
The file does not exist.
sys_enomem
Not enough memory for kernel.
sys_enotdir
A component of the path is not a directory.
sys_eloop
The path contains a circular reference (via symlinks).

See also

FpExecve | Execute process using environment
FpExecvp | Execute process, search path
FpExecle | Execute process (using argument list, environment)
FpExecl | Execute process (using argument list, environment)
FpExeclp | Execute process (using argument list, environment; search path)
FpFork | Create child process

Example

Program Example8;

{ Program to demonstrate the Execv function. }

Uses Unix, strings;

Const Arg0 : PChar = '/bin/ls';
      Arg1 : Pchar = '-l';

Var PP : PPchar;

begin
  GetMem (PP,3*SizeOf(Pchar));
  PP[0]:=Arg0;
  PP[1]:=Arg1;
  PP[3]:=Nil;
  { Execute '/bin/ls -l', with current environment }
  fpExecv ('/bin/ls',pp);
end.


FpExecVP

Execute process, search path

Declaration

Source position: unix.pp line 88

function FpExecVP(

  const PathName: AnsiString;

  args: PPChar

):cint;

Description

FpExecVP replaces the currently running program with the program, specified in PathName. The executable in path is searched in the path, if it isn't an absolute filename. It gives the program the options in args. This is a pointer to an array of pointers to null-terminated strings. The last pointer in this array should be nil. The current environment is passed to the program. On success, execvp does not return.

Errors

Extended error information is returned by the FpGetErrno function:

sys_eacces
File is not a regular file, or has no execute permission. A compononent of the path has no search permission.
sys_eperm
The file system is mounted noexec.
sys_e2big
Argument list too big.
sys_enoexec
The magic number in the file is incorrect.
sys_enoent
The file does not exist.
sys_enomem
Not enough memory for kernel.
sys_enotdir
A component of the path is not a directory.
sys_eloop
The path contains a circular reference (via symlinks).

See also

FpExecve | Execute process using environment
FpExecv | Execute process
FpExecle | Execute process (using argument list, environment)
FpExecl | Execute process (using argument list, environment)
FpExeclp | Execute process (using argument list, environment; search path)
FpFork | Create child process

Example

Program Example79;

{ Program to demonstrate the FpExecVP function. }

Uses Unix, strings;

Const Arg0 : PChar = 'ls';
      Arg1 : Pchar = '-l';

Var PP : PPchar;

begin
  GetMem (PP,3*SizeOf(Pchar));
  PP[0]:=Arg0;
  PP[1]:=Arg1;
  PP[2]:=Nil;
  { Execute 'ls -l', with current environment. }
  { 'ls' is looked for in PATH environment variable.}
  fpExecvp ('ls',pp);
end.


FpExecVPE

Execute process, search path using environment

Declaration

Source position: unix.pp line 89

function FpExecVPE(

  const PathName: AnsiString;

  args: PPChar;

  env: PPChar

):cint;

Description

FpExecVP replaces the currently running program with the program, specified in PathName. The executable in path is searched in the path, if it isn't an absolute filename. It gives the program the options in args. This is a pointer to an array of pointers to null-terminated strings. The last pointer in this array should be nil. The environment in Env is passed to the program. On success, execvp does not return.

Errors

Extended error information is returned by the FpGetErrno function:

sys_eacces
File is not a regular file, or has no execute permission. A compononent of the path has no search permission.
sys_eperm
The file system is mounted noexec.
sys_e2big
Argument list too big.
sys_enoexec
The magic number in the file is incorrect.
sys_enoent
The file does not exist.
sys_enomem
Not enough memory for kernel.
sys_enotdir
A component of the path is not a directory.
sys_eloop
The path contains a circular reference (via symlinks).

See also

FpExecve | Execute process using environment
FpExecv | Execute process
FpExecle | Execute process (using argument list, environment)
FpExecl | Execute process (using argument list, environment)
FpExeclp | Execute process (using argument list, environment; search path)
FpFork | Create child process

Example

Program Example79;

{ Program to demonstrate the FpExecVP function. }

Uses Unix, strings;

Const Arg0 : PChar = 'ls';
      Arg1 : Pchar = '-l';

Var PP : PPchar;

begin
  GetMem (PP,3*SizeOf(Pchar));
  PP[0]:=Arg0;
  PP[1]:=Arg1;
  PP[2]:=Nil;
  { Execute 'ls -l', with current environment. }
  { 'ls' is looked for in PATH environment variable.}
  fpExecvp ('ls',pp);
end.


fpFlock

Lock a file (advisory lock)

Declaration

Source position: unix.pp line 101

function fpFlock(

  var T: text;

  mode: cint

):cint;

function fpFlock(

  var F: file;

  mode: cint

):cint;

function fpFlock(

  fd: cint;

  mode: cint

):cint;

Description

FpFLock implements file locking. it sets or removes a lock on the file F. F can be of type Text or File, or it can be a Linux filedescriptor (a longint) Mode can be one of the following constants :

LOCK_SH
sets a shared lock.
LOCK_EX
sets an exclusive lock.
LOCK_UN
unlocks the file.
LOCK_NB
This can be OR-ed together with the other. If this is done the application doesn't block when locking.

The function returns zero if successful, a nonzero return value indicates an error.

Errors

Extended error information is returned by the FpGetErrno function:

See also

#rtl.baseunix.FpFcntl | File control operations.
FSync | Synchronize file's kernel data with disk.


fpfStatFS

Retrieve filesystem information.

Declaration

Source position: unxsysch.inc line 18

function fpfStatFS(

  Fd: cint;

  Info: pstatfs

):cint;

Description

fpStatFS returns in Info information about the filesystem on which the open file descriptor fd resides. Info is of type tstatfs. The function returns 0 if the call was succesfull, or an error code if the call failed.

Errors

On error, a non-zero error code is returned

See also

fpStatFS | Retrieve filesystem information.
#rtl.baseunix.fpfStat | Retrieve file information about a file descriptor.


fpfsync

Flush cached data to disk

Declaration

Source position: unxsysch.inc line 20

function fpfsync(

  fd: cint

):cint;

Description

fpfsync forces the system to write all paged (in-memory) changes to file descriptor fd to disk. If the call was succesful, 0 is returned.

Errors

On error, a nonzero error-code is returned.


fpgettimeofday

Return kernel time of day in GMT

Declaration

Source position: unxsysch.inc line 16

function fpgettimeofday(

  tp: ptimeval;

  tzp: ptimezone

):cint;

Description

FpGetTimeOfDay returns the number of seconds since 00:00, January 1 1970, GMT in a timeval record. This time NOT corrected any way, not taking into account timezones, daylight savings time and so on.

It is simply a wrapper to the kernel system call.

Errors

None.


fpStatFS

Retrieve filesystem information.

Declaration

Source position: unxsysch.inc line 19

function fpStatFS(

  Path: PChar;

  Info: pstatfs

):cint;

function fpStatFS(

  Path: ansistring;

  Info: pstatfs

):cint;

Description

fpStatFS returns in Info information about the filesystem on which the file or path Path resides. Info is of type tstatfs. The function returns 0 if the call was succesfull, or an error code if the call failed.

Errors

On error, a non-zero error code is returned

See also

fpFStatFS | Retrieve filesystem information.
#rtl.baseunix.fpStat | Retrieve file information about a file descriptor.


fpSystem

Execute and feed command to system shell

Declaration

Source position: unix.pp line 91

function fpSystem(

  const Command: string

):cint;

function fpSystem(

  const Command: AnsiString

):cint;

Description

FpSystem invokes the bash shell (/bin/sh), and feeds it the command Command (using the -c option). The function then waits for the command to complete, and then returns the exit status of the command in wait(3) format, or 127 if it could not complete the FpFork or FpExecve calls. To convert the return value of fpsystem to the real return value use WEXITSTATUS().

Errors

Errors are reported in (fpget)ErrNo

See also

POpen | Pipe file to standard input/output of program
FpFork | Create child process
FpExecve | Execute process using environment

Example

program example56;

uses Unix;

{ Program to demonstrate the Shell function }

Var S : Longint;

begin
  Writeln ('Output of ls -l *.pp');
  S:=fpSystem('ls -l *.pp');
  Writeln ('Command exited wwith status : ',S);
end.


FSearch

Search for file in search path.

Declaration

Source position: unix.pp line 133

function FSearch(

  const path: AnsiString;

  dirlist: Ansistring;

  CurrentDirStrategy: TFSearchOption

):AnsiString;

function FSearch(

  const path: AnsiString;

  dirlist: AnsiString

):AnsiString;

Description

FSearch searches in DirList, a colon separated list of directories, for a file named Path. It then returns a path to the found file.

The CurrentDirStrategy determines how the current directory is treated when searching:

NoCurrentDirectory
Do not search the current directory unless it is specified in the search path.
CurrentDirectoryFirst
Search the current directory first, before all directories in the search path.
CurrentDirectoryLast
Search the current directory last, after all directories in the search path

It is mainly provided to mimic DOS search path behaviour. Default behaviour is to search the current directory first.

Errors

An empty string if no such file was found.

See also

#rtl.unixutil.FNMatch

Check whether filename matches wildcard specification

Example

Program Example46;

{ Program to demonstrate the FSearch function. }

Uses BaseUnix, Unix, Strings;

begin
  Writeln ('ls is in : ',FSearch ('ls',strpas(fpGetenv('PATH'))));
end.


GetDomainName

[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'Unix' (#rtl)

GetDomainName (deprecated)

Return current domain name

Declaration

Source position: unix.pp line 123

function GetDomainName: string;

Description

Get the domain name of the machine on which the process is running. An empty string is returned if the domain is not set.

Errors

None.

See also

GetHostName

Return host name

Example

Program Example39;

{ Program to demonstrate the GetDomainName function. }

Uses Unix;

begin
  Writeln ('Domain name of this machine is : ',GetDomainName);
end.


GetHostName

Return host name

Declaration

Source position: unix.pp line 124

function GetHostName: string;

Description

Get the hostname of the machine on which the process is running. An empty string is returned if hostname is not set.

Errors

None.

See also

GetDomainName

Return current domain name

Example

Program Example40;

{ Program to demonstrate the GetHostName function. }

Uses unix;

begin
  Writeln ('Name of this machine is : ',GetHostName);
end.


GetLocalTimezone

Return local timzeone information

Declaration

Source position: unix.pp line 74

procedure GetLocalTimezone(

  timer: cint;

  var leap_correct: cint;

  var leap_hit: cint

);

procedure GetLocalTimezone(

  timer: cint

);

Description

GetLocalTimeZone returns the local timezone information. It also initializes the TZSeconds variable, which is used to correct the epoch time to local time.

There should never be any need to call this function directly. It is called by the initialization routines of the Linux unit.

See also

GetTimezoneFile | Return name of timezone information file
ReadTimezoneFile | Read the timezone file and initialize time routines


GetTimezoneFile

Return name of timezone information file

Declaration

Source position: unix.pp line 77

function GetTimezoneFile: string;

Description

GetTimezoneFile returns the location of the current timezone file. The location of file is determined as follows:

  1. If /etc/timezone exists, it is read, and the contents of this file is returned. This should work on Debian systems.
  2. If /usr/lib/zoneinfo/localtime exists, then it is returned. (this file is a symlink to the timezone file on SuSE systems)
  3. If /etc/localtime exists, then it is returned. (this file is a symlink to the timezone file on RedHat systems)

Errors

If no file was found, an empty string is returned.

See also

ReadTimezoneFile

Read the timezone file and initialize time routines


PClose

Close file opened with POpen

Declaration

Source position: unxovlh.inc line 16

function PClose(

  var F: file

):cint;

function PClose(

  var F: text

):cint;

Description

PClose closes a file opened with POpen. It waits for the command to complete, and then returns the exit status of the command.

For an example, see POpen

Errors

Extended error information is returned by the FpGetErrno function.

See also

POpen

Pipe file to standard input/output of program


POpen

Pipe file to standard input/output of program

Declaration

Source position: unix.pp line 117

function POpen(

  var F: text;

  const Prog: RawByteString;

  rw: Char

):cint;

function POpen(

  var F: file;

  const Prog: RawByteString;

  rw: Char

):cint;

function POpen(

  var F: text;

  const Prog: UnicodeString;

  rw: Char

):cint;

function POpen(

  var F: file;

  const Prog: UnicodeString;

  rw: Char

):cint;

Description

POpen runs the command specified in Prog, and redirects the standard in or output of the command to the other end of the pipe F. The parameter rw indicates the direction of the pipe. If it is set to 'W', then F can be used to write data, which will then be read by the command from stdinput. If it is set to 'R', then the standard output of the command can be read from F. F should be reset or rewritten prior to using it. F can be of type Text or File. A file opened with POpen can be closed with Close, but also with PClose. The result is the same, but PClose returns the exit status of the command Prog.

Errors

Extended error information is returned by the FpGetErrno function. Errors are essentially those of the Execve, Dup and AssignPipe commands.

See also

AssignPipe | Create a set of pipe file handlers
PClose | Close file opened with POpen

Example

Program Example37;

{ Program to demonstrate the Popen function. }

uses BaseUnix,Unix;

var f : text;
    i : longint;

begin
  writeln ('Creating a shell script to which echoes its arguments');
  writeln ('and input back to stdout');
  assign (f,'test21a');
  rewrite (f);
  writeln (f,'#!/bin/sh');
  writeln (f,'echo this is the child speaking.... ');
  writeln (f,'echo got arguments \*"$*"\*');
  writeln (f,'cat');
  writeln (f,'exit 2');
  writeln (f);
  close (f);
  fpchmod ('test21a',&755);
  popen (f,'./test21a arg1 arg2','W');
  if fpgeterrno<>0 then
     writeln ('error from POpen : errno : ', fpgeterrno);
  for i:=1 to 10 do
    writeln (f,'This is written to the pipe, and should appear on stdout.');
  Flush(f);
  Writeln ('The script exited with status : ',PClose (f));
  writeln;
  writeln ('Press <return> to remove shell script.');
  readln;
  assign (f,'test21a');
  erase (f)
end.


ReadTimezoneFile

Read the timezone file and initialize time routines

Declaration

Source position: unix.pp line 76

procedure ReadTimezoneFile(

  fn: string

);

Description

ReadTimeZoneFile reads the timezone file fn and initializes the local time routines based on the information found there.

There should be no need to call this function. The initialization routines of the linux unit call this routine at unit startup.

Errors

None.

See also

GetTimezoneFile | Return name of timezone information file
GetLocalTimezone | Return local timzeone information


ReReadLocalTime

Re-Read the local time files.

Declaration

Source position: unix.pp line 78

procedure ReReadLocalTime;

Description

ReReadLocalTime can be used to re-initialize the local timezone information.

To speed up conversion of epoch (UTC) time to local time, the timezone information is loaded only once, at program startup. Calling this routine re-reads the timezone information using current timezone settings.

The EpochToLocal function uses timezone information to transform epoch time to local time. This timezone information does not change while the application is running: in particular, on DST transitions or when the timezone files change, the time returned by local time routines will be wrong.

See also

Date | Return the current date.
Time | Returns the current time.
Now | Returns the current date and time.
EpochToLocal | Convert epoch time to local time


SeekDir

Seek to position in directory

Declaration

Source position: unix.pp line 109

procedure SeekDir(

  p: pDir;

  loc: clong

);

Description

SeekDir sets the directory pointer to the loc-th entry in the directory structure pointed to by p.

For an example, see #rtl.baseunix.fpOpenDir.

Errors

Extended error information is returned by the FpGetErrno function:

See also

#rtl.baseunix.fpCloseDir | Close directory file descriptor
#rtl.baseunix.fpReadDir | Read entry from directory
#rtl.baseunix.fpOpenDir | Open a directory for reading
TellDir | Return current location in a directory


SelectText

Wait for event on text file.

Declaration

Source position: unix.pp line 104

function SelectText(

  var T: Text;

  TimeOut: ptimeval

):cint;

function SelectText(

  var T: Text;

  TimeOut: cint

):cint;

Description

SelectText executes the FpSelect call on a file of type Text. You can specify a timeout in TimeOut. The SelectText call determines itself whether it should check for read or write, depending on how the file was opened : With Reset it is checked for reading, with Rewrite and Append it is checked for writing.

Errors

See #rtl.baseunix.FpSelect. SYS_EBADF can also mean that the file wasn't opened.

See also

#rtl.baseunix.FpSelect

Wait for events on file descriptors


SigRaise

[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'Unix' (#rtl)

SigRaise (deprecated)

Raise a signal (send to current process)

Declaration

Source position: unix.pp line 136

procedure SigRaise(

  sig: Integer

);

Description

SigRaise sends a Sig signal to the current process.

Errors

None.

See also

#rtl.baseunix.FpKill | Send a signal to a process
#rtl.baseunix.FpGetPid | Return current process ID

Example

Program example64;

{ Program to demonstrate the fpKill/getPID function.}

uses Unix,BaseUnix;

Var
   oa,na : PSigActionrec;

Procedure DoSig(sig : Longint);cdecl;

begin
   writeln('Receiving signal: ',sig);
end;

begin
   new(na);
   new(oa);
   na^.sa_handler:=SigActionHandler(@DoSig);
   fillchar(na^.Sa_Mask,sizeof(na^.Sa_Mask),#0);
   na^.Sa_Flags:=0;
   {$ifdef Linux}
   // this member is linux only, and afaik even there arcane
   na^.Sa_Restorer:=Nil;
   {$endif}
   if fpSigAction(SigUsr1,na,oa)<>0 then
     begin
     writeln('Error: ',fpgeterrno);
     halt(1);
     end;
   Writeln('Sending USR1 (',sigusr1,') signal to self.');
   fpKill(fpgetPID,sigusr1);
end.


TellDir

Return current location in a directory

Declaration

Source position: unix.pp line 110

function TellDir(

  p: pDir

):TOff;

Description

TellDir returns the current location in the directory structure pointed to by p. It returns -1 on failure.

For an example, see #rtl.baseunix.fpOpenDir.

See also

#rtl.baseunix.fpCloseDir | Close directory file descriptor
#rtl.baseunix.fpReadDir | Read entry from directory
#rtl.baseunix.fpOpenDir | Open a directory for reading
SeekDir | Seek to position in directory


WaitProcess

Wait for process to terminate.

Declaration

Source position: unix.pp line 94

function WaitProcess(

  Pid: cint

):cint;

Description

WaitProcess waits for process PID to exit. WaitProcess is equivalent to the #rtl.baseunix.FpWaitPID call:

FpWaitPid(PID,@result,0)

Handles of Signal interrupts (errno=EINTR), and returns the Exitcode of Process PID (>=0) or -Status if it was terminated

Errors

None.

See also

#rtl.baseunix.FpWaitPID | Wait for a process to terminate
#rtl.baseunix.WTERMSIG | Return the signal that caused a process to exit.
#rtl.baseunix.WSTOPSIG | Return the exit code from the process.
#rtl.baseunix.WIFEXITED | Check whether the process exited normally
WIFSTOPPED | Check whether the process is currently stopped.
#rtl.baseunix.WIFSIGNALED | Check whether the process was exited by a signal.
W_EXITCODE | Construct an exit status based on an return code and signal.
W_STOPCODE | Construct an exit status based on a signal.
#rtl.baseunix.WEXITSTATUS | Extract the exit status from the fpWaitPID result.


WIFSTOPPED

Check whether the process is currently stopped.

Declaration

Source position: unix.pp line 96

function WIFSTOPPED(

  Status: Integer

):Boolean;

Description

WIFSTOPPED checks Status and returns true if the process is currently stopped. This is only possible if WUNTRACED was specified in the options of FpWaitPID.

See also

#rtl.baseunix.FpWaitPID | Wait for a process to terminate
WaitProcess | Wait for process to terminate.
#rtl.baseunix.WTERMSIG | Return the signal that caused a process to exit.
#rtl.baseunix.WSTOPSIG | Return the exit code from the process.
#rtl.baseunix.WIFEXITED | Check whether the process exited normally
#rtl.baseunix.WIFSIGNALED | Check whether the process was exited by a signal.
W_EXITCODE | Construct an exit status based on an return code and signal.
W_STOPCODE | Construct an exit status based on a signal.
#rtl.baseunix.WEXITSTATUS | Extract the exit status from the fpWaitPID result.


W_EXITCODE

Construct an exit status based on an return code and signal.

Declaration

Source position: unix.pp line 97

function W_EXITCODE(

  ReturnCode: Integer;

  Signal: Integer

):Integer;

Description

W_EXITCODE combines ReturnCode and Signal to a status code fit for WaitPid.

See also

#rtl.baseunix.FpWaitPID | Wait for a process to terminate
WaitProcess | Wait for process to terminate.
#rtl.baseunix.WTERMSIG | Return the signal that caused a process to exit.
#rtl.baseunix.WSTOPSIG | Return the exit code from the process.
#rtl.baseunix.WIFEXITED | Check whether the process exited normally
WIFSTOPPED | Check whether the process is currently stopped.
#rtl.baseunix.WIFSIGNALED | Check whether the process was exited by a signal.
W_EXITCODE | Construct an exit status based on an return code and signal.
W_STOPCODE | Construct an exit status based on a signal.
#rtl.baseunix.WEXITSTATUS | Extract the exit status from the fpWaitPID result.


W_STOPCODE

Construct an exit status based on a signal.

Declaration

Source position: unix.pp line 98

function W_STOPCODE(

  Signal: Integer

):Integer;

Description

W_STOPCODE constructs an exit status based on Signal, which will cause WIFSIGNALED to return True

See also

#rtl.baseunix.FpWaitPID | Wait for a process to terminate
WaitProcess | Wait for process to terminate.
#rtl.baseunix.WTERMSIG | Return the signal that caused a process to exit.
#rtl.baseunix.WSTOPSIG | Return the exit code from the process.
#rtl.baseunix.WIFEXITED | Check whether the process exited normally
WIFSTOPPED | Check whether the process is currently stopped.
#rtl.baseunix.WIFSIGNALED | Check whether the process was exited by a signal.
W_EXITCODE | Construct an exit status based on an return code and signal.
#rtl.baseunix.WEXITSTATUS | Extract the exit status from the fpWaitPID result.


GetCodepageByName

Find code page by name

Declaration

Source position: unixcp.pp line 637

function GetCodepageByName(

  cpname: RawByteString

):TSystemCodePage;

Arguments

cpname

Name of code page.

Function result

Code page number corresponding to cpname or CP_NONE if none found.

Description

GetCodepageByName returns the code page number matching cpname. The supported code page names are the ones commonly in use in libiconv. Names are searched case-sentively, with the exception that 'cpN' is converted to 'CPN', where N is a digit.

Errors

If no matching code page name is found, CP_NONE is returned.

See also

UnixCpMap | Map with codepage names.
GetSystemCodepage | Return the system code page based on the program environment.
GetCodepageData | Return index of codepage.


GetCodepageData

Return index of codepage.

Declaration

Source position: unixcp.pp line 636

function GetCodepageData(

  cp: TSystemCodePage

):LongInt;

Arguments

cp

Code page to search for

Function result

Index of first entry in UnixCpMap or -1

Description

GetCodepageData returns the index of the first entry in UnixCpMap which matches cp. Since the entries are ordered by code page number, this means the entries can be scanned for alternate code names starting at this index.

Errors

If no matching code page is found, -1 is returned.

See also

UnixCpMap | Map with codepage names.
GetSystemCodepage | Return the system code page based on the program environment.
GetCodepageByName | Find code page by name


GetSystemCodepage

Return the system code page based on the program environment.

Declaration

Source position: unixcp.pp line 638

function GetSystemCodepage: TSystemCodePage;

Function result

Detected code page, or system default if no system found.

Description

GetSystemCodepage returns the system code page, based on one of the environment variables LC_ALL, LC_CTYPE or LANG. The first non-empty variable (in the order mentioned here) is used.

Errors

If none is found, then a system default is used: Linux and Darwin use CP_UTF8, others use CP_ASCII.

See also

UnixCpMap | Map with codepage names.
GetSystemCodepage | Return the system code page based on the program environment.
GetCodepageByName | Find code page by name


ArrayStringToPPchar

Concert an array of string to an array of null-terminated strings

Declaration

Source position: unixutil.pp line 42

function ArrayStringToPPchar(

  const S: array of AnsiString;

  reserveentries: LongInt

):PPChar;

Description

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.

Errors

If not enough memory is available, an error may occur.

See also

StringToPPChar

Split string in list of null-terminated strings


EpochToLocal

Convert epoch time to local time

Declaration

Source position: unixutil.pp line 46

procedure EpochToLocal(

  epoch: LongInt;

  var year: Word;

  var month: Word;

  var day: Word;

  var hour: Word;

  var minute: Word;

  var second: Word

);

Description

Converts the epoch time (=Number of seconds since 00:00:00, January 1, 1970, corrected for your time zone) to local date and time.

This function takes into account the timzeone settings of your system.

Errors

None

See also

LocalToEpoch

Convert local time to epoch (unix) time

Example

Program Example3;

{ Program to demonstrate the EpochToLocal function. }

Uses BaseUnix,Unix,UnixUtil;

Var Year,month,day,hour,minute,seconds : Word;

begin
  EpochToLocal (FPTime,Year,month,day,hour,minute,seconds);
  Writeln ('Current date : ',Day:2,'/',Month:2,'/',Year:4);
  Writeln ('Current time : ',Hour:2,':',minute:2,':',seconds:2);
end.


GetFS

Return file selector

Declaration

Source position: unixutil.pp line 43

function GetFS(

  var T: Text

):LongInt;

function GetFS(

  var F: file

):LongInt;

Description

GetFS returns the file selector that the kernel provided for your file. In principle you don' need this file selector. Only for some calls it is needed, such as the #rtl.baseunix.fpSelect call or so.

Errors

In case the file was not opened, then -1 is returned.

See also

#rtl.baseunix.fpSelect

Wait for events on file descriptors

Example

Program Example33;

{ Program to demonstrate the SelectText function. }

Uses Unix;

Var tv : TimeVal;

begin
  Writeln ('Press the <ENTER> to continue the program.');
  { Wait until File descriptor 0 (=Input) changes }
  SelectText (Input,nil);
  { Get rid of <ENTER> in buffer }
  readln;
  Writeln ('Press <ENTER> key in less than 2 seconds...');
  tv.tv_sec:=2;
  tv.tv_sec:=0;
  if SelectText (Input,@tv)>0 then
    Writeln ('Thank you !')
  else
    Writeln ('Too late !');
end.


GregorianToJulian

Converts a gregorian date to a julian date

Declaration

Source position: unixutil.pp line 48

function GregorianToJulian(

  Year: LongInt;

  Month: LongInt;

  Day: LongInt

):LongInt;

Description

GregorianToJulian takes a gregorian date and converts it to a Julian day.

Errors

None.

See also

JulianToGregorian

Converts a julian date to a gregorian date


JulianToGregorian

Converts a julian date to a gregorian date

Declaration

Source position: unixutil.pp line 47

procedure JulianToGregorian(

  JulianDN: LongInt;

  var Year: Word;

  var Month: Word;

  var Day: Word

);

Description

JulianToGregorian takes a julian day and converts it to a gregorian date. (Start of the Julian Date count is from 0 at 12 noon 1 JAN -4712 (4713 BC),)

Errors

None.

See also

GregorianToJulian

Converts a gregorian date to a julian date


LocalToEpoch

Convert local time to epoch (unix) time

Declaration

Source position: unixutil.pp line 45

function LocalToEpoch(

  year: Word;

  month: Word;

  day: Word;

  hour: Word;

  minute: Word;

  second: Word

):LongInt;

Description

Converts the Local time to epoch time (=Number of seconds since 00:00:00, January 1, 1970).

Errors

None

See also

EpochToLocal

Convert epoch time to local time

Example

Program Example4;

{ Program to demonstrate the LocalToEpoch function. }

Uses UnixUtil;

Var year,month,day,hour,minute,second : Word;

begin
  Write ('Year    : ');readln(Year);
  Write ('Month   : ');readln(Month);
  Write ('Day     : ');readln(Day);
  Write ('Hour    : ');readln(Hour);
  Write ('Minute  : ');readln(Minute);
  Write ('Seonds  : ');readln(Second);
  Write ('This is : ');
  Write (LocalToEpoch(year,month,day,hour,minute,second));
  Writeln (' seconds past 00:00 1/1/1980');
end.


StringToPPChar

Split string in list of null-terminated strings

Declaration

Source position: unixutil.pp line 40

function StringToPPChar(

  S: PChar;

  ReserveEntries: Integer

):PPChar;

function StringToPPChar(

  var S: AnsiString;

  ReserveEntries: Integer

):PPChar;

Description

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 can be called to create arguments for the various Exec calls.

Errors

None.

See also

ArrayStringToPPchar | Concert an array of string to an array of null-terminated strings
#rtl.baseunix.FpExecve | Execute process using environment

Example

Program Example70;

{ Program to demonstrate the StringToPPchar function. }

Uses UnixUtil;

Var S : String;
    P : PPChar;
    I : longint;

begin
  // remark whitespace at end.
  S:='This is a string with words. ';
  P:=StringToPPChar(S,0);
  I:=0;
  While P[i]<>Nil do
    begin
    Writeln('Word ',i,' : ',P[i]);
    Inc(I);
    end;
  FreeMem(P,i*SizeOf(Pchar));
end.


ClearScreen

Clear the video screen.

Declaration

Source position: videoh.inc line 132

procedure ClearScreen;

Description

ClearScreen clears the entire screen, and calls UpdateScreen after that. This is done by writing spaces to all character cells of the video buffer in the default color (lightgray on black, color attribute \$07).

Errors

None.

See also

InitVideo | Initialize video driver.
UpdateScreen | Update physical screen with internal screen image.

Example

program testvideo;

uses video,keyboard,vidutil;

Var
  i : longint;
  k : TkeyEvent;

begin
  InitVideo;
  InitKeyboard;
  For I:=1 to 10 do
    TextOut(i,i, 'Press any key to clear screen');
  UpdateScreen(false);
  K:=GetKeyEvent;
  ClearScreen;
  TextOut(1,1,'Cleared screen. Press any key to end');
  UpdateScreen(true);
  K:=GetKeyEvent;
  DoneKeyBoard;
  DoneVideo;
end.


DefaultErrorHandler

Default error handling routine.

Declaration

Source position: videoh.inc line 164

function DefaultErrorHandler(

  AErrorCode: LongInt;

  AErrorInfo: Pointer

):TErrorHandlerReturnValue;

Description

DefaultErrorHandler is the default error handler used by the video driver. It simply sets the error code AErrorCode and AErrorInfo in the global variables ErrorCode and ErrorInfo and returns errContinue.

Errors

None.


DoneVideo

Disable video driver.

Declaration

Source position: videoh.inc line 128

procedure DoneVideo;

Description

DoneVideo disables the Video driver if the video driver is active. If the videodriver was already disabled or not yet initialized, it does nothing. Disabling the driver means it will clean up any allocated resources, possibly restore the screen in the state it was before InitVideo was called. Particularly, the VideoBuf and OldVideoBuf arrays are no longer valid after a call to DoneVideo.

The DoneVideo should always be called if InitVideo was called. Failing to do so may leave the screen in an unusable state after the program exits.

For an example, see most other functions.

Errors

Normally none. If the driver reports an error, this is done through the ErrorCode variable.

See also

InitVideo

Initialize video driver.


GetCapabilities

Get current driver capabilities.

Declaration

Source position: videoh.inc line 130

function GetCapabilities: Word;

Description

GetCapabilities returns the capabilities of the current driver. It is an or-ed combination of the following constants:

cpUnderLine
Video driver supports underline attribute
cpBlink
Video driver supports blink attribute
cpColor
Video driver supports color
cpChangeFont
Video driver supports changing screen font.
cpChangeMode
Video driver supports changing mode
cpChangeCursor
Video driver supports changing cursor shape.

Note that the video driver should not yet be initialized to use this function. It is a property of the driver.

Errors

None.

See also

GetCursorType | Get screen cursor type
GetVideoDriver | Get a copy of the current video driver.

Example

Program Example4;

{ Program to demonstrate the GetCapabilities function. }

Uses video;

Var
  W: Word;

  Procedure TestCap(Cap: Word; Msg : String);

  begin
    Write(Msg,' : ');
    If (W and Cap=Cap) then
      Writeln('Yes')
    else
      Writeln('No');
  end;

begin
  W:=GetCapabilities;
  Writeln('Video driver supports following functionality');
  TestCap(cpUnderLine,'Underlined characters');
  TestCap(cpBlink,'Blinking characters');
  TestCap(cpColor,'Color characters');
  TestCap(cpChangeFont,'Changing font');
  TestCap(cpChangeMode,'Changing video mode');
  TestCap(cpChangeCursor,'Changing cursor shape');
end.


GetCursorType

Get screen cursor type

Declaration

Source position: videoh.inc line 139

function GetCursorType: Word;

Description

GetCursorType returns the current cursor type. It is one of the following values:

crHidden
Hide cursor
crUnderLine
Underline cursor
crBlock
Block cursor
crHalfBlock
Half block cursor

Note that not all drivers support all types of cursors.

Errors

None.

See also

SetCursorType | Set cursor type
GetCapabilities | Get current driver capabilities.

Example

Program Example5;

{ Program to demonstrate the GetCursorType function. }

Uses video,keyboard,vidutil;

Const
  Cursortypes : Array[crHidden..crHalfBlock] of string =
    ('Hidden','UnderLine','Block','HalfBlock');

begin
  InitVideo;
  InitKeyboard;
  TextOut(1,1,'Cursor type: '+CursorTypes[GetCursorType]);
  TextOut(1,2,'Press any key to exit.');
  UpdateScreen(False);
  GetKeyEvent;
  DoneKeyboard;
  DoneVideo;
end.


GetLockScreenCount

Get the screen lock update count.

Declaration

Source position: videoh.inc line 119

function GetLockScreenCount: Integer;

Description

GetLockScreenCount returns the current lock level. When the lock level is zero, a call to UpdateScreen will actually update the screen.

Errors

None.

See also

LockScreenUpdate | Prevent further screen updates.
UnlockScreenUpdate | Unlock screen update.
UpdateScreen | Update physical screen with internal screen image.

Example

Program Example6;

{ Program to demonstrate the GetLockScreenCount function. }

Uses video,keyboard,vidutil;

Var
  I : Longint;
  S : String;

begin
  InitVideo;
  InitKeyboard;
  TextOut(1,1,'Press key till new text appears.');
  UpdateScreen(False);
  Randomize;
  For I:=0 to Random(10)+1 do
    LockScreenUpdate;
  I:=0;
  While GetLockScreenCount<>0 do
    begin
    Inc(I);
    Str(I,S);
    UnlockScreenUpdate;
    GetKeyEvent;
    TextOut(1,1,'UnLockScreenUpdate had to be called '+S+' times');
    UpdateScreen(False);
    end;
  TextOut(1,2,'Press any key to end.');
  UpdateScreen(False);
  GetKeyEvent;
  DoneKeyboard;
  DoneVideo;
end.


GetVideoDriver

Get a copy of the current video driver.

Declaration

Source position: videoh.inc line 123

procedure GetVideoDriver(

  var Driver: TVideoDriver

);

Description

GetVideoDriver returns the currently active video driver record in Driver. It can be used to clone the current video driver, or to override certain parts of it using the SetVideoDriver call.

Errors

None.

See also

SetVideoDriver

Install a new video driver.


GetVideoMode

Return current video mode

Declaration

Source position: videoh.inc line 144

procedure GetVideoMode(

  var Mode: TVideoMode

);

Description

GetVideoMode returns the settings of the currently active video mode. The row,col fields indicate the dimensions of the current video mode, and Color is true if the current video supports colors.

See also

SetVideoMode | Set current video mode.
GetVideoModeData | Get the specifications for a video mode

Example

Program Example7;

{ Program to demonstrate the GetVideoMode function. }

Uses video,keyboard,vidutil;

Var
  M : TVideoMode;
  S : String;

begin
  InitVideo;
  InitKeyboard;
  GetVideoMode(M);
  if M.Color then
    TextOut(1,1,'Current mode has color')
  else
    TextOut(1,1,'Current mode does not have color');
  Str(M.Row,S);
  TextOut(1,2,'Number of rows    : '+S);
  Str(M.Col,S);
  TextOut(1,3,'Number of columns : '+S);
  Textout(1,4,'Press any key to exit.');
  UpdateScreen(False);
  GetKeyEvent;
  DoneKeyboard;
  DoneVideo;
end.


GetVideoModeCount

Get the number of video modes supported by the driver.

Declaration

Source position: videoh.inc line 148

function GetVideoModeCount: Word;

Description

GetVideoModeCount returns the number of video modes that the current driver supports. If the driver does not support switching of modes, then 1 is returned.

This function can be used in conjunction with the GetVideoModeData function to retrieve data for the supported video modes.

Errors

None.

See also

GetVideoModeData | Get the specifications for a video mode
GetVideoMode | Return current video mode

Example

Program Example8;

{ Program to demonstrate the GetVideoModeCount function. }

Uses video,keyboard,vidutil;

Procedure DumpMode (M : TVideoMode; Index : Integer);

Var
 S : String;

begin
  Str(Index:2,S);
  inc(Index);
  TextOut(1,Index,'Data for mode '+S+': ');
  if M.Color then
    TextOut(19,Index,'   color,')
  else
    TextOut(19,Index,'No color,');
  Str(M.Row:3,S);
  TextOut(28,Index,S+' rows');
  Str(M.Col:3,S);
  TextOut(36,index,S+' columns');
end;

Var
  i,Count : Integer;
  m : TVideoMode;

begin
  InitVideo;
  InitKeyboard;
  Count:=GetVideoModeCount;
  For I:=1 to Count do
    begin
    GetVideoModeData(I-1,M);
    DumpMode(M,I-1);
    end;
  TextOut(1,Count+1,'Press any key to exit');
  UpdateScreen(False);
  GetKeyEvent;
  DoneKeyboard;
  DoneVideo;
end.


GetVideoModeData

Get the specifications for a video mode

Declaration

Source position: videoh.inc line 150

function GetVideoModeData(

  Index: Word;

  var Data: TVideoMode

):Boolean;

Description

GetVideoModeData returns the characteristics of the Index-th video mode in Data. Index is zero based, and has a maximum value of GetVideoModeCount-1. If the current driver does not support setting of modes (GetVideoModeCount=1) and Index is zero, the current mode is returned.

The function returns True if the mode data was retrieved succesfully, False otherwise.

For an example, see GetVideoModeCount.

Errors

In case Index has a wrong value, False is returned.

See also

GetVideoModeCount | Get the number of video modes supported by the driver.
SetVideoMode | Set current video mode.
GetVideoMode | Return current video mode


InitVideo

Initialize video driver.

Declaration

Source position: videoh.inc line 126

procedure InitVideo;

Description

InitVideo Initializes the video subsystem. If the video system was already initialized, it does nothing. After the driver has been initialized, the VideoBuf and OldVideoBuf pointers are initialized, based on the ScreenWidth and ScreenHeight variables. When this is done, the screen is cleared.

For an example, see most other functions.

Errors

if the driver fails to initialize, the ErrorCode variable is set.

See also

DoneVideo

Disable video driver.


LockScreenUpdate

Prevent further screen updates.

Declaration

Source position: videoh.inc line 115

procedure LockScreenUpdate;

Description

LockScreenUpdate increments the screen update lock count with one. As long as the screen update lock count is not zero, UpdateScreen will not actually update the screen.

This function can be used to optimize screen updating: If a lot of writing on the screen needs to be done (by possibly unknown functions), calling LockScreenUpdate before the drawing, and UnlockScreenUpdate after the drawing, followed by a UpdateScreen call, all writing will be shown on screen at once.

For an example, see GetLockScreenCount.

Errors

None.

See also

UpdateScreen | Update physical screen with internal screen image.
UnlockScreenUpdate | Unlock screen update.
GetLockScreenCount | Get the screen lock update count.


SetCursorPos

Set write cursor position.

Declaration

Source position: videoh.inc line 137

procedure SetCursorPos(

  NewCursorX: Word;

  NewCursorY: Word

);

Description

SetCursorPos positions the cursor on the given position: Column NewCursorX and row NewCursorY. The origin of the screen is the upper left corner, and has coordinates (0,0).

The current position is stored in the CursorX and CursorY variables.

Errors

None.

See also

SetCursorType

Set cursor type

Example

program example2;

uses video,keyboard;

Var
  P,PP,D : Integer;
  K: TKeyEvent;

  Procedure PutSquare (P : INteger; C : Char);

  begin
    VideoBuf^[P]:=Ord(C)+($07 shl 8);
    VideoBuf^[P+ScreenWidth]:=Ord(c)+($07 shl 8);
    VideoBuf^[P+1]:=Ord(c)+($07 shl 8);
    VideoBuf^[P+ScreenWidth+1]:=Ord(c)+($07 shl 8);
  end;

begin
  InitVideo;
  InitKeyBoard;
  P:=0;
  PP:=-1;
  Repeat
    If PP<>-1 then
      PutSquare(PP,' ');
    PutSquare(P,'#');
    SetCursorPos(P Mod ScreenWidth,P div ScreenWidth);
    UpdateScreen(False);
    PP:=P;
    Repeat
      D:=0;
      K:=TranslateKeyEvent(GetKeyEvent);
      Case GetKeyEventCode(K) of
        kbdLeft : If (P Mod ScreenWidth)<>0 then
                   D:=-1;
        kbdUp : If P>=ScreenWidth then
                 D:=-ScreenWidth;
        kbdRight : If ((P+2) Mod ScreenWidth)<>0 then
                   D:=1;
        kbdDown : if (P<(VideoBufSize div 2)-(ScreenWidth*2)) then
                   D:=ScreenWidth;
      end;
    Until (D<>0) or (GetKeyEventChar(K)='q');
    P:=P+D;
  until GetKeyEventChar(K)='q';
  DoneKeyBoard;
  DoneVideo;
end.


SetCursorType

Set cursor type

Declaration

Source position: videoh.inc line 141

procedure SetCursorType(

  NewType: Word

);

Description

SetCursorType sets the cursor to the type specified in NewType.

crHidden
Hide cursor
crUnderLine
Underline cursor
crBlock
Block cursor
crHalfBlock
Half block cursor

Errors

None.

See also

SetCursorPos

Set write cursor position.


SetVideoDriver

Install a new video driver.

Declaration

Source position: videoh.inc line 121

function SetVideoDriver(

  const Driver: TVideoDriver

):Boolean;

Description

SetVideoDriver sets the videodriver to be used to Driver. If the current videodriver is initialized (after a call to InitVideo) then it does nothing and returns False.

A new driver can only be installed if the previous driver was not yet activated (i.e. before a call to InitVideo) or after it was deactivated (i.e after a call to DoneVideo).

For more information about installing a videodriver, see viddriver.

For an example, see the section on writing a custom video driver.

Errors

If the current driver is initialized, then False is returned.

See also

viddriver

Writing a custom video driver


SetVideoMode

Set current video mode.

Declaration

Source position: videoh.inc line 146

function SetVideoMode(

  const Mode: TVideoMode

):Boolean;

Description

SetVideoMode sets the video mode to the mode specified in Mode:

If the call was succesful, then the screen will have Col columns and Row rows, and will be displaying in color if Color is True.

The function returns True if the mode was set succesfully, False otherwise.

Note that the video mode may not always be set. E.g. a console on Linux or a telnet session cannot always set the mode. It is important to check the error value returned by this function if it was not succesful.

The mode can be set when the video driver has not yet been initialized (i.e. before InitVideo was called) In that case, the video mode will be stored, and after the driver was initialized, an attempt will be made to set the requested mode. Changing the video driver before the call to InitVideo will clear the stored video mode.

To know which modes are valid, use the GetVideoModeCount and GetVideoModeData functions. To retrieve the current video mode, use the GetVideoMode procedure.

Errors

If the specified mode cannot be set, then errVioNoSuchMode may be set in ErrorCode

See also

GetVideoModeCount | Get the number of video modes supported by the driver.
GetVideoModeData | Get the specifications for a video mode
GetVideoMode | Return current video mode


UnlockScreenUpdate

Unlock screen update.

Declaration

Source position: videoh.inc line 117

procedure UnlockScreenUpdate;

Description

UnlockScreenUpdate decrements the screen update lock count with one if it is larger than zero. When the lock count reaches zero, the UpdateScreen will actually update the screen. No screen update will be performed as long as the screen update lock count is nonzero. This mechanism can be used to increase screen performance in case a lot of writing is done.

It is important to make sure that each call to LockScreenUpdate is matched by exactly one call to UnlockScreenUpdate

For an example, see GetLockScreenCount.

Errors

None.

See also

LockScreenUpdate | Prevent further screen updates.
GetLockScreenCount | Get the screen lock update count.
UpdateScreen | Update physical screen with internal screen image.


UpdateScreen

Update physical screen with internal screen image.

Declaration

Source position: videoh.inc line 134

procedure UpdateScreen(

  Force: Boolean

);

Description

UpdateScreen synchronizes the actual screen with the contents of the VideoBuf internal buffer. The parameter Force specifies whether the whole screen has to be redrawn (Force=True) or only parts that have changed since the last update of the screen.

The Video unit keeps an internal copy of the screen as it last wrote it to the screen (in the OldVideoBuf array). The current contents of VideoBuf are examined to see what locations on the screen need to be updated. On slow terminals (e.g. a Linux telnet session) this mechanism can speed up the screen redraw considerably.

On platforms where mouse cursor visibility is not guaranteed to be preserved during screen updates this routine has to restore the mouse cursor after the update (usually by calling HideMouse from unit Mouse before the real update and ShowMouse afterwards).

For an example, see most other functions.

Errors

None.

See also

ClearScreen

Clear the video screen.


delay

Pause program execution

Declaration

Source position: wincrt.pp line 23

procedure delay(

  ms: Word

);

Arguments

ms

Number of milliseconds to wait

Description

Delay stops program execution for the indicated number ms of milliseconds.

See also

sound | Sound PC speaker
nosound | Stop the speaker


keypressed

Check if a key was pressed.

Declaration

Source position: wincrt.pp line 22

function keypressed: Boolean;

Function result

True if the user pressed a key, false if not.

Description

KeyPressed returns True if the user pressed a key, or False if not. It does not wait for the user to press a key.

See also

readkey

Read a key from the keyboard


nosound

Stop the speaker

Declaration

Source position: wincrt.pp line 33

procedure nosound;

Description

NoSound does nothing, windows does not support this.

See also

sound

Sound PC speaker


readkey

Read a key from the keyboard

Declaration

Source position: wincrt.pp line 21

function readkey: Char;

Function result

The pressed key

Description

ReadKey reads a key from the keyboard, and returns the ASCII value of the key, or the scancode of the key in case it is a special key.

The function waits until a key is pressed.

See also

KeyPressed

Check if a key was pressed.


sound

Sound PC speaker

Declaration

Source position: wincrt.pp line 30

procedure sound(

  hz: Word

);

Arguments

hz

Frequency of sound

Description

Sound sounds the PC speaker. It emits a tone with frequency Hz for 500 milliseconds. (the time argument is required by the windows API)

See also

nosound

Stop the speaker


textmode

Set indicated text mode

Declaration

Source position: wincrt.pp line 26

procedure textmode(

  mode: Integer

);

Arguments

mode

Currently ignored

Description

TextMode does nothing.


GetWindowsSpecialDir

Get the location of a special directory.

Declaration

Source position: windirs.pp line 69

function GetWindowsSpecialDir(

  ID: Integer;

  CreateIfNotExists: Boolean = True

):string;

Arguments

ID

Identifier of the folder location to retrieve.

Function result

Full path of the folder identified by ID.

Description

GetWindowsSpecialDir can be used to to get the path of special folders on the Windows system. The locations are identified using one of the CSIDL_* constants. If the ID of a location is or-ed with the CSIDL_FLAG_CREATE constant, then the directory will be created if it didn't exist yet (and the user has sufficient rights to do so).

Errors

On error, an empty string is returned.


GetWindowsSpecialDirUnicode

Declaration

Source position: windirs.pp line 70

function GetWindowsSpecialDirUnicode(

  ID: Integer;

  CreateIfNotExists: Boolean = True

):UnicodeString;


GetWindowsSystemDirectory

Declaration

Source position: windirs.pp line 72

function GetWindowsSystemDirectory: string;


GetWindowsSystemDirectoryUnicode

Declaration

Source position: windirs.pp line 73

function GetWindowsSystemDirectoryUnicode: UnicodeString;


fpIOperm

Set permission on IO ports

Declaration

Source position: x86.pp line 41

function fpIOperm(

  From: Cardinal;

  Num: Cardinal;

  Value: cint

):cint;

Description

FpIOperm sets permissions on Num ports starting with port From to Value. The function returns zero if the call was successfull, a nonzero value otherwise.

Note:

  • This works ONLY as root.
  • Only the first 0x03ff ports can be set.
  • When doing a FpFork, the permissions are reset. When doing a FpExecVE they are kept.

Errors

Extended error information can be retrieved with FpGetErrno


fpIoPL

Set I/O privilege level

Declaration

Source position: x86.pp line 42

function fpIoPL(

  Level: cint

):cint;

Description

FpIoPL sets the I/O privilige level. It is intended for completeness only, one should normally not use it.


ReadPort

Read data from a PC port

Declaration

Source position: x86.pp line 25

procedure ReadPort(

  Port: LongInt;

  var Value: Byte

);

procedure ReadPort(

  Port: LongInt;

  var Value: LongInt

);

procedure ReadPort(

  Port: LongInt;

  var Value: Word

);

Description

ReadPort reads one Byte, Word or Longint from port Port into Value.

Note that you need permission to read a port. This permission can be set by the root user with the FpIOPerm call.

Errors

In case of an error (not enough permissions read this port), runtime 216 ( Access Violation) will occur.

See also

FpIOPerm | Set permission on IO ports
ReadPortB | Read bytes from a PC port
ReadPortW | Read Words from a PC port
ReadPortL | Read longints from a PC port
WritePort | Write data to PC port
WritePortB | Write byte to PC port
WritePortL | Write longint to PC port.
WritePortW | Write Word to PC port


ReadPortB

Read bytes from a PC port

Declaration

Source position: x86.pp line 22

function ReadPortB(

  Port: LongInt

):Byte;

procedure ReadPortB(

  Port: LongInt;

  var Buf;

  Count: LongInt

);

Description

The procedural form of ReadPortB reads Count bytes from port Port and stores them in Buf. There must be enough memory allocated at Buf to store Count bytes.

The functional form of ReadPortB reads 1 byte from port B and returns the byte that was read.

Note that you need permission to read a port. This permission can be set by the root user with the FpIOPerm call.

Errors

In case of an error (not enough permissions read this port), runtime 216 ( Access Violation) will occur.

See also

FpIOPerm | Set permission on IO ports
ReadPort | Read data from a PC port
ReadPortW | Read Words from a PC port
ReadPortL | Read longints from a PC port
WritePort | Write data to PC port
WritePortB | Write byte to PC port
WritePortL | Write longint to PC port.
WritePortW | Write Word to PC port


ReadPortL

Read longints from a PC port

Declaration

Source position: x86.pp line 24

function ReadPortL(

  Port: LongInt

):LongInt;

procedure ReadPortL(

  Port: LongInt;

  var Buf;

  Count: LongInt

);

Description

The procedural form of ReadPortL reads Count longints from port Port and stores them in Buf. There must be enough memory allocated at Buf to store Count Longints.

The functional form of ReadPortL reads 1 longint from port B and returns the longint that was read.

Note that you need permission to read a port. This permission can be set by the root user with the FpIOPerm call.

Errors

In case of an error (not enough permissions read this port), runtime 216 ( Access Violation) will occur.

See also

FpIOPerm | Set permission on IO ports
ReadPort | Read data from a PC port
ReadPortW | Read Words from a PC port
ReadPortB | Read bytes from a PC port
WritePort | Write data to PC port
WritePortB | Write byte to PC port
WritePortL | Write longint to PC port.
WritePortW | Write Word to PC port


ReadPortW

Read Words from a PC port

Declaration

Source position: x86.pp line 23

function ReadPortW(

  Port: LongInt

):Word;

procedure ReadPortW(

  Port: LongInt;

  var Buf;

  Count: LongInt

);

Description

The procedural form of ReadPortW reads Count words from port Port and stores them in Buf. There must be enough memory allocated at Buf to store Count words.

The functional form of ReadPortW reads 1 word from port B and returns the word that was read.

Note that you need permission to read a port. This permission can be set by the root user with the FpIOPerm call.

Errors

In case of an error (not enough permissions read this port), runtime 216 ( Access Violation) will occur.

See also

FpIOPerm | Set permission on IO ports
ReadPort | Read data from a PC port
ReadPortB | Read bytes from a PC port
ReadPortL | Read longints from a PC port
WritePort | Write data to PC port
WritePortB | Write byte to PC port
WritePortL | Write longint to PC port.
WritePortW | Write Word to PC port


WritePort

Write data to PC port

Declaration

Source position: x86.pp line 31

procedure WritePort(

  Port: LongInt;

  Value: Byte

);

procedure WritePort(

  Port: LongInt;

  Value: LongInt

);

procedure WritePort(

  Port: LongInt;

  Value: Word

);

Description

WritePort writes Value -- 1 byte, Word or longint -- to port Port.

Remark: You need permission to write to a port. This permission can be set with root permission with the FpIOPerm call.

Errors

In case of an error (not enough permissions to write to this port), runtime 216 ( Access Violation) will occur.

See also

FpIOPerm | Set permission on IO ports
WritePortB | Write byte to PC port
WritePortL | Write longint to PC port.
WritePortW | Write Word to PC port
ReadPortB | Read bytes from a PC port
ReadPortL | Read longints from a PC port
ReadPortW | Read Words from a PC port


WritePortB

Write byte to PC port

Declaration

Source position: x86.pp line 34

procedure WritePortB(

  Port: LongInt;

  Value: Byte

);

procedure WritePortB(

  Port: LongInt;

  var Buf;

  Count: LongInt

);

Description

The first form of WritePortB writes 1 byte to port Port. The second form writes Count bytes from Buf to port Port.

Remark: You need permission to write to a port. This permission can be set with root permission with the FpIOPerm call.

Errors

In case of an error (not enough permissions to write to this port), runtime 216 ( Access Violation) will occur.

See also

FpIOPerm | Set permission on IO ports
WritePort | Write data to PC port
WritePortL | Write longint to PC port.
WritePortW | Write Word to PC port
ReadPortB | Read bytes from a PC port
ReadPortL | Read longints from a PC port
ReadPortW | Read Words from a PC port


WritePortl

Write longint to PC port.

Declaration

Source position: x86.pp line 36

procedure WritePortL(

  Port: LongInt;

  Value: LongInt

);

procedure WritePortl(

  Port: LongInt;

  var Buf;

  Count: LongInt

);

Description

The first form of WritePortB writes 1 byte to port Port. The second form writes Count bytes from Buf to port Port.

Remark: You need permission to write to a port. This permission can be set with root permission with the FpIOPerm call.

Errors

In case of an error (not enough permissions to write to this port), runtime 216 ( Access Violation) will occur.

See also

FpIOPerm | Set permission on IO ports
WritePort | Write data to PC port
WritePortB | Write byte to PC port
WritePortW | Write Word to PC port
ReadPortB | Read bytes from a PC port
ReadPortL | Read longints from a PC port
ReadPortW | Read Words from a PC port


WritePortW

Write Word to PC port

Declaration

Source position: x86.pp line 37

procedure WritePortW(

  Port: LongInt;

  Value: Word

);

procedure WritePortW(

  Port: LongInt;

  var Buf;

  Count: LongInt

);

Description

The first form of WritePortB writes 1 byte to port Port. The second form writes Count bytes from Buf to port Port.

Remark: You need permission to write to a port. This permission can be set with root permission with the FpIOPerm call.

Errors

In case of an error (not enough permissions to write to this port), runtime 216 ( Access Violation) will occur.

See also

FpIOPerm | Set permission on IO ports
WritePort | Write data to PC port
WritePortL | Write longint to PC port.
WritePortB | Write byte to PC port
ReadPortB | Read bytes from a PC port
ReadPortL | Read longints from a PC port
ReadPortW | Read Words from a PC port


Reference for package 'rtl'

Free Pascal Run-Time Library

Units

BaseUnix | Basic Unix functionality
character | Unicode character classification and conversion
charset | Character set support
Classes | Basic classes for RTL
clocale | Initialize internationalization settings from the C library
cmem | Memory manager replacement using the C memory manager
collation_de | German Unicode collation data
collation_es | Spanish Unicode collation data
collation_fr_ca | French (and Canadian) Unicode collation data
collation_ja | Japanse Unicode collation data
collation_ko | Korean Unicode collation data
collation_ru | Russian Unicode collation data
collation_sv | Swedish Unicode collation data
collation_zh | Chinese Unicode collation data
cp1250 | Single-Byte codepage 1250 definition
cp1251 | Single-Byte codepage 1251 definition
cp1252 | Single-Byte codepage 1252 definition
cp1253 | Single-Byte codepage 1253 definition
cp1254 | Single-Byte codepage 1254 definition
cp1255 | Single-Byte codepage 1255 definition
cp1256 | Single-Byte codepage 1256 definition
cp1257 | Single-Byte codepage 1257 definition
cp1258 | Single-Byte codepage 1258 definition
cp437 | Single-Byte codepage 437 definition
cp646 | Single-Byte codepage 646 definition
cp850 | Single-Byte codepage 850 definition
cp852 | Single-Byte codepage 852 definition
cp856 | Single-Byte codepage 856 definition
cp866 | Single-Byte codepage 866 definition
cp874 | Single-Byte codepage 874 definition
cp8859_1 | Single-Byte codepage 8859_1 definition
cp8859_2 | Single-Byte codepage 8859_2 definition
cp8859_5 | Single-Byte codepage 8859_5 definition
cp895 | Single-Byte codepage 895 definition
cp932 | Single-Byte codepage 932 definition
cp936 | Single-Byte codepage 936 definition
cp949 | Single-Byte codepage 949 definition
cp950 | Single-Byte codepage 950 definition
cpall | Add all known Single-Byte codepage definitions
Crt | CRT - Turbo Pascal screen and keyboard handling unit
cthreads | Initialize the thread manager with a POSIX thread manager
ctypes | Common C type definitions
cwstring | Implement the widestring manager with a C library based implementation
dateutils | Date/Time manipulation routines.
Dos | DOS - Turbo Pascal MS-DOS interface
dxeload | Load DXE file in to memory
dynlibs | Cross-platform support for dynamically loadable libraries
emu387 | Load coprocessor emulation support
errors | Convert unix error codes to string message
exeinfo | Return executable information
fgl | Free Pascal Generic Lists
fpwidestring | Native Object Pascal Unicode string support
getopts | GNU compatible access to command-line options.
go32 | GO32 - acces to the 32-bit DOS extender
gpm | Interface to GPM (General Purpose Mouse) library
Graph | TP compatible unit to handle screen graphics.
heaptrc | Heap debugging functionality.
ipc | Unix Inter Process Communication functionality.
keyboard | Access to low-level keyboard functions
lineinfo | Return adress line information
Linux | Linux-specific operating system calls.
lnfodwrf | Return adress line information
math | Additional mathematical routines.
matrix | Two, three, four dimensional matrix unit
mmx | Access to MMX processor functionality
Mouse | Mouse event handling unit
Objects | TP-Compatible basic Objects.
objpas | Objpas - Delphi and objfpc mode system overrides
ports | Access to hardware ports
printer | Provide access to the printer.
sharemem | Shared memory memory manager (windows)
Sockets | TCP/IP Sockets functionality unit
strings | Null-terminated string (PChar) routines.
strutils | Various string handling routines
System | The system unit
sysutils | Various system utilities.
Types | Various types
typinfo | Access Run-Time Type Information (RTTI)
unicodedata | Unicode data management
unicodeducet | Root Unicode collation (DUCET)
Unix | Extended Unix functionality.
unixcp | Code Page name to number conversions
unixtype | Basic unix types
unixutil | Unix utility routines.
video | Screen handling unit
wincrt | Auxiliary windows routines for the graph unit
windirs | Get names of special directories under windows
x86 | Intel X86 specific routines for Unix platforms.

Description

The Run-Time Library is the basis of all Free Pascal programs. It contains the basic units that most programs will use, and are made available on all platforms supported by Free pascal (well, more or less).

There are units for compatibility with the Turbo Pascal Run-Time library, and there are units for compatibility with Delphi.

On top of these two sets, there are also a series of units to handle keyboard/mouse and text screens in a cross-platform way.

Other units include platform specific units that implement the specifics of a platform, these are usually needed to support the Turbo Pascal or Delphi units.

Units that fall outside the above outline do not belong in the RTL, but should be included in the packages, or in the FCL.


Index of all identifiers in package 'rtl'

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

A

AbandonSignalHandler | AnsiUpperCaseFileName | assign(Tmatrix3_single):Tmatrix4_double
Abort | anyfile | assign(Tmatrix3_single):Tmatrix4_extended
abs | Append | assign(Tmatrix3_single):Tmatrix4_single
Abstract | AppendStr | assign(Tmatrix4_double):Tmatrix2_double
AbstractError | ApplicationHandleException | assign(Tmatrix4_double):Tmatrix2_extended
AbstractErrorProc | ApplicationName | assign(Tmatrix4_double):Tmatrix2_single
Accept | ApplicationShowException | assign(Tmatrix4_double):Tmatrix3_double
AcquireExceptionObject | ApproxDaysPerMonth | assign(Tmatrix4_double):Tmatrix3_extended
ActivateClassGroup | ApproxDaysPerYear | assign(Tmatrix4_double):Tmatrix3_single
AddChar | Arc | assign(Tmatrix4_double):Tmatrix4_extended
AddCharR | ArcCoordsType | assign(Tmatrix4_double):Tmatrix4_single
AddDataModule | archive | assign(Tmatrix4_extended):Tmatrix2_double
AddDisk | arctan | assign(Tmatrix4_extended):Tmatrix2_extended
AddDisk | ArgList | assign(Tmatrix4_extended):Tmatrix2_single
AddExitProc | ARG_MAX | assign(Tmatrix4_extended):Tmatrix3_double
Addr | ARG_MAX | assign(Tmatrix4_extended):Tmatrix3_extended
AddSequence | ARG_MAX | assign(Tmatrix4_extended):Tmatrix3_single
AddSpecialSequence | ArrayStringToPPchar | assign(Tmatrix4_extended):Tmatrix4_double
add_tail | ArrayStringToPPchar | assign(Tmatrix4_extended):Tmatrix4_single
AddTerminateProc | AsciiZ | assign(Tmatrix4_single):Tmatrix2_double
add(Tmatrix2_double,Double):Tmatrix2_double | Assert | assign(Tmatrix4_single):Tmatrix2_extended
add(Tmatrix2_double,Tmatrix2_double):Tmatrix2_double | AssertErrorProc | assign(Tmatrix4_single):Tmatrix2_single
add(Tmatrix2_extended,extended):Tmatrix2_extended | Assign | assign(Tmatrix4_single):Tmatrix3_double
add(Tmatrix2_extended,Tmatrix2_extended):Tmatrix2_extended | assign(ansistring):olevariant | assign(Tmatrix4_single):Tmatrix3_extended
add(Tmatrix2_single,single):Tmatrix2_single | assign(ansistring):variant | assign(Tmatrix4_single):Tmatrix3_single
add(Tmatrix2_single,Tmatrix2_single):Tmatrix2_single | assign(Boolean):olevariant | assign(Tmatrix4_single):Tmatrix4_double
add(Tmatrix3_double,Double):Tmatrix3_double | assign(Boolean):variant | assign(Tmatrix4_single):Tmatrix4_extended
add(Tmatrix3_double,Tmatrix3_double):Tmatrix3_double | assign(Byte):olevariant | assign(Tvector2_double):Tvector2_extended
add(Tmatrix3_extended,extended):Tmatrix3_extended | assign(Byte):variant | assign(Tvector2_double):Tvector2_single
add(Tmatrix3_extended,Tmatrix3_extended):Tmatrix3_extended | assign(Char):olevariant | assign(Tvector2_double):Tvector3_double
add(Tmatrix3_single,single):Tmatrix3_single | assign(Char):variant | assign(Tvector2_double):Tvector3_extended
add(Tmatrix3_single,Tmatrix3_single):Tmatrix3_single | assign(comp):olevariant | assign(Tvector2_double):Tvector3_single
add(Tmatrix4_double,Double):Tmatrix4_double | assign(comp):variant | assign(Tvector2_double):Tvector4_double
add(Tmatrix4_double,Tmatrix4_double):Tmatrix4_double | AssignCrt | assign(Tvector2_double):Tvector4_extended
add(Tmatrix4_extended,extended):Tmatrix4_extended | assign(currency):olevariant | assign(Tvector2_double):Tvector4_single
add(Tmatrix4_extended,Tmatrix4_extended):Tmatrix4_extended | assign(currency):variant | assign(Tvector2_extended):Tvector2_double
add(Tmatrix4_single,single):Tmatrix4_single | assign(Double):olevariant | assign(Tvector2_extended):Tvector2_single
add(Tmatrix4_single,Tmatrix4_single):Tmatrix4_single | assign(Double):variant | assign(Tvector2_extended):Tvector3_double
add(Tvector2_double,Double):Tvector2_double | assign(DWord):olevariant | assign(Tvector2_extended):Tvector3_extended
add(Tvector2_double,Tvector2_double):Tvector2_double | assign(DWord):variant | assign(Tvector2_extended):Tvector3_single
add(Tvector2_extended,extended):Tvector2_extended | Assigned | assign(Tvector2_extended):Tvector4_double
add(Tvector2_extended,Tvector2_extended):Tvector2_extended | assign(extended):olevariant | assign(Tvector2_extended):Tvector4_extended
add(Tvector2_single,single):Tvector2_single | assign(extended):variant | assign(Tvector2_extended):Tvector4_single
add(Tvector2_single,Tvector2_single):Tvector2_single | assign(Int64):olevariant | assign(Tvector2_single):Tvector2_double
add(Tvector3_double,Double):Tvector3_double | assign(Int64):variant | assign(Tvector2_single):Tvector2_extended
add(Tvector3_double,Tvector3_double):Tvector3_double | assign(longbool):olevariant | assign(Tvector2_single):Tvector3_double
add(Tvector3_extended,extended):Tvector3_extended | assign(longbool):variant | assign(Tvector2_single):Tvector3_extended
add(Tvector3_extended,Tvector3_extended):Tvector3_extended | assign(LongInt):olevariant | assign(Tvector2_single):Tvector3_single
add(Tvector3_single,single):Tvector3_single | assign(LongInt):variant | assign(Tvector2_single):Tvector4_double
add(Tvector3_single,Tvector3_single):Tvector3_single | AssignLst | assign(Tvector2_single):Tvector4_extended
add(Tvector4_double,Double):Tvector4_double | assign(olevariant):ansistring | assign(Tvector2_single):Tvector4_single
add(Tvector4_double,Tvector4_double):Tvector4_double | assign(olevariant):Boolean | assign(Tvector3_double):Tvector2_double
add(Tvector4_extended,extended):Tvector4_extended | assign(olevariant):Byte | assign(Tvector3_double):Tvector2_extended
add(Tvector4_extended,Tvector4_extended):Tvector4_extended | assign(olevariant):Char | assign(Tvector3_double):Tvector2_single
add(Tvector4_single,single):Tvector4_single | assign(olevariant):comp | assign(Tvector3_double):Tvector3_extended
add(Tvector4_single,Tvector4_single):Tvector4_single | assign(olevariant):currency | assign(Tvector3_double):Tvector3_single
add(variant,variant):variant | assign(olevariant):Double | assign(Tvector3_double):Tvector4_double
AdjustLineBreaks | assign(olevariant):DWord | assign(Tvector3_double):Tvector4_extended
AF_APPLETALK | assign(olevariant):extended | assign(Tvector3_double):Tvector4_single
AF_ASH | assign(olevariant):Int64 | assign(Tvector3_extended):Tvector2_double
AF_ATMPVC | assign(olevariant):longbool | assign(Tvector3_extended):Tvector2_extended
AF_ATMSVC | assign(olevariant):LongInt | assign(Tvector3_extended):Tvector2_single
AF_AX25 | assign(olevariant):QWord | assign(Tvector3_extended):Tvector3_double
AF_BLUETOOTH | assign(olevariant):Real | assign(Tvector3_extended):Tvector3_single
AF_BRIDGE | assign(olevariant):ShortInt | assign(Tvector3_extended):Tvector4_double
AF_DECnet | assign(olevariant):shortstring | assign(Tvector3_extended):Tvector4_extended
AF_ECONET | assign(olevariant):single | assign(Tvector3_extended):Tvector4_single
AF_INET | assign(olevariant):SmallInt | assign(Tvector3_single):Tvector2_double
AF_INET6 | assign(olevariant):TDateTime | assign(Tvector3_single):Tvector2_extended
AF_IPX | assign(olevariant):TError | assign(Tvector3_single):Tvector2_single
AF_IRDA | assign(olevariant):UnicodeString | assign(Tvector3_single):Tvector3_double
AF_KEY | assign(olevariant):variant | assign(Tvector3_single):Tvector3_extended
AF_LLC | assign(olevariant):WideChar | assign(Tvector3_single):Tvector4_double
AF_LOCAL | assign(olevariant):widestring | assign(Tvector3_single):Tvector4_extended
AF_MAX | assign(olevariant):Word | assign(Tvector3_single):Tvector4_single
AF_NETBEUI | assign(olevariant):wordbool | assign(Tvector4_double):Tvector2_double
AF_NETLINK | AssignPipe | assign(Tvector4_double):Tvector2_extended
AF_NETROM | assign(QWord):olevariant | assign(Tvector4_double):Tvector2_single
AF_PACKET | assign(QWord):variant | assign(Tvector4_double):Tvector3_double
AF_PPPOX | assign(real48):Double | assign(Tvector4_double):Tvector3_extended
AF_ROSE | assign(real48):extended | assign(Tvector4_double):Tvector3_single
AF_ROUTE | assign(Real):olevariant | assign(Tvector4_double):Tvector4_extended
AF_SECURITY | assign(Real):variant | assign(Tvector4_double):Tvector4_single
AF_SNA | assign(ShortInt):olevariant | assign(Tvector4_extended):Tvector2_double
AF_TIPC | assign(ShortInt):variant | assign(Tvector4_extended):Tvector2_extended
AF_UNIX | assign(shortstring):olevariant | assign(Tvector4_extended):Tvector2_single
AF_UNSPEC | assign(shortstring):variant | assign(Tvector4_extended):Tvector3_double
AF_WANPIPE | assign(single):olevariant | assign(Tvector4_extended):Tvector3_extended
AF_X25 | assign(single):variant | assign(Tvector4_extended):Tvector3_single
Align | assign(SmallInt):olevariant | assign(Tvector4_extended):Tvector4_double
allocate_ldt_descriptors | assign(SmallInt):variant | assign(Tvector4_extended):Tvector4_single
allocate_memory_block | AssignStr | assign(Tvector4_single):Tvector2_double
AllocMem | AssignStream | assign(Tvector4_single):Tvector2_extended
AllowReuseOfLineInfoData | assign(TDateTime):olevariant | assign(Tvector4_single):Tvector2_single
AllowReuseOfLineInfoData | assign(TDateTime):variant | assign(Tvector4_single):Tvector3_double
AltPrefix | assign(TError):olevariant | assign(Tvector4_single):Tvector3_extended
AndPut | assign(TError):variant | assign(Tvector4_single):Tvector3_single
AnsiChar | assign(Tmatrix2_double):Tmatrix2_extended | assign(Tvector4_single):Tvector4_double
AnsiCompareFileName | assign(Tmatrix2_double):Tmatrix2_single | assign(Tvector4_single):Tvector4_extended
AnsiCompareStr | assign(Tmatrix2_double):Tmatrix3_double | assign(UCS4String):variant
AnsiCompareText | assign(Tmatrix2_double):Tmatrix3_extended | assign(UnicodeString):olevariant
AnsiContainsStr | assign(Tmatrix2_double):Tmatrix3_single | assign(UnicodeString):variant
AnsiContainsText | assign(Tmatrix2_double):Tmatrix4_double | assign(UTF8String):variant
AnsiDequotedStr | assign(Tmatrix2_double):Tmatrix4_extended | assign(variant):ansistring
AnsiEndsStr | assign(Tmatrix2_double):Tmatrix4_single | assign(variant):Boolean
AnsiEndsText | assign(Tmatrix2_extended):Tmatrix2_double | assign(variant):Byte
AnsiExtractQuotedStr | assign(Tmatrix2_extended):Tmatrix2_single | assign(variant):Char
AnsiIndexStr | assign(Tmatrix2_extended):Tmatrix3_double | assign(variant):comp
AnsiIndexText | assign(Tmatrix2_extended):Tmatrix3_extended | assign(variant):currency
AnsiLastChar | assign(Tmatrix2_extended):Tmatrix3_single | assign(variant):Double
AnsiLeftStr | assign(Tmatrix2_extended):Tmatrix4_double | assign(variant):DWord
AnsiLowerCase | assign(Tmatrix2_extended):Tmatrix4_extended | assign(variant):extended
AnsiLowerCaseFileName | assign(Tmatrix2_extended):Tmatrix4_single | assign(variant):Int64
AnsiMatchStr | assign(Tmatrix2_single):Tmatrix2_double | assign(variant):longbool
AnsiMatchText | assign(Tmatrix2_single):Tmatrix2_extended | assign(variant):LongInt
AnsiMidStr | assign(Tmatrix2_single):Tmatrix3_double | assign(variant):olevariant
AnsiPos | assign(Tmatrix2_single):Tmatrix3_extended | assign(variant):QWord
AnsiProperCase | assign(Tmatrix2_single):Tmatrix3_single | assign(variant):Real
AnsiQuotedStr | assign(Tmatrix2_single):Tmatrix4_double | assign(variant):ShortInt
AnsiReplaceStr | assign(Tmatrix2_single):Tmatrix4_extended | assign(variant):shortstring
AnsiReplaceText | assign(Tmatrix2_single):Tmatrix4_single | assign(variant):single
AnsiResemblesProc | assign(Tmatrix3_double):Tmatrix2_double | assign(variant):SmallInt
AnsiResemblesText | assign(Tmatrix3_double):Tmatrix2_extended | assign(variant):TDateTime
AnsiReverseString | assign(Tmatrix3_double):Tmatrix2_single | assign(variant):TError
AnsiRightStr | assign(Tmatrix3_double):Tmatrix3_extended | assign(variant):unicodestring
AnsiSameStr | assign(Tmatrix3_double):Tmatrix3_single | assign(variant):UTF8String
AnsiSameText | assign(Tmatrix3_double):Tmatrix4_double | assign(variant):WideChar
AnsiStartsStr | assign(Tmatrix3_double):Tmatrix4_extended | assign(variant):widestring
AnsiStartsText | assign(Tmatrix3_double):Tmatrix4_single | assign(variant):Word
AnsiStrComp | assign(Tmatrix3_extended):Tmatrix2_double | assign(variant):wordbool
AnsiStrIComp | assign(Tmatrix3_extended):Tmatrix2_extended | assign(WideChar):olevariant
AnsiStrLastChar | assign(Tmatrix3_extended):Tmatrix2_single | assign(WideChar):variant
AnsiStrLComp | assign(Tmatrix3_extended):Tmatrix3_double | assign(widestring):olevariant
AnsiStrLIComp | assign(Tmatrix3_extended):Tmatrix3_single | assign(widestring):variant
AnsiStrLower | assign(Tmatrix3_extended):Tmatrix4_double | assign(wordbool):olevariant
AnsiStrPos | assign(Tmatrix3_extended):Tmatrix4_extended | assign(wordbool):variant
AnsiStrRScan | assign(Tmatrix3_extended):Tmatrix4_single | assign(Word):olevariant
AnsiStrScan | assign(Tmatrix3_single):Tmatrix2_double | assign(Word):variant
AnsiStrUpper | assign(Tmatrix3_single):Tmatrix2_extended | auxcarryflag
AnsiToASCIITransTable | assign(Tmatrix3_single):Tmatrix2_single | axrComponentOnly
AnsiToUtf8 | assign(Tmatrix3_single):Tmatrix3_double | axrIncludeDescendants
AnsiUpperCase | assign(Tmatrix3_single):Tmatrix3_extended |

B

BackTraceStrFunc | binStr | Bounds
BackWard | BinToHex | Brackets
Bar | BinToHex | Break
Bar3D | BITSHIFT | Brown
BaseUnix | BITSINWORD | brown
BasicEventCreate | BkSlashFill | Brown
basiceventdestroy | Black | BsfByte
basiceventResetEvent | black | BsfDWord
basiceventSetEvent | Black | BsfQWord
basiceventWaitFor | Blink | BsfWord
BCDToInt | Blink | BsrByte
bdLeftToRight | Blkcnt64_t | BsrDWord
bdRightToLeft | Blkcnt_t | BsrQWord
bdRightToLeftNoAlign | Blksize_t | BsrWord
bdRightToLeftReadingOnly | BlockRead | BW40
Beep | BlockWrite | BW80
BeginGlobalLoading | Blue | Byte
BeginThread | blue | ByteLength
BEtoN | Blue | BytesOf
Big | BoldFont | ByteToCharIndex
Big | BooleanIdents | ByteToCharLen
Big | BoolToStr | ByteType
BINARY_MAPPING_FILE_EXT | BottomText |
Bind | Bounds |

C

C40 | CLONE_FILES | CP_UTF16
C80 | CLONE_FS | CP_UTF16BE
CAlloc | CLONE_NEWNS | CP_UTF7
CallPointerConstructor | CLONE_PARENT | CP_UTF8
CallPointerLocal | CLONE_PARENT_SETTID | crBlock
CallPointerMethod | CLONE_PID | create_code_segment_alias_descriptor
CallPointerMethodLocal | CLONE_PTRACE | CreateDir
CallTerminateProcs | CLONE_SETTLS | CreateGUID
CallVoidConstructor | CLONE_SIGHAND | CreateShellArgV
CallVoidLocal | CLONE_STOPPED | CreateVCLComObjectProc
CallVoidMethod | CLONE_SYSVSEM | crHalfBlock
CallVoidMethodLocal | CLONE_THREAD | crHidden
CanonicalOrder | CLONE_UNTRACED | Crt
CAP_AUDIT_CONTROL | CLONE_VFORK | crUnderLine
CAP_AUDIT_WRITE | CLONE_VM | cschar
CAP_CHOWN | clong | cschar
CAP_DAC_OVERRIDE | clong | cschar
CAP_DAC_READ_SEARCH | clong | cschar
CAP_FOWNER | clong | Cseg
CAP_FSETID | clongdouble | cshort
CAP_FS_MASK | clongdouble | cshort
capget | clonglong | cshort
CAP_IPC_LOCK | clonglong | cshort
CAP_IPC_OWNER | clonglong | CSIDL_ADMINTOOLS
CAP_KILL | clonglong | CSIDL_APPDATA
CAP_LEASE | Close | CSIDL_CDBURN_AREA
CAP_LINUX_IMMUTABLE | CloseDotFill | CSIDL_COMMON_ADMINTOOLS
CAP_MKNOD | CloseDwarf | CSIDL_COMMON_APPDATA
CAP_NET_ADMIN | CloseExeFile | CSIDL_COMMON_DESKTOPDIRECTORY
CAP_NET_BIND_SERVICE | Closegraph | CSIDL_COMMON_DOCUMENTS
CAP_NET_BROADCAST | CloseSocket | CSIDL_COMMON_FAVORITES
CAP_NET_RAW | CloseStabs | CSIDL_COMMON_MUSIC
capset | CloseThread | CSIDL_COMMON_PICTURES
CAP_SETGID | ClrEol | CSIDL_COMMON_PROGRAMS
CAP_SETPCAP | ClrScr | CSIDL_COMMON_STARTMENU
CAP_SETUID | clrviewproc | CSIDL_COMMON_STARTUP
CAP_SYS_ADMIN | cmem | CSIDL_COMMON_TEMPLATES
CAP_SYS_BOOT | cnAdded | CSIDL_COMMON_VIDEO
CAP_SYS_CHROOT | cnDeleting | CSIDL_COOKIES
CAP_SYS_MODULE | cnExtracting | CSIDL_DESKTOPDIRECTORY
CAP_SYS_NICE | CO40 | CSIDL_FAVORITES
CAP_SYS_PACCT | CO80 | CSIDL_FLAG_CREATE
CAP_SYS_PTRACE | CodePageNameToCodePage | CSIDL_HISTORY
CAP_SYS_RAWIO | CodePageToCodePageName | CSIDL_INTERNET_CACHE
CAP_SYS_RESOURCE | CodePointer | CSIDL_LOCAL_APPDATA
CAP_SYS_TIME | CodePointer | CSIDL_MYMUSIC
CAP_SYS_TTY_CONFIG | CodePointer | CSIDL_MYPICTURES
CaptureBacktrace | CodePointer | CSIDL_MYVIDEO
Cardinal | CodePtrInt | CSIDL_NETHOOD
carryflag | CodePtrInt | CSIDL_PERSONAL
cbool | CodePtrUInt | CSIDL_PRINTHOOD
cbool | CodePtrUInt | CSIDL_PROFILE
cbool | coDigitAsNumbers | CSIDL_PROFILES
cbool | coff_t | CSIDL_PROGRAM_FILES
ccCdecl | coff_t | CSIDL_PROGRAM_FILES_COMMON
ccCppdecl | coff_t | CSIDL_PROGRAMS
ccFar16 | coIgnoreCase | CSIDL_RECENT
cchar | coIgnoreInvalidSequence | CSIDL_SENDTO
cchar | coIgnoreKanaType | CSIDL_STARTMENU
cchar | coIgnoreNonSpace | CSIDL_STARTUP
cchar | coIgnoreSymbols | CSIDL_SYSTEM
ccInternProc | coIgnoreWidth | CSIDL_TEMPLATES
ccMWPascal | coIndexError | CSIDL_WINDOWS
ccOldFPCCall | coLingCasing | CSIGNAL
ccPascal | coLingIgnoreCase | csigned
ccReg | coLingIgnoreDiacritic | csigned
ccSafeCall | collation_de | csigned
ccSoftFloat | collation_es | csigned
ccStdCall | collation_fr_ca | csint
ccSysCall | collation_ja | csint
cdouble | collation_ko | csint
cdouble | collation_ru | csint
cdouble | collation_sv | csize_t
cdouble | collation_zh | csize_t
CenterLn | CollectionsEqual | csize_t
CenterPoint | CompareByte | cslong
CenterText | CompareChar | cslong
cfloat | CompareChar0 | cslong
cfloat | CompareDate | cslong
cfloat | CompareDateTime | cslonglong
cfloat | CompareDWord | cslonglong
CGA | CompareMem | cslonglong
CGAC0 | CompareMemRange | cslonglong
CGAC1 | CompareSortKey | csshort
CGAC2 | CompareStr | csshort
CGAC3 | CompareText | csshort
CGAHi | CompareTime | csshort
ChangeFileExt | CompareWord | cthreads
Char | ComposeDateTime | CtrlPrefix
character | ComputeSortKey | ctypes
CharInSet | ComStr | cuchar
charset | ComStr | cuchar
CharToByteLen | Concat | cuchar
chdir | ConcatPaths | cuchar
CheckBreak | ConfigExtension | cuint
CheckEOF | Connect | cuint
CheckPointer | ConsoleBuf | cuint
CheckSnow | ConsoleMaxX | cuint
CheckSynchronize | ConsoleMaxY | cuint16
chr | Continue | cuint16
cint | coOverflow | cuint16
cint | Copy2Space | cuint16
cint | Copy2SpaceDel | cuint32
cint | Copy2Symb | cuint32
cint16 | Copy2SymbDel | cuint32
cint16 | CopyArray | cuint32
cint16 | copyfromdos | cuint64
cint16 | CopyPut | cuint64
cint32 | copytodos | cuint64
cint32 | cos | cuint64
cint32 | coStringSort | cuint8
cint32 | cp1250 | cuint8
cint64 | cp1251 | cuint8
cint64 | cp1252 | cuint8
cint64 | cp1253 | culong
cint64 | cp1254 | culong
cint8 | cp1255 | culong
cint8 | cp1256 | culong
cint8 | cp1257 | culonglong
cint8 | cp1258 | culonglong
Circle | cp437 | culonglong
CircleProc | cp437 | culonglong
Classes | cp646 | cunsigned
ClassGroupOf | cp850 | cunsigned
ClearDevice | cp850 | cunsigned
ClearScreen | cp852 | cunsigned
ClearViewPort | cp852 | CurrencyDecimals
ClipOff | cp856 | CurrencyFormat
ClipOn | cp866 | CurrencyString
clocale | cp866 | CurrentDirectoryFirst
clock_getres | cp874 | CurrentDirectoryLast
clock_gettime | cp8859_1 | CurrentDriver
clockid_t | cp8859_2 | CurrentYear
CLOCK_MONOTONIC | cp8859_5 | CurrToStr
CLOCK_MONOTONIC_COARSE | cp895 | CurrToStrF
CLOCK_MONOTONIC_RAW | cp932 | cursorbig
CLOCK_PROCESS_CPUTIME_ID | cp936 | CursorLines
CLOCK_REALTIME | cp949 | cursoroff
CLOCK_REALTIME_COARSE | cp950 | cursoron
clock_settime | CP_ACP | CursorX
CLOCK_SGI_CYCLE | cpall | CursorY
CLOCKS_MASK | CP_ASCII | cushort
CLOCKS_MONO | cpBlink | cushort
clock_t | cpChangeCursor | cushort
clock_t | cpChangeFont | cushort
clock_t | cpChangeMode | cwstring
CLOCK_THREAD_CPUTIME_ID | cpColor | Cyan
clone | CP_NONE | Cyan
CLONE_CHILD_CLEARTID | CP_OEMCP | cyan
CLONE_CHILD_SETTID | CPUEndian |
CLONE_DETACHED | cpUnderLine |

D

D12bit | DecodeSoundexWord | divide(Tvector2_double,Double):Tvector2_double
D15bit | DecodeTime | divide(Tvector2_extended,extended):Tvector2_extended
D16bit | Default | divide(Tvector2_single,single):Tvector2_single
D1bit | Default8087CW | divide(Tvector3_double,Double):Tvector3_double
D24bit | DefaultAnsi2UnicodeMove | divide(Tvector3_extended,extended):Tvector3_extended
D2bit | DefaultAnsi2WideMove | divide(Tvector3_single,single):Tvector3_single
D32bit | DefaultCollationName | divide(Tvector4_double,Double):Tvector4_double
D4bit | DefaultErrorHandler | divide(Tvector4_extended,extended):Tvector4_extended
D64bit | DefaultFileSystemCodePage | divide(Tvector4_single,single):Tvector4_single
D6bit | DefaultFont | divide(variant,variant):variant
D8bit | DefaultFormatSettings | DoDirSeparators
darkgray | DefaultMXCSR | DoneCriticalsection
DarkGray | DefaultRTLFileSystemCodePage | DoneKeyboard
DarkGray | DefaultStackSize | DoneMouse
DashedLn | DefaultSystemCodePage | DoneThread
Date | DefaultTPCompatible | DoneVideo
DateDelta | DefaultUnicode2AnsiMove | Dos
DateOf | DefaultUnicodeCodePage | DosDateTimeToDateTime
DateSeparator | defpixelproc | DosError
DateTime | delay | DosExitCode
DateTimeToDosDateTime | Delay | dosmemfillchar
DateTimeToFileDate | DelChars | dosmemfillword
DateTimeToJulianDate | Delete | dosmemget
DateTimeToMac | DeleteFile | dosmemmove
DateTimeToModifiedJulianDate | DelLine | dosmemput
DateTimeToStr | DelSpace | dosmemselector
DateTimeToString | DelSpace1 | DosVersion
DateTimeToSystemTime | Detect | DotSep
DateTimeToTimeStamp | DetectGraph | DottedLn
DateTimeToUnix | detectMode | dpmi_dosmemfillchar
DateToStr | DetectMouse | dpmi_dosmemfillword
dateutils | dev_t | dpmi_dosmemget
DayFriday | dev_t | dpmi_dosmemmove
DayMonday | dev_t | dpmi_dosmemput
DayOf | DigitChars | DrawPoly
DayOfTheMonth | Dir | DrawTextBackground
DayOfTheWeek | directionflag | DriveDelim
DayOfTheYear | directory | Dseg
DayOfWeek | DirectoryExists | DTToUnixDate
DaySaturday | DirectPutPixel | DumpExceptionBackTrace
DaysBetween | directvideo | DumpHeap
DaysInAMonth | DirectVideo | Dump_Stack
DaysInAYear | Dirent | dupAccept
DaysInMonth | DirStr | dupAccept
DaysInYear | DirStr | dupError
DaySpan | disable | dupError
DaysPerWeek | DiskFree | DupeString
DaysPerYear | DiskFree | dupIgnore
DaySunday | DiskSize | dupIgnore
DayThursday | DiskSize | DwarfBackTraceStr
DayTuesday | DispCallByIDProc | DWord
DayWednesday | Dispose | DWORD
Dec | DisposeStr | dxeload
Dec2Numb | DisposeStr | dxe_load
DecimalSeparator | divide(Tmatrix2_double,Double):Tmatrix2_double | DynArrayBounds
DecodeDate | divide(Tmatrix2_extended,extended):Tmatrix2_extended | DynArrayClear
DecodeDateDay | divide(Tmatrix2_single,single):Tmatrix2_single | DynArrayDim
DecodeDateFully | divide(Tmatrix3_double,Double):Tmatrix3_double | DynArrayIndex
DecodeDateMonthWeek | divide(Tmatrix3_extended,extended):Tmatrix3_extended | DynArraySetLength
DecodeDateTime | divide(Tmatrix3_single,single):Tmatrix3_single | DynArraySize
DecodeDateWeek | divide(Tmatrix4_double,Double):Tmatrix4_double | dynlibs
DecodeDayOfWeekInMonth | divide(Tmatrix4_extended,extended):Tmatrix4_extended |
DecodeSoundexInt | divide(Tmatrix4_single,single):Tmatrix4_single |

E

EAbort | EPOLLET | ESysENOCSI
EAbstractError | EPoll_Event | ESysENODATA
EAccessViolation | EPOLLHUP | ESysENODEV
EArgumentException | EPOLLIN | ESysENOENT
EArgumentNilException | EPOLLONESHOT | ESysENOEXEC
EArgumentOutOfRangeException | EPOLLOUT | ESysENOKEY
EAssertionFailed | EPOLLPRI | ESysENOLCK
EBitsError | epoll_wait | ESysENOLINK
EBusError | EPrivilege | ESysENOMEDIUM
EClassNotFound | EPropertyConvertError | ESysENOMEM
EComponentError | EPropertyError | ESysENOMSG
EControlC | EPropReadOnly | ESysENONET
EConvertError | EPropWriteOnly | ESysENOPKG
EDirectoryNotFoundException | EqualRect | ESysENOPROTOOPT
EDivByZero | equal(variant,variant):Boolean | ESysENOSPC
EEncodingError | ERangeError | ESysENOSR
EExternal | Erase | ESysENOSTR
EExternalException | EReadError | ESysENOSYS
E_FAIL | EResNotFound | ESysENOTBLK
EFCreateError | errAbort | ESysENOTCONN
EFileNotFoundException | errContinue | ESysENOTDIR
EFilerError | errKbdBase | ESysENOTEMPTY
EFOpenError | errKbdInitError | ESysENOTNAM
EFormatError | errKbdNotImplemented | ESysENOTRECOVERABLE
EGA | errMouseBase | ESysENOTSOCK
EGA64 | errMouseInitError | ESysENOTTY
EGA64Hi | errMouseNotImplemented | ESysENOTUNIQ
EGA64Lo | errOk | ESysENXIO
EGABlack | Error | ESysEOPNOTSUPP
EGABlue | Erroraddr | ESysEOVERFLOW
EGABrown | Errorcode | ESysEOWNERDEAD
EGACyan | ErrorCode | ESysEPERM
EGADarkgray | ErrorHandler | ESysEPFNOSUPPORT
EGAGreen | ErrorInfo | ESysEPIPE
EGAHi | ERROR_INVALID_CODEPOINT_SEQUENCE | ESysEPROTO
EGALightblue | ErrorProc | ESysEPROTONOSUPPORT
EGALightcyan | errors | ESysEPROTOTYPE
EGALightgray | ErrOutput | ESysERANGE
EGALightgreen | errRetry | ESysEREMCHG
EGALightmagenta | errVioBase | ESysEREMOTE
EGALightred | errVioInit | ESysEREMOTEIO
EGALo | errVioNoSuchMode | ESysERESTART
EGAMagenta | errVioNotSupported | ESysERFKILL
EGAMono | ESafecallException | ESysEROFS
EGAMonoHi | EsockADDRINUSE | ESysESHUTDOWN
EGARed | EsockEACCESS | ESysESOCKTNOSUPPORT
EGAWhite | EsockEBADF | ESysESPIPE
EGAYellow | EsockEFAULT | ESysESRCH
EHeapException | EsockEINTR | ESysESRMNT
EHeapMemoryError | EsockEINVAL | ESysESTALE
EInOutError | EsockEMFILE | ESysESTRPIPE
EInterror | EsockEMSGSIZE | ESysETIME
EIntfCastError | EsockENOBUFS | ESysETIMEDOUT
EIntOverflow | EsockENOTCONN | ESysETOOMANYREFS
E_INVALIDARG | EsockENOTSOCK | ESysETXTBSY
EInvalidCast | EsockEPROTONOSUPPORT | ESysEUCLEAN
EInvalidContainer | EsockEWOULDBLOCK | ESysEUNATCH
EInvalidImage | EStackOverflow | ESysEUSERS
EInvalidInsert | EStreamError | ESysEWOULDBLOCK
EInvalidOp | EStringListError | ESysEXDEV
EInvalidOperation | ESysE2BIG | ESysEXFULL
EInvalidPointer | ESysEACCES | etCustom
EListError | ESysEADDRINUSE | etDebug
EListError | ESysEADDRNOTAVAIL | etError
Ellipse | ESysEADV | etFieldValue
ellipseproc | ESysEAFNOSUPPORT | etFieldValueClass
EMathError | ESysEAGAIN | EThread
EMethodNotFound | ESysEALREADY | EThreadDestroyCalled
emms | ESysEBADE | EThreadExternalException
EmptyFill | ESysEBADF | etInfo
EmptyMethod | ESysEBADFD | etStandard
EmptyStr | ESysEBADMSG | etStaticMethodClass
EmptyWideStr | ESysEBADR | etStaticMethodResult
emu387 | ESysEBADRQC | etVirtualMethodClass
enable | ESysEBADSLT | etVirtualMethodResult
EncodeDate | ESysEBFONT | etWarning
EncodeDateDay | ESysEBUSY | EUnderflow
EncodeDateMonthWeek | ESysECANCELED | E_UNEXPECTED
EncodeDateTime | ESysECHILD | EuroFont
EncodeDateWeek | ESysECHRNG | EVariantError
EncodeDayOfWeekInMonth | ESysECOMM | EWriteError
EncodeTime | ESysECONNABORTED | ExceptAddr
EncodeTimeInterval | ESysECONNREFUSED | ExceptClass
EndGlobalLoading | ESysECONNRESET | ExceptClsProc
ENDIAN_SUFFIX | ESysEDEADLK | ExceptFrameCount
EndOfADay | ESysEDEADLOCK | ExceptFrames
EndOfAMonth | ESysEDESTADDRREQ | Exception
EndOfAWeek | ESysEDOM | ExceptionErrorMessage
EndOfAYear | ESysEDOTDOT | ExceptObject
EndOfOptions | ESysEDQUOT | ExceptObjProc
EndOfTheDay | ESysEEXIST | ExceptProc
EndOfTheMonth | ESysEFAULT | Exclude
EndOfTheWeek | ESysEFBIG | ExcludeEmpty
EndOfTheYear | ESysEHOSTDOWN | ExcludeLeadingPathDelimiter
EndThread | ESysEHOSTUNREACH | ExcludeTrailingBackslash
ENoConstructException | ESysEIDRM | ExcludeTrailingPathDelimiter
E_NOINTERFACE | ESysEILSEQ | exDenormalized
ENoThreadSupport | ESysEINPROGRESS | Exec
E_NOTIMPL | ESysEINTR | ExecuteProcess
ENotImplemented | ESysEINVAL | exeinfo
ENotSupportedException | ESysEIO | ExeSearch
ENoWideStringSupport | ESysEISCONN | exInvalidOp
EnterCriticalsection | ESysEISDIR | Exit
EnumResLangProc | ESysEISNAM | ExitCode
EnumResNameProc | ESysEKEYEXPIRED | ExitProc
EnumResourceLanguages | ESysEKEYREJECTED | exOverflow
EnumResourceNames | ESysEKEYREVOKED | exp
EnumResourceTypes | ESysEL2HLT | ExpandFileName
EnumResTypeProc | ESysEL2NSYNC | ExpandFileNameCase
EnvCount | ESysEL3HLT | ExpandUNCFileName
EnvStr | ESysEL3RST | exPrecision
EObjectCheck | ESysELIBACC | external_codepage
EObserver | ESysELIBBAD | ExtractDelimited
EOF | ESysELIBEXEC | ExtractFileDir
EOLn | ESysELIBMAX | ExtractFileDrive
EOSError | ESysELIBSCN | ExtractFileExt
EOutOfMemory | ESysELNRNG | ExtractFileName
EOutOfResources | ESysELOOP | ExtractFilePath
EOverflow | ESysEMEDIUMTYPE | ExtractRelativepath
EPackageError | ESysEMFILE | ExtractShortPathName
EParserError | ESysEMLINK | ExtractStrings
EPathNotFoundException | ESysEMSGSIZE | ExtractSubstr
EPathTooLongException | ESysEMULTIHOP | ExtractWord
EpochToLocal | ESysENAMETOOLONG | ExtractWordPos
epoll_create | ESysENAVAIL | ExtStr
epoll_ctl | ESysENETDOWN | ExtStr
EPOLL_CTL_ADD | ESysENETRESET | exUnderflow
EPOLL_CTL_DEL | ESysENETUNREACH | exZeroDivide
EPOLL_CTL_MOD | ESysENFILE | EZeroDivide
EPoll_Data | ESysENOANO |
EPOLLERR | ESysENOBUFS |

F

faAnyFile | FpChown | fpIOperm
faArchive | fpc_in_abs_long | fpIoPL
faCompressed | fpc_in_abs_real | FpKill
faDirectory | fpc_in_addr_x | FpLink
faEncrypted | fpc_in_aligned_x | fplisten
faHidden | fpc_in_arctan_real | FpLseek
False | fpc_in_assert_x_y | fpLstat
FalseBoolStrs | fpc_in_assigned_x | FpMkdir
faNormal | fpc_in_bitsizeof_x | FpMkfifo
faReadOnly | fpc_in_box_x | Fpmmap
FarPointer | fpc_in_break | Fpmunmap
faSymLink | fpc_in_bsf_x | FpNanoSleep
faSysFile | fpc_in_bsr_x | fpNice
faTemporary | fpc_in_chr_byte | FpOpen
fauxiliary | fpc_in_concat_x | FpOpendir
faVirtual | fpc_in_const_abs | FPower10
faVolumeId | fpc_in_const_odd | FpPause
fcarry | fpc_in_const_ptr | FpPipe
fdatasync | fpc_in_const_sqr | FpPoll
FD_MAXFDSET | fpc_in_const_swap_long | FppRead
fdoInterval | fpc_in_const_swap_qword | FppWrite
feInvalidHandle | fpc_in_const_swap_word | FpRead
femms | fpc_in_continue | FpReaddir
FExpand | fpc_in_copy_x | fpReadLink
ffChildPos | fpc_in_cos_real | FpReadV
ffCurrency | fpc_in_cycle | fprecv
ffExponent | fpc_in_dec_x | fprecvfrom
ffFixed | fpc_in_default_x | FpRename
ffGeneral | fpc_in_dispose_x | FpRmdir
ffInherited | fpc_in_exclude_x_y | fpSelect
ffInline | fpc_in_exit | fpsend
ffNumber | fpc_in_exp_real | fpsendto
F_GetFd | fpc_in_fillchar_x | fpseterrno
F_GetFl | fpc_in_finalize_x | FpSetgid
F_GetLk | fpc_in_fma_double | fpSetPriority
F_GetOwn | fpc_in_fma_extended | FpSetRLimit
fgl | fpc_in_fma_float128 | FpSetsid
FileAge | fpc_in_fma_single | fpsetsockopt
FileClose | fpc_in_frac_real | fpsettimeofday
FileCreate | fpc_in_get_caller_addr | FpSetuid
FileDateToDateTime | fpc_in_get_caller_frame | fpshutdown
FileExists | fpc_in_get_frame | FPSigaction
FileFlush | fpc_in_high_x | FpSigAddSet
FileGetAttr | fpc_in_hi_long | FpSigDelSet
FileGetDate | fpc_in_hi_qword | FpsigEmptySet
FileIsReadOnly | fpc_in_hi_word | FpSigFillSet
Filemode | fpc_in_include_x_y | FpSigIsMember
FileNameLen | fpc_in_inc_x | FpSignal
FileOpen | fpc_in_initialize_x | FpSigPending
FilePos | fpc_in_int_real | FpSigProcMask
FileRead | fpc_in_leave | FpSigSuspend
FileRec | fpc_in_length_string | FpSigTimedWait
filerecnamelength | fpc_in_ln_real | fpS_ISBLK
FilerSignature | fpc_in_lo_long | fpS_ISCHR
FileSearch | fpc_in_lo_qword | fpS_ISDIR
FileSeek | fpc_in_lo_word | fpS_ISFIFO
FileSetAttr | fpc_in_low_x | fpS_ISLNK
FileSetDate | fpc_in_mmx_pcmpeqb | fpS_ISREG
FileSize | fpc_in_mmx_pcmpeqd | fpS_ISSOCK
FILETIME | fpc_in_mmx_pcmpeqw | FpSleep
_FILETIME | fpc_in_mmx_pcmpgtb | fpsocket
FileTruncate | fpc_in_mmx_pcmpgtd | fpsocketpair
FileWrite | fpc_in_mmx_pcmpgtw | FpStat
FillByte | fpc_in_move_x | fpStatFS
FillChar | fpc_in_new_x | fpSymlink
FillDWord | fpc_in_ofs_x | fpSystem
FillEllipse | fpc_in_ord_x | fptime
fillpatternTable | fpc_in_pack_x_y_z | FpTimes
FillPatternType | fpc_in_pi_real | FpUmask
FillPoly | fpc_in_popcnt_x | FpUname
FillQWord | fpc_in_pred_x | FpUnlink
FillSettingsType | fpc_in_prefetch_var | FpUtime
FillWord | fpc_in_readln_x | FpWait
FinalizeArray | fpc_in_readstr_x | FpWaitPid
FindClass | fpc_in_read_x | fpwidestring
FindClose | fpc_in_reset_typedfile | FpWrite
FindClose | fpc_in_reset_x | FpWriteV
FindCmdLineSwitch | fpc_in_rewrite_typedfile | frac
FindCollation | fpc_in_rewrite_x | Free
FindExeSection | fpc_in_rol_x | FreeAndNil
FindFirst | fpc_in_rol_x_x | FreeCollation
FindFirst | fpc_in_ror_x | free_ldt_descriptor
FindGlobalComponent | fpc_in_ror_x_x | FreeLibrary
FindIdentToInt | fpc_in_round_real | free_linear_addr_mapping
FindIntToIdent | fpc_in_sar_x | Freemem
FindMatchesBoyerMooreCaseInSensitive | fpc_in_sar_x_y | FreeMemAndNil
FindMatchesBoyerMooreCaseSensitive | fpc_in_seg_x | Freememory
FindNestedComponent | fpc_in_setlength_x | free_memory_block
FindNext | fpc_in_setstring_x_y_z | FreeResource
FindNext | fpc_in_settextbuf_file_x | free_rm_callback
FindPart | fpc_in_sin_real | FreeShellArgV
FindPropInfo | fpc_in_sizeof_x | FromBeginning
FindResource | fpc_in_slice | FromEnd
FindResourceEx | fpc_in_sqr_real | FromUCS4
FindSequence | fpc_in_sqrt_real | fsDenormal
FirstDotAtFileNameStartIsExtension | fpc_in_str_x_string | FSearch
Float | fpc_in_succ_x | FSearch
float_flag_denormal | fpc_in_trunc_real | F_SetFd
float_flag_divbyzero | fpc_in_typeinfo_x | F_SetFl
float_flag_inexact | fpc_in_typeof_x | F_SetLk
float_flag_invalid | fpc_in_unbox_x_y | F_SetLkW
float_flag_overflow | fpc_in_unpack_x_y_z | F_SetOwn
float_flag_underflow | fpc_in_val_x | fs_ext
float_raise | fpc_in_writeln_x | fs_ext2
float_round_down | fpc_in_writestr_x | fsFromBeginning
float_round_nearest_even | fpc_in_write_x | fsFromCurrent
float_round_to_zero | FpClose | fsFromEnd
float_round_up | FpClosedir | fsign
FloattoCurr | fpc_objc_encode_x | fsInf
FloatToDateTime | fpc_objc_protocol_x | fsInvalidOp
FloatToDecimal | fpc_objc_selector_x | fs_iso
FloatToStr | fpconnect | fs_minix
FloatToStrF | fpc_SarInt64 | fs_minix_30
FloatToText | FpDup | fs_minux_V2
FloatToTextFmt | FpDup2 | fs_msdos
FLock | FPE_FLTDIV | fsNaN
FloodFill | FPE_FLTINV | fsNDenormal
Flush | FPE_FLTOVF | fsNegative
Flushing | FPE_FLTRES | fs_nfs
FlushThread | FPE_FLTSUB | fsNInf
FMADouble | FPE_FLTUND | fsNZero
FMAExtended | FPE_INTDIV | fs_old_ext2
fmAppend | FPE_INTOVF | FSplit
FMASingle | FpExecL | fsPositive
fmclosed | FpExecLE | fs_proc
fmClosed | FpExecLP | fs_xia
fmCreate | FpExecLPE | fsZero
fminout | FpExecv | ftComp
fmInOut | FpExecV | ftCurr
fminput | FpExecve | ftDouble
fmInput | FpExecVP | ftExtended
fmOpenRead | FpExecVPE | ftSingle
fmOpenRead | FpExit | FunctionKeyName
fmOpenReadWrite | FpFcntl | futex
fmOpenReadWrite | fpFD_CLR | FUTEX_CMP_REQUEUE
fmOpenWrite | fpfdfillset | FUTEX_FD
fmOpenWrite | fpFD_ISSET | FUTEX_LOCK_PI
fmoutput | fpFD_SET | futex_op
fmOutput | fpFD_ZERO | FUTEX_OP_ADD
fmShareCompat | fpFlock | FUTEX_OP_ANDN
fmShareDenyNone | FpFork | FUTEX_OP_CMP_EQ
fmShareDenyRead | FPFStat | FUTEX_OP_CMP_GE
fmShareDenyWrite | fpfStatFS | FUTEX_OP_CMP_GT
fmShareExclusive | fpfsync | FUTEX_OP_CMP_LE
FmtStr | FpFtruncate | FUTEX_OP_CMP_LT
FNameStr | FpGetcwd | FUTEX_OP_CMP_NE
F_OK | FpGetegid | FUTEX_OP_OPARG_SHIFT
Font8x8 | FpGetEnv | FUTEX_OP_OR
ForceDirectories | fpgeterrno | FUTEX_OP_SET
Format | FpGeteuid | FUTEX_OP_XOR
FormatBuf | FpGetgid | FUTEX_REQUEUE
FormatCurr | FpGetgroups | FUTEX_TRYLOCK_PI
FormatDateTime | fpgetpeername | FUTEX_UNLOCK_PI
FormatFloat | FpGetpgrp | FUTEX_WAIT
FormatSettings | FpGetpid | FUTEX_WAKE
foverflow | FpGetppid | FUTEX_WAKE_OP
fpaccept | fpGetPriority | fvComp
FpAccess | FpGetRLimit | fvCurrency
FpAlarm | FpGetsid | fvDouble
fparity | fpgetsockname | fvExtended
fpbind | fpgetsockopt | FVMaxWidth
fpc_dynarray_rangecheck | fpgettimeofday | fvReal
FpChdir | FpGetuid | fvSingle
FpChmod | FpIOCtl | fzero

G

G1024x768x16 | GetInt64Prop | GetWindowsSpecialDirUnicode
G1024x768x16M | GetInterfaceProp | GetWindowsSystemDirectory
G1024x768x16M32 | GetIntVec | GetWindowsSystemDirectoryUnicode
G1024x768x256 | GetKeyboardDriver | GetX
G1024x768x32K | GetKeyEvent | GetY
G1024x768x64K | GetKeyEventChar | gid_t
G1152x864x16 | GetKeyEventCode | gid_t
G1152x864x16M | GetKeyEventFlags | gid_t
G1152x864x16M32 | GetKeyEventShiftState | GIO_CMAP
G1152x864x256 | GetKeyEventUniCode | GIO_FONT
G1152x864x32K | GetLastOSError | GIO_FONTX
G1152x864x64K | get_linear_addr | GIO_SCRNMAP
G1280x1024x16 | GetLineInfo | GIO_UNIMAP
G1280x1024x16M | GetLineInfo | GIO_UNISCRNMAP
G1280x1024x16M32 | GetLineSettings | global_dos_alloc
G1280x1024x256 | GetLoadErrorStr | global_dos_free
G1280x1024x32K | GetLocalTime | GlobalFixupReferences
G1280x1024x64K | GetLocalTimeOffset | GlobalNameSpace
G1600x1200x16 | GetLocalTimezone | GlobalSkipIfNoLeaks
G1600x1200x16M | GetLockScreenCount | go32
G1600x1200x16M32 | GetLongName | GothicFont
G1600x1200x256 | GetLongOpts | GotoXY
G1600x1200x32K | getmap | gpm
G1600x1200x64K | GetMaxColor | Gpm_AnyDouble
G320x200x16 | GetMaxMode | Gpm_AnySingle
G320x200x16M | GetMaxX | Gpm_AnyTriple
G320x200x16M32 | GetMaxY | GPM_B_LEFT
G320x200x256 | GetMem | GPM_B_MIDDLE
G320x200x32K | get_meminfo | GPM_BOT
G320x200x64K | GetMemory | GPM_B_RIGHT
G320x240x256 | GetMemoryManager | gpm_close
G320x400x256 | GetMethodProp | gpm_current_roi
G360x480x256 | GetModeName | GPM_DOUBLE
G640x200x16 | GetModeRange | GPM_DOWN
G640x350x16 | GetModuleByAddr | GPM_DRAG
G640x480x16 | GetModuleName | GPM_ENTER
G640x480x16M | GetMouseButtons | gpm_fitvalues
G640x480x16M32 | GetMouseDriver | gpm_fitvaluesM
G640x480x2 | GetMouseEvent | gpm_getevent
G640x480x256 | GetMouseX | gpm_getsnapshot
G640x480x32K | GetMouseY | gpm_handler
G640x480x64K | GetMsCount | GPM_HARD
G720x348x2 | GetMXCSR | GPM_LEAVE
G800x600x16 | get_next_selector_increment_value | GPM_LFT
G800x600x16M | GetObjectProp | gpm_lowerroi
G800x600x16M32 | GetObjectPropClass | GPM_MAGIC
G800x600x256 | GetOpt | GPM_MFLAG
G800x600x32K | getopts | GPM_MOVE
G800x600x64K | GetOrdProp | GPM_NODE_CTL
Get8087CW | get_page_attributes | GPM_NODE_DEV
GetActiveCollation | get_page_size | GPM_NODE_DIR
GetAppConfigDir | GetPalette | GPM_NODE_DIR_MODE
GetAppConfigFile | GetPaletteSize | GPM_NODE_FIFO
GetArcCoords | Get_pc_addr | GPM_NODE_PID
getascii | GetPixel | gpm_open
GetAspectRatio | getpixelproc | gpm_poproi
GetBkColor | get_pm_exception_handler | gpm_pushroi
GetBkColorProc | get_pm_interrupt | gpm_raiseroi
get_caller_addr | GetProcAddress | gpm_repeat
get_caller_frame | GetProcedureAddress | GPM_RGT
get_caller_stackinfo | GetProcessID | gpm_roi
GetCapabilities | GetPropInfo | gpm_roi_data
GetCBreak | GetPropInfos | gpm_roi_handler
GetClass | GetPropList | GPM_SINGLE
GetCmdLineArg | GetProps | Gpm_StrictDouble
GetCodepageByName | GetPropUCA | Gpm_StrictSingle
GetCodepageData | GetPropValue | Gpm_StrictTriple
GetCollationCount | GetRawInterfaceProp | GPM_TOP
GetColor | GetResourceManager | GPM_TRIPLE
GetCPUCount | GetRGBPalette | GPM_UP
get_cs | getrgbpaletteproc | Graph
GetCurrentDir | get_rm_callback | GraphDefaults
GetCurrentThreadId | get_rm_interrupt | GraphErrorMsg
GetCursorType | get_run_mode | graph_float
GetDate | GetScanLine | graphfreememprc
GetDefaultPalette | getscanlineproc | GraphFreeMemPtr
get_descriptor_access_right | get_segment_base_address | graphgetmemprc
getdir | get_segment_limit | GraphGetMemPtr
GetDirectVideo | GetSetProp | GraphResult
GetDirs | GetShortName | GraphStringTransTable
GetDomainName | get_ss | greaterthanorequal(variant,variant):Boolean
get_dpmi_version | GetSSECSR | greaterthan(variant,variant):Boolean
GetDriveIDFromLetter | GetStrProp | Green
GetDriverName | GetSystemCodepage | green
get_ds | GetTempDir | Green
GetEnumName | GetTempFileName | GregorianToJulian
GetEnumNameCount | GetTextCodePage | grError
GetEnumProp | GetTextSettings | grFileNotFound
GetEnumValue | GetThreadID | grFontNotFound
GetEnv | GetThreadManager | grInvalidDriver
GetEnvironmentString | GetTickCount | grInvalidFont
GetEnvironmentVariable | GetTickCount64 | grInvalidFontNum
GetEnvironmentVariableCount | GetTime | grInvalidMode
get_exception_handler | GetTimezoneFile | grInvalidVersion
GetFAttr | GetTypeData | grIOerror
GetFileHandle | getunicode | grNoFloodMem
GetFillPattern | GetUnicodeStringManager | grNoFontMem
GetFillSettings | GetUnicodeStrProp | grNoInitGraph
GetFixupInstanceNames | GetUserDir | grNoLoadMem
GetFixupReferenceNames | GetVariantManager | grNoScanMem
GetFloatProp | GetVariantProp | grNotDetected
GetFPCHeapStatus | GetVerify | grOk
get_frame | GetVideoDriver | GroupDescendentsWith
GetFS | GetVideoMode | growheapsize1
GetFTime | GetVideoModeCount | growheapsize2
GetGraphMode | GetVideoModeData | growheapsizesmall
GetHeapStatus | GetViewSettings | GuidCase
GetHostName | GetWideStringManager | GUID_NULL
GetImage | GetWideStrProp | GUID_NULL
getimageproc | GetWindowsSpecialDir | GUIDToString

H

halt | High | HostToNet
HaltOnError | highNewDriver | HourOf
HaltOnNotReleased | highNewMode | HourOfTheDay
HashName | HIGH_SURROGATE_BEGIN | HourOfTheMonth
HatchFill | HIGH_SURROGATE_COUNT | HourOfTheWeek
heaptrc | HIGH_SURROGATE_END | HourOfTheYear
HercMono | HighVideo | HoursBetween
HercMonoHi | HINSTANCE | HourSpan
Hex2Dec | HLine | HoursPerDay
HexDisplayPrefix | hlineproc | HRESULT
hexStr | HMODULE | HRSRC
HexToBin | HModule | htContext
HexToBin | HMODULE | htKeyword
HGLOBAL | HookSignal | htonl
hi | HorizDir | htons
hidden | HostAddrToStr |
HideMouse | HostAddrToStr6 |

I

IClassFactory | Int16 | IP_RECVERR
IdentToInt | int31error | IP_RECVOPTS
IDesignerNotify | Int32 | IP_RECVRETOPTS
IDispatch | Int64 | IP_RECVTOS
IEnumerable | Int64Rec | IP_RECVTTL
IEnumerator | Int8 | IP_RETOPTS
ifDispatch | intdivide(variant,variant):variant | IP_ROUTER_ALERT
ifDispInterface | Integer | IP_TOS
ifHasGuid | Integer | IP_TTL
ifHasStrGUID | IntegerArray | IP_UNBLOCK_SOURCE
IFPObserved | IntegerArray | IPV6_ADD_MEMBERSHIP
IFPObserver | InterleaveFill | IPV6_ADDRFORM
IfThen | InterlockedCompareExchange | IPV6_AUTHHDR
IInterface | InterlockedCompareExchange64 | IPV6_CHECKSUM
IInterfaceComponentReference | InterLockedDecrement | IPV6_DROP_MEMBERSHIP
IInterfaceList | InterLockedDecrement64 | IPV6_DSTOPTS
IInvokable | InterLockedExchange | IPV6_HOPLIMIT
ImageSize | InterLockedExchange64 | IPV6_HOPOPTS
imagesizeproc | InterLockedExchangeAdd | IPV6_IPSEC_POLICY
in6_addr | InterLockedExchangeAdd64 | IPV6_JOIN_ANYCAST
IN_ACCESS | InterLockedIncrement | IPV6_JOIN_GROUP
in_addr | InterLockedIncrement64 | IPV6_LEAVE_ANYCAST
INADDR_ANY | internal_codepage | IPV6_LEAVE_GROUP
INADDR_NONE | InternalEllipse | IPV6_MTU
IN_ALL_EVENTS | interruptflag | IPV6_MTU_DISCOVER
IN_ATTRIB | IntersectRect | IPV6_MULTICAST_HOPS
Inc | IntPtr | IPV6_MULTICAST_IF
IncAMonth | Intr | IPV6_MULTICAST_LOOP
IncDay | IntToBin | IPV6_NEXTHOP
IncHour | IntToHex | IPV6_PKTINFO
IN_CLOEXEC | IntToIdent | IPV6_PKTOPTIONS
IN_CLOSE | IntToRoman | IPV6_PMTUDISC_DO
IN_CLOSE_NOWRITE | IntToStr | IPV6_PMTUDISC_DONT
IN_CLOSE_WRITE | IN_UNMOUNT | IPV6_PMTUDISC_WANT
Include | InvalidDateDayError | IPV6_RECVERR
IncludeLeadingPathDelimiter | InvalidDateMonthWeekError | IPV6_ROUTER_ALERT
IncludeTrailingBackslash | InvalidDateTimeError | IPV6_RTHDR
IncludeTrailingPathDelimiter | InvalidDateWeekError | IPV6_RTHDR_LOOSE
IncMilliSecond | InvalidDayOfWeekInMonthError | IPV6_RTHDR_STRICT
IncMinute | invalidhandle | IPV6_RTHDR_TYPE_0
IncMonth | InvalidPoint | IPV6_RXDSTOPTS
IN_CREATE | IObjectInstance | IPV6_RXHOPOPTS
IncrementalCompareString | IOCtl_TCGETS | IPV6_RXSRCRT
IncSecond | IOResult | IPV6_UNICAST_HOPS
IncWeek | iovec | IPV6_V6ONLY
IncYear | IP_ADD_MEMBERSHIP | IPV6_XFRM_POLICY
IN_DELETE | IP_ADD_SOURCE_MEMBERSHIP | IReadWriteSync
IN_DELETE_SELF | IP_BLOCK_SOURCE | is_amd_3d_cpu
IndexByte | ipc | is_amd_3d_dsp_cpu
IndexChar | IPC_CREAT | is_amd_3d_mmx_cpu
IndexChar0 | IPC_EXCL | IsConsole
IndexDWord | IPC_INFO | IsDelimiter
IndexQWord | IPC_NOWAIT | IsDynArrayRectangular
IndexStr | ipc_pid_t | IsEmptyStr
Indexword | IPC_PRIVATE | IsEqualGUID
IN_DONT_FOLLOW | IPC_RMID | ISequentialStream
InflateRect | IPC_SET | IsFunctionKey
IN_IGNORED | IPC_STAT | IsInLeapYear
IN_ISDIR | IP_DEFAULT_MULTICAST_LOOP | Is_IntResource
InitComponentRes | IP_DEFAULT_MULTICAST_TTL | IsLeapYear
InitCriticalSection | IP_DROP_MEMBERSHIP | IsLibrary
InitGraph | IP_DROP_SOURCE_MEMBERSHIP | IsLstAvailable
InitializeArray | IP_HDRINCL | IsMemoryManagerSet
InitInheritedComponent | IP_MAX_MEMBERSHIPS | is_mmx_cpu
InitKeyboard | IP_MSFILTER | IsMultiThread
initmodeproc | IP_MTU_DISCOVER | iso01
InitMouse | IP_MULTICAST_IF | iso02
InitPrinter | IP_MULTICAST_LOOP | iso03
InitProc | IP_MULTICAST_TTL | iso04
InitThread | IP_OPTIONS | iso05
InitThreadVars | IP_PKTINFO | iso06
InitVideo | IP_PKTOPTIONS | iso07
IN_MASK_ADD | IP_PMTUDISC | iso08
IN_MODIFY | IP_PMTUDISC_DO | iso09
IN_MOVE | IP_PMTUDISC_DONT | iso10
IN_MOVED_FROM | IP_PMTUDISC_WANT | iso13
IN_MOVED_TO | IPPROTO_AH | iso14
IN_MOVE_SELF | IPPROTO_COMP | iso15
IN_NONBLOCK | IPPROTO_DSTOPTS | iso_codepages
ino64_t | IPPROTO_EGP | IsPathDelimiter
IN_ONESHOT | IPPROTO_ENCAP | IsPM
IN_ONLYDIR | IPPROTO_ESP | IsPublishedProp
IN_OPEN | IPPROTO_FRAGMENT | IsRectEmpty
ino_t | IPPROTO_GRE | IsSameDay
ino_t | IPPROTO_HOPOPTS | IsSameMonth
ino_t | IPPROTO_ICMP | is_sse2_cpu
inotify_add_watch | IPPROTO_ICMPV6 | is_sse_cpu
inotify_event | IPPROTO_IDP | IsStoredProp
inotify_init | IPPROTO_IGMP | IsToday
inotify_init1 | IPPROTO_IP | IStream
inotify_rm_watch | IPPROTO_IPIP | IStreamPersist
InOutRes | IPPROTO_IPV6 | IStringsAdapter
inportb | IPPROTO_MAX | IsValidDate
inportl | IPPROTO_MTP | IsValidDateDay
inportw | IPPROTO_NONE | IsValidDateMonthWeek
Input | IPPROTO_PIM | IsValidDateTime
IN_Q_OVERFLOW | IPPROTO_PUP | IsValidDateWeek
InquireSignal | IPPROTO_RAW | IsValidIdent
Insert | IPPROTO_ROUTING | IsValidTime
InsLine | IPPROTO_RSVP | IsWild
InstallUserDriver | IPPROTO_SCTP | IsWordPresent
InstallUserFont | IPPROTO_TCP | IUnknown
int | IPPROTO_TP | IVCLComObject
Int128Rec | IPPROTO_UDP |

J

jmp_buf | JulianEpoch
JulianDateToDateTime | JulianToGregorian

K

KB_101 | kbdHome | KD_GRAPHICS
KB_84 | kbdInsert | KDMAPDISP
kbAlt | kbdLeft | KDMKTONE
kbASCII | kbdLWin | KDSETKEYCODE
kbCtrl | kbdMiddle | KDSETLED
kbdApps | kbdPgDn | KDSETMODE
kbdDelete | kbdPgUp | KDSIGACCEPT
kbdDown | kbdRight | KDSKBDIACR
kbdEnd | kbdRWin | KD_TEXT
kbdF1 | kbdUp | KD_TEXT0
kbdF10 | kbFnKey | KD_TEXT1
kbdF11 | kbLeftShift | KDUNMAPDISP
kbdF12 | KB_OTHER | Keep
kbdF13 | kbPhys | keepreleased
kbdF14 | kbReleased | kernel_gid_t
kbdF15 | kbRightShift | kernel_loff_t
kbdF16 | kbShift | kernel_mode_t
kbdF17 | kbUniCode | kernel_off_t
kbdF18 | KDADDIO | kernel_uid_t
kbdF19 | KDDELIO | keyboard
kbdF2 | KDDISABIO | KeyEventToString
kbdF20 | KDENABIO | KeyPressed
kbdF3 | kDev_t | KeyPressed
kbdF4 | KDFONTOP | keypressed
kbdF5 | KDGETKEYCODE | key_t
kbdF6 | KDGETLED | KillThread
kbdF7 | KDGETMODE | KIOCSOUND
kbdF8 | KDGKBDIACR | koi8r
kbdF9 | KDGKBTYPE |

L

laAnd | LightGreen | lock_data
laCopy | lightmagenta | LOCK_EX
laDestUnique | LightMagenta | LOCK_EXCLUSIVE
laOr | LightMagenta | lock_linear_region
Largeint | lightred | LOCK_NB
LARGE_INT | LightRed | LOCK_ONLYONCE
LargeUint | LightRed | LockResource
LARGE_UINT | Line | LockScreenUpdate
laSrcUnique | LineFill | LOCK_SH
LastDelimiter | lineinfo | LOCK_UN
LastMode | lineproc | LOCK_WRITE
lastmode | LineRel | logicaland(variant,variant):variant
laXor | LineSettingsType | logicalnot(variant):variant
LCOMFont | LineStart | logicalor(variant,variant):variant
LeadBytes | LineTo | logicalxor(variant,variant):variant
LeaveCriticalsection | linger | LongDateFormat
LED_CAP | Linux | LongDayNames
LED_NUM | LINUX_CAPABILITY_VERSION | LongDiv
LED_SCR | ListSeparator | Longint
LeftBStr | Little | longjmp
leftshift(variant,variant):variant | Little | LongMonthNames
LeftStr | Little | LongMul
LeftStr | ln | LongRec
LeftText | ln2bitmask | LongRec
lessthanorequal(variant,variant):Boolean | ln2bitsinword | LongTimeFormat
lessthan(variant,variant):Boolean | lnAdded | Longword
LEtoN | lnDeleted | Low
LibName | lnExtracted | LowAscii
lightblue | lnfodwrf | lowerCase
LightBlue | lo | LowerCase
LightBlue | loadbinaryunicodemapping | lowNewDriver
LightCyan | LoadCollation | lowNewMode
lightcyan | LoadLibrary | LowRes
LightCyan | LoadResource | LOW_SURROGATE_BEGIN
LightGray | LoadStr | LOW_SURROGATE_END
lightgray | loadunicodemapping | LowVideo
LightGray | LocalTimeToUniversal | Lst
lightgreen | LocalToEpoch | LtBkSlashFill
LightGreen | lock_code | LtSlashFill

M

m1024x768 | MCAST_BLOCK_SOURCE | MouseButtons
m1280x1024 | MCAST_EXCLUDE | MouseEventBufSize
m1600x1200 | MCAST_INCLUDE | MouseIntFlag
m2048x1536 | MCAST_JOIN_GROUP | MouseLeftButton
m320x200 | MCAST_JOIN_SOURCE_GROUP | MouseMiddleButton
m320x256 | MCAST_LEAVE_GROUP | MouseRightButton
m320x400 | MCAST_LEAVE_SOURCE_GROUP | MouseWhereX
m512x384 | MCAST_MSFILTER | MouseWhereY
m640x200 | MCAST_UNBLOCK_SOURCE | Move
m640x256 | MCGA | MoveChar0
m640x350 | MCGAC0 | MoveRel
m640x400 | MCGAC1 | MoveTo
m640x480 | MCGAC2 | MS_ASYNC
m800x600 | MCGAC3 | MSDos
m832x624 | MCGAHi | MSecsPerDay
MacTimeStampToUnix | MCGAMed | MSecsPerSec
MacToDateTime | MemSize | MSecsToTimeStamp
Magenta | MidBStr | MSG_CONFIRM
magenta | MidStr | MSG_CTRUNC
Magenta | MilliSecondOf | MSG_DONTROUTE
MainThreadID | MilliSecondOfTheDay | MSG_DONTWAIT
MAKEINTRESOURCE | MilliSecondOfTheHour | MSG_EOF
MakeLangID | MilliSecondOfTheMinute | MSG_EOR
Malloc | MilliSecondOfTheMonth | MSG_ERRQUERE
MAP_ANON | MilliSecondOfTheSecond | MSG_FIN
MAP_ANONYMOUS | MilliSecondOfTheWeek | MSG_MORE
MAP_DENYWRITE | MilliSecondOfTheYear | MSG_NOSIGNAL
MAP_DENYWRITE | MilliSecondsBetween | MSG_OOB
map_device_in_memory_block | MilliSecondSpan | MSG_PEEK
MAP_EXECUTABLE | MinCurrency | MSG_PROXY
MAP_EXECUTABLE | MinDateTime | MSG_RST
MAP_FAILED | MinsPerDay | MSG_SYN
MAP_FAILED | MinsPerHour | MSG_TRUNC
MAP_FIXED | MinuteOf | MSG_TRYHARD
MAP_FIXED | MinuteOfTheDay | MSG_WAITALL
MAP_GROWSDOWN | MinuteOfTheHour | MS_INVALIDATE
MAP_GROWSDOWN | MinuteOfTheMonth | MS_SYNC
MAP_LOCKED | MinuteOfTheWeek | multiply(Tmatrix2_double,Double):Tmatrix2_double
MAP_LOCKED | MinuteOfTheYear | multiply(Tmatrix2_double,Tmatrix2_double):Tmatrix2_double
MAP_NORESERVE | MinutesBetween | multiply(Tmatrix2_double,Tvector2_double):Tvector2_double
MAP_NORESERVE | MinuteSpan | multiply(Tmatrix2_extended,extended):Tmatrix2_extended
mappingavailable | mkAmbiguous | multiply(Tmatrix2_extended,Tmatrix2_extended):Tmatrix2_extended
MAP_PRIVATE | mkAmbiguous | multiply(Tmatrix2_extended,Tvector2_extended):Tvector2_extended
MAP_PRIVATE | mkClassConstructor | multiply(Tmatrix2_single,single):Tmatrix2_single
MAP_SHARED | mkClassDestructor | multiply(Tmatrix2_single,Tmatrix2_single):Tmatrix2_single
MAP_SHARED | mkClassFunction | multiply(Tmatrix2_single,Tvector2_single):Tvector2_single
MAP_TYPE | mkClassProcedure | multiply(Tmatrix3_double,Double):Tmatrix3_double
MAP_TYPE | mkConstructor | multiply(Tmatrix3_double,Tmatrix3_double):Tmatrix3_double
MASK | mkDestructor | multiply(Tmatrix3_double,Tvector3_double):Tvector3_double
MatchStr | mkdir | multiply(Tmatrix3_extended,extended):Tmatrix3_extended
math | mkExactMatch | multiply(Tmatrix3_extended,Tmatrix3_extended):Tmatrix3_extended
matrix | mkExactMatch | multiply(Tmatrix3_extended,Tvector3_extended):Tvector3_extended
MaxBitFlags | mkFunction | multiply(Tmatrix3_single,single):Tmatrix3_single
MaxBitRec | mkNone | multiply(Tmatrix3_single,Tmatrix3_single):Tmatrix3_single
MaxBytes | mkNone | multiply(Tmatrix3_single,Tvector3_single):Tvector3_single
MAX_CLOCKS | mkOperatorOverload | multiply(Tmatrix4_double,Double):Tmatrix4_double
MaxCollectionSize | mkProcedure | multiply(Tmatrix4_double,Tmatrix4_double):Tmatrix4_double
MaxColors | mkSingleMatch | multiply(Tmatrix4_double,Tvector4_double):Tvector4_double
MaxCurrency | mkSingleMatch | multiply(Tmatrix4_extended,extended):Tmatrix4_extended
MaxDateTime | mmx | multiply(Tmatrix4_extended,Tmatrix4_extended):Tmatrix4_extended
Max_Frame_Dump | mode_t | multiply(Tmatrix4_extended,Tvector4_extended):Tvector4_extended
MaxGListSize | mode_t | multiply(Tmatrix4_single,single):Tmatrix4_single
maxint | mode_t | multiply(Tmatrix4_single,Tmatrix4_single):Tmatrix4_single
MaxInt | ModifiedJulianDateToDateTime | multiply(Tmatrix4_single,Tvector4_single):Tvector4_single
MaxKeptOSChunks | modify_ldt | multiply(Tvector2_double,Double):Tvector2_double
MAX_LEGAL_UTF32 | MODIFY_LDT_CONTENTS_CODE | multiply(Tvector2_double,Tvector2_double):Tvector2_double
MaxListSize | MODIFY_LDT_CONTENTS_DATA | multiply(Tvector2_extended,extended):Tvector2_extended
MaxListSize | MODIFY_LDT_CONTENTS_STACK | multiply(Tvector2_extended,Tvector2_extended):Tvector2_extended
maxLongint | ModuleIsCpp | multiply(Tvector2_single,single):Tvector2_single
MAX_PATH | ModuleIsLib | multiply(Tvector2_single,Tvector2_single):Tvector2_single
maxprintedblocklength | ModuleIsPackage | multiply(Tvector3_double,Double):Tvector3_double
MaxPtrs | modulus(variant,variant):variant | multiply(Tvector3_double,Tvector3_double):Tvector3_double
MaxReadBytes | Mono | multiply(Tvector3_extended,extended):Tvector3_extended
MaxSIntValue | MonthDays | multiply(Tvector3_extended,Tvector3_extended):Tvector3_extended
maxSmallint | MonthOf | multiply(Tvector3_single,single):Tvector3_single
maxsmallint | MonthOfTheYear | multiply(Tvector3_single,Tvector3_single):Tvector3_single
MaxTPCompatibleCollectionSize | MonthsBetween | multiply(Tvector4_double,Double):Tvector4_double
MaxUIntValue | MonthSpan | multiply(Tvector4_double,Tvector4_double):Tvector4_double
MAX_WORD | MonthsPerYear | multiply(Tvector4_extended,extended):Tvector4_extended
MaxWords | Mouse | multiply(Tvector4_extended,Tvector4_extended):Tvector4_extended
mbLeadByte | MouseActionDown | multiply(Tvector4_single,single):Tvector4_single
mbSingleByte | MouseActionMove | multiply(Tvector4_single,Tvector4_single):Tvector4_single
mbstate_t | MouseActionUp | multiply(variant,variant):variant
mbstate_value_t | MouseButton4 |
mbTrailByte | MouseButton5 |

N

NAME_MAX | negative(Tvector4_double):Tvector4_double | NoNet6
NAME_MAX | negative(Tvector4_extended):Tvector4_extended | NormalizeNFD
NAME_MAX | negative(Tvector4_single):Tvector4_single | NormalPut
NameStr | negative(variant):variant | NormVideo
NameStr | NegCurrFormat | NormWidth
NativeInt | NetAddrToStr | nosound
NativeUInt | NetAddrToStr6 | NoSound
NaturalCompareText | NetToHost | NotifyGlobalLoading
negative(Tmatrix2_double):Tmatrix2_double | New | NotPut
negative(Tmatrix2_extended):Tmatrix2_extended | NewStr | Now
negative(Tmatrix2_single):Tmatrix2_single | NewStr | NPos
negative(Tmatrix3_double):Tmatrix3_double | NilHandle | npxsetup
negative(Tmatrix3_extended):Tmatrix3_extended | nlink_t | NthDayOfWeek
negative(Tmatrix3_single):Tmatrix3_single | nlink_t | NtoBE
negative(Tmatrix4_double):Tmatrix4_double | nlink_t | NToHl
negative(Tmatrix4_extended):Tmatrix4_extended | NoAddress | NToHs
negative(Tmatrix4_single):Tmatrix4_single | NoAddress6 | NtoLE
negative(Tvector2_double):Tvector2_double | No_Argument | Null
negative(Tvector2_extended):Tvector2_extended | NoCurrentDirectory | NullStr
negative(Tvector2_single):Tvector2_single | NoErrMsg | Numb2Dec
negative(Tvector3_double):Tvector3_double | NoExtendedFrame | Numb2USA
negative(Tvector3_extended):Tvector3_extended | None |
negative(Tvector3_single):Tvector3_single | NoNet |

O

O_APPEND | OnShowException | opor
ObjectBinaryToText | ooAddItem | oppower
ObjectResourceToText | ooChange | opRemove
Objects | ooCustom | opshiftleft
ObjectTextToBinary | ooDeleteItem | opshiftright
ObjectTextToResource | ooFree | opsubtract
objpas | opadd | OptArg
O_CREAT | opand | OptErr
OctStr | opcmpeq | OptInd
odd | opcmpge | Optional_Argument
O_DIRECT | opcmpgt | OptOpt
O_DIRECTORY | opcmple | OptSpecifier
O_EXCL | opcmplt | opxor
off64_t | opcmpne | Ord
OffsetRect | opcompare | Orderings
off_t | opdivide | O_RDONLY
off_t | Open_Accmode | O_RDWR
off_t | Open_Append | OrPut
Ofs | Open_Creat | O_SYNC
O_LARGEFILE | Open_Direct | oteDFM
OldVideoBuf | Open_Directory | oteLFM
OnBeep | Open_Excl | O_TRUNC
OnCreateGUID | OpenExeFile | otSByte
O_NDELAY | Open_LargeFile | otSLong
OneHour | Open_NDelay | otSWord
OneMillisecond | Open_NoCtty | otUByte
OneMinute | Open_NoFollow | otULong
OneSecond | Open_NonBlock | otUWord
OnGetApplicationName | Open_RdOnly | OutOfMemoryError
OnGetPropValue | Open_RdWr | outportb
OnGetTempDir | Open_Sync | outportl
OnGetTempFile | Open_Trunc | outportw
OnGetVariantprop | Open_WrOnly | Output
OnGetVendorName | opInsert | OutText
O_NOCTTY | opintdivide | OutTextXY
O_NOFOLLOW | opmodulus | OutTextXYProc
O_NONBLOCK | opmultiply | overflowflag
OnSetPropValue | opnegate | OWordRec
OnSetVariantprop | opnot | O_WRONLY

P

PackTime | pfExeModule | PPtrInt
PadCenter | pfIgnoreDupUnits | PPtrUInt
PadLeft | pFilDes | PPTypeInfo
PadRight | PFileTextRecChar | PPUnknown
PaletteType | PFileTime | PPWideChar
PAnsiChar | PF_INET | PQWord
PAnsiString | PF_INET6 | PRect
ParamCount | PF_IPX | PRect
ParamStr | PF_IRDA | Pred
parityflag | PF_KEY | prefetch
PathDelim | pfLibraryModule | PrepareCollation
_PATH_DEV | PF_LLC | PResourceCollection
PATH_MAX | PF_LOCAL | PResourceFile
PATH_MAX | PF_MAX | preversecharmapping
PATH_MAX | pfModuleTypeMask | PreviousDayOfWeek
PathSep | PF_NETBEUI | printer
PathStr | PF_NETLINK | printfaultyblock
PathStr | PF_NETROM | printleakedblock
_PATH_VARRUN | pfNeverBuild | PRIO_PGRP
PatternLine | pfOut | PRIO_PGRP
patternlineproc | pfPackageModule | Prio_PGrp
PBlkCnt | PF_PACKET | Prio_Process
PBlkSize | PF_PPPOX | PRIO_PROCESS
PBoolean | pfProducerMask | PRIO_PROCESS
PBufStream | pfProducerUndefined | PRIO_USER
PByte | pfpstate | Prio_User
PByte | pfReference | PRIO_USER
PByteArray | PF_ROSE | PRLimit
PByteArray | PF_ROUTE | PropIsType
pcalldesc | pfRunOnly | PropType
PCardinal | PF_SECURITY | PROT_EXEC
pcbool | PF_SNA | PROT_EXEC
pcbool | PF_TIPC | PROT_NONE
pcbool | PF_UNIX | PROT_NONE
pcbool | PF_UNSPEC | PROT_READ
pcchar | pfV3Produced | PROT_READ
pcchar | pfVar | PROT_WRITE
pcchar | PF_WANPIPE | PROT_WRITE
pcchar | PF_X25 | PRTLCriticalSection
pcdouble | pGid | PRTLEvent
pcdouble | pGid | PShortInt
pcdouble | pGid | PShortString
pcdouble | Pgpmconnect | psigactionrec
pcfloat | Pgpm_connect | PSigContext
pcfloat | Pgpmevent | psiginfo
pcfloat | Pgpm_event | psigset
pcfloat | Pgpmroi | PSingle
PChar | Pgpm_roi | PSize
PCharSet | pGrpArr | pSize
PCharsetTransTable | PGuid | pSize
pcint | pi | pSize
pcint | pid_t | PSizeInt
pcint | pid_t | pSize_t
pcint | pid_t | pSize_t
pcint16 | PieSlice | psize_t
pcint16 | P_IN | PSizeUInt
pcint16 | PIn6Addr | PSmallInt
pcint16 | pin6_addr | PSmallInt
pcint32 | PInAddr | PSmallPoint
pcint32 | pin_addr | psockaddr
pcint32 | PInetSockAddr | PSockAddr6
pcint32 | PInetSockAddr6 | psockaddr_in
pcint64 | pIno | psockaddr_in6
pcint64 | pIno | psockaddr_un
pcint64 | pIno | pSocklen
pcint64 | pIno64 | pSockLen
pcint8 | Pinotify_event | pSocklen
pcint8 | pInt16 | PSortedCollection
pcint8 | pInt32 | pSSize
pcint8 | PInt64 | psSize
PClass | pInt8 | psSize
pClock | PInteger | PStat
pClock | PInteger | PStatFS
pClock | PIntegerArray | pstatfs
pclong | PIntegerArray | pstatfs
pclong | PInterface | PStatStg
pclong | pinterfaceentry | PStrCollection
pclong | pinterfacetable | PStream
pclongdouble | PIntPtr | PStreamRec
Pclongdouble | PIO_CMAP | PStrIndex
pclonglong | PIO_FONT | PString
pclonglong | PIO_FONTRESET | PString
pclonglong | PIO_FONTX | PString
pclonglong | PIO_SCRNMAP | PStringCollection
PClose | PIO_UNIMAP | PStringItem
PCLSID | PIO_UNIMAPCLR | PStringItemList
PCodePointer | PIO_UNISCRNMAP | PStringList
PCollection | piovec | pstringmessagetable
PComp | PIPC_Perm | PStrListMaker
PConsoleBuf | PItemList | PSysCharSet
pcschar | PJmp_buf | PSysInfo
pcschar | pkDev | ptConst
pcschar | PLargeInt | PText
pcschar | PLargeuInt | ptField
pcshort | plinger | pthread_attr_t
pcshort | PLongBool | pthread_condattr_t
pcshort | PLongint | pthread_cond_t
pcshort | PLongint | pthread_cond_t
pcsigned | PLongWord | pthread_cond_t
pcsigned | PManagedField | _pthread_fastlock
pcsigned | pmbstate_t | pthread_key_t
pcsigned | pmDouble | _PTHREAD_MUTEX_ADAPTIVE_NP
pcsint | PMemoryManager | pthread_mutexattr_t
pcsint | PMemoryStream | _PTHREAD_MUTEX_DEFAULT
pcsint | PMethod | _PTHREAD_MUTEX_ERRORCHECK
pcsint | pmExtended | _PTHREAD_MUTEX_ERRORCHECK_NP
pcsize_t | pmmxbyte | _PTHREAD_MUTEX_FAST_NP
pcsize_t | pmmxcardinal | _PTHREAD_MUTEX_NORMAL
pcsize_t | pmmxinteger | _PTHREAD_MUTEX_RECURSIVE
pcslong | pmmxlongint | _PTHREAD_MUTEX_RECURSIVE_NP
pcslong | pmmxshortint | pthread_mutex_t
pcslong | pmmxsingle | pthread_mutex_t
pcslong | pmmxword | pthread_mutex_t
pcslonglong | pMode | _PTHREAD_MUTEX_TIMED_NP
pcslonglong | pMode | pthread_rwlockattr_t
pcslonglong | pMode | pthreadrwlocksize
pcslonglong | PModeInfo | pthread_rwlock_t
pcsshort | PMouseEvent | pthread_t
pcsshort | pmReserved | pthread_t
pcsshort | PMsgStrTable | pthread_t
pcsshort | pmSingle | pTime
pcuchar | PNativeInt | pTime
pcuchar | PNativeUInt | pTime
pcuchar | pnLink | ptimespec
pcuchar | pnLink | ptimespec
pcuint | pnLink | ptimespec
pcuint | PObject | ptime_t
pcuint | pOff | ptime_t
pcuint | pOff | ptime_t
pcuint16 | pOff | ptimeval
pcuint16 | pOff64 | ptimeval
pcuint16 | Point | ptimeval
pcuint16 | Point | ptimezone
pcuint32 | PointerArray | PtInRect
pcuint32 | PointerArray | PTms
pcuint32 | PointsEqual | ptr
pcuint32 | PointType | PTreeElement
pcuint64 | POleStr | PtrInt
pcuint64 | POleVariant | PtrInt
pcuint64 | POLLERR | PtrRec
pcuint64 | pollfd | PtrUInt
pcuint8 | POLLHUP | PtrUInt
pcuint8 | POLLIN | ptStatic
pcuint8 | PollKeyEvent | ptVirtual
pcuint8 | PollMouseEvent | PTypeData
pculong | POLLMSG | PTypeInfo
pculong | POLLNVAL | PUCA_DataBook
pculong | POLLOUT | PUCA_PropItemContextRec
pculong | POLLPRI | PUCA_PropItemContextTreeNodeRec
pculonglong | POLLRDBAND | PUCA_PropItemContextTreeRec
pculonglong | POLLRDHUP | PUCA_PropItemRec
pculonglong | POLLRDNORM | PUCA_PropWeights
pculonglong | POLLREMOVE | Pucontext
pcunsigned | PollShiftStateEvent | PUC_Prop
pcunsigned | POLLWRBAND | PUCS2Char
pcunsigned | POLLWRNORM | PUCS4Char
pcunsigned | PopCnt | PUCS4CharArray
PCurrency | POpen | pUid
pcushort | POption | pUid
pcushort | port | pUid
pcushort | portb | pUInt16
pcushort | portl | PUInt24
PDate | ports | pUInt32
PDateTime | portw | PUInt64
PDayTable | Pos | pUInt8
pDev | PosEx | PUintPtr
pDev | PosSet | PUnicodeChar
pDev | PosSetEx | punicodecharmapping
pDir | P_OUT | punicodemap
pDirent | power(Tvector2_double,Tvector2_double):Double | PUnicodeString
PDispatch | power(Tvector2_extended,Tvector2_extended):extended | PUnknown
pdispdesc | power(Tvector2_single,Tvector2_single):single | PUnSortedStrCollection
PDisplay | power(Tvector3_double,Tvector3_double):Double | Puser_cap_data
PDosStream | power(Tvector3_extended,Tvector3_extended):extended | Puser_cap_header
PDouble | power(Tvector3_single,Tvector3_single):single | PUser_Desc
PDouble | power(Tvector4_double,Tvector4_double):Double | PUTF8String
PDWord | power(Tvector4_extended,Tvector4_extended):extended | PutImage
PDWord | power(Tvector4_single,Tvector4_single):single | putimageproc
pdynarrayindex | power(variant,variant):variant | pUtimBuf
pdynarraytypeinfo | PPAnsiChar | PutKeyEvent
PEPoll_Data | PPByte | PutMouseEvent
PEpoll_Event | PPChar | PutPixel
PeriodBetween | PPCharArray | putpixelproc
permute | PPCodePointer | PUtsName
PError | PPDispatch | pvararray
PError | PPDouble | pvararraybound
PEvent | pPid | pvararrayboundarray
PEventState | pPid | pvararraycoorarray
PExceptObject | pPid | pvardata
PExtended | PPLongint | PVariant
pfAddress | PPoint | pvariantmanager
PF_APPLETALK | PPoint | PVarRec
pfArray | PPointer | PVideoBuf
PF_ASH | PPointerArray | PVideoCell
PF_ATMPVC | PPointerArray | PVideoMode
PF_ATMSVC | PPointerArray | PVmt
PF_AX25 | PPointerList | PVmtFieldEntry
pfBCB4Produced | PPOleStr | PVmtFieldTable
PF_BLUETOOTH | ppollfd | pwchar_t
PF_BRIDGE | PPPAnsiChar | PWideChar
pfConst | PPPChar | PWideString
PF_DECnet | PPPointer | PWord
pfDelphi4Produced | PPPWideChar | PWordarray
pfDesignOnly | PProcedureParam | PWordArray
pFDSet | PPropInfo | PWordBool
PF_ECONET | PPropList | PXrmOptionDescRec

Q

queryadapterinfo | QuotedStr
quicktrace | QWord

R

RaiseLastOSError | RegisterComponentsProc | RLIMIT_FSIZE
RaiseList | RegisterFindGlobalComponentProc | RLIMIT_LOCKS
RaiseMaxFrameCount | RegisterInitComponentHandler | RLIMIT_MEMLOCK
RaiseProc | RegisterIntegerConsts | RLIMIT_NOFILE
Random | registermapping | RLIMIT_NPROC
RandomFrom | RegisterNoIcon | RLIMIT_RSS
Randomize | RegisterNoIconProc | RLIMIT_STACK
RandSeed | RegisterNonActiveX | rlim_t
RawByteString | RegisterObjects | rmdir
RawReadKey | Registers | rmDown
RawReadString | registers | rm_dpmi
RCollection | RegisterType | rmNearest
rcsDontCare | reIntfCastError | rm_raw
rcsRelaxed | reIntOverflow | rmTruncate
rcsStrict | reInvalidCast | rm_unknown
reAccessViolation | reInvalidOp | rmUp
Read | reInvalidPtr | rm_vcpi
ReadBarrier | ReleaseExceptionObject | rm_xms
ReadComponentRes | RemoveDataModule | R_OK
ReadComponentResEx | RemoveDir | RolByte
ReadComponentResFile | RemoveFixupReferences | RolDWord
ReadDebugLink | RemoveFixups | RolQWord
ReadDependencyBarrier | Removeleadingchars | RolWord
readkey | RemovePadChars | RomanToInt
ReadKey | RemoveTrailingChars | RomanToIntDef
ReadLn | Rename | ROOT_COLLATION_NAME
readonly | RenameFile | RorByte
ReadPort | reNone | RorDWord
ReadPortB | reOutOfMemory | RorQWord
ReadPortL | reOverflow | RorWord
ReadPortW | ReplaceDate | round
ReadTimezoneFile | ReplaceStr | RPos
ReadWriteBarrier | ReplaceText | RPosex
Real | ReplaceTime | RStrCollection
Real2Double | rePrivInstruction | RStringCollection
real48 | request_linear_region | RStringList
realintr | Required_Argument | RStrListMaker
ReAlloc | require_order | RT_ACCELERATOR
ReAllocMem | reQuit | RT_ANICURSOR
ReAllocMemory | reRangeError | RT_ANIICON
reAssertionFailed | ReReadLocalTime | RT_BITMAP
RecodeDate | reSafeCallError | RT_CURSOR
RecodeDateTime | Reset | RT_DIALOG
RecodeDay | resolutions | RT_FONT
RecodeHour | reStackOverflow | RT_FONTDIR
RecodeLeaveFieldAsIs | RestoreCrtMode | RT_GROUP_CURSOR
RecodeMilliSecond | RestoreStartMode | RT_GROUP_ICON
RecodeMinute | restorestateproc | RT_HTML
RecodeMonth | RestoreVideoState | RT_ICON
RecodeSecond | ResumeThread | RTLEventCreate
reCodesetConversion | return_in_order | RTLeventdestroy
RecodeTime | ReturnNilIfGrowHeapFails | RTLeventResetEvent
RecodeYear | reUnderflow | RTLeventSetEvent
reControlBreak | reVarArrayBounds | RTLeventWaitFor
Rect | reVarArrayCreate | RTL_SIGBUS
Rect | reVarDispatch | RTL_SIGDEFAULT
Rectangle | reVarInvalidOp | RTL_SIGFPE
Red | reVarNotArray | RTL_SIGILL
Red | reVarTypeCast | RTL_SIGINT
red | ReverseString | RTL_SIGLAST
RedirectFixupReferences | Rewrite | RTL_SIGQUIT
reDivByZero | reZeroDivide | RTL_SIGSEGV
reExternalException | RGBRec | RT_MANIFEST
Region | RightBStr | RT_MENU
RegisterBGIDriver | rightshift(variant,variant):variant | RT_MESSAGETABLE
RegisterBGIfont | RightStr | RT_RCDATA
registerbinarymapping | RightStr | RT_STRING
RegisterClass | RightText | RT_VERSION
RegisterClassAlias | RLIMIT_AS | RunError
RegisterClasses | RLIMIT_CORE | RuntimeErrorExitCodes
RegisterCollation | RLIMIT_CPU |
RegisterComponents | RLIMIT_DATA |

S

sa_family_t | SIG_SETMASK | STG_E_INCOMPLETE
SafeCallErrorProc | sigset_t | STG_E_INSUFFICIENTMEMORY
SafeLoadLibrary | SIGSTKFLT | STG_E_INUSE
SafeLoadLibrary | SIGSTOP | STG_E_INVALIDFLAG
SA_INTERRUPT | SIGTERM | STG_E_INVALIDFUNCTION
SameDate | SIGTRAP | STG_E_INVALIDHANDLE
SameDateTime | SIGTSTP | STG_E_INVALIDHEADER
SameFileName | SIGTTIN | STG_E_INVALIDNAME
SameStr | SIGTTOU | STG_E_INVALIDPARAMETER
SameText | SIG_UNBLOCK | STG_E_INVALIDPOINTER
SameTime | SIGUNUSED | STG_E_LOCKVIOLATION
SAnd | SIGURG | STG_E_MEDIUMFULL
SA_NOCLDSTOP | SIGUSR1 | STG_E_NOMOREFILES
SA_NOCLDWAIT | SIGUSR2 | STG_E_NOTCURRENT
SA_NODEFER | SIGVTALRM | STG_E_OLDDLL
SA_NOMASK | SIGWINCH | STG_E_OLDFORMAT
SansSerifFont | SIGXCPU | STG_E_PATHNOTFOUND
SA_ONESHOT | SIGXFSZ | STG_E_PROPSETMISMATCHED
SA_ONSTACK | SimpleFont | STG_E_READFAULT
SA_RESETHAND | sin | STG_E_REVERTED
SA_RESTART | S_IN | STG_E_SEEKERROR
SA_RESTORER | SInvalidRomanNumeral | STG_E_SHAREREQUIRED
SarInt64 | SI_PAD_SIZE | STG_E_SHAREVIOLATION
SarLongint | S_IRGRP | STG_E_TERMINATED
SarShortint | S_IROTH | stGetError
SarSmallint | S_IRUSR | STG_E_TOOMANYOPENFILES
SA_SIGINFO | S_IRWXG | STG_E_UNIMPLEMENTEDFUNCTION
savestateproc | S_IRWXO | STG_E_UNKNOWN
SaveVideoState | S_IRWXU | STG_E_WRITEFAULT
scAlt | S_IWGRP | STG_S_BLOCK
ScanDateTime | S_IWOTH | STG_S_CONVERTED
scCtrl | S_IWUSR | STG_S_MONITORING
sched_param | S_IXGRP | STG_S_RETRYNOW
sched_yield | S_IXOTH | STGTY_LOCKBYTES
SCM_SRCRT | S_IXUSR | STGTY_PROPERTY
SCM_TIMESTAMP | Size | STGTY_STORAGE
scNone | SizeInt | STGTY_STREAM
SCollationNotFound | SizeInt | stInitError
scpAnsi | SizeIntArray | stOk
scpConsoleInput | SizeOf | stOpen
scpConsoleOutput | SizeofResource | stOpenError
scpFileSystemSingleByte | size_t | stOpenRead
ScreenColor | size_t | stOpenWrite
ScreenHeight | size_t | stPutError
ScreenHeight | SizeUInt | Str
ScreenWidth | SizeUInt | Str2UnixSockAddr
ScreenWidth | SKeyPad | stralloc
ScriptFont | SlashFill | StrAlloc
scShift | Sleep | StrBufSize
SearchBuf | SLeftRight | StrByteType
SearchRec | SmallFont | strcat
SecondOf | Smallint | strcat
SecondOfTheDay | SmallPoint | StrCharLength
SecondOfTheHour | SO_ACCEPTCONN | strcomp
SecondOfTheMinute | SO_ATTACH_FILTER | strcomp
SecondOfTheMonth | soBeginning | StrCopy
SecondOfTheWeek | SO_BINDTODEVICE | strcopy
SecondOfTheYear | SO_BROADCAST | strdispose
SecondsBetween | SO_BSDCOMPAT | StrDispose
SecondSpan | Sock2File | stReadError
SecsPerDay | Sock2Text | StreamError
SecsPerMin | sockaddr | STREAM_SEEK_CUR
Sector | sockaddr_in | STREAM_SEEK_END
Seek | sockaddr_in6 | STREAM_SEEK_SET
SEEK_CUR | sockaddr_un | strecopy
SeekDir | SOCK_DGRAM | strecopy
SEEK_END | socketerror | strend
SeekEOF | Sockets | strend
SeekEOLn | socklen_t | StrError
SEEK_SET | socklen_t | StrFmt
Seg | socklen_t | stricomp
seg_fillchar | SOCK_MAXADDRLEN | stricomp
seg_fillword | SOCK_RAW | StringCodePage
segment_to_descriptor | SOCK_RDM | StringElementSize
seg_move | SOCK_SEQPACKET | StringOf
SelectText | SOCK_STREAM | StringOfChar
SemaphoreDestroy | soCurrent | StringRefCount
SemaphoreInit | SO_DEBUG | StringReplace
SemaphorePost | SO_DETACH_FILTER | StringReplace
SemaphoreWait | SO_DONTROUTE | strings
sem_t | soDown | StringsReplace
SErrAmountStrings | soEnd | StringToGUID
Set8087CW | SO_ERROR | StringToPPChar
SetActiveCollation | soFromBeginning | StringToPPChar
SetActivePage | soFromCurrent | StringToSet
setactivepageproc | soFromEnd | StringToUnicodeChar
SetAllPalette | softfloat_exception_flags | StringToWideChar
SetAllPaletteProc | softfloat_exception_mask | stripos
SetAspectRatio | softfloat_rounding_mode | striscan
SetBkColor | S_OK | strlcat
SetBkColorProc | SO_KEEPALIVE | strlcat
SetCBreak | SOL_ICMPV6 | strlcomp
SetCodePage | SolidFill | strlcomp
SetColor | SolidLn | StrLCopy
SetCThreadManager | SO_LINGER | strlcopy
SetCurrentDir | SOL_IP | strlen
SetCursorPos | SOL_IPV6 | strlen
SetCursorType | SOL_SOCKET | StrLen
SetCWidestringManager | soMatchCase | StrLFmt
SetDate | SOMAXCONN | strlicomp
set_descriptor_access_right | SO_NO_CHECK | strlicomp
SetDirectVideo | SO_OOBINLINE | strlower
SetDirSeparators | soOwned | strlower
SetEnumProp | SO_PASSCRED | strmove
set_exception_handler | SO_PEERCRED | StrMove
SetFAttr | SO_PEERNAME | strnew
SetFillPattern | SO_PRIORITY | strnew
SetFillStyle | SO_RCVBUF | StrNextChar
SetFloatProp | SO_RCVLOWAT | StrPas
SetFTime | SO_RCVTIMEO | strpas
SetGraphMode | soReference | strpas
SetHeapExtraInfo | SO_REUSEADDR | strpcopy
SetHeapTraceOutput | SO_SECURITY_AUTHENTICATION | StrPCopy
SetInt64Prop | SO_SECURITY_ENCRYPTION_NETWORK | StrPLCopy
SetInterfaceProp | SO_SECURITY_ENCRYPTION_TRANSPORT | strpos
SetIntVec | SO_SNDBUF | strpos
Setjmp | SO_SNDLOWAT | strriscan
SetKeyboardDriver | SO_SNDTIMEO | strrscan
SetLineStyle | SO_TIMESTAMP | strrscan
SetMemoryManager | SO_TYPE | strscan
SetMethodProp | Sound | StrScan
SetMouseDriver | sound | StrToBool
SetMouseXY | Soundex | StrToBoolDef
SetMultiByteConversionCodePage | SoundexCompare | StrToCurr
SetMultiByteFileSystemCodePage | SoundexInt | StrToCurrDef
SetMultiByteRTLFileSystemCodePage | SoundexProc | StrToDate
SetMXCSR | SoundexSimilar | StrToDateDef
SetObjectProp | SoundexWord | StrToDateTime
SetOrdProp | S_OUT | StrToDateTimeDef
set_page_attributes | soWholeWord | StrToDWord
SetPalette | Space | StrToDWordDef
set_pm_exception_handler | SPLICE_F_GIFT | StrToFloat
set_pm_interrupt | SPLICE_F_MORE | StrToFloatDef
SetPropValue | SPLICE_F_MOVE | StrToHostAddr
SetRawInterfaceProp | SPLICE_F_NONBLOCK | StrToHostAddr6
setregid | Sptr | StrToInt
SetResourceManager | sqr | StrToInt64
setreuid | sqrt | StrToInt64Def
SetRGBPalette | sraBoyerMoore | StrToIntDef
setrgbpaletteproc | sraDefault | StrToNetAddr
set_rm_interrupt | sraManySmall | StrToNetAddr6
set_segment_base_address | srBottom | StrToQWord
set_segment_limit | srLeft | StrToQWordDef
SetSetProp | srRight | StrToTime
SetSSECSR | srTop | StrToTimeDef
SetStr | ssAlt | strupper
SetString | ssAltGr | strupper
SetStrProp | SScanCode | strutils
SetTextBuf | SScanf | stSeekError
SetTextCodePage | ssCaps | StuffString
SetTextJustify | ssCtrl | stWriteError
SetTextLineEnding | ssDouble | subtract(Tmatrix2_double,Double):Tmatrix2_double
SetTextStyle | Sseg | subtract(Tmatrix2_double,Tmatrix2_double):Tmatrix2_double
SetThreadManager | ssExtra1 | subtract(Tmatrix2_extended,extended):Tmatrix2_extended
SetTime | ssExtra2 | subtract(Tmatrix2_extended,Tmatrix2_extended):Tmatrix2_extended
SetToString | SShift | subtract(Tmatrix2_single,single):Tmatrix2_single
SetUnicodeStringManager | ssHooked | subtract(Tmatrix2_single,Tmatrix2_single):Tmatrix2_single
SetUnicodeStrProp | ssHyper | subtract(Tmatrix3_double,Double):Tmatrix3_double
SetUserCharSize | ssize_t | subtract(Tmatrix3_double,Tmatrix3_double):Tmatrix3_double
SetVariantManager | ssize_t | subtract(Tmatrix3_extended,extended):Tmatrix3_extended
SetVariantProp | ssize_t | subtract(Tmatrix3_extended,Tmatrix3_extended):Tmatrix3_extended
SetVerify | sslAuto | subtract(Tmatrix3_single,single):Tmatrix3_single
SetVideoDriver | ssLeft | subtract(Tmatrix3_single,Tmatrix3_single):Tmatrix3_single
SetVideoMode | sslNone | subtract(Tmatrix4_double,Double):Tmatrix4_double
SetViewPort | sslUser | subtract(Tmatrix4_double,Tmatrix4_double):Tmatrix4_double
SetVisualPage | ssMeta | subtract(Tmatrix4_extended,extended):Tmatrix4_extended
setvisualpageproc | ssMiddle | subtract(Tmatrix4_extended,Tmatrix4_extended):Tmatrix4_extended
SetWideStringManager | ssNotHooked | subtract(Tmatrix4_single,single):Tmatrix4_single
SetWideStrProp | ssNum | subtract(Tmatrix4_single,Tmatrix4_single):Tmatrix4_single
SetWriteMode | ssOverridden | subtract(Tvector2_double,Double):Tvector2_double
S_FALSE | ssQuad | subtract(Tvector2_double,Tvector2_double):Tvector2_double
sfoImplicitCurrentDir | ssRight | subtract(Tvector2_extended,extended):Tvector2_extended
sfoStripQuotes | ssScroll | subtract(Tvector2_extended,Tvector2_extended):Tvector2_extended
SGUIDObserved | ssShift | subtract(Tvector2_single,single):Tvector2_single
SGUIDObserver | ssSuper | subtract(Tvector2_single,Tvector2_single):Tvector2_single
SharedSuffix | ssTriple | subtract(Tvector3_double,Double):Tvector3_double
sharemem | StabBackTraceStr | subtract(Tvector3_double,Tvector3_double):Tvector3_double
ShiftPrefix | StackBottom | subtract(Tvector3_extended,extended):Tvector3_extended
ShiftStateToString | StackError | subtract(Tvector3_extended,Tvector3_extended):Tvector3_extended
ShortCompareText | StackLength | subtract(Tvector3_single,single):Tvector3_single
ShortDateFormat | StackTop | subtract(Tvector3_single,Tvector3_single):Tvector3_single
ShortDayNames | StartClassGroup | subtract(Tvector4_double,Double):Tvector4_double
ShortHostToNet | StartOfADay | subtract(Tvector4_double,Tvector4_double):Tvector4_double
Shortint | StartOfAMonth | subtract(Tvector4_extended,extended):Tvector4_extended
ShortMonthNames | StartOfAWeek | subtract(Tvector4_extended,Tvector4_extended):Tvector4_extended
ShortNetToHost | StartOfAYear | subtract(Tvector4_single,single):Tvector4_single
ShortStringBase | StartOfTheDay | subtract(Tvector4_single,Tvector4_single):Tvector4_single
ShortTimeFormat | StartOfTheMonth | subtract(variant,variant):variant
ShowException | StartOfTheWeek | Succ
ShowMouse | StartOfTheYear | SUnicodeChar
SHUT_RD | Stat | SUnknownFunctionKey
SHUT_RDWR | STATFLAG_DEFAULT | Supports
SHUT_WR | STATFLAG_NONAME | SuspendThread
S_IFBLK | STATFLAG_NOOPEN | Swap
S_IFCHR | STAT_IFBLK | SwapEndian
S_IFDIR | STAT_IFCHR | SwapVectors
S_IFIFO | STAT_IFDIR | Sw_Integer
S_IFLNK | STAT_IFIFO | SwitchChars
S_IFMT | STAT_IFLNK | Sw_Word
S_IFREG | STAT_IFMT | symmetricaldifference(Tvector3_double,Tvector3_double):Tvector3_double
S_IFSOCK | STAT_IFREG | symmetricaldifference(Tvector3_extended,Tvector3_extended):Tvector3_extended
SIGABRT | STAT_IFSOCK | symmetricaldifference(Tvector3_single,Tvector3_single):Tvector3_single
sigactionhandler | STAT_IRGRP | sync_file_range
sigactionhandler_t | STAT_IROTH | SYNC_FILE_RANGE_WAIT_AFTER
sigactionrec | STAT_IRUSR | SYNC_FILE_RANGE_WAIT_BEFORE
SIGALRM | STAT_IRWXG | SYNC_FILE_RANGE_WRITE
SIG_BLOCK | STAT_IRWXO | SysAllocMem
SIGBUS | STAT_IRWXU | SysAssert
SIGCHLD | STAT_ISGID | SysBackTraceStr
SIGCONT | STAT_ISUID | SysConfigDir
SIG_DFL | STAT_ISVTX | sys_errlist
SIG_ERR | STAT_IWGRP | sys_errn
SIGFPE | STAT_IWOTH | SysErrorMessage
SIGHUP | STAT_IWUSR | sysfile
SIG_IGN | STAT_IXGRP | SysFlushStdIO
SIGILL | STAT_IXOTH | SysFreemem
SIGINT | STAT_IXUSR | SysFreememSize
SIGIO | STATSTG | SysGetFPCHeapStatus
SIGIOT | _STAT_VER | SysGetHeapStatus
SIGKILL | _STAT_VER_KERNEL | SysGetmem
SIG_MAXSIG | _STAT_VER_LINUX | Sysinfo
SIG_MAXSIG | stCreate | SysInitExceptions
SIG_MAXSIG | StdErr | SysInitFPU
signalhandler | StdOut | SysInitStdIO
signalhandler_t | StdSwitchChars | SysLocale
signflag | StdWordDelims | SysMemSize
SIGPIPE | stError | SYS_NMLN
SIGPOLL | STG_E_ABNORMALAPIEXIT | SYS_NMLN
SIGPROF | STG_E_ACCESSDENIED | SYS_NMLN
SIGPWR | STG_E_BADBASEADDRESS | SysReAllocMem
SIGQUIT | STG_E_CANTSAVE | SysResetFPU
SigRaise | STG_E_DISKISWRITEPROTECTED | SysSetCtrlBreakHandler
sigrestorerhandler | STG_E_DOCFILECORRUPT | System
sigrestorerhandler_t | STG_E_EXTANTMARSHALLINGS | SystemTimeToDateTime
SIGSEGV | STG_E_FILEALREADYEXISTS | SysTryResizeMem
sigset | STG_E_FILENOTFOUND | sysutils

T

Tab2Space | Time | TRomanConversionStrictness
TAbstractErrorProc | TimeAMString | TRTLCreateEventHandler
TAbstractObjectReader | TimeOf | TRTLCriticalSection
TAbstractObjectWriter | TimePMString | TRTLEventHandler
taCenter | TimeSeparator | TRTLEventHandlerTimeout
TActiveXRegType | timespec | trtlmethod
TAggregatedObject | timespec | True
TagPoint | timespec | TrueBoolStrs
TagSize | TimeStampToDateTime | trunc
tagSTATSTG | TimeStampToMSecs | Truncate
taLeftJustify | time_t | TRuntimeError
TAlignment | time_t | TryEncodeDate
TAllocateThreadVarsHandler | time_t | TryEncodeDateDay
TAncestorNotFoundEvent | TimeToStr | TryEncodeDateMonthWeek
TAnsiChar | timeval | TryEncodeDateTime
taRightJustify | timeval | TryEncodeDateWeek
TArray | timeval | TryEncodeDayOfWeekInMonth
TArray4IntegerType | timezone | TryEncodeTime
TArrayTypeData | TIn6Addr | TryEncodeTimeInterval
TAssertErrorProc | Tin6_addr | TryEnterCriticalsection
TBackTraceStrFunc | TInAddr | TryFloatToCurr
TBasicAction | TIn_addr | TryJulianDateToDateTime
TBasicActionClass | TInetSockAddr | TryModifiedJulianDateToDateTime
TBasicActionLink | TInetSockAddr6 | TryRecodeDateTime
TBasicActionLinkClass | TInitComponentHandler | TryRomanToInt
TBasicEventCreateHandler | TInitThreadVarHandler | TryStringToGUID
TBasicEventHandler | TIno | TryStrToBool
TBasicEventWaitForHandler | TIno | TryStrToCurr
TBeepHandler | TIno | TryStrToDate
TBeginThreadHandler | TIno64 | TryStrToDateTime
TBiDiMode | TInt64DynArray | TryStrToDWord
TBigEndianUnicodeEncoding | TInt64Helper | TryStrToFloat
TBinaryObjectReader | TIntegerArray | TryStrToInt
TBinaryObjectWriter | TIntegerDynArray | TryStrToInt64
TBitArray | TIntegerHelper | TryStrToQWord
TBits | TIntegerSet | TryStrToTime
TBlkCnt | TInterfacedClass | TSafeCallErrorProc
TBlkSize | TInterfacedObject | TSCRFont
tb_offset | TInterfacedPersistent | TSearchRec
TBooleanDynArray | tinterfaceentry | TSeekOrigin
TBooleanHelper | tinterfaceentrytype | tseginfo
TBoundArray | TInterfaceList | TSemaphoreDestroyHandler
TBoundArray | TInterfaceListEnumerator | TSemaphorePostHandler
tb_segment | tinterfacetable | TSemaphoreWaitHandler
tb_size | TIntfFlag | TSempahoreInitHandler
TBufStream | TIntfFlags | TSerializedMapHeader
TByteArray | TIntfFlagsBase | TSetMethodPropertyEvent
TByteArray | TIntToIdent | TSetNameEvent
TByteBoolHelper | TIOCtlRequest | TSetPropValue
TByteDynArray | TIOCtlRequest | TSetVariantProp
TByteHelper | TIOCtlRequest | TShiftState
TBytes | tiovec | TShiftStateEnum
TBytesStream | TItemList | TShortCut
TCallConv | tkAny | TShortIntDynArray
tcalldesc | tkArray | TShortIntHelper
TCardinalDynArray | tkAString | tsigactionhandler
TCardinalHelper | tkBool | tsigaltstack
TCharacterOption | tkChar | TSigContext
TCharacterOptions | tkClass | tsiginfo
TCharArray | tkClassRef | tsignalhandler
TCharAttr | TkDev | TSignalState
TCharSet | tkDynArray | tsigrestorerhandler
TCharsetTransTable | tkEnumeration | tsigset
TClass | TKey | TSimpleRWSync
TClock | TKeyboardDriver | TSingleDynArray
TClock | TKeyEvent | TSingleHelper
TClock | TKeyRecord | TSingleRec
TCloneFunc | tkFile | TSize
TCLSID | tkFloat | TSize
TCollationField | tkHelper | TSize
TCollationFields | tkInt64 | TSize
TCollationName | tkInteger | TSmallIntDynArray
TCollection | tkInterface | TSmallIntHelper
TCollection | tkInterfaceRaw | TSmallPoint
TCollectionEnumerator | tkLString | TSmallPoint
TCollectionItem | tkMethod | TSockAddr
TCollectionItemClass | tkMethods | TSockAddr6
TCollectionNotification | tkObject | TSockArray
TCollectionSortCompare | tkPointer | Tsocket
TCompareOption | tkProcedure | TSockLen
TCompareOption | tkProcVar | TSocklen
TCompareOptions | tkProperties | TSocklen
TCompareOptions | tkQWord | TSockLen
TCompareTextProc | tkRecord | TSockPairArray
TCompDynArray | tkSet | TSortedCollection
TComponent | tkSString | TSoundexIntLength
TComponentClass | tkString | TSoundexLength
TComponentEnumerator | tkUChar | TSplitRectType
TComponentName | tkUnknown | TsSize
TComponentState | tkUString | TsSize
TComponentStyle | tkVariant | TSSize
TConsoleBuf | tkWChar | TStandardCodePageEnum
TContainedObject | tkWString | TStat
TCP_CONGESTION | tlbsCR | tstatfs
TCP_CORK | tlbsCRLF | TStatfs
TCP_DEFER_ACCEPT | tlbsLF | tstatfs
TCP_INFO | TLeftRight | TStatStg
TCP_KEEPCNT | TLibHandle | TStrCollection
TCP_KEEPIDLE | TLineEndStr | TStream
TCP_KEEPINTVL | TLinger | TStream
TCP_LINGER2 | TList | TStreamAdapter
TCP_MAXSEG | TListAssignOp | TStreamOwnership
TCP_MD5SIG | TListCallback | TStreamProc
TCP_NODELAY | TListCallback | TStreamRec
TCP_QUICKACK | TListEnumerator | TStrIndex
TCP_SYNCNT | TListNotification | TStrIndexRec
TCP_WINDOW_CLAMP | TListSortCompare | TStringArray
TCreateComponentEvent | TListStaticCallback | TStringCollection
TCreateGUIDFunc | TListStaticCallback | TStringDynArray
TCriticalSectionHandler | TLongBoolHelper | TStringHelper
TCriticalSectionHandlerTryEnter | TLongWordDynArray | TStringItem
tcrtcoord | TManagedField | TStringItemList
TCtrlBreakHandler | Tmatrix2_double | TStringList
TCurrencyArray | Tmatrix2_double_data | TStringList
TCustomMemoryStream | Tmatrix2_extended | TStringListSortCompare
TDataModule | Tmatrix2_extended_data | TStringMessageTable
TDataModuleClass | Tmatrix2_single | TStringReplaceAlgorithm
TDate | Tmatrix2_single_data | TStrings
TDateTime | Tmatrix3_double | TStringSeachOption
TDayTable | Tmatrix3_double_data | TStringSearchOption
TDev | Tmatrix3_extended | TStringSearchOptions
TDev | Tmatrix3_extended_data | TStringsEnumerator
TDev | Tmatrix3_single | TStringSplitOptions
TDir | Tmatrix3_single_data | TStringsSortStyle
TDirection | Tmatrix4_double | TStringsSortStyles
TDirent | Tmatrix4_double_data | TStringStream
tdispdesc | Tmatrix4_extended | TStrListMaker
tdisplayextrainfoProc | Tmatrix4_extended_data | TSynchronizeProcVar
TDosStream | Tmatrix4_single | TSysCharSet
TDoubleDynArray | Tmatrix4_single_data | TSysInfo
TDoubleHelper | TMbcsByteType | TSysLocale
TDoubleRec | TMBCSEncoding | TSystemCodePage
tdpmiversioninfo | tmeminfo | TSystemTime
TDuplicates | TMemoryManager | TTerminateProc
TDuplicates | TMemoryStream | TTextBuf
tdynarrayindex | TMemoryStream | TTextLineBreakStyle
tdynarraytypeinfo | TMethod | TTextObjectWriter
TellDir | TMethodKind | TTextRec
Tencoding | tmmxbyte | TThread
TEncoding | tmmxcardinal | TThreadExecuteCallBack
TEndian | tmmxinteger | TThreadExecuteHandler
TEndian | tmmxlongint | TThreadExecuteStatusCallBack
TEndianKind | tmmxshortint | TThreadExecuteStatusHandler
TEndThreadHandler | tmmxsingle | TThreadFunc
TEntryInformation | tmmxword | TThreadGetPriorityHandler
TEPoll_Data | TMode | TThreadHandler
TEPoll_Event | TMode | TThreadID
TError | TMode | TThreadList
TErrorHandler | TModeInfo | TThreadManager
TErrorHandlerReturnValue | TMonthNameArray | TThreadMethod
TErrorProc | TMouseDriver | TThreadPriority
TEventType | TMouseEvent | TThreadReportStatus
TEventTypes | tms | TThreadSetPriorityHandler
TExceptionClass | TMsgStrTable | TThreadStatusNotifyCallBack
TExceptObject | TMultiReadExclusiveWriteSynchronizer | TThreadStatusNotifyEvent
TExceptProc | TNativeIntHelper | TThreadSwitchHandler
TExecuteFlags | TNativeUIntHelper | TTime
TExeFile | TnLink | TTime
TextAttr | TnLink | TTime
TextBackground | TnLink | TTime
TextBuf | TNotifyCallBack | Ttimespec
TextColor | TNotifyEvent | TTimeSpec
TExtended80Rec | TObject | Ttimespec
TExtendedDynArray | TObject | TTimeStamp
TExtendedHelper | TObjectTextEncoding | TTimeVal
TextFile | Today | TTimeVal
TextHeight | toEOF | TTimeVal
TextMode | TOff | TTimeZone
textmode | TOff | TTms
TextRec | TOff | TTreeElement
TextRecBufSize | TOff64 | TTypeData
TextRecNameLength | toFloat | TTypeInfo
TextSettingsType | toInteger | TTypeKind
TextToFloat | TOleChar | TTypeKinds
TextWidth | Tomorrow | TUCA_DataBook
TFDSet | TOperation | TUCA_PropItemContextRec
TFilDes | TopOff | TUCA_PropItemContextTreeNodeRec
TFilename | TopOn | TUCA_PropItemContextTreeRec
TFilenameCaseMatch | TopText | TUCA_PropItemRec
TFilenameCaseMatch | TOption | TUCA_PropWeights
TFiler | TOrdinalEntry | TUCASortKey
TFileRec | TOrdType | TUCASortKeyItem
TFilerFlag | ToSingleByteFileSystemEncodedFileName | TUCA_VariableKind
TFilerFlags | toString | TUcontext
TFileSearchOption | toSymbol | TUC_Prop
TFileSearchOptions | ToUCS4 | TUCS4CharArray
TFileStream | TOwnedCollection | TUid
TFileTextRecChar | TOwnerStream | TUid
TFileTime | toWString | TUid
tFillExtraInfoProc | TParamFlag | TUInt24Rec
TFindAncestorEvent | TParamFlags | TUnicodeCategory
TFindComponentClassEvent | TParser | TUnicodeCategorySet
TFindGlobalComponent | TPCharArray | tunicodechar
TFindMethodEvent | TPersistent | TUnicodeCharArray
TFloatFormat | TPersistentClass | tunicodecharmapping
TFloatRec | tpHigher | tunicodecharmappingflag
TFloatSpecial | tpHighest | TUnicodeEncoding
TFloatType | TPid | tunicodemap
TFloatValue | TPid | TUnicodeSearchRec
TFormatDateTimeOption | TPid | tunicodestring
TFormatDateTimeOptions | tpIdle | TUnicodeStringManager
TFormatSettings | Tpipe | TUnixCpData
TFPCHeapStatus | tpLower | TUnixSockAddr
TFPGInterfacedObjectList | tpLowest | TUnSortedStrCollection
TFPGList | tpNormal | TUseBoolStrs
TFPGListEnumerator | TPoint | TUser_Desc
TFPGMap | TPoint | TUTF7Encoding
TFPGMapInterfacedObjectData | TPoint | TUTF8Encoding
TFPGMapObject | TPointerArray | TUtimBuf
TFPGObjectList | TPointerArray | TUtsName
TFPList | TPointerDynArray | TValueRelationship
TFPListEnumerator | TPointerList | TValueType
TFPObservedOperation | TPointF | tvararray
tfpreg | tpollfd | tvararraybound
TFPResourceHandle | tport | tvararrayboundarray
TFPResourceHGLOBAL | tportl | tvararraycoorarray
TFPResourceHMODULE | tportw | tvardata
TFPSList | TProcedure | tvariantmanager
TFPSListCompareFunc | Tprocedure | tvarop
TFPSMap | TProcedure | TVarRec
tfpstate | TProcedureParam | tvartype
TFPUException | TProcedureSignature | Tvector2_double
TFPUExceptionMask | TProcInfoProc | Tvector2_double_data
TFPUPrecisionMode | TPropData | Tvector2_extended
TFPURoundingMode | TPropertyNotFoundEvent | Tvector2_extended_data
TFSearchOption | TPropInfo | Tvector2_single
TGetAppNameEvent | TPropList | Tvector2_single_data
TGetChildProc | TProxyStream | Tvector3_double
TGetCurrentThreadIdHandler | tpTimeCritical | Tvector3_double_data
TGetPropValue | TQWordDynArray | Tvector3_extended
TGetStrProc | TQWordHelper | Tvector3_extended_data
TGetTempDirEvent | tracesize | Tvector3_single
TGetTempFileEvent | transfer_buffer | Tvector3_single_data
TGetVariantProp | TranslateKeyEvent | Tvector4_double
TGetVendorNameEvent | TranslateKeyEventUniCode | Tvector4_double_data
TGid | trapflag | Tvector4_extended
TGid | TRawbyteSearchRec | Tvector4_extended_data
TGid | TReadComponentsProc | Tvector4_single
Tgpmconnect | TReader | Tvector4_single_data
Tgpm_connect | TReaderError | TVideoBuf
TGpmEtype | TReaderProc | TVideoCell
Tgpmevent | TReadWriteStringPropertyEvent | TVideoDriver
Tgpm_event | trealregs | TVideoMode
TGpmHandler | TRecall | TVideoModeSelector
TGpmMargin | TRect | TVmt
Tgpmroi | TRect | TVmtFieldEntry
Tgpm_roi | TRect | TVmtFieldTable
TGrpArr | TRectF | TWaitForThreadTerminateHandler
TGuid | TReferenceNameEvent | TWeekNameArray
TGuidHelper | TReleaseThreadVarsHandler | TWideStringDynArray
THandle | TRelocateThreadVarHandler | TWideStringManager
THandle | TReplaceFlags | TwoDigitYearCenturyWindow
THandle | TResolutionRec | TWordArray
THandleStream | TResourceCollection | TWordArray
THeapStatus | TResourceFile | TWordBoolHelper
THelpContext | TResourceHandle | TWordDynArray
THelpEvent | TResourceManager | TWordHelper
THelpType | TResourceStream | TWriteMethodPropertyEvent
ThickWidth | treversecharmapping | TWriter
ThousandSeparator | Trim | TWriterProc
ThreadGetPriority | TrimLeft | TXrmOptionDescRec
ThreadID | TrimLeftSet | Types
ThreadingAlreadyUsed | TrimRight | typinfo
ThreadSetPriority | TrimRightSet | tzdaylight
ThreadSwitch | TrimSet | tzname
TIdentMapEntry | TriplexFont | Tzseconds
TIdentToInt | TRLimit |

U

ucaBlanked | ufWeakUnit | UnicodeLowerCase
ucaIgnoreSP | UGC_ClosePunctuation | UnicodeSameStr
ucaNonIgnorable | UGC_CombiningMark | UnicodeSameText
ucaShifted | UGC_ConnectPunctuation | UnicodeString
ucaShiftedTrimmed | UGC_Control | UnicodeStringReplace
ucClosePunctuation | UGC_CurrencySymbol | UnicodeStringToUCS4String
ucCombiningMark | UGC_DashPunctuation | UnicodeToLower
ucConnectPunctuation | UGC_DecimalNumber | UnicodeToUpper
ucControl | UGC_EnclosingMark | UnicodeToUtf8
ucCurrencySymbol | UGC_FinalPunctuation | UnicodeUpperCase
ucDashPunctuation | UGC_Format | UnionRect
ucDecimalNumber | UGC_InitialPunctuation | UniqueString
ucEnclosingMark | UGC_LetterNumber | UniversalTimeToLocal
ucFinalPunctuation | UGC_LineSeparator | Unix
ucFormat | UGC_LowercaseLetter | unixcp
ucInitialPunctuation | UGC_MathSymbol | UnixCpMap
ucLetterNumber | UGC_ModifierLetter | UnixCpMapLimit
ucLineSeparator | UGC_ModifierSymbol | UnixDateDelta
ucLowercaseLetter | UGC_NonSpacingMark | UnixDateToDt
ucMathSymbol | UGC_OpenPunctuation | UnixEpoch
ucModifierLetter | UGC_OtherLetter | UnixTimeStampToMac
ucModifierSymbol | UGC_OtherNumber | UnixToDateTime
ucNonSpacingMark | UGC_OtherPunctuation | unixtype
ucOpenPunctuation | UGC_OtherSymbol | unixutil
ucOtherLetter | UGC_ParagraphSeparator | UnloadLibrary
ucOtherNumber | UGC_PrivateUse | unlock_code
ucOtherPunctuation | UGC_SpaceSeparator | unlock_data
ucOtherSymbol | UGC_Surrogate | unlock_linear_region
ucParagraphSeparator | UGC_TitlecaseLetter | UnlockResource
ucPrivateUse | UGC_Unassigned | UnlockScreenUpdate
UCS2Char | UGC_UppercaseLetter | UnpackTime
UCS4Char | uid_t | UnRegisterClass
UCS4_HALF_BASE | uid_t | UnRegisterClasses
UCS4_HALF_MASK | uid_t | UnregisterCollation
UCS4String | UInt16 | UnregisterCollations
UCS4StringToUnicodeString | UInt24 | UnregisterFindGlobalComponentProc
UCS4StringToWideString | UInt32 | UnRegisterModuleClasses
ucSpaceSeparator | UInt64 | upCase
ucSurrogate | UInt8 | UpdateScreen
ucTitlecaseLetter | UIntPtr | UpperCase
ucUnassigned | umf_leadbyte | usecrc
ucUppercaseLetter | umf_noinfo | useheaptrace
UD_CONTENTS_CODE | umf_undefined | UserBitLn
UD_CONTENTS_DATA | umf_unused | user_cap_data
UD_CONTENTS_STACK | Unassigned | user_cap_header
UD_LIMIT_IN_PAGES | UnhookSignal | UserCharSize
UD_LM | UnicodeChar | user_desc
UDP_CORK | UnicodeCharLenToString | UserFill
UDP_ENCAP | UnicodeCharLenToStrVar | utf8
UDP_ENCAP_ESPINUDP | UnicodeCharToString | Utf8CodePointLen
UDP_ENCAP_ESPINUDP_NON_IKE | UnicodeCharToStrVar | UTF8CompareLocale
UDP_ENCAP_L2TPINUDP | UnicodeCompareStr | UTF8Decode
UD_READ_EXEC_ONLY | UnicodeCompareText | UTF8Encode
UD_SEG_32BIT | unicodedata | UTF8String
UD_SEG_NOT_PRESENT | unicodeducet | Utf8ToAnsi
UD_USEABLE | UnicodeFmtStr | Utf8ToUnicode
ufImplicitUnit | UnicodeFormat | UTimBuf
ufMainUnit | UnicodeFormatBuf | UtsName
ufOrgWeakUnit | UnicodeIsHighSurrogate | UTSNAME_DOMAIN_LENGTH
ufPackageUnit | UnicodeIsLowSurrogate | UTSNAME_LENGTH
ufWeakPackageUnit | UnicodeIsSurrogatePair | UTSNAME_NODENAME_LENGTH

V

vaBinary | varlongword | vmtClassName
vaCollection | varnull | vmtDefaultHandler
vaCurrency | varolestr | vmtDefaultHandlerStr
vaDate | varqword | vmtDestroy
vaExtended | varrecord | vmtDispatch
vaFalse | varshortint | vmtDispatchStr
vaIdent | varsingle | vmtDynamicTable
vaInt16 | varsmallint | vmtEquals
vaInt32 | varstrarg | vmtFieldTable
vaInt64 | varstring | vmtFreeInstance
vaInt8 | VarToLStrProc | vmtGetHashCode
Val | VarToWStrProc | vmtHeaderSize
vaList | vartypemask | vmtInitTable
ValReal | varuint64 | vmtInstanceSize
ValSInt | varunknown | vmtIntfTable
ValSInt | varustrarg | vmtMethodStart
vaLString | varustring | vmtMethodTable
ValUInt | varvariant | vmtMsgStrPtr
ValUInt | varword | vmtNewInstance
vaNil | varword64 | vmtParent
vaNull | vaSet | vmtSafeCallException
vaQWord | vaSingle | vmtToString
VarAddRefProc | vaString | vmtTypeInfo
varany | vaTrue | volumeid
vararray | vaUString | vtAnsiString
VarArrayGet | vaUTF8String | vtBoolean
VarArrayPut | vaWString | vtChar
VarArrayRedim | VendorName | vtClass
varboolean | VertDir | vtCurrency
varbyref | VESA | vtExtended
varbyte | VGA | vtInt64
VarCast | vga_codepages | vtInteger
VarClearProc | VGAHi | vtInterface
VarCopyProc | VGALo | vtObject
varcurrency | VGAMed | vtPChar
vardate | video | vtPointer
vardecimal | VideoBuf | vtPWideChar
vardispatch | VideoBufSize | vtQWord
vardouble | ViewPortType | vtString
varempty | vioOK | vtUnicodeString
varerror | VLine | vtVariant
VariableHighLimit | vlineproc | vtWideChar
VariableLowLimit | vmtAfterConstruction | vtWideString
varint64 | vmtAutoTable |
varinteger | vmtBeforeDestruction |

W

Wait_Any | WideCharToStrVar | wint_t
Wait_Clone | WideCompareStr | WithinPastDays
WaitForThreadTerminate | WideCompareText | WithinPastHours
Wait_MyPGRP | WideDotFill | WithinPastMilliSeconds
Wait_NoHang | WideFmtStr | WithinPastMinutes
WaitProcess | WideFormat | WithinPastMonths
Wait_UnTraced | WideFormatBuf | WithinPastSeconds
WakeMainThread | WideLowerCase | WithinPastWeeks
WChar | WideSameStr | WithinPastYears
wchar_t | WideSameText | WNOHANG
weekday | WideStrAlloc | W_OK
WeekOf | WideString | Word
WeekOfTheMonth | widestringmanager | WordCount
WeekOfTheYear | WideStringOf | WordDelimiters
WeeksBetween | WideStringReplace | WordPosition
WeeksInAYear | WideStringToUCS4String | WordRec
WeeksInYear | WideUpperCase | WordRec
WeekSpan | Widget | wordsinfdset
WeeksPerFortnight | WidgetClass | wordsinsigset
W_EXITCODE | wifexited | WrapText
wexitStatus | wifsignaled | WriteBarrier
WhereX | WIFSTOPPED | WriteComponentResFile
WhereY | wincrt | WriteErrorsToStdErr
White | windirs | WritePort
white | WindMax | WritePortB
White | WindMaxX | WritePortl
WideBytesOf | WindMaxY | WritePortW
WideChar | WindMin | W_STOPCODE
WideCharLenToString | WindMinX | wstopsig
WideCharLenToStrVar | WindMinY | wtermsig
WideCharToString | Window | WUNTRACED

X

x86 | XorDecode | XorString
XHatchFill | XorEncode | XrmOptionDescRec
X_OK | XORPut |

Y

YearOf | YearsPerDecade | Yellow
YearsBetween | YearsPerMillennium | Yesterday
YearSpan | yellow |
YearsPerCentury | Yellow |

Z

zeroflag ZERO_UINT24


Class hierarchy

  • TObject (System)
    • Exception (sysutils)
      • EAbort (sysutils)
      • EAbstractError (sysutils)
      • EArgumentException (sysutils)
        • EArgumentNilException (sysutils)
        • EArgumentOutOfRangeException (sysutils)
      • EAssertionFailed (sysutils)
      • EBitsError (Classes)
      • EComponentError (Classes)
      • EConvertError (sysutils)
      • EDirectoryNotFoundException (sysutils)
      • EEncodingError (sysutils)
      • EExternal (sysutils)
        • EAccessViolation (sysutils)
          • EBusError (sysutils)
        • EControlC (sysutils)
        • EExternalException (sysutils)
        • EInterror (sysutils)
          • EDivByZero (sysutils)
          • EIntOverflow (sysutils)
          • ERangeError (sysutils)
        • EMathError (sysutils)
          • EInvalidOp (sysutils)
          • EOverflow (sysutils)
          • EUnderflow (sysutils)
          • EZeroDivide (sysutils)
        • EPrivilege (sysutils)
        • EStackOverflow (sysutils)
      • EFileNotFoundException (sysutils)
      • EFormatError (sysutils)
      • EHeapMemoryError (sysutils)
        • EInvalidPointer (sysutils)
        • EOutOfMemory (sysutils)
          • EOutOfResources (Classes)
      • EInOutError (sysutils)
      • EIntfCastError (sysutils)
      • EInvalidCast (sysutils)
      • EInvalidContainer (sysutils)
      • EInvalidInsert (sysutils)
      • EInvalidOperation (Classes)
      • EListError (fgl)
      • EListError (Classes)
      • ENoConstructException (sysutils)
      • ENoThreadSupport (sysutils)
      • ENotImplemented (sysutils)
      • ENotSupportedException (sysutils)
      • ENoWideStringSupport (sysutils)
      • EObjectCheck (sysutils)
      • EObserver (Classes)
      • EOSError (sysutils)
      • EPackageError (sysutils)
      • EParserError (Classes)
      • EPathNotFoundException (sysutils)
      • EPathTooLongException (sysutils)
      • EPropertyConvertError (typinfo)
      • EPropertyError (typinfo)
      • EPropReadOnly (sysutils)
      • EPropWriteOnly (sysutils)
      • EResNotFound (Classes)
      • ESafecallException (sysutils)
      • EStreamError (Classes)
        • EFCreateError (Classes)
        • EFilerError (Classes)
          • EClassNotFound (Classes)
          • EInvalidImage (Classes)
          • EMethodNotFound (Classes)
          • EReadError (Classes)
          • EWriteError (Classes)
        • EFOpenError (Classes)
      • EStringListError (Classes)
      • EThread (Classes)
        • EThreadDestroyCalled (Classes)
        • EThreadExternalException (Classes)
      • EVariantError (sysutils)
    • TAbstractObjectReader (Classes)
      • TBinaryObjectReader (Classes)
    • TAbstractObjectWriter (Classes)
      • TBinaryObjectWriter (Classes)
      • TTextObjectWriter (Classes)
    • TAggregatedObject (System)
      • TContainedObject (System)
    • TBasicActionLink (Classes)
    • TBits (Classes)
    • TCollectionEnumerator (Classes)
    • TComponentEnumerator (Classes)
    • TEncoding (sysutils)
      • TMBCSEncoding (sysutils)
        • TUTF7Encoding (sysutils)
          • TUTF8Encoding (sysutils)
      • TUnicodeEncoding (sysutils)
        • TBigEndianUnicodeEncoding (sysutils)
    • TFiler (Classes)
      • TReader (Classes)
      • TWriter (Classes)
    • TFPList (Classes)
    • TFPListEnumerator (Classes)
    • TFPSList (fgl)
      • TFPSMap (fgl)
    • TInterfacedObject (System)
      • TInterfaceList (Classes)
      • TMultiReadExclusiveWriteSynchronizer (sysutils)
      • TSimpleRWSync (sysutils)
      • TStreamAdapter (Classes)
    • TInterfaceListEnumerator (Classes)
    • TList (Classes)
    • TListEnumerator (Classes)
    • TParser (Classes)
    • TPersistent (Classes)
      • TCollection (Classes)
        • TOwnedCollection (Classes)
      • TCollectionItem (Classes)
      • TComponent (Classes)
        • TBasicAction (Classes)
        • TDataModule (Classes)
      • TInterfacedPersistent (Classes)
      • TStrings (Classes)
        • TStringList (Classes)
    • tport (ports)
    • tportl (ports)
    • tportw (ports)
    • TRecall (Classes)
    • TStream (Classes)
      • TCustomMemoryStream (Classes)
        • TMemoryStream (Classes)
          • TBytesStream (Classes)
        • TResourceStream (Classes)
      • THandleStream (Classes)
        • TFileStream (Classes)
      • TOwnerStream (Classes)
      • TProxyStream (Classes)
      • TStringStream (Classes)
    • TStringsEnumerator (Classes)
    • TThread (Classes)
    • TThreadList (Classes)


_STAT_VER

Stat version number

Declaration

Source position: ostypes.inc line 87

const _STAT_VER = _STAT_VER_LINUX;


_STAT_VER_KERNEL

Current version of stat record

Declaration

Source position: ostypes.inc line 84

const _STAT_VER_KERNEL = 0;


_STAT_VER_LINUX

Version of Linux stat record

Declaration

Source position: ostypes.inc line 85

const _STAT_VER_LINUX = 1;


ARG_MAX

Maximum number of arguments to a program.

Declaration

Source position: aliasptp.inc line 80

const ARG_MAX = UnixType.ARG_MAX;


BITSINWORD

Number of bits in a word.

Declaration

Source position: ostypes.inc line 35

const BITSINWORD = 8 * sizeof(cuLong);


Blkcnt64_t

64-bit block count

Declaration

Source position: ostypes.inc line 51

type Blkcnt64_t = cuint64;


Blkcnt_t

Block count type.

Declaration

Source position: ostypes.inc line 50

type Blkcnt_t = cuint;


Blksize_t

Block size type.

Declaration

Source position: ostypes.inc line 49

type Blksize_t = cuint;


cbool

Boolean type

Declaration

Source position: aliasctp.inc line 45

type cbool = UnixType.cbool;


cchar

Alias for #rtl.UnixType.cchar

Declaration

Source position: aliasctp.inc line 21

type cchar = UnixType.cchar;


cdouble

Double precision real format.

Declaration

Source position: aliasctp.inc line 53

type cdouble = UnixType.cdouble;


cfloat

Floating-point real format

Declaration

Source position: aliasctp.inc line 52

type cfloat = UnixType.cfloat;


cint

C type: integer (natural size)

Declaration

Source position: aliasctp.inc line 33

type cint = UnixType.cint;


cint8

C type: 8 bits sized, signed integer.

Declaration

Source position: aliasctp.inc line 19

type cint8 = UnixType.cint8;


cint16

C type: 16 bits sized, signed integer.

Declaration

Source position: aliasctp.inc line 25

type cint16 = UnixType.cint16;


cint32

C type: 32 bits sized, signed integer.

Declaration

Source position: aliasctp.inc line 31

type cint32 = UnixType.cint32;


cint64

C type: 64 bits sized, signed integer.

Declaration

Source position: aliasctp.inc line 39

type cint64 = UnixType.cint64;


clock_t

Clock ticks type

Declaration

Source position: aliasptp.inc line 53

type clock_t = UnixType.clock_t;


clong

C type: long signed integer (double sized)

Declaration

Source position: aliasctp.inc line 47

type clong = UnixType.clong;


clonglong

C type: 64-bit (double long) signed integer.

Declaration

Source position: aliasctp.inc line 41

type clonglong = UnixType.clonglong;


coff_t

Character offset type

Declaration

Source position: aliasctp.inc line 59

type coff_t = UnixType.TOff;


cschar

Signed character type

Declaration

Source position: aliasctp.inc line 22

type cschar = UnixType.cschar;


cshort

C type: short signed integer (half sized)

Declaration

Source position: aliasctp.inc line 27

type cshort = UnixType.cshort;


csigned

Signed integer

Declaration

Source position: aliasctp.inc line 36

type csigned = UnixType.csigned;

Description

csigned is an alias for cint.


csint

Signed integer

Declaration

Source position: aliasctp.inc line 34

type csint = UnixType.csint;


csize_t

Character size type

Declaration

Source position: aliasctp.inc line 57

type csize_t = UnixType.size_t;


cslong

Signed long

Declaration

Source position: aliasctp.inc line 48

type cslong = UnixType.cslong;

Description

The size is CPU dependent.


cslonglong

Signed longlong type

Declaration

Source position: aliasctp.inc line 42

type cslonglong = UnixType.cslonglong;

Description

cslonglong is an alias for clonglong.


csshort

Short signed integer type

Declaration

Source position: aliasctp.inc line 28

type csshort = UnixType.csshort;


cuchar

Alias for #rtl.UnixType.cuchar

Declaration

Source position: aliasctp.inc line 23

type cuchar = UnixType.cuchar;


cuint

C type: unsigned integer (natural size)

Declaration

Source position: aliasctp.inc line 35

type cuint = UnixType.cuint;


cuint8

C type: 8 bits sized, unsigned integer.

Declaration

Source position: aliasctp.inc line 20

type cuint8 = UnixType.cuint8;


cuint16

C type: 16 bits sized, unsigned integer.

Declaration

Source position: aliasctp.inc line 26

type cuint16 = UnixType.cuint16;


cuint32

C type: 32 bits sized, unsigned integer.

Declaration

Source position: aliasctp.inc line 32

type cuint32 = UnixType.cuint32;


cuint64

C type: 64 bits sized, unsigned integer.

Declaration

Source position: aliasctp.inc line 40

type cuint64 = UnixType.cuint64;


culong

C type: long unsigned integer (double sized)

Declaration

Source position: aliasctp.inc line 49

type culong = UnixType.culong;


culonglong

C type: 64-bit (double long) unsigned integer.

Declaration

Source position: aliasctp.inc line 43

type culonglong = UnixType.culonglong;


cunsigned

Alias for #rtl.unixtype.cunsigned

Declaration

Source position: aliasctp.inc line 37

type cunsigned = UnixType.cunsigned;


cushort

C type: short unsigned integer (half sized)

Declaration

Source position: aliasctp.inc line 29

type cushort = UnixType.cushort;


dev_t

Device descriptor type.

Declaration

Source position: aliasptp.inc line 21

type dev_t = UnixType.dev_t;


Dir

Record used in fpOpenDir and fpReadDir calls

Declaration

Source position: ostypes.inc line 123

type Dir = record
dd_fd: LongInt; | File descriptor. Do not use.
dd_loc: LongInt; | Location in directory listing
dd_size: LongInt; | File size
dd_buf: pDirent; | Pointer to Dir records
dd_nextoff: Cardinal; | ?
dd_max: Integer; | ?
dd_lock: pointer; | ?
end;


Dirent

Record used in the fpReadDir function to return files in a directory.

Declaration

Source position: ostypes.inc line 110

type Dirent = record
d_fileno: ino64_t; | Inode number of file
d_off: off_t; | Offset in directory.
d_reclen: cushort; | Record length
d_type: cuchar; | Entry type
d_name: array [0..4095-sizeof(ino64_t)-sizeof(off_t)-sizeof(cushort)-sizeof(cuchar)] of Char; | Name of file
end;


ESysE2BIG

System error: Argument list too long

Declaration

Source position: errno.inc line 39

const ESysE2BIG = 7;


ESysEACCES

System error: Permission denied

Declaration

Source position: errno.inc line 45

const ESysEACCES = 13;


ESysEADDRINUSE

System error: Address already in use

Declaration

Source position: errno.inc line 138

const ESysEADDRINUSE = 98;


ESysEADDRNOTAVAIL

System error: Cannot assign requested address

Declaration

Source position: errno.inc line 139

const ESysEADDRNOTAVAIL = 99;


ESysEADV

System error: Advertise error

Declaration

Source position: errno.inc line 108

const ESysEADV = 68;


ESysEAFNOSUPPORT

System error: Address family not supported by protocol

Declaration

Source position: errno.inc line 137

const ESysEAFNOSUPPORT = 97;


ESysEAGAIN

System error: Try again

Declaration

Source position: errno.inc line 43

const ESysEAGAIN = 11;


ESysEALREADY

System error: Operation already in progress

Declaration

Source position: errno.inc line 154

const ESysEALREADY = 114;


ESysEBADE

System error: Invalid exchange

Declaration

Source position: errno.inc line 92

const ESysEBADE = 52;


ESysEBADF

System error: Bad file number

Declaration

Source position: errno.inc line 41

const ESysEBADF = 9;


ESysEBADFD

System error: File descriptor in bad state

Declaration

Source position: errno.inc line 117

const ESysEBADFD = 77;


ESysEBADMSG

System error: Not a data message

Declaration

Source position: errno.inc line 114

const ESysEBADMSG = 74;


ESysEBADR

System error: Invalid request descriptor

Declaration

Source position: errno.inc line 93

const ESysEBADR = 53;


ESysEBADRQC

System error: Invalid request code

Declaration

Source position: errno.inc line 96

const ESysEBADRQC = 56;


ESysEBADSLT

System error: Invalid slot

Declaration

Source position: errno.inc line 97

const ESysEBADSLT = 57;


ESysEBFONT

System error: Bad font file format

Declaration

Source position: errno.inc line 99

const ESysEBFONT = 59;


ESysEBUSY

System error: Device or resource busy

Declaration

Source position: errno.inc line 48

const ESysEBUSY = 16;


ESysECANCELED

Operation canceled

Declaration

Source position: errno.inc line 168

const ESysECANCELED = 125;


ESysECHILD

System error: No child processes

Declaration

Source position: errno.inc line 42

const ESysECHILD = 10;


ESysECHRNG

System error: Channel number out of range

Declaration

Source position: errno.inc line 84

const ESysECHRNG = 44;


ESysECOMM

System error: Communication error on send

Declaration

Source position: errno.inc line 110

const ESysECOMM = 70;


ESysECONNABORTED

System error: Software caused connection abort

Declaration

Source position: errno.inc line 143

const ESysECONNABORTED = 103;


ESysECONNREFUSED

System error: Connection refused

Declaration

Source position: errno.inc line 151

const ESysECONNREFUSED = 111;


ESysECONNRESET

System error: Connection reset by peer

Declaration

Source position: errno.inc line 144

const ESysECONNRESET = 104;


ESysEDEADLK

System error: Resource deadlock would occur

Declaration

Source position: errno.inc line 75

const ESysEDEADLK = 35;


ESysEDEADLOCK

System error: File locking deadlock error

Declaration

Source position: errno.inc line 98

const ESysEDEADLOCK = ESysEDEADLK;


ESysEDESTADDRREQ

System error: Destination address required

Declaration

Source position: errno.inc line 129

const ESysEDESTADDRREQ = 89;


ESysEDOM

System error: Math argument out of domain of func

Declaration

Source position: errno.inc line 71

const ESysEDOM = 33;


ESysEDOTDOT

System error: RFS specific error

Declaration

Source position: errno.inc line 113

const ESysEDOTDOT = 73;


ESysEDQUOT

System error: Quota exceeded

Declaration

Source position: errno.inc line 162

const ESysEDQUOT = 122;


ESysEEXIST

System error: File exists

Declaration

Source position: errno.inc line 49

const ESysEEXIST = 17;


ESysEFAULT

System error: Bad address

Declaration

Source position: errno.inc line 46

const ESysEFAULT = 14;


ESysEFBIG

System error: File too large

Declaration

Source position: errno.inc line 65

const ESysEFBIG = 27;


ESysEHOSTDOWN

System error: Host is down

Declaration

Source position: errno.inc line 152

const ESysEHOSTDOWN = 112;


ESysEHOSTUNREACH

System error: No route to host

Declaration

Source position: errno.inc line 153

const ESysEHOSTUNREACH = 113;


ESysEIDRM

System error: Identifier removed

Declaration

Source position: errno.inc line 83

const ESysEIDRM = 43;


ESysEILSEQ

System error: Illegal byte sequence

Declaration

Source position: errno.inc line 124

const ESysEILSEQ = 84;


ESysEINPROGRESS

System error: Operation now in progress

Declaration

Source position: errno.inc line 155

const ESysEINPROGRESS = 115;


ESysEINTR

System error: Interrupted system call

Declaration

Source position: errno.inc line 36

const ESysEINTR = 4;


ESysEINVAL

System error: Invalid argument

Declaration

Source position: errno.inc line 54

const ESysEINVAL = 22;


ESysEIO

System error: I/O error

Declaration

Source position: errno.inc line 37

const ESysEIO = 5;


ESysEISCONN

System error: Transport endpoint is already connected

Declaration

Source position: errno.inc line 146

const ESysEISCONN = 106;


ESysEISDIR

System error: Is a directory

Declaration

Source position: errno.inc line 53

const ESysEISDIR = 21;


ESysEISNAM

System error: Is a named type file

Declaration

Source position: errno.inc line 160

const ESysEISNAM = 120;


ESysEKEYEXPIRED

Key has expired (Linux kernel module)

Declaration

Source position: errno.inc line 170

const ESysEKEYEXPIRED = 127;


ESysEKEYREJECTED

Key was rejected by service (Linux kernel module)

Declaration

Source position: errno.inc line 172

const ESysEKEYREJECTED = 129;


ESysEKEYREVOKED

Key has been revoked (Linux kernel module)

Declaration

Source position: errno.inc line 171

const ESysEKEYREVOKED = 128;


ESysEL2HLT

System error: Level 2 halted

Declaration

Source position: errno.inc line 91

const ESysEL2HLT = 51;


ESysEL2NSYNC

System error: Level 2 not synchronized

Declaration

Source position: errno.inc line 85

const ESysEL2NSYNC = 45;


ESysEL3HLT

System error: Level 3 halted

Declaration

Source position: errno.inc line 86

const ESysEL3HLT = 46;


ESysEL3RST

System error: Level 3 reset

Declaration

Source position: errno.inc line 87

const ESysEL3RST = 47;


ESysELIBACC

System error: Can not access a needed shared library

Declaration

Source position: errno.inc line 119

const ESysELIBACC = 79;


ESysELIBBAD

System error: Accessing a corrupted shared library

Declaration

Source position: errno.inc line 120

const ESysELIBBAD = 80;


ESysELIBEXEC

System error: Cannot exec a shared library directly

Declaration

Source position: errno.inc line 123

const ESysELIBEXEC = 83;


ESysELIBMAX

System error: Attempting to link in too many shared libraries

Declaration

Source position: errno.inc line 122

const ESysELIBMAX = 82;


ESysELIBSCN

System error: .lib section in a.out corrupted

Declaration

Source position: errno.inc line 121

const ESysELIBSCN = 81;


ESysELNRNG

System error: Link number out of range

Declaration

Source position: errno.inc line 88

const ESysELNRNG = 48;


ESysELOOP

System error: Too many symbolic links encountered

Declaration

Source position: errno.inc line 80

const ESysELOOP = 40;


ESysEMEDIUMTYPE

Wrong medium type

Declaration

Source position: errno.inc line 167

const ESysEMEDIUMTYPE = 124;


ESysEMFILE

System error: Too many open files

Declaration

Source position: errno.inc line 56

const ESysEMFILE = 24;


ESysEMLINK

System error: Too many links

Declaration

Source position: errno.inc line 69

const ESysEMLINK = 31;


ESysEMSGSIZE

System error: Message too long

Declaration

Source position: errno.inc line 130

const ESysEMSGSIZE = 90;


ESysEMULTIHOP

System error: Multihop attempted

Declaration

Source position: errno.inc line 112

const ESysEMULTIHOP = 72;


ESysENAMETOOLONG

System error: File name too long

Declaration

Source position: errno.inc line 76

const ESysENAMETOOLONG = 36;


ESysENAVAIL

System error: No XENIX semaphores available

Declaration

Source position: errno.inc line 159

const ESysENAVAIL = 119;


ESysENETDOWN

System error: Network is down

Declaration

Source position: errno.inc line 140

const ESysENETDOWN = 100;


ESysENETRESET

System error: Network dropped connection because of reset

Declaration

Source position: errno.inc line 142

const ESysENETRESET = 102;


ESysENETUNREACH

System error: Network is unreachable

Declaration

Source position: errno.inc line 141

const ESysENETUNREACH = 101;


ESysENFILE

System error: File table overflow

Declaration

Source position: errno.inc line 55

const ESysENFILE = 23;


ESysENOANO

System error: No anode

Declaration

Source position: errno.inc line 95

const ESysENOANO = 55;


ESysENOBUFS

System error: No buffer space available

Declaration

Source position: errno.inc line 145

const ESysENOBUFS = 105;


ESysENOCSI

System error: No CSI structure available

Declaration

Source position: errno.inc line 90

const ESysENOCSI = 50;


ESysENODATA

System error: No data available

Declaration

Source position: errno.inc line 101

const ESysENODATA = 61;


ESysENODEV

System error: No such device

Declaration

Source position: errno.inc line 51

const ESysENODEV = 19;


ESysENOENT

System error: No such file or directory

Declaration

Source position: errno.inc line 34

const ESysENOENT = 2;


ESysENOEXEC

System error: Exec format error

Declaration

Source position: errno.inc line 40

const ESysENOEXEC = 8;


ESysENOKEY

Required key not available (Linux kernel module)

Declaration

Source position: errno.inc line 169

const ESysENOKEY = 126;


ESysENOLCK

System error: No record locks available

Declaration

Source position: errno.inc line 77

const ESysENOLCK = 37;


ESysENOLINK

System error: Link has been severed

Declaration

Source position: errno.inc line 107

const ESysENOLINK = 67;


ESysENOMEDIUM

No medium present

Declaration

Source position: errno.inc line 166

const ESysENOMEDIUM = 123;


ESysENOMEM

System error: Out of memory

Declaration

Source position: errno.inc line 44

const ESysENOMEM = 12;


ESysENOMSG

System error: No message of desired type

Declaration

Source position: errno.inc line 82

const ESysENOMSG = 42;


ESysENONET

System error: Machine is not on the network

Declaration

Source position: errno.inc line 104

const ESysENONET = 64;


ESysENOPKG

System error: Package not installed

Declaration

Source position: errno.inc line 105

const ESysENOPKG = 65;


ESysENOPROTOOPT

System error: Protocol not available

Declaration

Source position: errno.inc line 132

const ESysENOPROTOOPT = 92;


ESysENOSPC

System error: No space left on device

Declaration

Source position: errno.inc line 66

const ESysENOSPC = 28;


ESysENOSR

System error: Out of streams resources

Declaration

Source position: errno.inc line 103

const ESysENOSR = 63;


ESysENOSTR

System error: Device not a stream

Declaration

Source position: errno.inc line 100

const ESysENOSTR = 60;


ESysENOSYS

System error: Function not implemented

Declaration

Source position: errno.inc line 78

const ESysENOSYS = 38;


ESysENOTBLK

System error: Block device required

Declaration

Source position: errno.inc line 47

const ESysENOTBLK = 15;


ESysENOTCONN

System error: Transport endpoint is not connected

Declaration

Source position: errno.inc line 147

const ESysENOTCONN = 107;


ESysENOTDIR

System error: Not a directory

Declaration

Source position: errno.inc line 52

const ESysENOTDIR = 20;


ESysENOTEMPTY

System error: Directory not empty

Declaration

Source position: errno.inc line 79

const ESysENOTEMPTY = 39;


ESysENOTNAM

System error: Not a XENIX named type file

Declaration

Source position: errno.inc line 158

const ESysENOTNAM = 118;


ESysENOTRECOVERABLE

State not recoverable (mutexes)

Declaration

Source position: errno.inc line 174

const ESysENOTRECOVERABLE = 131;


ESysENOTSOCK

System error: Socket operation on non-socket

Declaration

Source position: errno.inc line 128

const ESysENOTSOCK = 88;


ESysENOTTY

System error: Not a typewriter

Declaration

Source position: errno.inc line 57

const ESysENOTTY = 25;


ESysENOTUNIQ

System error: Name not unique on network

Declaration

Source position: errno.inc line 116

const ESysENOTUNIQ = 76;


ESysENXIO

System error: No such device or address

Declaration

Source position: errno.inc line 38

const ESysENXIO = 6;


ESysEOPNOTSUPP

System error: Operation not supported on transport endpoint

Declaration

Source position: errno.inc line 135

const ESysEOPNOTSUPP = 95;


ESysEOVERFLOW

System error: Value too large for defined data type

Declaration

Source position: errno.inc line 115

const ESysEOVERFLOW = 75;


ESysEOWNERDEAD

Owner died (mutexes)

Declaration

Source position: errno.inc line 173

const ESysEOWNERDEAD = 130;


ESysEPERM

System error: Operation not permitted.

Declaration

Source position: errno.inc line 33

const ESysEPERM = 1;


ESysEPFNOSUPPORT

System error: Protocol family not supported

Declaration

Source position: errno.inc line 136

const ESysEPFNOSUPPORT = 96;


ESysEPIPE

System error: Broken pipe

Declaration

Source position: errno.inc line 70

const ESysEPIPE = 32;


ESysEPROTO

System error: Protocol error

Declaration

Source position: errno.inc line 111

const ESysEPROTO = 71;


ESysEPROTONOSUPPORT

System error: Protocol not supported

Declaration

Source position: errno.inc line 133

const ESysEPROTONOSUPPORT = 93;


ESysEPROTOTYPE

System error: Protocol wrong type for socket

Declaration

Source position: errno.inc line 131

const ESysEPROTOTYPE = 91;


ESysERANGE

System error: Math result not representable

Declaration

Source position: errno.inc line 72

const ESysERANGE = 34;


ESysEREMCHG

System error: Remote address changed

Declaration

Source position: errno.inc line 118

const ESysEREMCHG = 78;


ESysEREMOTE

System error: Object is remote

Declaration

Source position: errno.inc line 106

const ESysEREMOTE = 66;


ESysEREMOTEIO

System error: Remote I/O error

Declaration

Source position: errno.inc line 161

const ESysEREMOTEIO = 121;


ESysERESTART

System error: Interrupted system call should be restarted

Declaration

Source position: errno.inc line 125

const ESysERESTART = 85;


ESysERFKILL

Operation not possible due to RF-Kill (wireless)

Declaration

Source position: errno.inc line 175

const ESysERFKILL = 132;


ESysEROFS

System error: Read-only file system

Declaration

Source position: errno.inc line 68

const ESysEROFS = 30;


ESysESHUTDOWN

System error: Cannot send after transport endpoint shutdown

Declaration

Source position: errno.inc line 148

const ESysESHUTDOWN = 108;


ESysESOCKTNOSUPPORT

System error: Socket type not supported

Declaration

Source position: errno.inc line 134

const ESysESOCKTNOSUPPORT = 94;


ESysESPIPE

System error: Illegal seek

Declaration

Source position: errno.inc line 67

const ESysESPIPE = 29;


ESysESRCH

System error: No such process

Declaration

Source position: errno.inc line 35

const ESysESRCH = 3;


ESysESRMNT

System error: Srmount error

Declaration

Source position: errno.inc line 109

const ESysESRMNT = 69;


ESysESTALE

System error: Stale NFS file handle

Declaration

Source position: errno.inc line 156

const ESysESTALE = 116;


ESysESTRPIPE

System error: Streams pipe error

Declaration

Source position: errno.inc line 126

const ESysESTRPIPE = 86;


ESysETIME

System error: Timer expired

Declaration

Source position: errno.inc line 102

const ESysETIME = 62;


ESysETIMEDOUT

System error: Connection timed out

Declaration

Source position: errno.inc line 150

const ESysETIMEDOUT = 110;


ESysETOOMANYREFS

System error: Too many references: cannot splice

Declaration

Source position: errno.inc line 149

const ESysETOOMANYREFS = 109;


ESysETXTBSY

System error: Text (code segment) file busy

Declaration

Source position: errno.inc line 58

const ESysETXTBSY = 26;


ESysEUCLEAN

System error: Structure needs cleaning

Declaration

Source position: errno.inc line 157

const ESysEUCLEAN = 117;


ESysEUNATCH

System error: Protocol driver not attached

Declaration

Source position: errno.inc line 89

const ESysEUNATCH = 49;


ESysEUSERS

System error: Too many users

Declaration

Source position: errno.inc line 127

const ESysEUSERS = 87;


ESysEWOULDBLOCK

System error: Operation would block

Declaration

Source position: errno.inc line 81

const ESysEWOULDBLOCK = ESysEAGAIN;


ESysEXDEV

System error: Cross-device link

Declaration

Source position: errno.inc line 50

const ESysEXDEV = 18;


ESysEXFULL

System error: Exchange full

Declaration

Source position: errno.inc line 94

const ESysEXFULL = 54;


F_GetFd

fpFCntl command: Get close-on-exec flag

Declaration

Source position: ostypes.inc line 358

const F_GetFd = 1;


F_GetFl

fpFCntl command: Get filedescriptor flags

Declaration

Source position: ostypes.inc line 360

const F_GetFl = 3;


F_GetLk

fpFCntl command: Get lock

Declaration

Source position: ostypes.inc line 362

const F_GetLk = 5;


F_GetOwn

fpFCntl command: get owner of filedescriptor events

Declaration

Source position: ostypes.inc line 366

const F_GetOwn = 9;


F_OK

fpAccess call test: file exists.

Declaration

Source position: ostypes.inc line 240

const F_OK = 0;


F_SetFd

fpFCntl command: Set close-on-exec flag

Declaration

Source position: ostypes.inc line 359

const F_SetFd = 2;


F_SetFl

fpFCntl command: Set filedescriptor flags

Declaration

Source position: ostypes.inc line 361

const F_SetFl = 4;


F_SetLk

fpFCntl command: Set lock

Declaration

Source position: ostypes.inc line 363

const F_SetLk = 6;


F_SetLkW

fpFCntl command: Test lock

Declaration

Source position: ostypes.inc line 364

const F_SetLkW = 7;


F_SetOwn

fpFCntl command: Set owner of filedescriptor events

Declaration

Source position: ostypes.inc line 365

const F_SetOwn = 8;


FD_MAXFDSET

Maximum elements in a TFDSet array.

Declaration

Source position: ostypes.inc line 34

const FD_MAXFDSET = 1024;


FLock

Lock description type for fpFCntl lock call.

Declaration

Source position: ostypes.inc line 170

type FLock = record
l_type: cshort; | Type of lock.
l_whence: cshort; | Where to measure start of lock from
l_start: kernel_off_t; | Start of lock
l_len: kernel_off_t; | Length of locked area
l_pid: pid_t; | Process ID of process holding the lock
end;


FPE_FLTDIV

Value signalling floating point divide by zero in case of SIGFPE signal

Declaration

Source position: signal.inc line 160

const FPE_FLTDIV = 3;


FPE_FLTINV

Value signalling floating point invalid operation in case of SIGFPE signal

Declaration

Source position: signal.inc line 164

const FPE_FLTINV = 7;


FPE_FLTOVF

Value signalling floating point overflow in case of SIGFPE signal

Declaration

Source position: signal.inc line 161

const FPE_FLTOVF = 4;


FPE_FLTRES

Value signalling floating point inexact result in case of SIGFPE signal

Declaration

Source position: signal.inc line 163

const FPE_FLTRES = 6;


FPE_FLTSUB

Value signalling floating point subscript out of range in case of SIGFPE signal

Declaration

Source position: signal.inc line 165

const FPE_FLTSUB = 8;


FPE_FLTUND

Value signalling floating point underflow in case of SIGFPE signal

Declaration

Source position: signal.inc line 162

const FPE_FLTUND = 5;


FPE_INTDIV

Value signalling integer divide in case of SIGFPE signal

Declaration

Source position: signal.inc line 158

const FPE_INTDIV = 1;


FPE_INTOVF

Value signalling integer overflow in case of SIGFPE signal

Declaration

Source position: signal.inc line 159

const FPE_INTOVF = 2;


gid_t

Group ID type.

Declaration

Source position: aliasptp.inc line 24

type gid_t = UnixType.gid_t;


Reference for unit 'BaseUnix'

Basic Unix functionality

uses
System, | The system unit
unixtype; | Basic unix types

Overview

The BaseUnix unit was implemented by Marco Van de Voort. It contains basic Unix functionality. It supersedes the Linux unit of version 1.0.X of the compiler, but only implements a cleaned up, portable subset of that unit.

For porting FPC to new Unix-like platforms, it should be sufficient to implement the functionality in this unit for the new platform.


Reference for unit 'BaseUnix': Constants

ARG_MAX | Maximum number of arguments to a program.
BITSINWORD | Number of bits in a word.
ESysE2BIG | System error: Argument list too long
ESysEACCES | System error: Permission denied
ESysEADDRINUSE | System error: Address already in use
ESysEADDRNOTAVAIL | System error: Cannot assign requested address
ESysEADV | System error: Advertise error
ESysEAFNOSUPPORT | System error: Address family not supported by protocol
ESysEAGAIN | System error: Try again
ESysEALREADY | System error: Operation already in progress
ESysEBADE | System error: Invalid exchange
ESysEBADF | System error: Bad file number
ESysEBADFD | System error: File descriptor in bad state
ESysEBADMSG | System error: Not a data message
ESysEBADR | System error: Invalid request descriptor
ESysEBADRQC | System error: Invalid request code
ESysEBADSLT | System error: Invalid slot
ESysEBFONT | System error: Bad font file format
ESysEBUSY | System error: Device or resource busy
ESysECANCELED | Operation canceled
ESysECHILD | System error: No child processes
ESysECHRNG | System error: Channel number out of range
ESysECOMM | System error: Communication error on send
ESysECONNABORTED | System error: Software caused connection abort
ESysECONNREFUSED | System error: Connection refused
ESysECONNRESET | System error: Connection reset by peer
ESysEDEADLK | System error: Resource deadlock would occur
ESysEDEADLOCK | System error: File locking deadlock error
ESysEDESTADDRREQ | System error: Destination address required
ESysEDOM | System error: Math argument out of domain of func
ESysEDOTDOT | System error: RFS specific error
ESysEDQUOT | System error: Quota exceeded
ESysEEXIST | System error: File exists
ESysEFAULT | System error: Bad address
ESysEFBIG | System error: File too large
ESysEHOSTDOWN | System error: Host is down
ESysEHOSTUNREACH | System error: No route to host
ESysEIDRM | System error: Identifier removed
ESysEILSEQ | System error: Illegal byte sequence
ESysEINPROGRESS | System error: Operation now in progress
ESysEINTR | System error: Interrupted system call
ESysEINVAL | System error: Invalid argument
ESysEIO | System error: I/O error
ESysEISCONN | System error: Transport endpoint is already connected
ESysEISDIR | System error: Is a directory
ESysEISNAM | System error: Is a named type file
ESysEKEYEXPIRED | Key has expired (Linux kernel module)
ESysEKEYREJECTED | Key was rejected by service (Linux kernel module)
ESysEKEYREVOKED | Key has been revoked (Linux kernel module)
ESysEL2HLT | System error: Level 2 halted
ESysEL2NSYNC | System error: Level 2 not synchronized
ESysEL3HLT | System error: Level 3 halted
ESysEL3RST | System error: Level 3 reset
ESysELIBACC | System error: Can not access a needed shared library
ESysELIBBAD | System error: Accessing a corrupted shared library
ESysELIBEXEC | System error: Cannot exec a shared library directly
ESysELIBMAX | System error: Attempting to link in too many shared libraries
ESysELIBSCN | System error: .lib section in a.out corrupted
ESysELNRNG | System error: Link number out of range
ESysELOOP | System error: Too many symbolic links encountered
ESysEMEDIUMTYPE | Wrong medium type
ESysEMFILE | System error: Too many open files
ESysEMLINK | System error: Too many links
ESysEMSGSIZE | System error: Message too long
ESysEMULTIHOP | System error: Multihop attempted
ESysENAMETOOLONG | System error: File name too long
ESysENAVAIL | System error: No XENIX semaphores available
ESysENETDOWN | System error: Network is down
ESysENETRESET | System error: Network dropped connection because of reset
ESysENETUNREACH | System error: Network is unreachable
ESysENFILE | System error: File table overflow
ESysENOANO | System error: No anode
ESysENOBUFS | System error: No buffer space available
ESysENOCSI | System error: No CSI structure available
ESysENODATA | System error: No data available
ESysENODEV | System error: No such device
ESysENOENT | System error: No such file or directory
ESysENOEXEC | System error: Exec format error
ESysENOKEY | Required key not available (Linux kernel module)
ESysENOLCK | System error: No record locks available
ESysENOLINK | System error: Link has been severed
ESysENOMEDIUM | No medium present
ESysENOMEM | System error: Out of memory
ESysENOMSG | System error: No message of desired type
ESysENONET | System error: Machine is not on the network
ESysENOPKG | System error: Package not installed
ESysENOPROTOOPT | System error: Protocol not available
ESysENOSPC | System error: No space left on device
ESysENOSR | System error: Out of streams resources
ESysENOSTR | System error: Device not a stream
ESysENOSYS | System error: Function not implemented
ESysENOTBLK | System error: Block device required
ESysENOTCONN | System error: Transport endpoint is not connected
ESysENOTDIR | System error: Not a directory
ESysENOTEMPTY | System error: Directory not empty
ESysENOTNAM | System error: Not a XENIX named type file
ESysENOTRECOVERABLE | State not recoverable (mutexes)
ESysENOTSOCK | System error: Socket operation on non-socket
ESysENOTTY | System error: Not a typewriter
ESysENOTUNIQ | System error: Name not unique on network
ESysENXIO | System error: No such device or address
ESysEOPNOTSUPP | System error: Operation not supported on transport endpoint
ESysEOVERFLOW | System error: Value too large for defined data type
ESysEOWNERDEAD | Owner died (mutexes)
ESysEPERM | System error: Operation not permitted.
ESysEPFNOSUPPORT | System error: Protocol family not supported
ESysEPIPE | System error: Broken pipe
ESysEPROTO | System error: Protocol error
ESysEPROTONOSUPPORT | System error: Protocol not supported
ESysEPROTOTYPE | System error: Protocol wrong type for socket
ESysERANGE | System error: Math result not representable
ESysEREMCHG | System error: Remote address changed
ESysEREMOTE | System error: Object is remote
ESysEREMOTEIO | System error: Remote I/O error
ESysERESTART | System error: Interrupted system call should be restarted
ESysERFKILL | Operation not possible due to RF-Kill (wireless)
ESysEROFS | System error: Read-only file system
ESysESHUTDOWN | System error: Cannot send after transport endpoint shutdown
ESysESOCKTNOSUPPORT | System error: Socket type not supported
ESysESPIPE | System error: Illegal seek
ESysESRCH | System error: No such process
ESysESRMNT | System error: Srmount error
ESysESTALE | System error: Stale NFS file handle
ESysESTRPIPE | System error: Streams pipe error
ESysETIME | System error: Timer expired
ESysETIMEDOUT | System error: Connection timed out
ESysETOOMANYREFS | System error: Too many references: cannot splice
ESysETXTBSY | System error: Text (code segment) file busy
ESysEUCLEAN | System error: Structure needs cleaning
ESysEUNATCH | System error: Protocol driver not attached
ESysEUSERS | System error: Too many users
ESysEWOULDBLOCK | System error: Operation would block
ESysEXDEV | System error: Cross-device link
ESysEXFULL | System error: Exchange full
FD_MAXFDSET | Maximum elements in a TFDSet array.
FPE_FLTDIV | Value signalling floating point divide by zero in case of SIGFPE signal
FPE_FLTINV | Value signalling floating point invalid operation in case of SIGFPE signal
FPE_FLTOVF | Value signalling floating point overflow in case of SIGFPE signal
FPE_FLTRES | Value signalling floating point inexact result in case of SIGFPE signal
FPE_FLTSUB | Value signalling floating point subscript out of range in case of SIGFPE signal
FPE_FLTUND | Value signalling floating point underflow in case of SIGFPE signal
FPE_INTDIV | Value signalling integer divide in case of SIGFPE signal
FPE_INTOVF | Value signalling integer overflow in case of SIGFPE signal
F_GetFd | fpFCntl command: Get close-on-exec flag
F_GetFl | fpFCntl command: Get filedescriptor flags
F_GetLk | fpFCntl command: Get lock
F_GetOwn | fpFCntl command: get owner of filedescriptor events
F_OK | fpAccess call test: file exists.
F_SetFd | fpFCntl command: Set close-on-exec flag
F_SetFl | fpFCntl command: Set filedescriptor flags
F_SetLk | fpFCntl command: Set lock
F_SetLkW | fpFCntl command: Test lock
F_SetOwn | fpFCntl command: Set owner of filedescriptor events
ln2bitmask | Last bit in word.
ln2bitsinword | Power of 2 number of bits in word.
MAP_ANON | Anonymous memory mapping (data private to application)
MAP_ANONYMOUS | FpMMap map type: Don't use a file
MAP_DENYWRITE | FpMMap option: Ignored.
MAP_EXECUTABLE | FpMMap option: Ignored.
MAP_FAILED | Memory mapping failed error code
MAP_FIXED | FpMMap map type: Interpret addr exactly
MAP_GROWSDOWN | FpMMap option: Memory grows downward (like a stack)
MAP_LOCKED | FpMMap option: lock the pages in memory.
MAP_NORESERVE | FpMMap option: Do not reserve swap pages for this memory.
MAP_PRIVATE | FpMMap map type: Changes are private
MAP_SHARED | FpMMap map type: Share changes
MAP_TYPE | FpMMap map type: Bitmask for type of mapping
NAME_MAX | Maximum filename length.
O_APPEND | fpOpen file open mode: Append to file
O_CREAT | fpOpen file open mode: Create if file does not yet exist.
O_DIRECT | fpOpen file open mode: Minimize caching effects
O_DIRECTORY | fpOpen file open mode: File must be directory.
O_EXCL | fpOpen file open mode: Open exclusively
O_LARGEFILE | fpOpen file open mode: Open for 64-bit I/O
O_NDELAY | fpOpen file open mode: Alias for O_NonBlock
O_NOCTTY | fpOpen file open mode: No TTY control.
O_NOFOLLOW | fpOpen file open mode: Fail if file is symbolic link.
O_NONBLOCK | fpOpen file open mode: Open in non-blocking mode
O_RDONLY | fpOpen file open mode: Read only
O_RDWR | fpOpen file open mode: Read/Write
O_SYNC | fpOpen file open mode: Write to disc at once
O_TRUNC | fpOpen file open mode: Truncate file to length 0
O_WRONLY | fpOpen file open mode: Write only
PATH_MAX | Maximum pathname length.
POLLERR | Error condition on output file descriptor
POLLHUP | Hang up
POLLIN | Data is available for reading
POLLNVAL | Invalid request, file descriptor not open.
POLLOUT | Writing data will not block the write call
POLLPRI | Urgent data is available for reading.
POLLRDBAND | Priority data ready for reading.
POLLRDNORM | Same as POLLIN.
POLLWRBAND | Priority data my be written.
POLLWRNORM | Equivalent to POLLOUT.
PRIO_PGRP | Easy access alias for unixtype.PRIO_PGRP
PRIO_PROCESS | Easy access alias for unixtype.PRIO_PROCESS
PRIO_USER | Easy access alias for unixtype.PRIO_USER
PROT_EXEC | FpMMap memory access: page can be executed
PROT_NONE | FpMMap memory access: page can not be accessed
PROT_READ | FpMMap memory access: page can be read
PROT_WRITE | FpMMap memory access: page can be written
RLIMIT_AS | RLimit request address space limit
RLIMIT_CORE | RLimit request max core file size
RLIMIT_CPU | RLimit request CPU time in ms
RLIMIT_DATA | RLimit request max data size
RLIMIT_FSIZE | Rlimit request maximum filesize
RLIMIT_LOCKS | RLimit request maximum file locks held
RLIMIT_MEMLOCK | RLimit request max locked-in-memory address space
RLIMIT_NOFILE | RLimit request max number of open files
RLIMIT_NPROC | RLimit request max number of processes
RLIMIT_RSS | RLimit request max resident set size
RLIMIT_STACK | RLimit request max stack size
R_OK | fpAccess call test: read allowed
SA_INTERRUPT | Sigaction options: ?
SA_NOCLDSTOP | Sigaction options: Do not receive notification when child processes stop
SA_NOCLDWAIT | Sigaction options: ?
SA_NODEFER | Sigaction options: Do not mask signal in its own signal handler
SA_NOMASK | Sigaction options: Do not prevent the signal from being received when it is handled.
SA_ONESHOT | Sigaction options: Restore the signal action to the default state.
SA_ONSTACK | Call the signal handler on an alternate signal stack
SA_RESETHAND | Sigaction options: Restore signal action to default state when signal handler exits.
SA_RESTART | Sigaction options: Provide behaviour compatible with BSD signal semantics
SA_RESTORER | Signal restorer handler
SA_SIGINFO | Sigaction options: The signal handler takes 3 arguments, not one.
SEEK_CUR | fpLSeek option: Set position relative to current position.
SEEK_END | fpLSeek option: Set position relative to end of file.
SEEK_SET | fpLSeek option: Set absolute position.
SIGABRT | Signal: ABRT (Abort)
SIGALRM | Signal: ALRM (Alarm clock)
SIGBUS | Signal: BUS (bus error)
SIGCHLD | Signal: CHLD (child status changed)
SIGCONT | Signal: CONT (Continue)
SIGFPE | Signal: FPE (Floating point error)
SIGHUP | Signal: HUP (Hangup)
SIGILL | Signal: ILL (Illegal instruction)
SIGINT | Signal: INT (Interrupt)
SIGIO | Signal: IO (I/O operation possible)
SIGIOT | Signal: IOT (IOT trap)
SIGKILL | Signal: KILL (unblockable)
SIGPIPE | Signal: PIPE (Broken pipe
SIGPOLL | Signal: POLL (Pollable event)
SIGPROF | Signal: PROF (Profiling alarm)
SIGPWR | Signal: PWR (power failure restart)
SIGQUIT | Signal: QUIT
SIGSEGV | Signal: SEGV (Segmentation violation)
SIGSTKFLT | Signal: STKFLT (Stack Fault)
SIGSTOP | Signal: STOP (Stop, unblockable)
SIGTERM | Signal: TERM (Terminate)
SIGTRAP | Signal: TRAP (Trace trap)
SIGTSTP | Signal: TSTP (keyboard stop)
SIGTTIN | Signal: TTIN (Terminal input, background)
SIGTTOU | Signal: TTOU (Terminal output, background)
SIGUNUSED | Signal: Unused
SIGURG | Signal: URG (Socket urgent condition)
SIGUSR1 | Signal: USR1 (User-defined signal 1)
SIGUSR2 | Signal: USR2 (User-defined signal 2)
SIGVTALRM | Signal: VTALRM (Virtual alarm clock)
SIGWINCH | Signal: WINCH (Window/Terminal size change)
SIGXCPU | Signal: XCPU (CPU limit exceeded)
SIGXFSZ | Signal: XFSZ (File size limit exceeded)
SIG_BLOCK | Sigprocmask flags: Add signals to the set of blocked signals.
SIG_DFL | Signal handler: Default signal handler
SIG_ERR | Signal handler: error
SIG_IGN | Signal handler: Ignore signal
SIG_MAXSIG | Maximum system signal number.
SIG_SETMASK | Sigprocmask flags: Set of blocked signals is given.
SIG_UNBLOCK | Sigprocmask flags: Remove signals from the set set of blocked signals.
SI_PAD_SIZE | Signal information pad size.
SYS_NMLN | Max system name length.
S_IFBLK | File (#rtl.baseunix.stat record) mode: Block device
S_IFCHR | File (#rtl.baseunix.stat record) mode: Character device
S_IFDIR | File (#rtl.baseunix.stat record) mode: Directory
S_IFIFO | File (#rtl.baseunix.stat record) mode: FIFO
S_IFLNK | File (#rtl.baseunix.stat record) mode: Link
S_IFMT | File (#rtl.baseunix.stat record) mode: File type bit mask
S_IFREG | File (#rtl.baseunix.stat record) mode: Regular file
S_IFSOCK | File (#rtl.baseunix.stat record) mode: Socket
S_IRGRP | Mode flag: Read by group.
S_IROTH | Mode flag: Read by others.
S_IRUSR | Mode flag: Read by owner.
S_IRWXG | Mode flag: Read, write, execute by groups.
S_IRWXO | Mode flag: Read, write, execute by others.
S_IRWXU | Mode flag: Read, write, execute by user.
S_IWGRP | Mode flag: Write by group.
S_IWOTH | Mode flag: Write by others.
S_IWUSR | Mode flag: Write by owner.
S_IXGRP | Mode flag: Execute by group.
S_IXOTH | Mode flag: Execute by others.
S_IXUSR | Mode flag: Execute by owner.
UTSNAME_DOMAIN_LENGTH | Max length of utsname domain name.
UTSNAME_LENGTH | Max length of utsname system name, release, version, machine.
UTSNAME_NODENAME_LENGTH | Max length of utsname node name.
WNOHANG | #rtl.baseunix.fpWaitpid option: Do not wait for processes to terminate.
wordsinfdset | Number of words in a TFDSet array
wordsinsigset | Number of words in a signal set.
WUNTRACED | #rtl.baseunix.fpWaitpid option: Also report children wich were stopped but not yet reported
W_OK | fpAccess call test: write allowed
X_OK | fpAccess call test: execute allowed


Reference for unit 'BaseUnix': Types

Blkcnt64_t | 64-bit block count
Blkcnt_t | Block count type.
Blksize_t | Block size type.
cbool | Boolean type
cchar | Alias for #rtl.UnixType.cchar
cdouble | Double precision real format.
cfloat | Floating-point real format
cint | C type: integer (natural size)
cint16 | C type: 16 bits sized, signed integer.
cint32 | C type: 32 bits sized, signed integer.
cint64 | C type: 64 bits sized, signed integer.
cint8 | C type: 8 bits sized, signed integer.
clock_t | Clock ticks type
clong | C type: long signed integer (double sized)
clonglong | C type: 64-bit (double long) signed integer.
coff_t | Character offset type
cschar | Signed character type
cshort | C type: short signed integer (half sized)
csigned | Signed integer
csint | Signed integer
csize_t | Character size type
cslong | Signed long
cslonglong | Signed longlong type
csshort | Short signed integer type
cuchar | Alias for #rtl.UnixType.cuchar
cuint | C type: unsigned integer (natural size)
cuint16 | C type: 16 bits sized, unsigned integer.
cuint32 | C type: 32 bits sized, unsigned integer.
cuint64 | C type: 64 bits sized, unsigned integer.
cuint8 | C type: 8 bits sized, unsigned integer.
culong | C type: long unsigned integer (double sized)
culonglong | C type: 64-bit (double long) unsigned integer.
cunsigned | Alias for #rtl.unixtype.cunsigned
cushort | C type: short unsigned integer (half sized)
dev_t | Device descriptor type.
Dir | Record used in fpOpenDir and fpReadDir calls
Dirent | Record used in the fpReadDir function to return files in a directory.
FLock | Lock description type for fpFCntl lock call.
gid_t | Group ID type.
ino_t | Inode type.
iovec | IO buffer structure
kernel_gid_t | Kernel group ID type
kernel_loff_t | Long kernel offset type
kernel_mode_t | Kernel mode type
kernel_off_t | Kernel offset type
kernel_uid_t | Kernel user ID type
mode_t | Inode mode type.
nlink_t | Number of links type.
off_t | Offset type.
PBlkCnt | pointer to TBlkCnt type.
PBlkSize | Pointer to TBlkSize type.
pcbool | Pointer to boolean type
pcchar | Alias for #rtl.UnixType.pcchar
pcdouble | Pointer to cdouble type.
pcfloat | Pointer to cfloat type.
pcint | Pointer to cInt type.
pcint16 | Pointer to 16-bit signed integer type
pcint32 | Pointer to signed 32-bit integer type
pcint64 | Pointer to signed 64-bit integer type
pcint8 | Pointer to 8-bits signed integer type
pClock | Pointer to TClock type.
pclong | Pointer to cLong type.
pclonglong | Pointer to longlong type.
pcschar | Pointer to signed character type
pcshort | Pointer to cShort type.
pcsigned | Pointer to signed integer
pcsint | Pointer to signed integer
pcsize_t | Pointer to csize_t
pcslong | Pointer to signed long
pcslonglong | Pointer to Signed longlong type
pcsshort | Pointer to short signed integer type
pcuchar | Alias for #rtl.UnixType.pcuchar
pcuint | Pointer to cUInt type.
pcuint16 | Pointer to 16-bit unsigned integer type
pcuint32 | Pointer to unsigned 32-bit integer type
pcuint64 | Pointer to unsigned 64-bit integer type
pcuint8 | Pointer to 8-bits unsigned integer type
pculong | Pointer to cuLong type.
pculonglong | Unsigned longlong type
pcunsigned | Alias for #rtl.unixtype.pcunsigned
pcushort | Pointer to cuShort type.
pDev | Pointer to TDev type.
pDir | Pointer to TDir record
pDirent | Pointer to TDirent record.
pFDSet | Pointer to TFDSet type.
pFilDes | Pointer to TFilDes type.
pfpstate | Pointer to tfpstate record.
pGid | Pointer to TGid type.
pGrpArr | Pointer to TGrpArr array.
pid_t | Process ID type.
pIno | Pointer to TIno type.
piovec | pointer to a iovec record
pMode | Pointer to TMode type.
pnLink | Pointer to TnLink type.
pOff | Pointer to TOff type.
pollfd | Poll structure
pPid | Pointer to TPid type.
ppollfd | Pointer to tpollfd.
PRLimit | Pointer to TRLimit record
psigactionrec | Pointer to SigActionRec record type.
PSigContext | Pointer to #rtl.baseunix.TSigContext record type.
psiginfo | Pointer to #rtl.baseunix.TSigInfo record type.
psigset | Pointer to SigSet type.
pSize | Pointer to TSize type.
pSize_t | Pointer to Size_t
pSocklen | Pointer to TSockLen type.
psSize | Pointer to TsSize type
PStat | Pointer to TStat type.
pstatfs | Pointer to statfs type
pthread_cond_t | Thread conditional variable type.
pthread_mutex_t | Thread mutex type.
pthread_t | Posix thread type.
pTime | Pointer to TTime type.
ptimespec | Pointer to timespec type.
ptimeval | Pointer to timeval type.
ptimezone | Pointer to TimeZone record.
ptime_t | Pointer to time_t type.
PTms | Pointer to TTms type.
Pucontext | Pointer to TUContext type.
pUid | Pointer to TUid type.
pUtimBuf | Pointer to TUTimBuf type.
PUtsName | Pointer to TUtsName type.
rlim_t | TRLimit record field type
sigactionhandler | Callback prototype for a #rtl.baseunix.SigActionRec record.
sigactionhandler_t | Standard signal action handler prototype
sigactionrec | Record used in fpSigAction call.
signalhandler | Simple signal handler prototype
signalhandler_t | Standard signal handler prototype
sigrestorerhandler | Alias for sigrestorerhandler_t type.
sigrestorerhandler_t | Standard signal action restorer prototype
sigset | Signal set type
sigset_t | Signal set type
size_t | Size specification type.
socklen_t | Socket address length type.
ssize_t | Small size type.
Stat | Record describing an inode (file) in the FPFstat call.
TBlkCnt | Alias for Blkcnt_t type.
TBlkSize | Alias for blksize_t type.
TClock | Alias for clock_t type.
TDev | Alias for dev_t type.
TDir | Alias for Dir type.
TDirent | Alias for Dirent type.
TFDSet | File descriptor set for fpSelect call.
TFilDes | Array of file descriptors as used in fpPipe call.
tfpreg | Record describing floating point register in signal handler.
tfpstate | Record describing floating point unit in signal handler.
TGid | Alias for gid_t type.
TGrpArr | Array of gid_t IDs
timespec | Short time specification type.
timeval | Time specification type.
timezone | Record describing a timezone
time_t | Time span type
TIno | Alias for ino_t type.
TIOCtlRequest | Easy access alias for unixtype.TIOCtlRequest
tiovec | Alias for the iovec record type.
TMode | Alias for mode_t type.
tms | Record containing timings for fpTimes call.
TnLink | Alias for nlink_t type.
TOff | Alias for off_t type.
TPid | Alias for pid_t type.
tpollfd | Alias for pollfd type
TRLimit | Structure to return RLimit data in.
tsigactionhandler | Alias for sigactionhandler_t type.
tsigaltstack | Provide the location of an alternate signal handler stack.
TSigContext | Record describing the CPU context when a signal occurs.
tsiginfo | Record describing the signal when a signal occurs.
tsignalhandler | Alias for signalhandler_t type.
tsigrestorerhandler | Alias for sigrestorerhandler_t type.
tsigset | Alias for SigSet type.
TSize | Alias for size_t type
TSocklen | Alias for socklen_t type.
TsSize | Alias for ssize_t type
TStat | Alias for Stat type.
tstatfs | Record describing a file system in the unix.fpstatfs call.
TTime | Alias for TTime type.
Ttimespec | Alias for TimeSpec type.
TTimeVal | Alias for timeval type.
TTimeZone | Alias for TimeZone record.
TTms | Alias for Tms record type.
TUcontext | Context description record
TUid | Alias for uid_t type.
TUtimBuf | Alias for UtimBuf type.
TUtsName | Alias for UtsName type.
uid_t | User ID type
UTimBuf | Record used in fpUtime to set file access and modification times.
UtsName | Record used to return kernel information in fpUName function.


Reference for unit 'BaseUnix': Procedures and functions

CreateShellArgV | Create a null-terminated array of strings from a command-line string
FpAccess | Check file access
FpAlarm | Schedule an alarm signal to be delivered
FpChdir | Change current working directory.
FpChmod | Change file permission bits
FpChown | Change owner of file
FpClose | Close file descriptor
FpClosedir | Close directory file descriptor
FpDup | Duplicate a file handle
FpDup2 | Duplicate one filehandle to another
FpExecv | Execute process
FpExecve | Execute process using environment
FpExit | Exit the current process
FpFcntl | File control operations.
fpfdfillset | Set all filedescriptors in the set.
fpFD_CLR | Clears a filedescriptor in a set
fpFD_ISSET | Check whether a filedescriptor is set
fpFD_SET | Set a filedescriptor in a set
fpFD_ZERO | Clear all file descriptors in set
FpFork | Create child process
FPFStat | Retrieve file information about a file descriptor.
FpFtruncate | Truncate file on certain size.
FpGetcwd | Retrieve the current working directory.
FpGetegid | Return effective group ID
FpGetEnv | Return value of environment variable.
fpgeterrno | Retrieve extended error information.
FpGeteuid | Return effective user ID
FpGetgid | Return real group ID
FpGetgroups | Get the list of supplementary groups.
FpGetpgrp | Get process group ID
FpGetpid | Return current process ID
FpGetppid | Return parent process ID
fpGetPriority | Return process priority
FpGetRLimit | Get process resource limits
FpGetsid | Get current session ID
FpGetuid | Return current user ID
FpIOCtl | General kernel IOCTL call.
FpKill | Send a signal to a process
FpLink | Create a hard link to a file
FpLseek | Set file pointer position.
fpLstat | Return information about symbolic link. Do not follow the link
FpMkdir | Create a new directory
FpMkfifo | Create FIFO (named pipe) in file system
Fpmmap | Create memory map of a file
Fpmunmap | Unmap previously mapped memory block
FpNanoSleep | Suspend process for a short time
fpNice | Set process priority
FpOpen | Open file and return file descriptor
FpOpendir | Open a directory for reading
FpPause | Wait for a signal to arrive
FpPipe | Create a set of pipe file handlers
FpPoll | Poll a file descriptor for events.
FppRead | Positional read: read from file descriptor at a certain position.
FppWrite | Positional write: write to file descriptor at a certain position.
FpRead | Read data from file descriptor
FpReaddir | Read entry from directory
fpReadLink | Read destination of symbolic link
FpReadV | Vector read: Read into multiple buffers
FpRename | Rename file
FpRmdir | Remove a directory.
fpSelect | Wait for events on file descriptors
fpseterrno | Set extended error information.
FpSetgid | Set the current group ID
fpSetPriority | Set process priority
FpSetRLimit | Set process resource limits
FpSetsid | Create a new session.
fpsettimeofday | Set kernel time
FpSetuid | Set the current user ID
FPSigaction | Install signal handler
FpSigAddSet | Set a signal in a signal set.
FpSigDelSet | Remove a signal from a signal set.
FpsigEmptySet | Clear all signals from signal set.
FpSigFillSet | Set all signals in signal set.
FpSigIsMember | Check whether a signal appears in a signal set.
FpSignal | Install signal handler (deprecated)
FpSigPending | Return set of currently pending signals
FpSigProcMask | Set list of blocked signals
FpSigSuspend | Set signal mask and suspend process till signal is received
FpSigTimedWait | Wait for signal, with timeout
FpSleep | Suspend process for several seconds
FpStat | Retrieve file information about a file descriptor.
fpSymlink | Create a symbolic link
fpS_ISBLK | Is file a block device
fpS_ISCHR | Is file a character device
fpS_ISDIR | Is file a directory
fpS_ISFIFO | Is file a FIFO
fpS_ISLNK | Is file a symbolic link
fpS_ISREG | Is file a regular file
fpS_ISSOCK | Is file a Unix socket
fptime | Return the current Unix time
FpTimes | Return execution times for the current process
FpUmask | Set file creation mask.
FpUname | Return system name.
FpUnlink | Unlink (i.e. remove) a file.
FpUtime | Set access and modification times of a file (touch).
FpWait | Wait for a child to exit.
FpWaitPid | Wait for a process to terminate
FpWrite | Write data to file descriptor
FpWriteV | Vector write: Write from multiple buffers to a file descriptor
FreeShellArgV | Free the result of a CreateShellArgV function
wexitStatus | Extract the exit status from the fpWaitPID result.
wifexited | Check whether the process exited normally
wifsignaled | Check whether the process was exited by a signal.
wstopsig | Return the exit code from the process.
wtermsig | Return the signal that caused a process to exit.


Index of all identifiers in unit 'BaseUnix'

A B C D E F G I K L M N O P R S T U W X

A

ARG_MAX

B

BITSINWORD | Blkcnt_t
Blkcnt64_t | Blksize_t

C

cbool | clonglong | cuchar
cchar | coff_t | cuint
cdouble | CreateShellArgV | cuint16
cfloat | cschar | cuint32
cint | cshort | cuint64
cint16 | csigned | cuint8
cint32 | csint | culong
cint64 | csize_t | culonglong
cint8 | cslong | cunsigned
clock_t | cslonglong | cushort
clong | csshort |

D

dev_t Dir Dirent

E

ESysE2BIG | ESysEKEYEXPIRED | ESysENOSYS
ESysEACCES | ESysEKEYREJECTED | ESysENOTBLK
ESysEADDRINUSE | ESysEKEYREVOKED | ESysENOTCONN
ESysEADDRNOTAVAIL | ESysEL2HLT | ESysENOTDIR
ESysEADV | ESysEL2NSYNC | ESysENOTEMPTY
ESysEAFNOSUPPORT | ESysEL3HLT | ESysENOTNAM
ESysEAGAIN | ESysEL3RST | ESysENOTRECOVERABLE
ESysEALREADY | ESysELIBACC | ESysENOTSOCK
ESysEBADE | ESysELIBBAD | ESysENOTTY
ESysEBADF | ESysELIBEXEC | ESysENOTUNIQ
ESysEBADFD | ESysELIBMAX | ESysENXIO
ESysEBADMSG | ESysELIBSCN | ESysEOPNOTSUPP
ESysEBADR | ESysELNRNG | ESysEOVERFLOW
ESysEBADRQC | ESysELOOP | ESysEOWNERDEAD
ESysEBADSLT | ESysEMEDIUMTYPE | ESysEPERM
ESysEBFONT | ESysEMFILE | ESysEPFNOSUPPORT
ESysEBUSY | ESysEMLINK | ESysEPIPE
ESysECANCELED | ESysEMSGSIZE | ESysEPROTO
ESysECHILD | ESysEMULTIHOP | ESysEPROTONOSUPPORT
ESysECHRNG | ESysENAMETOOLONG | ESysEPROTOTYPE
ESysECOMM | ESysENAVAIL | ESysERANGE
ESysECONNABORTED | ESysENETDOWN | ESysEREMCHG
ESysECONNREFUSED | ESysENETRESET | ESysEREMOTE
ESysECONNRESET | ESysENETUNREACH | ESysEREMOTEIO
ESysEDEADLK | ESysENFILE | ESysERESTART
ESysEDEADLOCK | ESysENOANO | ESysERFKILL
ESysEDESTADDRREQ | ESysENOBUFS | ESysEROFS
ESysEDOM | ESysENOCSI | ESysESHUTDOWN
ESysEDOTDOT | ESysENODATA | ESysESOCKTNOSUPPORT
ESysEDQUOT | ESysENODEV | ESysESPIPE
ESysEEXIST | ESysENOENT | ESysESRCH
ESysEFAULT | ESysENOEXEC | ESysESRMNT
ESysEFBIG | ESysENOKEY | ESysESTALE
ESysEHOSTDOWN | ESysENOLCK | ESysESTRPIPE
ESysEHOSTUNREACH | ESysENOLINK | ESysETIME
ESysEIDRM | ESysENOMEDIUM | ESysETIMEDOUT
ESysEILSEQ | ESysENOMEM | ESysETOOMANYREFS
ESysEINPROGRESS | ESysENOMSG | ESysETXTBSY
ESysEINTR | ESysENONET | ESysEUCLEAN
ESysEINVAL | ESysENOPKG | ESysEUNATCH
ESysEIO | ESysENOPROTOOPT | ESysEUSERS
ESysEISCONN | ESysENOSPC | ESysEWOULDBLOCK
ESysEISDIR | ESysENOSR | ESysEXDEV
ESysEISNAM | ESysENOSTR | ESysEXFULL

F

FD_MAXFDSET | FpGeteuid | fpsettimeofday
F_GetFd | FpGetgid | FpSetuid
F_GetFl | FpGetgroups | FPSigaction
F_GetLk | FpGetpgrp | FpSigAddSet
F_GetOwn | FpGetpid | FpSigDelSet
FLock | FpGetppid | FpsigEmptySet
F_OK | fpGetPriority | FpSigFillSet
FpAccess | FpGetRLimit | FpSigIsMember
FpAlarm | FpGetsid | FpSignal
FpChdir | FpGetuid | FpSigPending
FpChmod | FpIOCtl | FpSigProcMask
FpChown | FpKill | FpSigSuspend
FpClose | FpLink | FpSigTimedWait
FpClosedir | FpLseek | fpS_ISBLK
FpDup | fpLstat | fpS_ISCHR
FpDup2 | FpMkdir | fpS_ISDIR
FPE_FLTDIV | FpMkfifo | fpS_ISFIFO
FPE_FLTINV | Fpmmap | fpS_ISLNK
FPE_FLTOVF | Fpmunmap | fpS_ISREG
FPE_FLTRES | FpNanoSleep | fpS_ISSOCK
FPE_FLTSUB | fpNice | FpSleep
FPE_FLTUND | FpOpen | FpStat
FPE_INTDIV | FpOpendir | fpSymlink
FPE_INTOVF | FpPause | fptime
FpExecv | FpPipe | FpTimes
FpExecve | FpPoll | FpUmask
FpExit | FppRead | FpUname
FpFcntl | FppWrite | FpUnlink
fpFD_CLR | FpRead | FpUtime
fpfdfillset | FpReaddir | FpWait
fpFD_ISSET | fpReadLink | FpWaitPid
fpFD_SET | FpReadV | FpWrite
fpFD_ZERO | FpRename | FpWriteV
FpFork | FpRmdir | FreeShellArgV
FPFStat | fpSelect | F_SetFd
FpFtruncate | fpseterrno | F_SetFl
FpGetcwd | FpSetgid | F_SetLk
FpGetegid | fpSetPriority | F_SetLkW
FpGetEnv | FpSetRLimit | F_SetOwn
fpgeterrno | FpSetsid |

G

gid_t

I

ino_t iovec

K

kernel_gid_t | kernel_mode_t | kernel_uid_t
kernel_loff_t | kernel_off_t |

L

ln2bitmask ln2bitsinword

M

MAP_ANON | MAP_FIXED | MAP_SHARED
MAP_ANONYMOUS | MAP_GROWSDOWN | MAP_TYPE
MAP_DENYWRITE | MAP_LOCKED | mode_t
MAP_EXECUTABLE | MAP_NORESERVE |
MAP_FAILED | MAP_PRIVATE |

N

NAME_MAX nlink_t

O

O_APPEND | O_LARGEFILE | O_RDWR
O_CREAT | O_NDELAY | O_SYNC
O_DIRECT | O_NOCTTY | O_TRUNC
O_DIRECTORY | O_NOFOLLOW | O_WRONLY
O_EXCL | O_NONBLOCK |
off_t | O_RDONLY |

P

PATH_MAX | pcunsigned | PRIO_USER
PBlkCnt | pcushort | PRLimit
PBlkSize | pDev | PROT_EXEC
pcbool | pDir | PROT_NONE
pcchar | pDirent | PROT_READ
pcdouble | pFDSet | PROT_WRITE
pcfloat | pFilDes | psigactionrec
pcint | pfpstate | PSigContext
pcint16 | pGid | psiginfo
pcint32 | pGrpArr | psigset
pcint64 | pid_t | pSize
pcint8 | pIno | pSize_t
pClock | piovec | pSocklen
pclong | pMode | psSize
pclonglong | pnLink | PStat
pcschar | pOff | pstatfs
pcshort | POLLERR | pthread_cond_t
pcsigned | pollfd | pthread_mutex_t
pcsint | POLLHUP | pthread_t
pcsize_t | POLLIN | pTime
pcslong | POLLNVAL | ptimespec
pcslonglong | POLLOUT | ptime_t
pcsshort | POLLPRI | ptimeval
pcuchar | POLLRDBAND | ptimezone
pcuint | POLLRDNORM | PTms
pcuint16 | POLLWRBAND | Pucontext
pcuint32 | POLLWRNORM | pUid
pcuint64 | pPid | pUtimBuf
pcuint8 | ppollfd | PUtsName
pculong | PRIO_PGRP |
pculonglong | PRIO_PROCESS |

R

RLIMIT_AS | RLIMIT_LOCKS | RLIMIT_STACK
RLIMIT_CORE | RLIMIT_MEMLOCK | rlim_t
RLIMIT_CPU | RLIMIT_NOFILE | R_OK
RLIMIT_DATA | RLIMIT_NPROC |
RLIMIT_FSIZE | RLIMIT_RSS |

S

SA_INTERRUPT | SIG_DFL | SIG_UNBLOCK
SA_NOCLDSTOP | SIG_ERR | SIGUNUSED
SA_NOCLDWAIT | SIGFPE | SIGURG
SA_NODEFER | SIGHUP | SIGUSR1
SA_NOMASK | SIG_IGN | SIGUSR2
SA_ONESHOT | SIGILL | SIGVTALRM
SA_ONSTACK | SIGINT | SIGWINCH
SA_RESETHAND | SIGIO | SIGXCPU
SA_RESTART | SIGIOT | SIGXFSZ
SA_RESTORER | SIGKILL | SI_PAD_SIZE
SA_SIGINFO | SIG_MAXSIG | S_IRGRP
SEEK_CUR | signalhandler | S_IROTH
SEEK_END | signalhandler_t | S_IRUSR
SEEK_SET | SIGPIPE | S_IRWXG
S_IFBLK | SIGPOLL | S_IRWXO
S_IFCHR | SIGPROF | S_IRWXU
S_IFDIR | SIGPWR | S_IWGRP
S_IFIFO | SIGQUIT | S_IWOTH
S_IFLNK | sigrestorerhandler | S_IWUSR
S_IFMT | sigrestorerhandler_t | S_IXGRP
S_IFREG | SIGSEGV | S_IXOTH
S_IFSOCK | sigset | S_IXUSR
SIGABRT | SIG_SETMASK | size_t
sigactionhandler | sigset_t | socklen_t
sigactionhandler_t | SIGSTKFLT | ssize_t
sigactionrec | SIGSTOP | Stat
SIGALRM | SIGTERM | _STAT_VER
SIG_BLOCK | SIGTRAP | _STAT_VER_KERNEL
SIGBUS | SIGTSTP | _STAT_VER_LINUX
SIGCHLD | SIGTTIN | SYS_NMLN
SIGCONT | SIGTTOU |

T

TBlkCnt | TIno | tsigset
TBlkSize | TIOCtlRequest | TSize
TClock | tiovec | TSocklen
TDev | TMode | TsSize
TDir | tms | TStat
TDirent | TnLink | tstatfs
TFDSet | TOff | TTime
TFilDes | TPid | Ttimespec
tfpreg | tpollfd | TTimeVal
tfpstate | TRLimit | TTimeZone
TGid | tsigactionhandler | TTms
TGrpArr | tsigaltstack | TUcontext
timespec | TSigContext | TUid
time_t | tsiginfo | TUtimBuf
timeval | tsignalhandler | TUtsName
timezone | tsigrestorerhandler |

U

uid_t | UtsName | UTSNAME_LENGTH
UTimBuf | UTSNAME_DOMAIN_LENGTH | UTSNAME_NODENAME_LENGTH

W

wexitStatus | W_OK | wtermsig
wifexited | wordsinfdset | WUNTRACED
wifsignaled | wordsinsigset |
WNOHANG | wstopsig |

X

X_OK


ino_t

Inode type.

Declaration

Source position: aliasptp.inc line 28

type ino_t = UnixType.ino_t;


iovec

IO buffer structure

Declaration

Source position: ostypes.inc line 390

type iovec = record
iov_base: pointer; | Location of the buffer
iov_len: size_t; | Length of the buffer
end;

Description

iovec is used in fpreadv for IO to multiple buffers to describe a buffer location.

See also

fpreadv | Vector read: Read into multiple buffers
fpwritev | Vector write: Write from multiple buffers to a file descriptor


kernel_gid_t

Kernel group ID type

Declaration

Source position: ostypes.inc line 167

type kernel_gid_t = cuint;

Description

kernel_gid_t may differ from the libc type used to describe group IDs.

See also

kernel_mode_t | Kernel mode type
kernel_uid_t | Kernel user ID type


kernel_loff_t

Long kernel offset type

Declaration

Source position: ostypes.inc line 158

type kernel_loff_t = clonglong;


kernel_mode_t

Kernel mode type

Declaration

Source position: ostypes.inc line 165

type kernel_mode_t = cuint;

Description

kernel_mode_t may differ from the libc type used to describe file modes.

See also

kernel_uid_t | Kernel user ID type
kernel_gid_t | Kernel group ID type


kernel_off_t

Kernel offset type

Declaration

Source position: ostypes.inc line 157

type kernel_off_t = clong;


kernel_uid_t

Kernel user ID type

Declaration

Source position: ostypes.inc line 166

type kernel_uid_t = cuint;

Description

kernel_uid_t may differ from the libc type used to describe user IDs.

See also

kernel_mode_t | Kernel mode type
kernel_gid_t | Kernel group ID type


ln2bitmask

Last bit in word.

Declaration

Source position: ostypes.inc line 45

const ln2bitmask = 1 shl ln2bitsinword - 1;


ln2bitsinword

Power of 2 number of bits in word.

Declaration

Source position: ostypes.inc line 42

const ln2bitsinword = 6;


MAP_ANON

Anonymous memory mapping (data private to application)

Declaration

Source position: baseunix.pp line 63

const MAP_ANON = MAP_ANONYMOUS;


MAP_ANONYMOUS

FpMMap map type: Don't use a file

Declaration

Source position: ostypes.inc line 349

const MAP_ANONYMOUS = $20;


MAP_DENYWRITE

FpMMap option: Ignored.

Declaration

Source position: ostypes.inc line 351

const MAP_DENYWRITE = $800;


MAP_EXECUTABLE

FpMMap option: Ignored.

Declaration

Source position: ostypes.inc line 352

const MAP_EXECUTABLE = $1000;


MAP_FAILED

Memory mapping failed error code

Declaration

Source position: baseunix.pp line 55

const MAP_FAILED = pointer(- 1);


MAP_FIXED

FpMMap map type: Interpret addr exactly

Declaration

Source position: baseunix.pp line 59

const MAP_FIXED = $10;


MAP_GROWSDOWN

FpMMap option: Memory grows downward (like a stack)

Declaration

Source position: ostypes.inc line 350

const MAP_GROWSDOWN = $100;


MAP_LOCKED

FpMMap option: lock the pages in memory.

Declaration

Source position: ostypes.inc line 353

const MAP_LOCKED = $2000;


MAP_NORESERVE

FpMMap option: Do not reserve swap pages for this memory.

Declaration

Source position: ostypes.inc line 354

const MAP_NORESERVE = $4000;


MAP_PRIVATE

FpMMap map type: Changes are private

Declaration

Source position: baseunix.pp line 57

const MAP_PRIVATE = $2;


MAP_SHARED

FpMMap map type: Share changes

Declaration

Source position: baseunix.pp line 56

const MAP_SHARED = $1;


MAP_TYPE

FpMMap map type: Bitmask for type of mapping

Declaration

Source position: baseunix.pp line 58

const MAP_TYPE = $f;


mode_t

Inode mode type.

Declaration

Source position: aliasptp.inc line 31

type mode_t = UnixType.mode_t;


NAME_MAX

Maximum filename length.

Declaration

Source position: aliasptp.inc line 81

const NAME_MAX = UnixType.NAME_MAX;


nlink_t

Number of links type.

Declaration

Source position: aliasptp.inc line 34

type nlink_t = UnixType.nlink_t;


O_APPEND

fpOpen file open mode: Append to file

Declaration

Source position: ostypes.inc line 283

const O_APPEND = $400;


O_CREAT

fpOpen file open mode: Create if file does not yet exist.

Declaration

Source position: ostypes.inc line 279

const O_CREAT = $40;


O_DIRECT

fpOpen file open mode: Minimize caching effects

Declaration

Source position: ostypes.inc line 287

const O_DIRECT = $4000;


O_DIRECTORY

fpOpen file open mode: File must be directory.

Declaration

Source position: ostypes.inc line 288

const O_DIRECTORY = $10000;


O_EXCL

fpOpen file open mode: Open exclusively

Declaration

Source position: ostypes.inc line 280

const O_EXCL = $80;


O_LARGEFILE

fpOpen file open mode: Open for 64-bit I/O

Declaration

Source position: ostypes.inc line 303

const O_LARGEFILE = $8000;


O_NDELAY

fpOpen file open mode: Alias for O_NonBlock

Declaration

Source position: ostypes.inc line 285

const O_NDELAY = O_NONBLOCK;


O_NOCTTY

fpOpen file open mode: No TTY control.

Declaration

Source position: ostypes.inc line 281

const O_NOCTTY = $100;


O_NOFOLLOW

fpOpen file open mode: Fail if file is symbolic link.

Declaration

Source position: ostypes.inc line 289

const O_NOFOLLOW = $20000;


O_NONBLOCK

fpOpen file open mode: Open in non-blocking mode

Declaration

Source position: ostypes.inc line 284

const O_NONBLOCK = $800;


O_RDONLY

fpOpen file open mode: Read only

Declaration

Source position: ostypes.inc line 250

const O_RDONLY = 0;


O_RDWR

fpOpen file open mode: Read/Write

Declaration

Source position: ostypes.inc line 252

const O_RDWR = 2;


O_SYNC

fpOpen file open mode: Write to disc at once

Declaration

Source position: ostypes.inc line 286

const O_SYNC = $1000;


O_TRUNC

fpOpen file open mode: Truncate file to length 0

Declaration

Source position: ostypes.inc line 282

const O_TRUNC = $200;


O_WRONLY

fpOpen file open mode: Write only

Declaration

Source position: ostypes.inc line 251

const O_WRONLY = 1;


off_t

Offset type.

Declaration

Source position: aliasptp.inc line 37

type off_t = UnixType.off_t;


PATH_MAX

Maximum pathname length.

Declaration

Source position: aliasptp.inc line 82

const PATH_MAX = UnixType.PATH_MAX;


PBlkCnt

pointer to TBlkCnt type.

Declaration

Source position: ostypes.inc line 56

type PBlkCnt = ^Blkcnt_t;


PBlkSize

Pointer to TBlkSize type.

Declaration

Source position: ostypes.inc line 54

type PBlkSize = ^Blksize_t;


pcbool

Pointer to boolean type

Declaration

Source position: aliasctp.inc line 45

type pcbool = UnixType.pcbool;

Description

Pointer to boolean type cbool


pcchar

Alias for #rtl.UnixType.pcchar

Declaration

Source position: aliasctp.inc line 21

type pcchar = UnixType.pcchar;


pcdouble

Pointer to cdouble type.

Declaration

Source position: aliasctp.inc line 53

type pcdouble = UnixType.pcdouble;


pcfloat

Pointer to cfloat type.

Declaration

Source position: aliasctp.inc line 52

type pcfloat = UnixType.pcfloat;


pcint

Pointer to cInt type.

Declaration

Source position: aliasctp.inc line 33

type pcint = UnixType.pcint;


pcint8

Pointer to 8-bits signed integer type

Declaration

Source position: aliasctp.inc line 19

type pcint8 = UnixType.pcint8;


pcint16

Pointer to 16-bit signed integer type

Declaration

Source position: aliasctp.inc line 25

type pcint16 = UnixType.pcint16;


pcint32

Pointer to signed 32-bit integer type

Declaration

Source position: aliasctp.inc line 31

type pcint32 = UnixType.pcint32;


pcint64

Pointer to signed 64-bit integer type

Declaration

Source position: aliasctp.inc line 39

type pcint64 = UnixType.pcint64;


pClock

Pointer to TClock type.

Declaration

Source position: aliasptp.inc line 55

type pClock = UnixType.pClock;


pclong

Pointer to cLong type.

Declaration

Source position: aliasctp.inc line 47

type pclong = UnixType.pclong;


pclonglong

Pointer to longlong type.

Declaration

Source position: aliasctp.inc line 41

type pclonglong = UnixType.pclonglong;


pcschar

Pointer to signed character type

Declaration

Source position: aliasctp.inc line 22

type pcschar = UnixType.pcschar;

Description

Pointer to character type cschar.


pcshort

Pointer to cShort type.

Declaration

Source position: aliasctp.inc line 27

type pcshort = UnixType.pcshort;


pcsigned

Pointer to signed integer

Declaration

Source position: aliasctp.inc line 36

type pcsigned = UnixType.pcsigned;

Description

Pointer to signed integer type csigned.


pcsint

Pointer to signed integer

Declaration

Source position: aliasctp.inc line 34

type pcsint = UnixType.pcsint;

Description

Pointer to signed integer type csint


pcsize_t

Pointer to csize_t

Declaration

Source position: aliasctp.inc line 57

type pcsize_t = UnixType.psize_t;


pcslong

Pointer to signed long

Declaration

Source position: aliasctp.inc line 48

type pcslong = UnixType.pcslong;

Description

Pointer ot the signed long cslong


pcslonglong

Pointer to Signed longlong type

Declaration

Source position: aliasctp.inc line 42

type pcslonglong = UnixType.pcslonglong;

Description

Pointer to Signed longlong type cslonglong


pcsshort

Pointer to short signed integer type

Declaration

Source position: aliasctp.inc line 28

type pcsshort = UnixType.pcsshort;

Description

Pointer to short signed integer type csshort


pcuchar

Alias for #rtl.UnixType.pcuchar

Declaration

Source position: aliasctp.inc line 23

type pcuchar = UnixType.pcuchar;


pcuint

Pointer to cUInt type.

Declaration

Source position: aliasctp.inc line 35

type pcuint = UnixType.pcuint;


pcuint8

Pointer to 8-bits unsigned integer type

Declaration

Source position: aliasctp.inc line 20

type pcuint8 = UnixType.pcuint8;


pcuint16

Pointer to 16-bit unsigned integer type

Declaration

Source position: aliasctp.inc line 26

type pcuint16 = UnixType.pcuint16;


pcuint32

Pointer to unsigned 32-bit integer type

Declaration

Source position: aliasctp.inc line 32

type pcuint32 = UnixType.pcuint32;


pcuint64

Pointer to unsigned 64-bit integer type

Declaration

Source position: aliasctp.inc line 40

type pcuint64 = UnixType.pcuint64;


pculong

Pointer to cuLong type.

Declaration

Source position: aliasctp.inc line 49

type pculong = UnixType.pculong;


pculonglong

Unsigned longlong type

Declaration

Source position: aliasctp.inc line 43

type pculonglong = UnixType.pculonglong;


pcunsigned

Alias for #rtl.unixtype.pcunsigned

Declaration

Source position: aliasctp.inc line 37

type pcunsigned = UnixType.pcunsigned;


pcushort

Pointer to cuShort type.

Declaration

Source position: aliasctp.inc line 29

type pcushort = UnixType.pcushort;


pDev

Pointer to TDev type.

Declaration

Source position: aliasptp.inc line 23

type pDev = UnixType.pDev;


pDir

Pointer to TDir record

Declaration

Source position: ostypes.inc line 146

type pDir = ^Dir;


pDirent

Pointer to TDirent record.

Declaration

Source position: ostypes.inc line 118

type pDirent = ^Dirent;


pFDSet

Pointer to TFDSet type.

Declaration

Source position: ostypes.inc line 204

type pFDSet = ^TFDSet;


pFilDes

Pointer to TFilDes type.

Declaration

Source position: bunxh.inc line 19

type pFilDes = ^TFilDes;


pfpstate

Pointer to tfpstate record.

Declaration

Source position: sighndh.inc line 25

type pfpstate = ^tfpstate;


pGid

Pointer to TGid type.

Declaration

Source position: aliasptp.inc line 27

type pGid = UnixType.pGid;


pGrpArr

Pointer to TGrpArr array.

Declaration

Source position: bunxh.inc line 17

type pGrpArr = ^TGrpArr;


pid_t

Process ID type.

Declaration

Source position: aliasptp.inc line 40

type pid_t = UnixType.pid_t;


pIno

Pointer to TIno type.

Declaration

Source position: aliasptp.inc line 30

type pIno = UnixType.pIno;


piovec

pointer to a iovec record

Declaration

Source position: ostypes.inc line 395

type piovec = ^tiovec;


pMode

Pointer to TMode type.

Declaration

Source position: aliasptp.inc line 33

type pMode = UnixType.pMode;


pnLink

Pointer to TnLink type.

Declaration

Source position: aliasptp.inc line 36

type pnLink = UnixType.pnLink;


pOff

Pointer to TOff type.

Declaration

Source position: aliasptp.inc line 39

type pOff = UnixType.pOff;


POLLERR

Error condition on output file descriptor

Declaration

Source position: ostypes.inc line 216

const POLLERR = $0008;


pollfd

Poll structure

Declaration

Source position: ostypes.inc line 227

type pollfd = record
fd: cint; | File descriptor
events: cshort; | Events to look for
revents: cshort; | Returned events
end;

Description

pollfd is used in the fpPoll call to describe the various actions.

See also

fpPoll

Poll a file descriptor for events.


POLLHUP

Hang up

Declaration

Source position: ostypes.inc line 217

const POLLHUP = $0010;


POLLIN

Data is available for reading

Declaration

Source position: ostypes.inc line 213

const POLLIN = $0001;


POLLNVAL

Invalid request, file descriptor not open.

Declaration

Source position: ostypes.inc line 218

const POLLNVAL = $0020;


POLLOUT

Writing data will not block the write call

Declaration

Source position: ostypes.inc line 215

const POLLOUT = $0004;


POLLPRI

Urgent data is available for reading.

Declaration

Source position: ostypes.inc line 214

const POLLPRI = $0002;


POLLRDBAND

Priority data ready for reading.

Declaration

Source position: ostypes.inc line 222

const POLLRDBAND = $0080;


POLLRDNORM

Same as POLLIN.

Declaration

Source position: ostypes.inc line 221

const POLLRDNORM = $0040;


POLLWRBAND

Priority data my be written.

Declaration

Source position: ostypes.inc line 224

const POLLWRBAND = $0200;


POLLWRNORM

Equivalent to POLLOUT.

Declaration

Source position: ostypes.inc line 223

const POLLWRNORM = $0100;


pPid

Pointer to TPid type.

Declaration

Source position: aliasptp.inc line 42

type pPid = UnixType.pPid;


ppollfd

Pointer to tpollfd.

Declaration

Source position: ostypes.inc line 233

type ppollfd = ^pollfd;


PRIO_PGRP

Easy access alias for unixtype.PRIO_PGRP

Declaration

Source position: aliasptp.inc line 88

const PRIO_PGRP = UnixType.PRIO_PGRP;


PRIO_PROCESS

Easy access alias for unixtype.PRIO_PROCESS

Declaration

Source position: aliasptp.inc line 87

const PRIO_PROCESS = UnixType.PRIO_PROCESS;


PRIO_USER

Easy access alias for unixtype.PRIO_USER

Declaration

Source position: aliasptp.inc line 89

const PRIO_USER = UnixType.PRIO_USER;


PRLimit

Pointer to TRLimit record

Declaration

Source position: ostypes.inc line 384

type PRLimit = ^TRLimit;


PROT_EXEC

FpMMap memory access: page can be executed

Declaration

Source position: baseunix.pp line 67

const PROT_EXEC = $4;


PROT_NONE

FpMMap memory access: page can not be accessed

Declaration

Source position: baseunix.pp line 68

const PROT_NONE = $0;


PROT_READ

FpMMap memory access: page can be read

Declaration

Source position: baseunix.pp line 65

const PROT_READ = $1;


PROT_WRITE

FpMMap memory access: page can be written

Declaration

Source position: baseunix.pp line 66

const PROT_WRITE = $2;


psigactionrec

Pointer to SigActionRec record type.

Declaration

Source position: signal.inc line 234

type psigactionrec = ^sigactionrec;


PSigContext

Pointer to #rtl.baseunix.TSigContext record type.

Declaration

Source position: sighndh.inc line 32

type PSigContext = ^TSigContext;


psiginfo

Pointer to #rtl.baseunix.TSigInfo record type.

Declaration

Source position: signal.inc line 176

type psiginfo = ^tsiginfo;


psigset

Pointer to SigSet type.

Declaration

Source position: signal.inc line 174

type psigset = ^tsigset;


pSize

Pointer to TSize type.

Declaration

Source position: aliasptp.inc line 45

type pSize = UnixType.pSize;


pSize_t

Pointer to Size_t

Declaration

Source position: aliasptp.inc line 46

type pSize_t = UnixType.pSize_t;


pSocklen

Pointer to TSockLen type.

Declaration

Source position: aliasptp.inc line 63

type pSocklen = UnixType.pSocklen;


psSize

Pointer to TsSize type

Declaration

Source position: aliasptp.inc line 49

type psSize = UnixType.psSize;


PStat

Pointer to TStat type.

Declaration

Source position: ostypes.inc line 94

type PStat = ^Stat;


pstatfs

Pointer to statfs type

Declaration

Source position: aliasptp.inc line 77

type pstatfs = UnixType.PStatFs;

Description

This is an alias for the type defined in the #rtl.unixtype unit.

See also

#rtl.unixtype.tstatfs | Record describing a file system in the unix.fpstatfs call.
#rtl.ctypes | Common C type definitions


pthread_cond_t

Thread conditional variable type.

Declaration

Source position: aliasptp.inc line 73

type pthread_cond_t = UnixType.pthread_cond_t;


pthread_mutex_t

Thread mutex type.

Declaration

Source position: aliasptp.inc line 72

type pthread_mutex_t = UnixType.pthread_mutex_t;


pthread_t

Posix thread type.

Declaration

Source position: aliasptp.inc line 74

type pthread_t = UnixType.pthread_t;


pTime

Pointer to TTime type.

Declaration

Source position: aliasptp.inc line 58

type pTime = UnixType.pTime;


ptime_t

Pointer to time_t type.

Declaration

Source position: aliasptp.inc line 59

type ptime_t = UnixType.ptime_t;


ptimespec

Pointer to timespec type.

Declaration

Source position: aliasptp.inc line 69

type ptimespec = UnixType.ptimespec;


ptimeval

Pointer to timeval type.

Declaration

Source position: aliasptp.inc line 66

type ptimeval = UnixType.ptimeval;


ptimezone

Pointer to TimeZone record.

Declaration

Source position: ostypes.inc line 209

type ptimezone = ^timezone;


PTms

Pointer to TTms type.

Declaration

Source position: ostypes.inc line 201

type PTms = ^tms;


Pucontext

Pointer to TUContext type.

Declaration

Source position: sighndh.inc line 64

type Pucontext = ^Tucontext;


pUid

Pointer to TUid type.

Declaration

Source position: aliasptp.inc line 52

type pUid = UnixType.pUid;


pUtimBuf

Pointer to TUTimBuf type.

Declaration

Source position: ostypes.inc line 155

type pUtimBuf = ^UTimBuf;


PUtsName

Pointer to TUtsName type.

Declaration

Source position: ostypes.inc line 70

type PUtsName = ^TUtsName;


R_OK

fpAccess call test: read allowed

Declaration

Source position: ostypes.inc line 241

const R_OK = 4;


rlim_t

TRLimit record field type

Declaration

Source position: ostypes.inc line 383

type rlim_t = culong;

Description

rlim_t is used as the type for the various fields in the TRLimit record.

See also

TRLimit

Structure to return RLimit data in.


RLIMIT_AS

RLimit request address space limit

Declaration

Source position: ostypes.inc line 379

const RLIMIT_AS = 9;


RLIMIT_CORE

RLimit request max core file size

Declaration

Source position: ostypes.inc line 374

const RLIMIT_CORE = 4;


RLIMIT_CPU

RLimit request CPU time in ms

Declaration

Source position: ostypes.inc line 370

const RLIMIT_CPU = 0;


RLIMIT_DATA

RLimit request max data size

Declaration

Source position: ostypes.inc line 372

const RLIMIT_DATA = 2;


RLIMIT_FSIZE

Rlimit request maximum filesize

Declaration

Source position: ostypes.inc line 371

const RLIMIT_FSIZE = 1;


RLIMIT_LOCKS

RLimit request maximum file locks held

Declaration

Source position: ostypes.inc line 380

const RLIMIT_LOCKS = 10;


RLIMIT_MEMLOCK

RLimit request max locked-in-memory address space

Declaration

Source position: ostypes.inc line 378

const RLIMIT_MEMLOCK = 8;


RLIMIT_NOFILE

RLimit request max number of open files

Declaration

Source position: ostypes.inc line 377

const RLIMIT_NOFILE = 7;


RLIMIT_NPROC

RLimit request max number of processes

Declaration

Source position: ostypes.inc line 376

const RLIMIT_NPROC = 6;


RLIMIT_RSS

RLimit request max resident set size

Declaration

Source position: ostypes.inc line 375

const RLIMIT_RSS = 5;


RLIMIT_STACK

RLimit request max stack size

Declaration

Source position: ostypes.inc line 373

const RLIMIT_STACK = 3;


S_IFBLK

File (#rtl.baseunix.stat record) mode: Block device

Declaration

Source position: ostypes.inc line 331

const S_IFBLK = 24576;


S_IFCHR

File (#rtl.baseunix.stat record) mode: Character device

Declaration

Source position: ostypes.inc line 329

const S_IFCHR = 8192;


S_IFDIR

File (#rtl.baseunix.stat record) mode: Directory

Declaration

Source position: ostypes.inc line 330

const S_IFDIR = 16384;


S_IFIFO

File (#rtl.baseunix.stat record) mode: FIFO

Declaration

Source position: ostypes.inc line 328

const S_IFIFO = 4096;


S_IFLNK

File (#rtl.baseunix.stat record) mode: Link

Declaration

Source position: ostypes.inc line 333

const S_IFLNK = 40960;


S_IFMT

File (#rtl.baseunix.stat record) mode: File type bit mask

Declaration

Source position: ostypes.inc line 327

const S_IFMT = 61440;


S_IFREG

File (#rtl.baseunix.stat record) mode: Regular file

Declaration

Source position: ostypes.inc line 332

const S_IFREG = 32768;


S_IFSOCK

File (#rtl.baseunix.stat record) mode: Socket

Declaration

Source position: ostypes.inc line 334

const S_IFSOCK = 49152;


S_IRGRP

Mode flag: Read by group.

Declaration

Source position: ostypes.inc line 312

const S_IRGRP = %0000100000;


S_IROTH

Mode flag: Read by others.

Declaration

Source position: ostypes.inc line 315

const S_IROTH = %0000000100;


S_IRUSR

Mode flag: Read by owner.

Declaration

Source position: ostypes.inc line 309

const S_IRUSR = %0100000000;


S_IRWXG

Mode flag: Read, write, execute by groups.

Declaration

Source position: ostypes.inc line 319

const S_IRWXG = S_IRGRP or S_IWGRP or S_IXGRP;


S_IRWXO

Mode flag: Read, write, execute by others.

Declaration

Source position: ostypes.inc line 320

const S_IRWXO = S_IROTH or S_IWOTH or S_IXOTH;


S_IRWXU

Mode flag: Read, write, execute by user.

Declaration

Source position: ostypes.inc line 318

const S_IRWXU = S_IRUSR or S_IWUSR or S_IXUSR;


S_IWGRP

Mode flag: Write by group.

Declaration

Source position: ostypes.inc line 313

const S_IWGRP = %0000010000;


S_IWOTH

Mode flag: Write by others.

Declaration

Source position: ostypes.inc line 316

const S_IWOTH = %0000000010;


S_IWUSR

Mode flag: Write by owner.

Declaration

Source position: ostypes.inc line 310

const S_IWUSR = %0010000000;


S_IXGRP

Mode flag: Execute by group.

Declaration

Source position: ostypes.inc line 314

const S_IXGRP = %0000001000;


S_IXOTH

Mode flag: Execute by others.

Declaration

Source position: ostypes.inc line 317

const S_IXOTH = %0000000001;


S_IXUSR

Mode flag: Execute by owner.

Declaration

Source position: ostypes.inc line 311

const S_IXUSR = %0001000000;


SA_INTERRUPT

Sigaction options: ?

Declaration

Source position: signal.inc line 49

const SA_INTERRUPT = $20000000;


SA_NOCLDSTOP

Sigaction options: Do not receive notification when child processes stop

Declaration

Source position: signal.inc line 39

const SA_NOCLDSTOP = 1;


SA_NOCLDWAIT

Sigaction options: ?

Declaration

Source position: signal.inc line 40

const SA_NOCLDWAIT = 2;


SA_NODEFER

Sigaction options: Do not mask signal in its own signal handler

Declaration

Source position: signal.inc line 50

const SA_NODEFER = $40000000;


SA_NOMASK

Sigaction options: Do not prevent the signal from being received when it is handled.

Declaration

Source position: signal.inc line 53

const SA_NOMASK = SA_NODEFER;


SA_ONESHOT

Sigaction options: Restore the signal action to the default state.

Declaration

Source position: signal.inc line 54

const SA_ONESHOT = SA_RESETHAND;


SA_ONSTACK

Call the signal handler on an alternate signal stack

Declaration

Source position: signal.inc line 47

const SA_ONSTACK = $08000000;

Description

SA_ONSTACK is used in the fpsigaction to indicate the signal handler must be called on an alternate signal stack provided by sigaltstack(2) If an alternate stack is not available, the default stack will be used.

See also

fpsigaction

Install signal handler


SA_RESETHAND

Sigaction options: Restore signal action to default state when signal handler exits.

Declaration

Source position: signal.inc line 51

const SA_RESETHAND = $80000000;


SA_RESTART

Sigaction options: Provide behaviour compatible with BSD signal semantics

Declaration

Source position: signal.inc line 48

const SA_RESTART = $10000000;


SA_RESTORER

Signal restorer handler

Declaration

Source position: signal.inc line 46

const SA_RESTORER = $04000000;


SA_SIGINFO

Sigaction options: The signal handler takes 3 arguments, not one.

Declaration

Source position: signal.inc line 41

const SA_SIGINFO = 4;


SEEK_CUR

fpLSeek option: Set position relative to current position.

Declaration

Source position: ostypes.inc line 246

const SEEK_CUR = 1;


SEEK_END

fpLSeek option: Set position relative to end of file.

Declaration

Source position: ostypes.inc line 247

const SEEK_END = 2;


SEEK_SET

fpLSeek option: Set absolute position.

Declaration

Source position: ostypes.inc line 245

const SEEK_SET = 0;


SI_PAD_SIZE

Signal information pad size.

Declaration

Source position: signal.inc line 168

const SI_PAD_SIZE = 128 div sizeof(longint) - 3;


SIG_BLOCK

Sigprocmask flags: Add signals to the set of blocked signals.

Declaration

Source position: signal.inc line 42

const SIG_BLOCK = 0;


SIG_DFL

Signal handler: Default signal handler

Declaration

Source position: signal.inc line 58

const SIG_DFL = 0;


SIG_ERR

Signal handler: error

Declaration

Source position: signal.inc line 60

const SIG_ERR = - 1;


SIG_IGN

Signal handler: Ignore signal

Declaration

Source position: signal.inc line 59

const SIG_IGN = 1;


SIG_MAXSIG

Maximum system signal number.

Declaration

Source position: aliasptp.inc line 84

const SIG_MAXSIG = UnixType.SIG_MAXSIG;


SIG_SETMASK

Sigprocmask flags: Set of blocked signals is given.

Declaration

Source position: signal.inc line 44

const SIG_SETMASK = 2;


SIG_UNBLOCK

Sigprocmask flags: Remove signals from the set set of blocked signals.

Declaration

Source position: signal.inc line 43

const SIG_UNBLOCK = 1;


SIGABRT

Signal: ABRT (Abort)

Declaration

Source position: signal.inc line 103

const SIGABRT = 6;


sigactionhandler

Callback prototype for a #rtl.baseunix.SigActionRec record.

Declaration

Source position: signal.inc line 228

type sigactionhandler = sigactionhandler_t;

Description

When installing a signal handler, the actual signal handler must be of type SigActionHandler.


sigactionhandler_t

Standard signal action handler prototype

Declaration

Source position: signal.inc line 224

type sigactionhandler_t = procedure(

  signal: LongInt;

  info: psiginfo;

  context: PSigContext

);


sigactionrec

Record used in fpSigAction call.

Declaration

Source position: signal.inc line 253

type sigactionrec = record
sa_handler: sigactionhandler_t; | Funcion called when signal is triggered.
sa_flags: culong; | Flags for SigAction
sa_restorer: sigrestorerhandler_t; | Obsolete, don't use
sa_mask: sigset_t; | Signal mask.
end;


SIGALRM

Signal: ALRM (Alarm clock)

Declaration

Source position: signal.inc line 109

const SIGALRM = 14;


SIGBUS

Signal: BUS (bus error)

Declaration

Source position: signal.inc line 133

const SIGBUS = 7;


SIGCHLD

Signal: CHLD (child status changed)

Declaration

Source position: signal.inc line 137

const SIGCHLD = 17;


SIGCONT

Signal: CONT (Continue)

Declaration

Source position: signal.inc line 138

const SIGCONT = 18;


SIGFPE

Signal: FPE (Floating point error)

Declaration

Source position: signal.inc line 105

const SIGFPE = 8;


SIGHUP

Signal: HUP (Hangup)

Declaration

Source position: signal.inc line 98

const SIGHUP = 1;


SIGILL

Signal: ILL (Illegal instruction)

Declaration

Source position: signal.inc line 101

const SIGILL = 4;


SIGINT

Signal: INT (Interrupt)

Declaration

Source position: signal.inc line 99

const SIGINT = 2;


SIGIO

Signal: IO (I/O operation possible)

Declaration

Source position: signal.inc line 149

const SIGIO = 29;


SIGIOT

Signal: IOT (IOT trap)

Declaration

Source position: signal.inc line 104

const SIGIOT = 6;


SIGKILL

Signal: KILL (unblockable)

Declaration

Source position: signal.inc line 106

const SIGKILL = 9;


signalhandler

Simple signal handler prototype

Declaration

Source position: signal.inc line 227

type signalhandler = signalhandler_t;


signalhandler_t

Standard signal handler prototype

Declaration

Source position: signal.inc line 223

type signalhandler_t = procedure(

  signal: LongInt

);


SIGPIPE

Signal: PIPE (Broken pipe

Declaration

Source position: signal.inc line 108

const SIGPIPE = 13;


SIGPOLL

Signal: POLL (Pollable event)

Declaration

Source position: signal.inc line 150

const SIGPOLL = SIGIO;


SIGPROF

Signal: PROF (Profiling alarm)

Declaration

Source position: signal.inc line 147

const SIGPROF = 27;


SIGPWR

Signal: PWR (power failure restart)

Declaration

Source position: signal.inc line 151

const SIGPWR = 30;


SIGQUIT

Signal: QUIT

Declaration

Source position: signal.inc line 100

const SIGQUIT = 3;


sigrestorerhandler

Alias for sigrestorerhandler_t type.

Declaration

Source position: signal.inc line 229

type sigrestorerhandler = sigrestorerhandler_t;


sigrestorerhandler_t

Standard signal action restorer prototype

Declaration

Source position: signal.inc line 225

type sigrestorerhandler_t = procedure;


SIGSEGV

Signal: SEGV (Segmentation violation)

Declaration

Source position: signal.inc line 107

const SIGSEGV = 11;


sigset

Signal set type

Declaration

Source position: signal.inc line 173

type sigset = sigset_t;


sigset_t

Signal set type

Declaration

Source position: signal.inc line 171

type sigset_t = array [0..wordsinsigset-1] of culong;


SIGSTKFLT

Signal: STKFLT (Stack Fault)

Declaration

Source position: signal.inc line 136

const SIGSTKFLT = 16;


SIGSTOP

Signal: STOP (Stop, unblockable)

Declaration

Source position: signal.inc line 139

const SIGSTOP = 19;


SIGTERM

Signal: TERM (Terminate)

Declaration

Source position: signal.inc line 110

const SIGTERM = 15;


SIGTRAP

Signal: TRAP (Trace trap)

Declaration

Source position: signal.inc line 102

const SIGTRAP = 5;


SIGTSTP

Signal: TSTP (keyboard stop)

Declaration

Source position: signal.inc line 140

const SIGTSTP = 20;


SIGTTIN

Signal: TTIN (Terminal input, background)

Declaration

Source position: signal.inc line 141

const SIGTTIN = 21;


SIGTTOU

Signal: TTOU (Terminal output, background)

Declaration

Source position: signal.inc line 142

const SIGTTOU = 22;


SIGUNUSED

Signal: Unused

Declaration

Source position: signal.inc line 152

const SIGUNUSED = 31;


SIGURG

Signal: URG (Socket urgent condition)

Declaration

Source position: signal.inc line 143

const SIGURG = 23;


SIGUSR1

Signal: USR1 (User-defined signal 1)

Declaration

Source position: signal.inc line 134

const SIGUSR1 = 10;


SIGUSR2

Signal: USR2 (User-defined signal 2)

Declaration

Source position: signal.inc line 135

const SIGUSR2 = 12;


SIGVTALRM

Signal: VTALRM (Virtual alarm clock)

Declaration

Source position: signal.inc line 146

const SIGVTALRM = 26;


SIGWINCH

Signal: WINCH (Window/Terminal size change)

Declaration

Source position: signal.inc line 148

const SIGWINCH = 28;


SIGXCPU

Signal: XCPU (CPU limit exceeded)

Declaration

Source position: signal.inc line 144

const SIGXCPU = 24;


SIGXFSZ

Signal: XFSZ (File size limit exceeded)

Declaration

Source position: signal.inc line 145

const SIGXFSZ = 25;


size_t

Size specification type.

Declaration

Source position: aliasptp.inc line 43

type size_t = UnixType.size_t;


socklen_t

Socket address length type.

Declaration

Source position: aliasptp.inc line 61

type socklen_t = UnixType.socklen_t;


ssize_t

Small size type.

Declaration

Source position: aliasptp.inc line 47

type ssize_t = UnixType.ssize_t;


Stat

Record describing an inode (file) in the FPFstat call.

Declaration

Source position: stat.inc line 17

type Stat = packed record
case Byte of
0: (
dev: QWord; | Device number
__pad0: array [0..3] of Byte; | Pad bytes, do not use
__ino: Cardinal; | Inode number
mode: Cardinal; | File mode
nlink: Cardinal; | Number of links to file.
uid: Cardinal; | File owner UID
gid: Cardinal; | File owner GID
rdev: QWord; |
__pad3: array [0..3] of Byte; | Pad bytes, do not use
size: QWord; | File size
blksize: Cardinal; | Block size
blocks: QWord; | Number of blocks used
atime: Cardinal; | Last access time
atime_nsec: Cardinal; | Last access time, nano seconds part
mtime: Cardinal; | Last modification time.
mtime_nsec: Cardinal; | Last modification time, nano seconds part
ctime: Cardinal; | Creation time
ctime_nsec: Cardinal; | Creation time, nano seconds part
ino: QWord; | Inode number of file
);
1: (
st_dev: QWord; | Device number
__pad0_: array [0..3] of Byte; | Alignment padding.
__st_ino_: Cardinal; | Inode number
st_mode: Cardinal; | File mode
st_nlink: Cardinal; | Number of hard links
st_uid: Cardinal; | File owner User ID
st_gid: Cardinal; | File owner group ID
st_rdev: QWord; | ??
__pad3_: array [0..3] of Byte; | Alignment padding.
st_size: QWord; | File size in bytes
st_blksize: Cardinal; | Block size
st_blocks: QWord; | Number of blocks
st_atime: Cardinal; | Last file access time
st_atime_nsec: Cardinal; | Access time with nanosecond precision
st_mtime: Cardinal; | Last file modification time
st_mtime_nsec: Cardinal; | Modification time with nanosecond precision
st_ctime: Cardinal; | File creation time
st_ctime_nsec: Cardinal; | Create time with nanosecond precision
st_ino: QWord; | Inode number
);
end;


SYS_NMLN

Max system name length.

Declaration

Source position: aliasptp.inc line 83

const SYS_NMLN = UnixType.SYS_NMLN;


TBlkCnt

Alias for Blkcnt_t type.

Declaration

Source position: ostypes.inc line 55

type TBlkCnt = Blkcnt_t;


TBlkSize

Alias for blksize_t type.

Declaration

Source position: ostypes.inc line 53

type TBlkSize = Blksize_t;


TClock

Alias for clock_t type.

Declaration

Source position: aliasptp.inc line 54

type TClock = UnixType.TClock;


TDev

Alias for dev_t type.

Declaration

Source position: aliasptp.inc line 22

type TDev = UnixType.TDev;


TDir

Alias for Dir type.

Declaration

Source position: ostypes.inc line 145

type TDir = Dir;


TDirent

Alias for Dirent type.

Declaration

Source position: ostypes.inc line 117

type TDirent = Dirent;


TFDSet

File descriptor set for fpSelect call.

Declaration

Source position: ostypes.inc line 203

type TFDSet = array [0..(FD_MAXFDSETdivBITSINWORD)-1] of culong;


TFilDes

Array of file descriptors as used in fpPipe call.

Declaration

Source position: bunxh.inc line 18

type TFilDes = array [0..1] of cint;


tfpreg

Record describing floating point register in signal handler.

Declaration

Source position: sighndh.inc line 20

type tfpreg = record
significand: array [0..3] of Word; | Decimal part of floating point value
exponent: Word; | Exponent of floating point value
end;


tfpstate

Record describing floating point unit in signal handler.

Declaration

Source position: sighndh.inc line 26

type tfpstate = record

  cw: Cardinal;

  sw: Cardinal;

  tag: Cardinal;

  ipoff: Cardinal;

  cssel: Cardinal;

  dataoff: Cardinal;

  datasel: Cardinal;

  st: array [0..7] of tfpreg;

  status: Cardinal;

end;


TGid

Alias for gid_t type.

Declaration

Source position: aliasptp.inc line 25

type TGid = UnixType.TGid;


TGrpArr

Array of gid_t IDs

Declaration

Source position: bunxh.inc line 16

type TGrpArr = array [0..0] of TGid;


time_t

Time span type

Declaration

Source position: aliasptp.inc line 56

type time_t = UnixType.time_t;


timespec

Short time specification type.

Declaration

Source position: aliasptp.inc line 68

type timespec = UnixType.timespec;


timeval

Time specification type.

Declaration

Source position: aliasptp.inc line 65

type timeval = UnixType.timeval;


timezone

Record describing a timezone

Declaration

Source position: ostypes.inc line 206

type timezone = record
tz_minuteswest: cint; | Minutes west of GMT
tz_dsttime: cint; | Uses Daylight Savings Time
end;


TIno

Alias for ino_t type.

Declaration

Source position: aliasptp.inc line 29

type TIno = UnixType.TIno;


TIOCtlRequest

Easy access alias for unixtype.TIOCtlRequest

Declaration

Source position: aliasptp.inc line 26

type TIOCtlRequest = UnixType.TIOCtlRequest;


tiovec

Alias for the iovec record type.

Declaration

Source position: ostypes.inc line 394

type tiovec = iovec;


TMode

Alias for mode_t type.

Declaration

Source position: aliasptp.inc line 32

type TMode = UnixType.TMode;


tms

Record containing timings for fpTimes call.

Declaration

Source position: ostypes.inc line 194

type tms = record
tms_utime: clock_t; | User time.
tms_stime: clock_t; | System time.
tms_cutime: clock_t; | Children's user time.
tms_cstime: clock_t; | Children's system time.
end;


TnLink

Alias for nlink_t type.

Declaration

Source position: aliasptp.inc line 35

type TnLink = UnixType.TnLink;


TOff

Alias for off_t type.

Declaration

Source position: aliasptp.inc line 38

type TOff = UnixType.TOff;


TPid

Alias for pid_t type.

Declaration

Source position: aliasptp.inc line 41

type TPid = UnixType.TPid;


tpollfd

Alias for pollfd type

Declaration

Source position: ostypes.inc line 232

type tpollfd = pollfd;


TRLimit

Structure to return RLimit data in.

Declaration

Source position: ostypes.inc line 385

type TRLimit = record
rlim_cur: rlim_t; | Current value of the resource.
rlim_max: rlim_t; | Maximum value for the resource
end;

Description

TRLimit is the structure used by the kernel to return resource limit information in.


tsigactionhandler

Alias for sigactionhandler_t type.

Declaration

Source position: signal.inc line 231

type tsigactionhandler = sigactionhandler_t;


tsigaltstack

Provide the location of an alternate signal handler stack.

Declaration

Source position: sighndh.inc line 58

type tsigaltstack = record
ss_sp: pointer; | Stack pointer
ss_flags: LongInt; | Flags
ss_size: LongInt; | Size of the alternate stack
end;


TSigContext

Record describing the CPU context when a signal occurs.

Declaration

Source position: sighndh.inc line 33

type TSigContext = record
gs: Word; | GS register (intel)
__gsh: Word; | __gsh register (intel)
fs: Word; | fs register (intel)
__fsh: Word; | __fsh register (intel)
es: Word; | es register (intel)
__esh: Word; | __esh register (intel)
ds: Word; | ds register (intel)
__dsh: Word; | __dsh register (intel)
edi: Cardinal; | edi register (intel)
esi: Cardinal; | esi register (intel)
ebp: Cardinal; | dbp register (intel)
esp: Cardinal; | esp register (intel)
ebx: Cardinal; | ebx register (intel)
edx: Cardinal; | edx register (intel)
ecx: Cardinal; | ecx register (intel)
eax: Cardinal; | eax register (intel)
trapno: Cardinal; | trapno register (intel)
err: Cardinal; | err register (intel)
eip: Cardinal; | eip register (intel)
cs: Word; | cs register (intel)
__csh: Word; | __csh register (intel)
eflags: Cardinal; | eflags register (intel)
esp_at_signal: Cardinal; | esp register at signal (intel)
ss: Word; | ss register (intel)
__ssh: Word; | __ssh register (intel)
fpstate: pfpstate; | fpstate (intel)
oldmask: Cardinal; | Old signal mask
cr2: Cardinal; | cr register (intel)
end;

Description

This type is CPU dependent. Cross-platform code should not use the contents of this record.


tsiginfo

Record describing the signal when a signal occurs.

Declaration

Source position: signal.inc line 177

type tsiginfo = record
si_signo: LongInt; | Signal number
si_errno: LongInt; | Error code
si_code: LongInt; | Extra code (?)
_sifields: record | Extra signal information fields
case LongInt of
0: (
_pad: array [0..(SI_PAD_SIZE)-1] of LongInt; | Unused
);
1: (
_kill: record | Kill signal info
_pid: pid_t; | Process ID of sending process
_uid: uid_t; | User ID of sending process
end;
);
2: (
_timer: record | Timer info
_timer1: DWord; | Timer info part 1
_timer2: DWord; | Timer info part 2
end;
);
3: (
_rt: record | Realtime signal
_pid: pid_t; | Process ID
_uid: uid_t; | User ID
_sigval: pointer; | Signal value
end;
);
4: (
_sigchld: record | SIGCHILD info
_pid: pid_t; | Process ID
_uid: uid_t; | User ID
_status: LongInt; | Exit status
_utime: clock_t; | User time used by process
_stime: clock_t; | System time used by process
end;
);
5: (
_sigfault: record | SIGSEGV info
_addr: pointer; | Address at which SEGV occurred
end;
);
6: (
_sigpoll: record | SIGPOLL info
_band: LongInt; | Band (?)
_fd: LongInt; | File descriptor
end;
);
end;
end;

Description

This type describes the signal that occurred.


tsignalhandler

Alias for signalhandler_t type.

Declaration

Source position: signal.inc line 230

type tsignalhandler = signalhandler_t;


tsigrestorerhandler

Alias for sigrestorerhandler_t type.

Declaration

Source position: signal.inc line 232

type tsigrestorerhandler = sigrestorerhandler_t;


tsigset

Alias for SigSet type.

Declaration

Source position: signal.inc line 172

type tsigset = sigset_t;


TSize

Alias for size_t type

Declaration

Source position: aliasptp.inc line 44

type TSize = UnixType.TSize;


TSocklen

Alias for socklen_t type.

Declaration

Source position: aliasptp.inc line 62

type TSocklen = UnixType.TSocklen;


TsSize

Alias for ssize_t type

Declaration

Source position: aliasptp.inc line 48

type TsSize = UnixType.TsSize;


TStat

Alias for Stat type.

Declaration

Source position: ostypes.inc line 93

type TStat = Stat;


tstatfs

Record describing a file system in the unix.fpstatfs call.

Declaration

Source position: aliasptp.inc line 76

type tstatfs = UnixType.TStatFs;


TTime

Alias for TTime type.

Declaration

Source position: aliasptp.inc line 57

type TTime = UnixType.TTime;


Ttimespec

Alias for TimeSpec type.

Declaration

Source position: aliasptp.inc line 70

type Ttimespec = UnixType.Ttimespec;


TTimeVal

Alias for timeval type.

Declaration

Source position: aliasptp.inc line 67

type TTimeVal = UnixType.TTimeVal;


TTimeZone

Alias for TimeZone record.

Declaration

Source position: ostypes.inc line 210

type TTimeZone = timezone;


TTms

Alias for Tms record type.

Declaration

Source position: ostypes.inc line 200

type TTms = tms;


TUcontext

Context description record

Declaration

Source position: sighndh.inc line 65

type TUcontext = record
uc_flags: Cardinal; | Flags describing the context
uc_link: Pucontext; | Context that will be resumed when current context ends
uc_stack: tsigaltstack; | Stack used by this context
uc_mcontext: TSigContext; | Machine specific context representation of the context
uc_sigmask: tsigset; | Bitmask of masked signals in this context
end;

Description

This structure is used to describe the user context in a program or thread. It is not used in this unit, but is provided for completeness.


TUid

Alias for uid_t type.

Declaration

Source position: aliasptp.inc line 51

type TUid = UnixType.TUid;


TUtimBuf

Alias for UtimBuf type.

Declaration

Source position: ostypes.inc line 154

type TUtimBuf = UTimBuf;


TUtsName

Alias for UtsName type.

Declaration

Source position: ostypes.inc line 69

type TUtsName = UtsName;


uid_t

User ID type

Declaration

Source position: aliasptp.inc line 50

type uid_t = UnixType.uid_t;


UTimBuf

Record used in fpUtime to set file access and modification times.

Declaration

Source position: ostypes.inc line 149

type UTimBuf = record
actime: time_t; | Access time
modtime: time_t; | Modification time
end;


UtsName

Record used to return kernel information in fpUName function.

Declaration

Source position: ostypes.inc line 59

type UtsName = record
Sysname: array [0..UTSNAME_LENGTH-1] of Char; | System name
Nodename: array [0..UTSNAME_NODENAME_LENGTH-1] of Char; | Computer name
Release: array [0..UTSNAME_LENGTH-1] of Char; | Release number
Version: array [0..UTSNAME_LENGTH-1] of Char; | Version number
Machine: array [0..UTSNAME_LENGTH-1] of Char; | Machine type
Domain: array [0..UTSNAME_DOMAIN_LENGTH-1] of Char; | Domain name
end;

Description

The elements of this record are null-terminated C style strings, you cannot access them directly. Note that the Domain field is a GNU extension, and may not be available on all platforms.


UTSNAME_DOMAIN_LENGTH

Max length of utsname domain name.

Declaration

Source position: ostypes.inc line 31

const UTSNAME_DOMAIN_LENGTH = UTSNAME_LENGTH;


UTSNAME_LENGTH

Max length of utsname system name, release, version, machine.

Declaration

Source position: ostypes.inc line 28

const UTSNAME_LENGTH = SYS_NMLN;


UTSNAME_NODENAME_LENGTH

Max length of utsname node name.

Declaration

Source position: ostypes.inc line 29

const UTSNAME_NODENAME_LENGTH = UTSNAME_LENGTH;


W_OK

fpAccess call test: write allowed

Declaration

Source position: ostypes.inc line 242

const W_OK = 2;


WNOHANG

#rtl.baseunix.fpWaitpid option: Do not wait for processes to terminate.

Declaration

Source position: ostypes.inc line 323

const WNOHANG = 1;


wordsinfdset

Number of words in a TFDSet array

Declaration

Source position: ostypes.inc line 37

const wordsinfdset = FD_MAXFDSET div BITSINWORD;


wordsinsigset

Number of words in a signal set.

Declaration

Source position: ostypes.inc line 36

const wordsinsigset = SIG_MAXSIG div BITSINWORD;


WUNTRACED

#rtl.baseunix.fpWaitpid option: Also report children wich were stopped but not yet reported

Declaration

Source position: ostypes.inc line 324

const WUNTRACED = 2;


X_OK

fpAccess call test: execute allowed

Declaration

Source position: ostypes.inc line 243

const X_OK = 1;


Reference for unit 'character'

Unicode character classification and conversion

uses
System, | The system unit
unicodedata; | Unicode data management

Overview

The character unit contains the TCharacter class, which consists mainly of class functions. It should not be constructed, but its class methods can be used. All class methods also exist as regular methods.

Many routines depend on unicode collation data to be present in the binary (or distributed on disc with the application. This data can be loaded using the routines in the unicodedata unit.. The FPC project distributes some unicode collation data in .bco files which can be loaded using the LoadCollation routine from that unit.


Reference for unit 'character': Types

TCharacterOption | Character functions behaviour options
TCharacterOptions | Set of TCharacterOptions
TUnicodeCategory | Unicode code point (character) category
TUnicodeCategorySet | Set of TUnicodeCategory


Index of all identifiers in unit 'character'

C T U

C

coIgnoreInvalidSequence

T

TCharacterOption | TUnicodeCategory
TCharacterOptions | TUnicodeCategorySet

U

ucClosePunctuation | ucInitialPunctuation | ucOtherNumber
ucCombiningMark | ucLetterNumber | ucOtherPunctuation
ucConnectPunctuation | ucLineSeparator | ucOtherSymbol
ucControl | ucLowercaseLetter | ucParagraphSeparator
ucCurrencySymbol | ucMathSymbol | ucPrivateUse
ucDashPunctuation | ucModifierLetter | ucSpaceSeparator
ucDecimalNumber | ucModifierSymbol | ucSurrogate
ucEnclosingMark | ucNonSpacingMark | ucTitlecaseLetter
ucFinalPunctuation | ucOpenPunctuation | ucUnassigned
ucFormat | ucOtherLetter | ucUppercaseLetter


TCharacterOption

Character functions behaviour options

Declaration

Source position: character.pas line 73

type TCharacterOption = (

  coIgnoreInvalidSequence

Ignore invalid unicodecode sequences

);

Description

TCharacterOption is used in the toUpper and toLower functions to control the behaviour of the function.

See also

toUpper | Alias for TCharacter.ToUpper
toLower | Alias for TCharacter.ToLower
TCharacter.toUpper | Convert a character or string to uppercase
Tcharacter.toLower | Convert a character or string to lowercase


TCharacterOptions

Set of TCharacterOptions

Declaration

Source position: character.pas line 74

type TCharacterOptions = set of (

  coIgnoreInvalidSequence

Ignore invalid unicodecode sequences

);

Description

TCharacterOptions is the set of TCharacterOption, used in toUpper and toLower functions to control the behaviour of the function.

See also

toUpper | Alias for TCharacter.ToUpper
toLower | Alias for TCharacter.ToLower
TCharacter.toUpper | Convert a character or string to uppercase
Tcharacter.toLower | Convert a character or string to lowercase


TUnicodeCategory

Unicode code point (character) category

Declaration

Source position: character.pas line 33

type TUnicodeCategory = (
ucUppercaseLetter, | Letter, uppercase (Lu)
ucLowercaseLetter, | Letter, lowercase (Ll)
ucTitlecaseLetter, | Letter, titlecase (Lt)
ucModifierLetter, | Letter, modifier (Lm)
ucOtherLetter, | Letter, other (Lo)
ucNonSpacingMark, | Mark, nonspacing (Mn)
ucCombiningMark, | Mark, spacing combining (Mc)
ucEnclosingMark, | Mark, enclosing (Me)
ucDecimalNumber, | Number, decimal digit (Nd)
ucLetterNumber, | Number, letter (Nl)
ucOtherNumber, | Number, other (No)
ucConnectPunctuation, | Punctuation, connector (Pc)
ucDashPunctuation, | Punctuation, dash (Pd)
ucOpenPunctuation, | Punctuation, open (Ps)
ucClosePunctuation, | Punctuation, close (Pe)
ucInitialPunctuation, | Punctuation, initial quote (Pi, may behave like Ps or Pe depending on usage)
ucFinalPunctuation, | Punctuation, final quote (Pf, may behave like Ps or Pe depending on usage)
ucOtherPunctuation, | Punctuation, other (Po)
ucMathSymbol, | Symbol, math (Sm)
ucCurrencySymbol, | Symbol, currency (Sc)
ucModifierSymbol, | Symbol, modifier (Sk)
ucOtherSymbol, | Symbol, other (So)
ucSpaceSeparator, | Separator, space (Zs)
ucLineSeparator, | Separator, line (Zl)
ucParagraphSeparator, | Separator, paragraph (Zp)
ucControl, | Other, control (Cc)
ucFormat, | Other, format (Cf)
ucSurrogate, | Other, surrogate (Cs)
ucPrivateUse, | Other, private use (Co)
ucUnassigned | Other, not assigned (including noncharacters) (Cn)
);

Description

This enumeration type contains the characterization of all possible unicode characters. It is used in the GetUnicodeCategory and TCharacter.GetUnicodeCategory functions.

See also

GetUnicodeCategory | Alias for TCharacter.GetUnicodeCategory
TCharacter.GetUnicodeCategory | Get the unicode category of a character


TUnicodeCategorySet

Set of TUnicodeCategory

Declaration

Source position: character.pas line 71

type TUnicodeCategorySet = set of (
ucUppercaseLetter, | Letter, uppercase (Lu)
ucLowercaseLetter, | Letter, lowercase (Ll)
ucTitlecaseLetter, | Letter, titlecase (Lt)
ucModifierLetter, | Letter, modifier (Lm)
ucOtherLetter, | Letter, other (Lo)
ucNonSpacingMark, | Mark, nonspacing (Mn)
ucCombiningMark, | Mark, spacing combining (Mc)
ucEnclosingMark, | Mark, enclosing (Me)
ucDecimalNumber, | Number, decimal digit (Nd)
ucLetterNumber, | Number, letter (Nl)
ucOtherNumber, | Number, other (No)
ucConnectPunctuation, | Punctuation, connector (Pc)
ucDashPunctuation, | Punctuation, dash (Pd)
ucOpenPunctuation, | Punctuation, open (Ps)
ucClosePunctuation, | Punctuation, close (Pe)
ucInitialPunctuation, | Punctuation, initial quote (Pi, may behave like Ps or Pe depending on usage)
ucFinalPunctuation, | Punctuation, final quote (Pf, may behave like Ps or Pe depending on usage)
ucOtherPunctuation, | Punctuation, other (Po)
ucMathSymbol, | Symbol, math (Sm)
ucCurrencySymbol, | Symbol, currency (Sc)
ucModifierSymbol, | Symbol, modifier (Sk)
ucOtherSymbol, | Symbol, other (So)
ucSpaceSeparator, | Separator, space (Zs)
ucLineSeparator, | Separator, line (Zl)
ucParagraphSeparator, | Separator, paragraph (Zp)
ucControl, | Other, control (Cc)
ucFormat, | Other, format (Cf)
ucSurrogate, | Other, surrogate (Cs)
ucPrivateUse, | Other, private use (Co)
ucUnassigned | Other, not assigned (including noncharacters) (Cn)
);

Description

TUnicodeCategorySet is the set of TUnicodeCategory. It is used internally in the TCharacter class.

See also

TUnicodeCategory

Unicode code point (character) category


BINARY_MAPPING_FILE_EXT

Default extension of binary map file

Declaration

Source position: charset.pp line 65

const BINARY_MAPPING_FILE_EXT = '.bcm';

Description

BINARY_MAPPING_FILE_EXT contains the default extension of a file containing a binary-coded map.

See also

loadbinaryunicodemapping

Load binary single-byte codepage to unicode map from file or memory


Reference for unit 'charset'

Character set support

uses

  System;

The system unit

Overview

The charset unit can be used to load single-byte character set (code page) descriptions. It is used in the fpwidestring unit to add support for converting single-byte codepage strings to unicode strings (and vice versa).

Data of a code page may be included using one of the ready-made units, or can be loaded (in a binary form) at runtime with the loadbinaryunicodemapping function. The binary files have the .bcm extension and are produced by the creumap utility distributed with Free Pascal.

Pre-made units are available for the following codepages: cp895, cp932, cp936, cp949 and cp950.


Reference for unit 'charset': Constants

BINARY_MAPPING_FILE_EXT

Default extension of binary map file


Reference for unit 'charset': Types

preversecharmapping | Pointer to treversecharmapping
punicodecharmapping | Pointer to tunicodecharmapping
punicodemap | Pointer to tunicodemap
treversecharmapping | Describe a unicode character to single byte character mapping.
TSerializedMapHeader | Record describing binary file header
tunicodechar | Unicode character representation.
tunicodecharmapping | Describe a single byte character to unicode character mapping.
tunicodecharmappingflag | Information flags for unicode characters
tunicodemap | Unicode character mapping for single-byte codepage
tunicodestring | Unicode string representation.


Reference for unit 'charset': Procedures and functions

getascii | Convert unicode character or string to single-byte character or string.
getmap | Find a codepage map
getunicode | Map single-byte character to unicode character.
loadbinaryunicodemapping | Load binary single-byte codepage to unicode map from file or memory
loadunicodemapping | Load textual single-byte codepage to unicode map from file
mappingavailable | Check if a mapping is available for a specified code page.
registerbinarymapping | Load and register binary single-byte codepage to unicode map from file
registermapping | Register mapping


Index of all identifiers in unit 'charset'

B G L M P R T U

B

BINARY_MAPPING_FILE_EXT

G

getascii getmap getunicode

L

loadbinaryunicodemapping loadunicodemapping

M

mappingavailable

P

preversecharmapping punicodecharmapping punicodemap

R

registerbinarymapping registermapping

T

treversecharmapping | tunicodecharmapping | tunicodestring
TSerializedMapHeader | tunicodecharmappingflag |
tunicodechar | tunicodemap |

U

umf_leadbyte | umf_undefined
umf_noinfo | umf_unused


preversecharmapping

Pointer to treversecharmapping

Declaration

Source position: charset.pp line 37

type preversecharmapping = ^treversecharmapping;

See also

treversecharmapping

Describe a unicode character to single byte character mapping.


punicodecharmapping

Pointer to tunicodecharmapping

Declaration

Source position: charset.pp line 30

type punicodecharmapping = ^tunicodecharmapping;

See also

tunicodecharmapping

Describe a single byte character to unicode character mapping.


punicodemap

Pointer to tunicodemap

Declaration

Source position: charset.pp line 44

type punicodemap = ^tunicodemap;

See also

tunicodemap

Unicode character mapping for single-byte codepage


treversecharmapping

Describe a unicode character to single byte character mapping.

Declaration

Source position: charset.pp line 38

type treversecharmapping = packed record
unicode: tunicodechar; | Unicode character
char1: Byte; | First single-byte character
char2: Byte; | Second single-byte character.
end;

Description

treversecharmapping describes how a unicode character can be created in terms of single-byte characters.

See also

preversecharmapping

Pointer to treversecharmapping


TSerializedMapHeader

Record describing binary file header

Declaration

Source position: charset.pp line 56

type TSerializedMapHeader = packed record
cpName: string; | Code page name
cp: UInt16; | Numerical code page identifier
mapLength: UInt32; | Map length
lastChar: Int32; | Last character in map
reverseMapLength: UInt32; | Reverse map length
end;

Description

TSerializedMapHeader is a record describing the binary map data file. The contents of this record can be found at offset zero of a (.bcm) file containing a single-byte unicode map.

See also

loadbinaryunicodemapping

Load binary single-byte codepage to unicode map from file or memory


tunicodechar

Unicode character representation.

Declaration

Source position: charset.pp line 24

type tunicodechar = Word;

Description

tunicodechar is a type used to represent unicode characters in this file, it should not be used for other unicode routines.

See also

tunicodestring

Unicode string representation.


tunicodecharmapping

Describe a single byte character to unicode character mapping.

Declaration

Source position: charset.pp line 31

type tunicodecharmapping = packed record
unicode: tunicodechar; | Unicode character
flag: tunicodecharmappingflag; | Flag for this unicode character.
reserved: Byte; | Unused
end;

Description

tunicodecharmapping describes a unicode character. An array of these mappings is built for each character in the single-byte character set,

See also

punicodecharmapping | Pointer to tunicodecharmapping
tunicodecharmappingflag | Information flags for unicode characters


tunicodecharmappingflag

Information flags for unicode characters

Declaration

Source position: charset.pp line 27

type tunicodecharmappingflag = (
umf_noinfo, | No extra information about unicode character
umf_leadbyte, | Unicode character uses leading byte
umf_undefined, | Currently unused
umf_unused | Unused position in code page
);

Description

tunicodecharmappingflag contains various Flags describing information about a unicode character.

See also

tunicodecharmapping

Describe a single byte character to unicode character mapping.


tunicodemap

Unicode character mapping for single-byte codepage

Declaration

Source position: charset.pp line 45

type tunicodemap = record
cpname: string; | Codepage name
cp: Word; | Numerical codepage identifier
map: punicodecharmapping; | Forward map (array)
lastchar: LongInt; | Index of last character (or size of map array)
reversemap: preversecharmapping; | Reverse map (array)
reversemaplength: LongInt; | Length of reverse map (or size of reversemap array)
next: punicodemap; | Pointer to next unicode map in chain
internalmap: Boolean; | Is this an internal map (not dynamically loaded, may not be freed)
end;

Description

tunicodemap describes a complete mapping between a single-byte code page and a unicode character set. It contains both a forward and backward mapping.


tunicodestring

Unicode string representation.

Declaration

Source position: charset.pp line 25

type tunicodestring = ^tunicodechar;

Description

tunicodestring is a type used to represent unicode strings in this file, it should not be used for other unicode routines.

See also

tunicodechar

Unicode character representation.


AddDataModule

Handler called when a new TDataModule instance is created.

Declaration

Source position: classesh.inc line 2052

var AddDataModule: procedure(

  DataModule: TDataModule

) of object = ;

Description

AddDataModule can be set by an IDE or a streaming mechanism to receive notification when a new instance of a TDataModule descendant is created.

See also

RemoveDataModule | Handler called when a TDataModule instance is freed.
TDataModule | Container for non-visual components.


ApplicationHandleException

Handler for exceptions when a TDataModule streaming error occurs.

Declaration

Source position: classesh.inc line 2054

var ApplicationHandleException: procedure(

  Sender: TObject

) of object = ;

Description

ApplicationHandleException can be set by an application object to handle any exceptions that may occur when a TDataModule is created.

See also

TDataModule

Container for non-visual components.


ApplicationShowException

Unused.

Declaration

Source position: classesh.inc line 2055

var ApplicationShowException: procedure(

  E: Exception

) of object = ;


BITSHIFT

Used to calculate the size of a bits array

Declaration

Source position: classesh.inc line 371

const BITSHIFT = 5;

See also

TBits | Class to store collections of bits (binary values that can be 0 or 1)
TBits.Size | Current size of the array of bits.


CreateVCLComObjectProc

Called to create an instance of IVCLComObject

Declaration

Source position: classesh.inc line 2083

var CreateVCLComObjectProc: procedure(

  Component: TComponent

) = Nil;

Description

CreateVCLComObjectProc is called by TComponent if it needs to create a IVCLComObject interface for itself (when the ComObject property is read). It passes itself as the Component parameter.

See also

IVCLComObject

Com automation Object interface


dupAccept

Duplicate values can be added to the list.

Declaration

Source position: classesh.inc line 70

const dupAccept = Types.dupAccept;


dupError

If an attempt is made to add a duplicate value to the list, an EStringListError exception is raised.

Declaration

Source position: classesh.inc line 71

const dupError = Types.dupError;


dupIgnore

Duplicate values will not be added to the list, but no error will be triggered.

Declaration

Source position: classesh.inc line 69

const dupIgnore = Types.dupIgnore;


FilerSignature

Constant that is found at the start of a binary stream containing a streamed component.

Declaration

Source position: classesh.inc line 90

const FilerSignature: array [1..4] of Char = 'TPF0';


fmCreate

TFileStream.Create creates a new file if needed.

Declaration

Source position: classesh.inc line 75

const fmCreate = $FF00;


fmOpenRead

TFileStream.Create opens a file with read-only access.

Declaration

Source position: classesh.inc line 76

const fmOpenRead = 0;


fmOpenReadWrite

TFileStream.Create opens a file with read-write access.

Declaration

Source position: classesh.inc line 78

const fmOpenReadWrite = 2;


fmOpenWrite

TFileStream.Create opens a file with write-only access.

Declaration

Source position: classesh.inc line 77

const fmOpenWrite = 1;


GlobalNameSpace

Global namespace

Declaration

Source position: classesh.inc line 2123

var GlobalNameSpace: IReadWriteSync = ;

Description

An interface protecting the global namespace. Used when reading/writing to the global namespace list during streaming of forms.


HMODULE

Special type for handling modules.

Declaration

Source position: classesh.inc line 34

type HMODULE = PtrInt;

Description

FPC doesn't support modules yet, so this is a dummy type.


HRSRC

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Classes' (#rtl)

HRSRC (deprecated)

Type to manage resources

Declaration

Source position: classesh.inc line 23

type HRSRC = TFPResourceHandle;

Description

This type is provided for Delphi compatibilty, it is used for resource streams.


Reference for unit 'Classes'

Basic classes for RTL

uses
System, | The system unit
sysutils, | Various system utilities.
Types, | Various types
typinfo, | Access Run-Time Type Information (RTTI)
rtlconsts; | Resource strings with messages

Overview

This documentation describes the FPC classes unit. The Classes unit contains basic classes for the Free Component Library (FCL):

  • a TList class for maintaining lists of pointers,
  • TStringList for lists of strings,
  • TCollection to manage collections of objects
  • TStream classes to support streaming.

Furthermore it introduces methods for object persistence, and classes that understand an owner-owned relationship, with automatic memory management.


Reference for unit 'Classes': Constants

BITSHIFT | Used to calculate the size of a bits array
dupAccept | Duplicate values can be added to the list.
dupError | If an attempt is made to add a duplicate value to the list, an EStringListError exception is raised.
dupIgnore | Duplicate values will not be added to the list, but no error will be triggered.
FilerSignature | Constant that is found at the start of a binary stream containing a streamed component.
fmCreate | TFileStream.Create creates a new file if needed.
fmOpenRead | TFileStream.Create opens a file with read-only access.
fmOpenReadWrite | TFileStream.Create opens a file with read-write access.
fmOpenWrite | TFileStream.Create opens a file with write-only access.
MASK | Bitmask with all bits on.
MaxBitFlags | Maximum number of bits in TBits collection.
MaxBitRec | Maximum number of bit records in TBits.
MaxListSize | Maximum number of elemens in list.
scAlt | Indicates ALT key in a keyboard shortcut.
scCtrl | indicates CTRL key in a keyboard shortcut.
scNone | Indicates no special key is presed in a keyboard shortcut.
scShift | Indicates Shift key in a keyboard shortcut.
SGUIDObserved | Observed interface GUID as a string
SGUIDObserver | Observer interface GUID as a string
soFromBeginning | Seek starts relative to the stream origin.
soFromCurrent | Seek starts relative to the current position in the stream.
soFromEnd | Seek starts relative to the stream end.
toEOF | Value returned by TParser.Token when the end of the input stream was reached.
toFloat | Value returned by TParser.Token when a floating point value was found in the input stream.
toInteger | Value returned by TParser.Token when an integer was found in the input stream.
toString | Value returned by TParser.Token when a string was found in the input stream.
toSymbol | Value returned by TParser.Token when a symbol was found in the input stream.
toWString | Value returned by TParser.Token when a widestring was found in the input stream.


Reference for unit 'Classes': Types

HMODULE | Special type for handling modules.
HRSRC | Type to manage resources
PPointerList | Pointer to an array of pointers.
PStringItem | Pointer to a TStringItem record.
PStringItemList | Pointer to a TStringItemList.
TActiveXRegType | Used when registering ActveX component types.
TAlignment | Type to specify text alignment in controls that display text.
TAncestorNotFoundEvent | This event occurs when an ancestor component cannot be found.
TBasicActionClass | TBasicAction class reference.
TBasicActionLinkClass | TBasicActionLink class reference.
TBiDiMode | BIDI description
TBitArray | Array to store bits.
TCollectionItemClass | Class reference for TCollectionItem.
TCollectionNotification | Collection change notifcation enumeration.
TCollectionSortCompare | Callback to sort collection items
TComponentClass | Class of TComponent
TComponentName | Special type for component names.
TComponentState | Indicates the state of the component during the streaming process.
TComponentStyle | Describes the style of the component.
TCreateComponentEvent | Event handler type, occurs when a component instance must be created when a component is read from a stream.
TDataModuleClass | Class pointer for TDataModule
TDuplicates | Type to describe what to do with duplicate values in a TStringlist.
TExceptionClass | Class of Exception
TFilerFlag | Flags used by the TFiler class
TFilerFlags | Set of TFilerFlag
TFindAncestorEvent | Event that occurs w
TFindComponentClassEvent | Event handler type, occurs when a component class pointer must be found when reading a component from a stream.
TFindGlobalComponent | Callback type to search for a component.
TFindMethodEvent | Occurs when the streaming process needs to locate a method
TFPObservedOperation | Operation which is reported to an observer
TGetChildProc | Callback used when obtaining child components.
TGetStrProc | Event for retrieving string values.
THandle | Type to manage streams.
THelpContext | Range type to specify help contexts.
THelpEvent | Special event for display of online help.
THelpType | Enumeration type specifying the kind of help requested.
TIdentMapEntry | Record used when associating names with integer values.
TIdentToInt | Callback for converting identifiers to integers.
TInitComponentHandler | Callback type for RegisterInitComponentHandler
TIntToIdent | Callback for converting integers to identifiers.
TLeftRight | Subrange type based on TAlignment
TListAssignOp | List assign operation
TListCallback | Method callback type for TFPList.ForEachCall
TListNotification | Kind of list notification event.
TListSortCompare | Callback type for the list sort algorithm.
TListStaticCallback | Static method callback type for TFPList.ForEachCall
TNotifyCallBack | Thread termination callback handler
TNotifyEvent | Standard event handler type.
TObjectTextEncoding | Encoding of the object text file
TOperation | Operation of which a component is notified.
TPersistentClass | Class reference type for TPersistent.
TPoint | Special type to handle a fake TComponent position
TPointerList | Type for an Array of pointers.
TPropertyNotFoundEvent | Callback for the TReader.OnPropertyNotFound event.
TReadComponentsProc | Callback type when reading a component from a stream
TReaderError | Event handler type, called when an error occurs during the streaming.
TReaderProc | Reader procedure used by DefineProperties
TReadWriteStringPropertyEvent | Callback for the TReader.OnReadStringProperty event handler
TRect | Descibes a rectangle
TReferenceNameEvent | Occurs when a named object needs to be looked up.
TSeekOrigin | Specifies the origin of the TStream.Seek method.
TSetMethodPropertyEvent | Callback for the TReader.OnSetMethodProperty event.
TSetNameEvent | Occurs when the reader needs to set a component's name.
TShiftState | Indicates what special keys were pressed in combination with a normal key
TShiftStateEnum | Keyboard/Mouse shift state enumerator
TShortCut | Enumeration type to identify shortcut key combinations.
TSmallPoint | Type to describe point in a small plane.
TStreamOwnership | Determines the ownership of a TStreamAdapter
TStreamProc | Procedure type used in streaming.
TStringItem | The TStringItem is used to store the string and object items in a TStringList string list instance. It should never be used directly.
TStringItemList | Array of TStringItem records.
TStringListSortCompare | Callback type used in stringlist compares.
TStringsSortStyle | Determines how the strings are sorted
TStringsSortStyles | Set of TStringsSortStyle
TSynchronizeProcVar | Synchronize callback type
TThreadExecuteCallBack | Signature of procedure to execute in a thread, without status reporting
TThreadExecuteHandler | Signature of method to execute in a thread, without status reporting
TThreadExecuteStatusCallBack | Signature of procedure to execute in a thread, with status reporting
TThreadExecuteStatusHandler | Signature of method to execute in a thread, with status reporting
TThreadMethod | Procedure variable used when synchronizing threads.
TThreadPriority | Enumeration specifying the priority at which a thread runs.
TThreadReportStatus | Thread status report callback prototype
TThreadStatusNotifyCallBack | Signature of thread status report callback
TThreadStatusNotifyEvent | Signature of thread status report event handler
TValueType | Enumerated type used to identify the kind of streamed property
TWriteMethodPropertyEvent | Callback for the TWriter.OnWriteMethodProperty event.
TWriterProc | Writer procedure used by DefineProperties


Reference for unit 'Classes': Classes

EBitsError | Exception raised when an error occurs in a method of TBits.
EClassNotFound | Exception raised when an unknown class is referenced in a streamed component.
EComponentError | Exception raised when an error occurs in the component registration routines.
EFCreateError | Exception raised when an error occurred during creation of a TFileStream stream.
EFilerError | Exception raised by the component streaming system if an error occurs.
EFOpenError | Exception raised when an error occurred during creation of a TFileStream
EInvalidImage | Exception raised when the resource header needed for streaming of a component is invalid.
EInvalidOperation | Exception raised when an invalid operation is performed. Obsolete.
EListError | Exception raised when an error occurs in lists handling.
EMethodNotFound | This exception is no longer used.
EObserver | Error raised when an observer error occurs
EOutOfResources | Exception raised when the system is out of resources.
EParserError | Exception raised when an error occurs during the parsing of streams.
EReadError | Exception raised if an error occurs while reading from a stream.
EResNotFound | Exception raised when a resource, needed to initialize a component, is not found.
EStreamError | Exception raised when an error occurs during read or write operations on a stream.
EStringListError | Exception raised when an error occurs in a method of TStrings.
EThread | Thread error exception.
EThreadDestroyCalled | Exception raised when a thread is destroyed illegally.
EThreadExternalException | Exception raised when an invalid operation is attempted on an external thread
EWriteError | Exception raised when an error occurs during writing to a stream.
IDesignerNotify | Designer notification interface
IFPObserved | Interface implemented by an object that can be observed.
IFPObserver | Interface for an object to observe other objects.
IInterfaceComponentReference | Interface for checking component references
IInterfaceList | Interface for maintaining a list of interfaces.
IStreamPersist | Persistence streaming interface.
IStringsAdapter | IStringsAdapter Interface declaration.
IVCLComObject | Com automation Object interface
TAbstractObjectReader | Abstract driver class to read stored component data.
TAbstractObjectWriter | Abstract driver class for writing component data.
TBasicAction | Abstract base class for all Actions.
TBasicActionLink | Link between actions and action clients (e.g. controls)
TBinaryObjectReader | Driver class descendant which reads component data stored in binary format.
TBinaryObjectWriter | Driver class which stores component data in binary form.
TBits | Class to store collections of bits (binary values that can be 0 or 1)
TBytesStream | Stream of bytes
TCollection | Base class to manage collections of named objects.
TCollectionEnumerator | Implements IEnumerator for the TCollection class.
TCollectionItem | Basic object that is managed by a TCollection class.
TComponent | Base class for all components that need owner-owned functionality.
TComponentEnumerator | Implements IEnumerator for the TComponent class.
TCustomMemoryStream | Abstract stream that stores its data in memory.
TDataModule | Container for non-visual components.
TFiler | Class responsible for streaming of components.
TFileStream | Stream that stores its data in a named file on disk.
TFPList | Class to manage collections of pointers.
TFPListEnumerator | Implements IEnumerator for the TFPList class.
THandleStream | Base class for streams that are identified by an OS handle.
TInterfacedPersistent | TPersistent descendant which implements the IInterface interface
TInterfaceList | Standard implementation of the IInterfaceList interface.
TInterfaceListEnumerator | Implements IEnumerator for the TInterfaceList class.
TList | Class to manage collections of pointers.
TListEnumerator | Implements IEnumerator for the TList class.
TMemoryStream | Standard implementation of a stream that stores its data in memory
TOwnedCollection | TCollection descendant which maintains owner information.
TOwnerStream | Stream which uses a second stream as a source
TParser | Class to parse the contents of a stream containing text data.
TPersistent | Base class for streaming system and persistent properties.
TProxyStream | Proxy stream for the IStream interface
TReader | Generic reader object which reads component data from any given source.
TRecall | Helper class for storing published properties
TResourceStream | Stream that reads its data from a resource object.
TStream | Base class for streams.
TStreamAdapter | Implements IStream for TStream descendants
TStringList | Standard implementation of the TStrings class.
TStrings | Class to manage arrays or collections of strings
TStringsEnumerator | Implements IEnumerator for the TStrings class.
TStringStream | Stream that stores its data in a string.
TTextObjectWriter | Driver class which stores component data in text format.
TThread | Abstract Thread class.
TThreadList | Thread-safe list object
TWriter | Object to write component data to an arbitrary format.


Reference for unit 'Classes': Procedures and functions

ActivateClassGroup | Activates a class group
BeginGlobalLoading | Not yet implemented
BinToHex | Convert a binary buffer to a hexadecimal string
Bounds | Returns a TRect structure with the bounding rect of the given location and size.
CheckSynchronize | Check whether there are any synchronize calls in the synchronize queue.
ClassGroupOf | Returns the class group to which an instance or class belongs
CollectionsEqual | Returns True if two collections are equal.
EndGlobalLoading | Not yet implemented.
ExtractStrings | Split a string in different words.
FindClass | Returns the class pointer of a class with given name.
FindGlobalComponent | Callback used when a component must be found.
FindIdentToInt | Return the string to integer converter for an integer type
FindIntToIdent | Return the integer to string converter for an integer type
FindNestedComponent | Finds the component with name path starting at the indicated root component.
GetClass | Returns the class pointer of a class with given name.
GetFixupInstanceNames | Returns the names of elements that need to be resolved for the root component, whose reference contains ReferenceRootName
GetFixupReferenceNames | Returns the names of elements that need to be resolved for the root component.
GlobalFixupReferences | Called to resolve unresolved references after forms are loaded.
GroupDescendentsWith | Provided for Delphi compatibility
HexToBin | Convert a hexadecimal string to a binary buffer
IdentToInt | Looks up an integer value in a integer-to-identifier map list.
InitComponentRes | Provided for Delphi compatibility only
InitInheritedComponent | Initializes a component descending from RootAncestor
IntToIdent | Looks up an identifier for an integer value in a identifier-to-integer map list.
InvalidPoint | Check whether a point is invalid.
LineStart | Finds the start of a line in Buffer before BufPos.
NotifyGlobalLoading | Not yet implemented.
ObjectBinaryToText | Converts an object stream from a binary to a text format.
ObjectResourceToText | Converts an object stream from a (windows) resource to a text format.
ObjectTextToBinary | Converts an object stream from a text to a binary format.
ObjectTextToResource | Converts an object stream from a text to a (windows) resource format.
Point | Returns a TPoint record with the given coordinates.
PointsEqual | Check whether two TPoint variables are equal.
ReadComponentRes | Read component properties from a resource in the current module
ReadComponentResEx | Read component properties from a resource in the specified module
ReadComponentResFile | Read component properties from a specified resource file
Rect | Returns a TRect record with the given coordinates.
RedirectFixupReferences | Redirects references under the root object from OldRootName to NewRootName
RegisterClass | Registers a class with the streaming system.
RegisterClassAlias | Registers a class alias with the streaming system.
RegisterClasses | Registers multiple classes with the streaming system.
RegisterComponents | Registers components for the component palette.
RegisterFindGlobalComponentProc | Register a component searching handler
RegisterInitComponentHandler | Register a component initialization handler
RegisterIntegerConsts | Registers some integer-to-identifier mappings.
RegisterNoIcon | Registers components that have no icon on the component palette.
RegisterNonActiveX | Register non-activex component.
RemoveFixupReferences | Removes references to rootname from the fixup list.
RemoveFixups | Removes Instance from the fixup list.
SmallPoint | Returns a TSmallPoint record with the given coordinates.
StartClassGroup | Start new class group.
UnRegisterClass | Unregisters a class from the streaming system.
UnRegisterClasses | Unregisters multiple classes from the streaming system.
UnregisterFindGlobalComponentProc | Remove a previously registered component searching handler.
UnRegisterModuleClasses | Unregisters classes registered by module.
WriteComponentResFile | Write component properties to a specified resource file


Reference for unit 'Classes': Variables

AddDataModule | Handler called when a new TDataModule instance is created.
ApplicationHandleException | Handler for exceptions when a TDataModule streaming error occurs.
ApplicationShowException | Unused.
CreateVCLComObjectProc | Called to create an instance of IVCLComObject
GlobalNameSpace | Global namespace
MainThreadID | ID of main thread. Unused at this point.
RegisterComponentsProc | Callback procedure used when handling component registration.
RegisterNoIconProc | Callback procedure used when handling iconless component registration.
RemoveDataModule | Handler called when a TDataModule instance is freed.
WakeMainThread | Handler which is called if a thread wants to synchronize with the main application thread.


Index of all identifiers in unit 'Classes'

A B C D E F G H I L M N O P R S T U V W

A

ActivateClassGroup | ApplicationHandleException | axrComponentOnly
AddDataModule | ApplicationShowException | axrIncludeDescendants

B

bdLeftToRight | bdRightToLeftReadingOnly | BITSHIFT
bdRightToLeft | BeginGlobalLoading | Bounds
bdRightToLeftNoAlign | BinToHex |

C

CheckSynchronize | cnDeleting | CreateVCLComObjectProc
ClassGroupOf | cnExtracting |
cnAdded | CollectionsEqual |

D

dupAccept dupError dupIgnore

E

EBitsError | EListError | EStreamError
EClassNotFound | EMethodNotFound | EStringListError
EComponentError | EndGlobalLoading | EThread
EFCreateError | EObserver | EThreadDestroyCalled
EFilerError | EOutOfResources | EThreadExternalException
EFOpenError | EParserError | EWriteError
EInvalidImage | EReadError | ExtractStrings
EInvalidOperation | EResNotFound |

F

ffChildPos | FindGlobalComponent | fmOpenRead
ffInherited | FindIdentToInt | fmOpenReadWrite
ffInline | FindIntToIdent | fmOpenWrite
FilerSignature | FindNestedComponent |
FindClass | fmCreate |

G

GetClass | GetFixupReferenceNames | GlobalNameSpace
GetFixupInstanceNames | GlobalFixupReferences | GroupDescendentsWith

H

HexToBin | HRSRC | htKeyword
HMODULE | htContext |

I

IdentToInt | IInterfaceList | IStreamPersist
IDesignerNotify | InitComponentRes | IStringsAdapter
IFPObserved | InitInheritedComponent | IVCLComObject
IFPObserver | IntToIdent |
IInterfaceComponentReference | InvalidPoint |

L

laAnd | laSrcUnique | lnDeleted
laCopy | laXor | lnExtracted
laDestUnique | LineStart |
laOr | lnAdded |

M

MainThreadID | MaxBitFlags | MaxListSize
MASK | MaxBitRec |

N

NotifyGlobalLoading

O

ObjectBinaryToText | ooChange | opRemove
ObjectResourceToText | ooCustom | oteDFM
ObjectTextToBinary | ooDeleteItem | oteLFM
ObjectTextToResource | ooFree |
ooAddItem | opInsert |

P

Point | PPointerList | PStringItemList
PointsEqual | PStringItem |

R

ReadComponentRes | RegisterClasses | RegisterNoIconProc
ReadComponentResEx | RegisterComponents | RegisterNonActiveX
ReadComponentResFile | RegisterComponentsProc | RemoveDataModule
Rect | RegisterFindGlobalComponentProc | RemoveFixupReferences
RedirectFixupReferences | RegisterInitComponentHandler | RemoveFixups
RegisterClass | RegisterIntegerConsts |
RegisterClassAlias | RegisterNoIcon |

S

scAlt | soOwned | sslUser
scCtrl | soReference | ssMeta
scNone | ssAlt | ssMiddle
scShift | ssAltGr | ssNum
SGUIDObserved | ssCaps | ssQuad
SGUIDObserver | ssCtrl | ssRight
SmallPoint | ssDouble | ssScroll
soBeginning | ssExtra1 | ssShift
soCurrent | ssExtra2 | ssSuper
soEnd | ssHyper | ssTriple
soFromBeginning | sslAuto | StartClassGroup
soFromCurrent | ssLeft |
soFromEnd | sslNone |

T

TAbstractObjectReader | TGetStrProc | TReadComponentsProc
TAbstractObjectWriter | THandle | TReader
taCenter | THandleStream | TReaderError
TActiveXRegType | THelpContext | TReaderProc
taLeftJustify | THelpEvent | TReadWriteStringPropertyEvent
TAlignment | THelpType | TRecall
TAncestorNotFoundEvent | TIdentMapEntry | TRect
taRightJustify | TIdentToInt | TReferenceNameEvent
TBasicAction | TInitComponentHandler | TResourceStream
TBasicActionClass | TInterfacedPersistent | TSeekOrigin
TBasicActionLink | TInterfaceList | TSetMethodPropertyEvent
TBasicActionLinkClass | TInterfaceListEnumerator | TSetNameEvent
TBiDiMode | TIntToIdent | TShiftState
TBinaryObjectReader | TLeftRight | TShiftStateEnum
TBinaryObjectWriter | TList | TShortCut
TBitArray | TListAssignOp | TSmallPoint
TBits | TListCallback | TStream
TBytesStream | TListEnumerator | TStreamAdapter
TCollection | TListNotification | TStreamOwnership
TCollectionEnumerator | TListSortCompare | TStreamProc
TCollectionItem | TListStaticCallback | TStringItem
TCollectionItemClass | TMemoryStream | TStringItemList
TCollectionNotification | TNotifyCallBack | TStringList
TCollectionSortCompare | TNotifyEvent | TStringListSortCompare
TComponent | TObjectTextEncoding | TStrings
TComponentClass | toEOF | TStringsEnumerator
TComponentEnumerator | toFloat | TStringsSortStyle
TComponentName | toInteger | TStringsSortStyles
TComponentState | TOperation | TStringStream
TComponentStyle | toString | TSynchronizeProcVar
TCreateComponentEvent | toSymbol | TTextObjectWriter
TCustomMemoryStream | TOwnedCollection | TThread
TDataModule | TOwnerStream | TThreadExecuteCallBack
TDataModuleClass | toWString | TThreadExecuteHandler
TDuplicates | TParser | TThreadExecuteStatusCallBack
TExceptionClass | TPersistent | TThreadExecuteStatusHandler
TFiler | TPersistentClass | TThreadList
TFilerFlag | tpHigher | TThreadMethod
TFilerFlags | tpHighest | TThreadPriority
TFileStream | tpIdle | TThreadReportStatus
TFindAncestorEvent | tpLower | TThreadStatusNotifyCallBack
TFindComponentClassEvent | tpLowest | TThreadStatusNotifyEvent
TFindGlobalComponent | tpNormal | TValueType
TFindMethodEvent | TPoint | TWriteMethodPropertyEvent
TFPList | TPointerList | TWriter
TFPListEnumerator | TPropertyNotFoundEvent | TWriterProc
TFPObservedOperation | TProxyStream |
TGetChildProc | tpTimeCritical |

U

UnRegisterClass | UnregisterFindGlobalComponentProc
UnRegisterClasses | UnRegisterModuleClasses

V

vaBinary | vaInt32 | vaSet
vaCollection | vaInt64 | vaSingle
vaCurrency | vaInt8 | vaString
vaDate | vaList | vaTrue
vaExtended | vaLString | vaUString
vaFalse | vaNil | vaUTF8String
vaIdent | vaNull | vaWString
vaInt16 | vaQWord |

W

WakeMainThread WriteComponentResFile


MainThreadID

ID of main thread. Unused at this point.

Declaration

Source position: classesh.inc line 2139

var MainThreadID: TThreadID = ;


MASK

Bitmask with all bits on.

Declaration

Source position: classesh.inc line 372

const MASK = 31;

See also

TBits

Class to store collections of bits (binary values that can be 0 or 1)


MaxBitFlags

Maximum number of bits in TBits collection.

Declaration

Source position: classesh.inc line 377

const MaxBitFlags = $7FFFFFE0;

See also

TBits

Class to store collections of bits (binary values that can be 0 or 1)


MaxBitRec

Maximum number of bit records in TBits.

Declaration

Source position: classesh.inc line 379

const MaxBitRec = MaxBitFlags div SizeOf(cardinal) * 8;

See also

TBits

Class to store collections of bits (binary values that can be 0 or 1)


MaxListSize

Maximum number of elemens in list.

Declaration

Source position: classesh.inc line 47

const MaxListSize = Maxint div 16;

Description

This constant sets the maximum number of elements in a TList.


PPointerList

Pointer to an array of pointers.

Declaration

Source position: classesh.inc line 195

type PPointerList = ^TPointerList;


PStringItem

Pointer to a TStringItem record.

Declaration

Source position: classesh.inc line 723

type PStringItem = ^TStringItem;


PStringItemList

Pointer to a TStringItemList.

Declaration

Source position: classesh.inc line 729

type PStringItemList = ^TStringItemList;


RemoveDataModule

Handler called when a TDataModule instance is freed.

Declaration

Source position: classesh.inc line 2053

var RemoveDataModule: procedure(

  DataModule: TDataModule

) of object = ;

Description

RemoveDataModule can be set by an IDE or a streaming mechanism to receive notification when an instance of a TDataModule descendant is freed.

See also

AddDataModule | Handler called when a new TDataModule instance is created.
TDataModule | Container for non-visual components.


scAlt

Indicates ALT key in a keyboard shortcut.

Declaration

Source position: classesh.inc line 54

const scAlt = $8000;


scCtrl

indicates CTRL key in a keyboard shortcut.

Declaration

Source position: classesh.inc line 53

const scCtrl = $4000;


scNone

Indicates no special key is presed in a keyboard shortcut.

Declaration

Source position: classesh.inc line 55

const scNone = 0;


scShift

Indicates Shift key in a keyboard shortcut.

Declaration

Source position: classesh.inc line 52

const scShift = $2000;


SGUIDObserved

Observed interface GUID as a string

Declaration

Source position: classesh.inc line 155

const SGUIDObserved = '{663C603C-3F3C-4CC5-823C-AC8079F979E5}';


SGUIDObserver

Observer interface GUID as a string

Declaration

Source position: classesh.inc line 156

const SGUIDObserver = '{BC7376EA-199C-4C2A-8684-F4805F0691CA}';


soFromBeginning

Seek starts relative to the stream origin.

Declaration

Source position: classesh.inc line 59

const soFromBeginning = 0;


soFromCurrent

Seek starts relative to the current position in the stream.

Declaration

Source position: classesh.inc line 60

const soFromCurrent = 1;


soFromEnd

Seek starts relative to the stream end.

Declaration

Source position: classesh.inc line 61

const soFromEnd = 2;


TActiveXRegType

Used when registering ActveX component types.

Declaration

Source position: classesh.inc line 1933

type TActiveXRegType = (

  axrComponentOnly,

  axrIncludeDescendants

);

Description

This type is provided for compatibility only, and is currently not used in Free Pascal.


TAlignment

Type to specify text alignment in controls that display text.

Declaration

Source position: classesh.inc line 94

type TAlignment = (
taLeftJustify, | Text is displayed aligned to the left
taRightJustify, | Text is displayed aligned to the right.
taCenter | Text is displayed centered.
);

Description

The TAlignment type is used to specify the alignment of the text in controls that display a text.


TAncestorNotFoundEvent

This event occurs when an ancestor component cannot be found.

Declaration

Source position: classesh.inc line 1218

type TAncestorNotFoundEvent = procedure(

  Reader: TReader;

  const ComponentName: string;

  ComponentClass: TPersistentClass;

  var Component: TComponent

) of object;


TBiDiMode

BIDI description

Declaration

Source position: classesh.inc line 98

type TBiDiMode = (
bdLeftToRight, | Texts read from left to right.
bdRightToLeft, | Texts read from right to left.
bdRightToLeftNoAlign, | Texts read from right to left, but not right-aligned
bdRightToLeftReadingOnly | Texts read from right to left
);

Description

TBiDiMode describes bi-directional support for displaying texts.


TBitArray

Array to store bits.

Declaration

Source position: classesh.inc line 381

type TBitArray = array [0..MaxBitRec-1] of Cardinal;

See also

TBits

Class to store collections of bits (binary values that can be 0 or 1)


TCollectionNotification

Collection change notifcation enumeration.

Declaration

Source position: classesh.inc line 518

type TCollectionNotification = (
cnAdded, | An item is added to the collection.
cnExtracting, | An item is extracted from the collection.
cnDeleting | An item is deleted from the collection.
);

Description

TCollectionNotification is used in the TCollection class to send notifications about changes to the collection.


TCollectionSortCompare

Callback to sort collection items

Declaration

Source position: classesh.inc line 519

type TCollectionSortCompare = function(

  Item1: TCollectionItem;

  Item2: TCollectionItem

):Integer;

Description

TCollectionSortCompare is the prototype for a callback used in the TCollection.Sort method. The procedure should compare Item1 and Item2 and return an integer:

Result < 0
if Item1 comes before Item2
Result = 0
if Item1 is at the same level as Item2
Result > 0
if Item1 comes after Item2

See also

TCollection.Sort

Sort the items in the collection


TComponentName

Special type for component names.

Declaration

Source position: classesh.inc line 24

type TComponentName = String;

Description

Names of components are of type TComponentName. By specifying a different type, the Object inspector can handle this property differently than a standard string property.


TComponentState

Indicates the state of the component during the streaming process.

Declaration

Source position: classesh.inc line 1725

type TComponentState = set of (
csLoading, | The component is being loaded from the stream.
csReading, | Properties are being read from the stream.
csWriting, | Properties are being written to the stream.
csDestroying, | The component is being destroyed.
csDesigning, | The component is being designed in an IDE.
csAncestor, | The component is being streamed as part of a frame (?)
csUpdating, | The component is being updated.
csFixups, | The component's references to other components are being fixed.
csFreeNotification, | Indicates whether the component has freenotifications
csInline, | Component is part of a frame (?).
csDesignInstance | ??
);

Description

The following values are possible:

csLoading
The component (and all child components) are being loaded from a stream. This means that a TReader instance is reading properties from this and child components from a stream and is applying the values found in the stream to the properties.
csReading
The properties of this component are being read from a stream. This means that a TReader instance is reading properties from this component from a stream and is applying the values.
csWriting
The properties of this component are being written to a stream. This means that a TWriter instance is writing properties from this component to a stream.
csDestroying
The component is being destroyed.
csDesigning
The component is being designed in an IDE.
csAncestor
The component has a design ancestor. This is used to record differences between a component and it's design ancestor. For example a form TForm2 inherited from a form TForm1. TForm1 and all its components are copied to TForm2. TForm2 and all its inherited components have csAncestor set. Only differences between TForm1 and TForm2 are stored in the stream of TForm2. The child components of a frame put onto a form have csAncestor too.
csInline
The component is a nested top level component. For example a frame on a form. The children of the frame do not have csInline, unless they are other frames.
csDesignInstance
The component is designed (csDesigning) and is a root component, meaning it has no owner (Owner=nil).
csFixups
The component's references to other components are being fixed. While reading a component from stream, it can happen that the stream contains a component reference property with a name of a component that was not yet created and read from the stream. Such properties are saved, and the missing references are resolved when the complete stream was read. This resolving step is called fixing up references, and the csFixups flags is set during this step.
csFreeNotification
This flag indicates that the component has free notifications registered with TComponent.FreeNotification


TComponentStyle

Describes the style of the component.

Declaration

Source position: classesh.inc line 1728

type TComponentStyle = set of (
csInheritable, | The component can be on inherited forms.
csCheckPropAvail, | ??
csSubComponent, | Subcomponent - streamed as part of the owning component
csTransient | Transient component
);


TCreateComponentEvent

Event handler type, occurs when a component instance must be created when a component is read from a stream.

Declaration

Source position: classesh.inc line 1227

type TCreateComponentEvent = procedure(

  Reader: TReader;

  ComponentClass: TComponentClass;

  var Component: TComponent

) of object;


TDuplicates

Type to describe what to do with duplicate values in a TStringlist.

Declaration

Source position: classesh.inc line 65

type TDuplicates = Types.TDuplicates;


TExceptionClass

Class of Exception

Declaration

Source position: classesh.inc line 147

type TExceptionClass = class of Exception;

Description

TExceptionClass is the class pointer for the Exception class, defined in the SysUtils unit.

See also

Exception

Base class of all exceptions.


TFindAncestorEvent

Event that occurs w

Declaration

Source position: classesh.inc line 1426

type TFindAncestorEvent = procedure(

  Writer: TWriter;

  Component: TComponent;

  const Name: string;

  var Ancestor: TComponent;

  var RootAncestor: TComponent

) of object;


TFindComponentClassEvent

Event handler type, occurs when a component class pointer must be found when reading a component from a stream.

Declaration

Source position: classesh.inc line 1225

type TFindComponentClassEvent = procedure(

  Reader: TReader;

  const ClassName: string;

  var ComponentClass: TComponentClass

) of object;


TFindGlobalComponent

Callback type to search for a component.

Declaration

Source position: classesh.inc line 2135

type TFindGlobalComponent = function(

  const Name: string

):TComponent;

Description

TFindGlobalComponent is a callback used to find a component in a global scope. It is used when the streaming system needs to find a component which is not part of the component which is currently being streamed. It should return the component with name Name, or Nil if none is found.

The variable FindGlobalComponent is a callback of type TFindGlobalComponent. It can be set by the IDE when an unknown reference is found, to offer the designer to redirect the link to a new component.

See also

FindGlobalComponent

Callback used when a component must be found.


TFindMethodEvent

Occurs when the streaming process needs to locate a method

Declaration

Source position: classesh.inc line 1210

type TFindMethodEvent = procedure(

  Reader: TReader;

  const MethodName: string;

  var Address: CodePointer;

  var Error: Boolean

) of object;

Description

If a TReader instance needs to locate a method and it doesn't find it in the streamed form, then the OnFindMethod event handler will be called, if one is installed. This event can be assigned in order to use different locating methods. If a method is found, then its address should be returned in Address. The Error should be set to True if the reader should raise an exception after the event was handled. If it is set to False no exception will be raised, even if no method was found. On entry, Error will be set to True.


TFPObservedOperation

Operation which is reported to an observer

Declaration

Source position: classesh.inc line 161

type TFPObservedOperation = (
ooChange, | The observed object has changed.
ooFree, | The observed object is being freed.
ooAddItem, | An item is added to the observed object (generally a list).
ooDeleteItem, | An item is deleted from the observed object (generally a list).
ooCustom | Custom event.
);

Description

TFPObservedOperation enumerates the possible operations that can be reported to an observer. Which of these operations is reported depends on the implementation of the observed object.

See also

IFPObserved | Interface implemented by an object that can be observed.
IFPObserver | Interface for an object to observe other objects.


TGetChildProc

Callback used when obtaining child components.

Declaration

Source position: classesh.inc line 1730

type TGetChildProc = procedure(

  Child: TComponent

) of object;


TGetStrProc

Event for retrieving string values.

Declaration

Source position: classesh.inc line 122

type TGetStrProc = procedure(

  const S: string

) of object;

Description

This event is used as a callback to retrieve string values. It is used, among other things, to pass along string properties in property editors.

See also

THelpEvent | Special event for display of online help.
TNotifyEvent | Standard event handler type.


THandle

Type to manage streams.

Declaration

Source position: classesh.inc line 25

type THandle = System.THandle;

Description

This type is used as the handle for THandleStream stream descendants


THelpContext

Range type to specify help contexts.

Declaration

Source position: classesh.inc line 112

type THelpContext = - MaxLongint..MaxLongint;


THelpEvent

Special event for display of online help.

Declaration

Source position: classesh.inc line 120

type THelpEvent = function(

  Command: Word;

  Data: LongInt;

  var CallHelp: Boolean

):Boolean of object;

Description

This event is used for display of online help.

See also

TNotifyEvent | Standard event handler type.
TGetStrProc | Event for retrieving string values.


THelpType

Enumeration type specifying the kind of help requested.

Declaration

Source position: classesh.inc line 113

type THelpType = (
htKeyword, | Help type: Keyword help
htContext | Help type: Context ID help.
);


TIdentMapEntry

Record used when associating names with integer values.

Declaration

Source position: classesh.inc line 2128

type TIdentMapEntry = record
Value: Integer; | Integer value
Name: string; | Name of the integer value.
end;

Description

TIdentMapEntry is used internally by the IdentToInt and IntToIdent calls to store the mapping between the identifiers and the integers they represent.

See also

IntToIdent | Looks up an identifier for an integer value in a identifier-to-integer map list.
IdentToInt | Looks up an integer value in a integer-to-identifier map list.


TIdentToInt

Callback for converting identifiers to integers.

Declaration

Source position: classesh.inc line 2133

type TIdentToInt = function(

  const Ident: string;

  var Int: LongInt

):Boolean;

Description

TIdentToInt is a callback used to look up identifiers (Ident) and return an integer value corresponding to this identifier (Int). The callback should return True if a value corresponding to integer Ident was found, False if not.

A callback of type TIdentToInt should be specified when an integer is registered using the RegisterIntegerConsts call.

See also

RegisterIntegerConsts | Registers some integer-to-identifier mappings.
TIntToIdent | Callback for converting integers to identifiers.


TInitComponentHandler

Callback type for RegisterInitComponentHandler

Declaration

Source position: classesh.inc line 2136

type TInitComponentHandler = function(

  Instance: TComponent;

  RootAncestor: TClass

):Boolean;

Description

TInitComponentHandler is a callback type. It is used in the InitInheritedComponent call to initialize a component. Callbacks of this type are registered with the RegisterInitComponentHandler call.


TIntToIdent

Callback for converting integers to identifiers.

Declaration

Source position: classesh.inc line 2134

type TIntToIdent = function(

  Int: LongInt;

  var Ident: string

):Boolean;

Description

TIdentToInt is a callback used to look up integers (Ident) and return an identifier (Ident) that can be used to represent this integer value in an IDE. The callback should return True if a value corresponding to integer Ident was found, False if not.

A callback of type TIntToIdent should be specified when an integer is registered using the RegisterIntegerConsts call.

See also

RegisterIntegerConsts | Registers some integer-to-identifier mappings.
TIdentToInt | Callback for converting identifiers to integers.


TLeftRight

Subrange type based on TAlignment

Declaration

Source position: classesh.inc line 96

type TLeftRight = taLeftJustify..taRightJustify;

Description

TLeftRight is a subrange type based on the TAlignment enumerated type. It contains only the left and right alignment constants.

See also

TAlignment

Type to specify text alignment in controls that display text.


TListNotification

Kind of list notification event.

Declaration

Source position: classesh.inc line 284

type TListNotification = (
lnAdded, | List change notification: Element added to the list.
lnExtracted, | List change notification: Element extracted from the list.
lnDeleted | List change notification: Element deleted from the list.
);


TListSortCompare

Callback type for the list sort algorithm.

Declaration

Source position: classesh.inc line 197

type TListSortCompare = function(

  Item1: Pointer;

  Item2: Pointer

):Integer;


TListStaticCallback

Static method callback type for TFPList.ForEachCall

Declaration

Source position: classesh.inc line 199

type TListStaticCallback = Types.TListStaticCallback;

Description

TListCallback is the procedurald callback prototype for the function that is passed to the TFPList.ForEachCall call. The data argument will be filled with all the pointers in the list (one per call) and the arg argument is the Arg argument passed to the ForEachCall call.

See also

TFPList.ForEachCall | Call a procedure or method for each pointer in the list.
TListCallback | Method callback type for TFPList.ForEachCall


TNotifyCallBack

Thread termination callback handler

Declaration

Source position: classesh.inc line 1581

type TNotifyCallBack = procedure(

  Sender: TObject;

  AData: Pointer

);

Description

TNotifyCallBack is used to notify about thread termination when using static callbacks. When called, the Sender will contain the thread which is terminating, and AData is the AData parameter passed to TThread.ExecuteInThread.

See also

TThread.ExecuteInThread | Execute a method or static procedure in a thread
TThread | Abstract Thread class.


TNotifyEvent

Standard event handler type.

Declaration

Source position: classesh.inc line 119

type TNotifyEvent = procedure(

  Sender: TObject

) of object;

Description

Most event handlers are implemented as a property of type TNotifyEvent. When this is set to a certain method of a class, when the event occurs, the method will be called, and the class that generated the event will pass itself along as the Sender argument.

See also

THelpEvent | Special event for display of online help.
TGetStrProc | Event for retrieving string values.


TObjectTextEncoding

Encoding of the object text file

Declaration

Source position: classesh.inc line 2180

type TObjectTextEncoding = (
oteDFM, | Characters are in DFM (Delphi) format: widechar encoded.
oteLFM | Characters are in LFM format: UTF-8 encoded.
);

Description

TObjectTextEncoding is an enumerated type which denotes the encoding of non ascii characters in an object stream file. It is needed for correct encoding when reading string values in the text stream.

See also

ObjectTextToBinary

Converts an object stream from a text to a binary format.


toEOF

Value returned by TParser.Token when the end of the input stream was reached.

Declaration

Source position: classesh.inc line 82

const toEOF = Char(0);

See also

TParser.Token

The type of the current token.


toFloat

Value returned by TParser.Token when a floating point value was found in the input stream.

Declaration

Source position: classesh.inc line 86

const toFloat = Char(4);

See also

TParser.FloatType | The type of a float token.
TParser.Token | The type of the current token.
TParser.TokenFloat | Returns the current token as a float.


toInteger

Value returned by TParser.Token when an integer was found in the input stream.

Declaration

Source position: classesh.inc line 85

const toInteger = Char(3);

See also

TParser.Token | The type of the current token.
TParser.TokenInt | Returns the current token as an integer.


TOperation

Operation of which a component is notified.

Declaration

Source position: classesh.inc line 1724

type TOperation = (
opInsert, | A new component is being inserted in the child component list.
opRemove | A component is being removed from the child component list.
);


toString

Value returned by TParser.Token when a string was found in the input stream.

Declaration

Source position: classesh.inc line 84

const toString = Char(2);

See also

TParser.Token | The type of the current token.
TParser.TokenString | Returns the current token as a string.


toSymbol

Value returned by TParser.Token when a symbol was found in the input stream.

Declaration

Source position: classesh.inc line 83

const toSymbol = Char(1);

See also

TParser.CheckTokenSymbol | Checks whether the token equals the given symbol
TParser.Token | The type of the current token.
TParser.TokenComponentIdent | Returns the path of a subcomponent starting from the current token.
TParser.TokenSymbolIs | Returns True if the token equals the given symbol.


toWString

Value returned by TParser.Token when a widestring was found in the input stream.

Declaration

Source position: classesh.inc line 87

const toWString = Char(5);

See also

TParser.Token | The type of the current token.
TParser.TokenWideString | Returns the current token as a widestring


TPoint

Special type to handle a fake TComponent position

Declaration

Source position: classesh.inc line 27

type TPoint = Types.TPoint;

Description

This record describes a coordinate. It is used to handle the Top and Left properties of TComponent.

X represents the X-Coordinate of the point described by the record. Y represents the Y-Coordinate of the point described by the record.


TPointerList

Type for an Array of pointers.

Declaration

Source position: classesh.inc line 196

type TPointerList = array [0..MaxListSize-1] of Pointer;


TPropertyNotFoundEvent

Callback for the TReader.OnPropertyNotFound event.

Declaration

Source position: classesh.inc line 1223

type TPropertyNotFoundEvent = procedure(

  Reader: TReader;

  Instance: TPersistent;

  var PropName: string;

  IsPath: Boolean;

  var Handled: Boolean;

  var Skip: Boolean

) of object;

Description

TPropertyNotFoundEvent is the prototype for the TReader.OnPropertyNotFound event. Reader is the sender of the event, Instance is the instance that is being streamed. PropInfo is a pointer to the RTTI information for the property being read. Handled should be set to True if the handler redirected the unknown property succesfully, and Skip should be set to True if the value should be skipped. IsPath determines whether the property refers to a sub-property.

See also

TReader.OnPropertyNotFound

Handler for treating missing properties.


TReadComponentsProc

Callback type when reading a component from a stream

Declaration

Source position: classesh.inc line 1220

type TReadComponentsProc = procedure(

  Component: TComponent

) of object;


TReadWriteStringPropertyEvent

Callback for the TReader.OnReadStringProperty event handler

Declaration

Source position: classesh.inc line 1230

type TReadWriteStringPropertyEvent = procedure(

  Sender: TObject;

  const Instance: TPersistent;

  PropInfo: PPropInfo;

  var Content: string

) of object;

Description

TReadWriteStringPropertyEvent is the prototype for the TReader.OnReadStringProperty event handler. Reader is the sender of the event, Instance is the instance that is being streamed. PropInfo is a pointer to the RTTI information for the property being read. Content is the string as it was read from the stream.

See also

TReader.OnReadStringProperty

Handler for translating strings when read from the stream.


TRect

Descibes a rectangle

Declaration

Source position: classesh.inc line 28

type TRect = Types.TRect;

Description

TRect describes a rectangle in space with its upper-left (in (Top,Left>)) and lower-right (in (Bottom ,Right)) corners.


TReferenceNameEvent

Occurs when a named object needs to be looked up.

Declaration

Source position: classesh.inc line 1217

type TReferenceNameEvent = procedure(

  Reader: TReader;

  var Name: string

) of object;


TSeekOrigin

Specifies the origin of the TStream.Seek method.

Declaration

Source position: classesh.inc line 64

type TSeekOrigin = (
soBeginning, | Offset is interpreted relative to the start of the stream.
soCurrent, | Offset is interpreted relative to the current position in the stream.
soEnd | Offset is interpreted relative to the end of the stream.
);


TSetMethodPropertyEvent

Callback for the TReader.OnSetMethodProperty event.

Declaration

Source position: classesh.inc line 1212

type TSetMethodPropertyEvent = procedure(

  Reader: TReader;

  Instance: TPersistent;

  PropInfo: PPropInfo;

  const TheMethodName: string;

  var Handled: Boolean

) of object;

Description

TSetMethodPropertyEvent is the prototype for the TReader.OnSetMethodProperty event. Reader is the sender of the event, Instance is the instance that is being streamed. PropInfo is a pointer to the RTTI information for the property being read, and TheMethodName is the name of the method that the property should be set to. Handled should be set to True if the handler set the property succesfully.


TSetNameEvent

Occurs when the reader needs to set a component's name.

Declaration

Source position: classesh.inc line 1215

type TSetNameEvent = procedure(

  Reader: TReader;

  Component: TComponent;

  var Name: string

) of object;


TShiftState

Indicates what special keys were pressed in combination with a normal key

Declaration

Source position: classesh.inc line 109

type TShiftState = set of (
ssShift, | Shift key pressed
ssAlt, | Alt key pressed
ssCtrl, | Ctrl key pressed
ssLeft, | Left mouse button pressed.
ssRight, | Right mouse button pressed.
ssMiddle, | Middle mouse button pressed.
ssDouble, | Double mouse click.
ssMeta, | Meta key pressed.
ssSuper, | Super key pressed.
ssHyper, | Hyper key pressed.
ssAltGr, | Alt-GR key pressed.
ssCaps, | Caps lock key pressed
ssNum, | Num lock key pressed
ssScroll, | Scroll lock key pressed
ssTriple, | Triple mouse click
ssQuad, | Quadruple mouse click
ssExtra1, | Extra key 1
ssExtra2 | Extra key 2
);

Description

This type is used when describing a shortcut key or when describing what special keys are pressed on a keyboard when a key event is generated.

The set contains the special keys that can be used in combination with a 'normal' key.


TShiftStateEnum

Keyboard/Mouse shift state enumerator

Declaration

Source position: classesh.inc line 102

type TShiftStateEnum = (
ssShift, | Shift key pressed
ssAlt, | Alt key pressed
ssCtrl, | Ctrl key pressed
ssLeft, | Left mouse button pressed.
ssRight, | Right mouse button pressed.
ssMiddle, | Middle mouse button pressed.
ssDouble, | Double mouse click.
ssMeta, | Meta key pressed.
ssSuper, | Super key pressed.
ssHyper, | Hyper key pressed.
ssAltGr, | Alt-GR key pressed.
ssCaps, | Caps lock key pressed
ssNum, | Num lock key pressed
ssScroll, | Scroll lock key pressed
ssTriple, | Triple mouse click
ssQuad, | Quadruple mouse click
ssExtra1, | Extra key 1
ssExtra2 | Extra key 2
);


TShortCut

Enumeration type to identify shortcut key combinations.

Declaration

Source position: classesh.inc line 115

type TShortCut = (Word)..(Word);


TSmallPoint

Type to describe point in a small plane.

Declaration

Source position: classesh.inc line 31

type TSmallPoint = record
x: SmallInt; | X coordinate
y: SmallInt; | Y coordinate
end;

Description

Same as TPoint, only the X and Y ranges are limited to 2-byte integers instead of 4-byte integers.


TStreamOwnership

Determines the ownership of a TStreamAdapter

Declaration

Source position: classesh.inc line 1053

type TStreamOwnership = (
soReference, | Stream is referenced only, it is not freed by the adapter
soOwned | Stream is owned: it will be freed when the adapter is freed.
);

Description

The ownership of a streamadapter determines what happens with the stream on which a TStreamAdapter acts, when the adapter is freed.

See also

TStreamAdapter | Implements IStream for TStream descendants
#rtl.types.IStream | COM stream abstraction


TStreamProc

Procedure type used in streaming.

Declaration

Source position: classesh.inc line 1091

type TStreamProc = procedure(

  Stream: TStream

) of object;


TStringItem

The TStringItem is used to store the string and object items in a TStringList string list instance. It should never be used directly.

Declaration

Source position: classesh.inc line 724

type TStringItem = record
FString: string; | Contains the string.
FObject: TObject; | Contains the object, if any.
end;

See also

TStringList

Standard implementation of the TStrings class.


TStringItemList

Array of TStringItem records.

Declaration

Source position: classesh.inc line 730

type TStringItemList = array [0..MaxListSize] of TStringItem;

Description

This declaration is provided for Delphi compatibility, it is not used in Free Pascal.


TStringsSortStyle

Determines how the strings are sorted

Declaration

Source position: classesh.inc line 732

type TStringsSortStyle = (
sslNone, | The strings are not sorted
sslUser, | The strings are kept sorted by the user.
sslAuto | The TStrings instance keeps the strings sorted.
);

Description

TStringsSortStyle is the type used in the TStringList.SortStyle property, and describes how the strings are sorted when the TStringList.Sorted property is True. It has the following values:

sslNone
The strings are not sorted
sslUser
The strings are kept sorted by the user.
sslAuto
The TStrings instance keeps the strings sorted.

See also

TStringList.Sorted | Determines whether the list is sorted or not.
TStringList.SortStyle | Sort style for strings


TStringsSortStyles

Set of TStringsSortStyle

Declaration

Source position: classesh.inc line 733

type TStringsSortStyles = set of (
sslNone, | The strings are not sorted
sslUser, | The strings are kept sorted by the user.
sslAuto | The TStrings instance keeps the strings sorted.
);

Description

TStringsSortStyles is the set type for enumeration TStringsSortStyle.

See also

TStringsSortStyle

Determines how the strings are sorted


TSynchronizeProcVar

Synchronize callback type

Declaration

Source position: classesh.inc line 1572

type TSynchronizeProcVar = procedure;


TThreadMethod

Procedure variable used when synchronizing threads.

Declaration

Source position: classesh.inc line 1573

type TThreadMethod = procedure of object;


TThreadPriority

Enumeration specifying the priority at which a thread runs.

Declaration

Source position: classesh.inc line 1586

type TThreadPriority = (
tpIdle, | Thread only runs when other processes are idle.
tpLowest, | Thread runs at the lowest priority.
tpLower, | Thread runs at a lower priority.
tpNormal, | Thread runs at normal process priority.
tpHigher, | Thread runs at high priority
tpHighest, | Thread runs at highest possible priority.
tpTimeCritical | Thread runs at realtime priority.
);


TThreadReportStatus

Thread status report callback prototype

Declaration

Source position: classesh.inc line 1575

type TThreadReportStatus = procedure(

  const status: string

) of object;

Description

TThreadReportStatus is the callback prototype for the TThread.ExecuteInThread method. This callback is used to report thread status to the main thread: the Status string can be used to report the status of thread execution.

See also

TThread.ExecuteInThread | Execute a method or static procedure in a thread
TThreadExecuteStatusHandler | Signature of method to execute in a thread, with status reporting


TThreadStatusNotifyCallBack

Signature of thread status report callback

Declaration

Source position: classesh.inc line 1582

type TThreadStatusNotifyCallBack = procedure(

  Sender: TThread;

  AData: Pointer;

  const status: string

);

Description

TThreadStatusNotifyCallBack is the signature of the callback to be provided when executing a static procedure in a thread using TThread.ExecuteInThread when status reporting is required.

This callback will be called in the main thread. When called, it has the thread whose status is reported in Sender, AData is the AData parameter passed to TThread.ExecuteInThread. Finally, the status message in ReportStatus is passed to the callback.

Note that the thread reporting its status is blocked while the callback is being handled: The status is be reported to the main thread using TThread.synchronize.

See also

TThread.ExecuteInThread | Execute a method or static procedure in a thread
TThreadReportStatus | Thread status report callback prototype
TThreadExecuteStatusHandler | Signature of method to execute in a thread, with status reporting


TThreadStatusNotifyEvent

Signature of thread status report event handler

Declaration

Source position: classesh.inc line 1577

type TThreadStatusNotifyEvent = procedure(

  Sender: TThread;

  const status: string

) of object;

Description

TThreadStatusNotifyEvent is the signature of the method to be provided when executing something in a thread using TThread.ExecuteInThread when status reporting is required.

This event handler will be called in the main thread. When called, it has the thread whose status is reported in Sender, and the status message in ReportStatus is passed to the method.

Note that the thread reporting its status is blocked while the callback is being handled: The status is be reported to the main thread using TThread.synchronize.

See also

TThread.ExecuteInThread | Execute a method or static procedure in a thread
TThreadReportStatus | Thread status report callback prototype
TThreadExecuteStatusHandler | Signature of method to execute in a thread, with status reporting


TValueType

Enumerated type used to identify the kind of streamed property

Declaration

Source position: classesh.inc line 1081

type TValueType = (
vaNull, | Empty value. Ends a list.
vaList, | Identifies the start of a list of values
vaInt8, | Integer value, 8 bits long.
vaInt16, | Integer value, 16 bits long.
vaInt32, | Integer value, 32 bits long.
vaExtended, | Extended value.
vaString, | String value.
vaIdent, | Identifier.
vaFalse, | Boolean False value.
vaTrue, | Boolean True value.
vaBinary, | Binary data follows.
vaSet, | Set data follows.
vaLString, | Ansistring data follows.
vaNil, | Nil pointer.
vaCollection, | Collection follows
vaSingle, | Single type follows.
vaCurrency, | Currency value follows
vaDate, | Date value follows
vaWString, | Widestring value follows.
vaInt64, | Integer value, 64 bits long.
vaUTF8String, | UTF8 encoded unicode string.
vaUString, | UnicodeString value
vaQWord | QWord (64-bit word) value
);


TWriteMethodPropertyEvent

Callback for the TWriter.OnWriteMethodProperty event.

Declaration

Source position: classesh.inc line 1428

type TWriteMethodPropertyEvent = procedure(

  Writer: TWriter;

  Instance: TPersistent;

  PropInfo: PPropInfo;

  const MethodValue: TMethod;

  const DefMethodValue: TMethod;

  var Handled: Boolean

) of object;

Description

TWriteMethodPropertyEvent is the prototype for the TWriter.OnWriteMethodProperty event. Writer is the sender of the event, Instance is the instance that is being streamed. PropInfo is a pointer to the RTTI information for the property being written, and MethodValue is the value of the method that the property was set to. DefMethodCodeValue is set to the default value of the property (Nil or the parent value). Handled should be set to True if the handler set the property succesfully.

See also

TWriter.OnWriteMethodProperty

Handler from writing method properties.


WakeMainThread

Handler which is called if a thread wants to synchronize with the main application thread.

Declaration

Source position: classesh.inc line 2069

var WakeMainThread: TNotifyEvent = Nil;

Description

WakeMainThread is a handler, which, when set, is called by the TThread.Synchronize routine to signal the main thread that a synchronization routine is waiting in the queue.

This handler is by default empty. An actual implementation depends on the main program logic (usually an event loop) and must be provided by the event loop logic: the event loop will normally call CheckSynchronize at regular intervals. The WakeMainThread can make sure this happens as soon as possible.

While this handle should alert the main program thread that a thread is waiting for synchronization, the call is executed by the thread, and should therefore NOT synchronize the thread, but should somehow signal the main thread that a thread is waiting for synchronization. For example, by sending a message.

See also

CheckSynchronize | Check whether there are any synchronize calls in the synchronize queue.
TThread.Synchronize | Synchronizes the thread by executing the method in the main thread.


Reference for unit 'clocale'

Initialize internationalization settings from the C library

uses

  System;

The system unit

Overview

The clocale offers no API by itself: it just initializes the internationalization settings of the sysutils unit with the values provided by the C library found on most Unix or Linux systems that are POSIX compliant.

The clocale should simply be included in the uses clause of the program, preferably as one of the first units, and the initialization section of the unit will do all the work.

Note that including this unit, links your program to the C library of the system.

It makes no sense to use this unit on a non-posix system: Windows, OS/2 or DOS - therefore it should always be between an ifdef statement:

program myprogram;

uses
  {$ifdef unix}clocale{$endif},
   classes, sysutils;


Index of all identifiers in unit 'clocale'

Documentation generated on: May 12 2018


Reference for unit 'cmem'

Memory manager replacement using the C memory manager

uses

  System;

The system unit

Overview

The cmem memory manager sets the system units memory manager to a C-based memory manager: all memory management calls are shunted through to the C memory manager, using Malloc, Free and ReAlloc. For this reason, the cmem unit should be the first unit of the uses clause of the program.

The unit also offers the C memory calls directly as external declarations from the C library, but it is recommended to use the normal FPC routines for this.

Obviously, including this unit links your program to the C library.


Reference for unit 'cmem': Constants

LibName

Name of the library used


Reference for unit 'cmem': Procedures and functions

CAlloc | Allocate memory based on item size and count
Free | Free a previously allocated block
Malloc | Malloc external declaration.
ReAlloc | Reallocates a memory block


Index of all identifiers in unit 'cmem'

C F L M R

C

CAlloc

F

Free

L

LibName

M

Malloc

R

ReAlloc


LibName

Name of the library used

Declaration

Source position: cmem.pp line 41

const LibName = 'c';

Description

LibName is the name of the library that is actually used. On most systems, this is simply "libc.so".


Reference for unit 'collation_de'

German Unicode collation data

uses

  System;

The system unit

Overview

The collation_de unit registers the German Unicode collation (de). This collation bases itself on the DUCET collation, so that collation will be included as well.

This unit does not contain any routines. It simply registers the collation in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'collation_de'

Documentation generated on: May 12 2018


Reference for unit 'collation_es'

Spanish Unicode collation data

uses

  System;

The system unit

Overview

The collation_es unit registers the Spanish Unicode collation (de). This collation bases itself on the DUCET collation, so that collation will be included as well.

This unit does not contain any routines. It simply registers the collation in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'collation_es'

Documentation generated on: May 12 2018


Reference for unit 'collation_fr_ca'

French (and Canadian) Unicode collation data

uses

  System;

The system unit

Overview

The collation_fr_ca unit registers the French Unicode collation (fr). This collation bases itself on the DUCET collation, so that collation will be included as well.

This unit does not contain any routines. It simply registers the collation in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'collation_fr_ca'

Documentation generated on: May 12 2018


Reference for unit 'collation_ja'

Japanse Unicode collation data

uses

  System;

The system unit

Overview

The collation_ja unit registers the Japanese Unicode collation (ja). This collation bases itself on the DUCET collation, so that collation will be included as well.

This unit does not contain any routines. It simply registers the collation in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'collation_ja'

Documentation generated on: May 12 2018


Reference for unit 'collation_ko'

Korean Unicode collation data

uses

  System;

The system unit

Overview

The collation_ko unit registers the Korean Unicode collation (ko). This collation bases itself on the DUCET collation, so that collation will be included as well.

This unit does not contain any routines. It simply registers the collation in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'collation_ko'

Documentation generated on: May 12 2018


Reference for unit 'collation_ru'

Russian Unicode collation data

uses

  System;

The system unit

Overview

The collation_ru unit registers the Russian Unicode collation (ru). This collation bases itself on the DUCET collation, so that collation will be included as well.

This unit does not contain any routines. It simply registers the collation in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'collation_ru'

Documentation generated on: May 12 2018


Reference for unit 'collation_sv'

Swedish Unicode collation data

uses

  System;

The system unit

Overview

The collation_sv unit registers the Swedish Unicode collation (sv). This collation bases itself on the DUCET collation, so that collation will be included as well.

This unit does not contain any routines. It simply registers the collation in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'collation_sv'

Documentation generated on: May 12 2018


Reference for unit 'collation_zh'

Chinese Unicode collation data

uses

  System;

The system unit

Overview

The collation_zh unit registers the Chinese Unicode collation (zh). This collation bases itself on the DUCET collation, so that collation will be included as well.

This unit does not contain any routines. It simply registers the collation in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'collation_zh'

Documentation generated on: May 12 2018


Reference for unit 'cp1250'

Single-Byte codepage 1250 definition

uses

  System;

The system unit

Overview

The cp1250 unit registers single-byte codepage 1250. This is necessary to convert single-byte strings using codepage 1250 to unicode strings.

This unit does not contain any routines. It simply registers the code page data in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'cp1250'

Documentation generated on: May 12 2018


Reference for unit 'cp1251'

Single-Byte codepage 1251 definition

uses

  System;

The system unit

Overview

The cp1251 unit registers single-byte codepage 1251. This is necessary to convert single-byte strings using codepage 1251 to unicode strings.

This unit does not contain any routines. It simply registers the code page data in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'cp1251'

Documentation generated on: May 12 2018


Reference for unit 'cp1252'

Single-Byte codepage 1252 definition

uses

  System;

The system unit

Overview

The cp1252 unit registers single-byte codepage 1252. This is necessary to convert single-byte strings using codepage 1252 to unicode strings.

This unit does not contain any routines. It simply registers the code page data in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'cp1252'

Documentation generated on: May 12 2018


Reference for unit 'cp1253'

Single-Byte codepage 1253 definition

uses

  System;

The system unit

Overview

The cp1253 unit registers single-byte codepage 1253. This is necessary to convert single-byte strings using codepage 1253 to unicode strings.

This unit does not contain any routines. It simply registers the code page data in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'cp1253'

Documentation generated on: May 12 2018


Reference for unit 'cp1254'

Single-Byte codepage 1254 definition

uses

  System;

The system unit

Overview

The cp1254 unit registers single-byte codepage 1254. This is necessary to convert single-byte strings using codepage 1254 to unicode strings.

This unit does not contain any routines. It simply registers the code page data in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'cp1254'

Documentation generated on: May 12 2018


Reference for unit 'cp1255'

Single-Byte codepage 1255 definition

uses

  System;

The system unit

Overview

The cp1255 unit registers single-byte codepage 1255. This is necessary to convert single-byte strings using codepage 1255 to unicode strings.

This unit does not contain any routines. It simply registers the code page data in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'cp1255'

Documentation generated on: May 12 2018


Reference for unit 'cp1256'

Single-Byte codepage 1256 definition

uses

  System;

The system unit

Overview

The cp1256 unit registers single-byte codepage 1256. This is necessary to convert single-byte strings using codepage 1256 to unicode strings.

This unit does not contain any routines. It simply registers the code page data in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'cp1256'

Documentation generated on: May 12 2018


Reference for unit 'cp1257'

Single-Byte codepage 1257 definition

uses

  System;

The system unit

Overview

The cp1257 unit registers single-byte codepage 1257. This is necessary to convert single-byte strings using codepage 1257 to unicode strings.

This unit does not contain any routines. It simply registers the code page data in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'cp1257'

Documentation generated on: May 12 2018


Reference for unit 'cp1258'

Single-Byte codepage 1258 definition

uses

  System;

The system unit

Overview

The cp1258 unit registers single-byte codepage 1258. This is necessary to convert single-byte strings using codepage 1258 to unicode strings.

This unit does not contain any routines. It simply registers the code page data in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'cp1258'

Documentation generated on: May 12 2018


Reference for unit 'cp437'

Single-Byte codepage 437 definition

uses

  System;

The system unit

Overview

The cp437 unit registers single-byte codepage 437. This is necessary to convert single-byte strings using codepage 437 to unicode strings.

This unit does not contain any routines. It simply registers the code page data in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'cp437'

Documentation generated on: May 12 2018


Reference for unit 'cp646'

Single-Byte codepage 646 definition

uses

  System;

The system unit

Overview

The cp646 unit registers single-byte codepage 646. This is necessary to convert single-byte strings using codepage 646 to unicode strings.

This unit does not contain any routines. It simply registers the code page data in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'cp646'

Documentation generated on: May 12 2018


Reference for unit 'cp850'

Single-Byte codepage 850 definition

uses

  System;

The system unit

Overview

The cp850 unit registers single-byte codepage 850. This is necessary to convert single-byte strings using codepage 850 to unicode strings.

This unit does not contain any routines. It simply registers the code page data in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'cp850'

Documentation generated on: May 12 2018


Reference for unit 'cp852'

Single-Byte codepage 852 definition

uses

  System;

The system unit

Overview

The cp852 unit registers single-byte codepage 852. This is necessary to convert single-byte strings using codepage 852 to unicode strings.

This unit does not contain any routines. It simply registers the code page data in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'cp852'

Documentation generated on: May 12 2018


Reference for unit 'cp856'

Single-Byte codepage 856 definition

uses

  System;

The system unit

Overview

The cp856 unit registers single-byte codepage 856. This is necessary to convert single-byte strings using codepage 856 to unicode strings.

This unit does not contain any routines. It simply registers the code page data in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'cp856'

Documentation generated on: May 12 2018


Reference for unit 'cp866'

Single-Byte codepage 866 definition

uses

  System;

The system unit

Overview

The cp866 unit registers single-byte codepage 866. This is necessary to convert single-byte strings using codepage 866 to unicode strings.

This unit does not contain any routines. It simply registers the code page data in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'cp866'

Documentation generated on: May 12 2018


Reference for unit 'cp874'

Single-Byte codepage 874 definition

uses

  System;

The system unit

Overview

The cp874 unit registers single-byte codepage 874. This is necessary to convert single-byte strings using codepage 874 to unicode strings.

This unit does not contain any routines. It simply registers the code page data in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'cp874'

Documentation generated on: May 12 2018


Reference for unit 'cp8859_1'

Single-Byte codepage 8859_1 definition

uses

  System;

The system unit

Overview

The cp8859_1 unit registers single-byte codepage 8859-1. This is necessary to convert single-byte strings using codepage 8859-1 to unicode strings.

This unit does not contain any routines. It simply registers the code page data in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'cp8859_1'

Documentation generated on: May 12 2018


Reference for unit 'cp8859_2'

Single-Byte codepage 8859_2 definition

uses

  System;

The system unit

Overview

The cp8859_2 unit registers single-byte codepage 8859-2. This is necessary to convert single-byte strings using codepage 8859-2 to unicode strings.

This unit does not contain any routines. It simply registers the code page data in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'cp8859_2'

Documentation generated on: May 12 2018


Reference for unit 'cp8859_5'

Single-Byte codepage 8859_5 definition

uses

  System;

The system unit

Overview

The cp8859_5 unit registers single-byte codepage 8859-5. This is necessary to convert single-byte strings using codepage 8859-5 to unicode strings.

This unit does not contain any routines. It simply registers the code page data in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'cp8859_5'

Documentation generated on: May 12 2018


Reference for unit 'cp895'

Single-Byte codepage 895 definition

uses

  System;

The system unit

Overview

The cp895 unit registers single-byte codepage 895. This is necessary to convert single-byte strings using codepage 895 to unicode strings.

This unit does not contain any routines. It simply registers the code page data in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'cp895'

Documentation generated on: May 12 2018


Reference for unit 'cp932'

Single-Byte codepage 932 definition

uses

  System;

The system unit

Overview

The cp932 unit registers single-byte codepage 932. This is necessary to convert single-byte strings using codepage 932 to unicode strings.

This unit does not contain any routines. It simply registers the code page data in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'cp932'

Documentation generated on: May 12 2018


Reference for unit 'cp936'

Single-Byte codepage 936 definition

uses

  System;

The system unit

Overview

The cp936 unit registers single-byte codepage 936. This is necessary to convert single-byte strings using codepage 936 to unicode strings.

This unit does not contain any routines. It simply registers the code page data in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'cp936'

Documentation generated on: May 12 2018


Reference for unit 'cp949'

Single-Byte codepage 949 definition

uses

  System;

The system unit

Overview

The cp949 unit registers single-byte codepage 949. This is necessary to convert single-byte strings using codepage 949 to unicode strings.

This unit does not contain any routines. It simply registers the code page data in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'cp949'

Documentation generated on: May 12 2018


Reference for unit 'cp950'

Single-Byte codepage 950 definition

uses

  System;

The system unit

Overview

The cp950 unit registers single-byte codepage 950. This is necessary to convert single-byte strings using codepage 950 to unicode strings.

This unit does not contain any routines. It simply registers the code page data in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'cp950'

Documentation generated on: May 12 2018


Reference for unit 'cpall'

Add all known Single-Byte codepage definitions

uses
System, | The system unit
cp1251, | Single-Byte codepage 1251 definition
cp866, | Single-Byte codepage 866 definition
cp8859_5, | Single-Byte codepage 8859_5 definition
cp1253, | Single-Byte codepage 1253 definition
cp8859_1, | Single-Byte codepage 8859_1 definition
cp850, | Single-Byte codepage 850 definition
cp437, | Single-Byte codepage 437 definition
cp1252, | Single-Byte codepage 1252 definition
cp646, | Single-Byte codepage 646 definition
cp874, | Single-Byte codepage 874 definition
cp856, | Single-Byte codepage 856 definition
cp1250, | Single-Byte codepage 1250 definition
cp1254, | Single-Byte codepage 1254 definition
cp1255, | Single-Byte codepage 1255 definition
cp1256, | Single-Byte codepage 1256 definition
cp1257, | Single-Byte codepage 1257 definition
cp1258, | Single-Byte codepage 1258 definition
cp852, | Single-Byte codepage 852 definition
cp8859_2; | Single-Byte codepage 8859_2 definition

Overview

The cpall unit registers all known single-byte codepages: 1251, 866, ISO 8856-5 (cyrillic), 8859-1, 8859-2, 1253 (greek), 850, 437, 1252, 646, 874, 856, 1250, 1254, 1255, 1256, 1257, 1258, 852.

This unit does not contain any routines. It simply uses the other units so all corresponding code pages are registered.


Index of all identifiers in unit 'cpall'

Documentation generated on: May 12 2018


Black

Black color attribute

Declaration

Source position: crth.inc line 30

const Black = 0;


Blink

Blink attribute

Declaration

Source position: crth.inc line 50

const Blink = 128;


Blue

Blue color attribute

Declaration

Source position: crth.inc line 31

const Blue = 1;


Brown

Brown color attribute

Declaration

Source position: crth.inc line 36

const Brown = 6;


BW40

40 columns black and white screen mode.

Declaration

Source position: crth.inc line 18

const BW40 = 0;


BW80

80 columns black and white screen mode.

Declaration

Source position: crth.inc line 20

const BW80 = 2;


C40

40 columns color screen mode.

Declaration

Source position: crth.inc line 26

const C40 = CO40;


C80

80 columns color screen mode.

Declaration

Source position: crth.inc line 27

const C80 = CO80;


CheckBreak

Check for CTRL-Break keystroke. Not used.

Declaration

Source position: crth.inc line 55

var CheckBreak: Boolean = ;


CheckEOF

Check for EOF on standard input. Not used.

Declaration

Source position: crth.inc line 56

var CheckEOF: Boolean = ;


CheckSnow

Check snow on CGA screens. Not used.

Declaration

Source position: crth.inc line 58

var CheckSnow: Boolean = ;


CO40

40 columns color screen mode.

Declaration

Source position: crth.inc line 19

const CO40 = 1;


CO80

80 columns color screen mode.

Declaration

Source position: crth.inc line 21

const CO80 = 3;


ConsoleBuf

Declaration

Source position: crt.pp line 37

var ConsoleBuf: PConsoleBuf = ;


ConsoleMaxX

Declaration

Source position: crt.pp line 23

const ConsoleMaxX = 1024;


ConsoleMaxY

Declaration

Source position: crt.pp line 24

const ConsoleMaxY = 1024;


Cyan

Cyan color attribute

Declaration

Source position: crth.inc line 33

const Cyan = 3;


DarkGray

Dark gray color attribute

Declaration

Source position: crth.inc line 40

const DarkGray = 8;


DirectVideo

Use direct video access. DOS only

Declaration

Source position: crth.inc line 57

var DirectVideo: Boolean = ;

Description

The DirectVideo variable controls the writing to the screen. If it is True, the cursor is set via direct port access. If False, then the BIOS is used. This is defined under dos only.


Flushing

Declaration

Source position: crt.pp line 22

const Flushing = False;


Font8x8

Internal ROM font mode

Declaration

Source position: crth.inc line 23

const Font8x8 = 256;


Green

Green color attribute

Declaration

Source position: crth.inc line 32

const Green = 2;


Reference for unit 'Crt'

CRT - Turbo Pascal screen and keyboard handling unit

uses

  System;

The system unit

Overview

This chapter describes the CRT unit for Free Pascal, under all of Dos, Linux and Windows. The unit was first written for Dos by Florian Klaempfl. The unit was ported to Linux by Mark May and enhanced by Michael Van Canneyt and Peter Vreman. It works on the Linux console, and in xterm and rxvt windows under X-Windows. The functionality for both is the same, except that under Linux the use of an early implementation (versions 0.9.1 and earlier of the compiler) the CRT unit automatically cleared the screen at program startup.

There are some caveats when using the CRT unit:

  • Programs using the CRT unit will not be usable when input/output is being redirected on the command-line.
  • For similar reasons they are not usable as CGI-scripts for use with a webserver.
  • The use of the CRT unit and the graph unit may not always be supported.
  • The CRT unit is not thread safe.
  • On Linux or other Unix OSes, executing other programs that expect special terminal behaviour (using one of the special functions in the Linux unit) will not work. The terminal is set in RAW mode, which will destroy most terminal emulation settings.
  • The CRT unit stems from the TP/Dos area. It is designed to work with single-byte character sets, where 1 char = 1 byte. That means that widestrings or UTF-8 encoded (ansi)strings will not work correctly.


Reference for unit 'Crt': Constants

Black | Black color attribute
Blink | Blink attribute
Blue | Blue color attribute
Brown | Brown color attribute
BW40 | 40 columns black and white screen mode.
BW80 | 80 columns black and white screen mode.
C40 | 40 columns color screen mode.
C80 | 80 columns color screen mode.
CO40 | 40 columns color screen mode.
CO80 | 80 columns color screen mode.
Cyan | Cyan color attribute
DarkGray | Dark gray color attribute
Font8x8 | Internal ROM font mode
Green | Green color attribute
LightBlue | Light Blue color attribute
LightCyan | Light cyan color attribute
LightGray | Light gray color attribute
LightGreen | Light green color attribute
LightMagenta | Light magenta color attribute
LightRed | Light red color attribute
Magenta | Magenta color attribute
Mono | Monochrome screen mode (hercules screens)
Red | Red color attribute
ScreenHeight | Current screen height.
ScreenWidth | Current screen width
White | White color attribute
Yellow | Yellow color attribute


Reference for unit 'Crt': Types

tcrtcoord

Type to denote CRT coordinates


Reference for unit 'Crt': Procedures and functions

AssignCrt | Assign file to CRT.
ClrEol | Clear from cursor position till end of line.
ClrScr | Clear current window.
cursorbig | Show big cursor
cursoroff | Hide cursor
cursoron | Display cursor
Delay | Delay program execution.
DelLine | Delete line at cursor position.
GotoXY | Set cursor position on screen.
HighVideo | Switch to highlighted text mode
InsLine | Insert an empty line at cursor position
KeyPressed | Check if there is a keypress in the keybuffer
LowVideo | Switch to low intensity colors.
NormVideo | Return to normal (startup) modus
NoSound | Stop system speaker
ReadKey | Read key from keybuffer
Sound | Sound system speaker
TextBackground | Set text background
TextColor | Set text color
TextMode | Set screen mode.
WhereX | Return X (horizontal) cursor position
WhereY | Return Y (vertical) cursor position
Window | Create new window on screen.


Reference for unit 'Crt': Variables

CheckBreak | Check for CTRL-Break keystroke. Not used.
CheckEOF | Check for EOF on standard input. Not used.
CheckSnow | Check snow on CGA screens. Not used.
DirectVideo | Use direct video access. DOS only
LastMode | Last screen mode.
TextAttr | Mask to filter text attribute
WindMax | Lower right corner of currently defined window
WindMaxX | X coordinate of lower right corner of the defined window
WindMaxY | Y coordinate of lower right corner of the defined window
WindMin | Upper left corner of currently defined window
WindMinX | X coordinate of upper left corner of the defined window
WindMinY | Y coordinate of upper left corner of the defined window


Index of all identifiers in unit 'Crt'

A B C D F G H I K L M N P R S T W Y

A

AssignCrt

B

Black | Blue | BW40
Blink | Brown | BW80

C

C40 | ClrScr | cursorbig
C80 | CO40 | cursoroff
CheckBreak | CO80 | cursoron
CheckEOF | ConsoleBuf | Cyan
CheckSnow | ConsoleMaxX |
ClrEol | ConsoleMaxY |

D

DarkGray | DelLine
Delay | DirectVideo

F

Flushing Font8x8

G

GotoXY Green

H

HighVideo

I

InsLine

K

KeyPressed

L

LastMode | LightGray | LightRed
LightBlue | LightGreen | LowVideo
LightCyan | LightMagenta |

M

Magenta Mono

N

NormVideo NoSound

P

PConsoleBuf

R

ReadKey Red

S

ScreenHeight ScreenWidth Sound

T

TCharAttr | TextAttr | TextMode
TConsoleBuf | TextBackground |
tcrtcoord | TextColor |

W

WhereX | WindMaxX | WindMinY
WhereY | WindMaxY | Window
White | WindMin |
WindMax | WindMinX |

Y

Yellow


LastMode

Last screen mode.

Declaration

Source position: crth.inc line 59

var LastMode: Word = 3;

Description

The Lastmode variable tells you which mode was last selected for the screen. It is defined on DOS only.


LightBlue

Light Blue color attribute

Declaration

Source position: crth.inc line 41

const LightBlue = 9;


LightCyan

Light cyan color attribute

Declaration

Source position: crth.inc line 43

const LightCyan = 11;


LightGray

Light gray color attribute

Declaration

Source position: crth.inc line 37

const LightGray = 7;


LightGreen

Light green color attribute

Declaration

Source position: crth.inc line 42

const LightGreen = 10;


LightMagenta

Light magenta color attribute

Declaration

Source position: crth.inc line 45

const LightMagenta = 13;


LightRed

Light red color attribute

Declaration

Source position: crth.inc line 44

const LightRed = 12;


Magenta

Magenta color attribute

Declaration

Source position: crth.inc line 35

const Magenta = 5;


Mono

Monochrome screen mode (hercules screens)

Declaration

Source position: crth.inc line 22

const Mono = 7;


PConsoleBuf

Declaration

Source position: crt.pp line 34

type PConsoleBuf = ^TConsoleBuf;


Red

Red color attribute

Declaration

Source position: crth.inc line 34

const Red = 4;


ScreenHeight

Current screen height.

Declaration

Source position: crt.pp line 25

const ScreenHeight: LongInt = 25;


ScreenWidth

Current screen width

Declaration

Source position: crt.pp line 26

const ScreenWidth: LongInt = 80;


TCharAttr

Declaration

Source position: crt.pp line 29

type TCharAttr = packed record
ch: Char; | Character code
attr: Byte; | Attributes
end;


TConsoleBuf

Declaration

Source position: crt.pp line 33

type TConsoleBuf = array [0..ConsoleMaxX*ConsoleMaxY-1] of TCharAttr;


tcrtcoord

Type to denote CRT coordinates

Declaration

Source position: crth.inc line 71

type tcrtcoord = 1..255;

Description

tcrtcoord is a subrange type for denoting CRT coordinates. It supports coordinates ranging from 1 to 255. Using this type together with range-checking turned on can be used to debug CRT code.

See also

GotoXY

Set cursor position on screen.


TextAttr

Mask to filter text attribute

Declaration

Source position: crth.inc line 60

var TextAttr: Byte = $07;

Description

The TextAttr variable controls the attributes with which characters are written to screen.


White

White color attribute

Declaration

Source position: crth.inc line 47

const White = 15;


WindMax

Lower right corner of currently defined window

Declaration

Source position: crth.inc line 62

var WindMax: Word = $184f;

Description

The upper byte of WindMax contains the Y coordinate while the lower byte contains the X coordinate. The use of this variable is deprecated, use WindMaxX and WindMaxY instead.

See also

WindMaxX | X coordinate of lower right corner of the defined window
WindMaxY | Y coordinate of lower right corner of the defined window
WindMin | Upper left corner of currently defined window
WindMinX | X coordinate of upper left corner of the defined window
WindMinY | Y coordinate of upper left corner of the defined window
Window | Create new window on screen.


WindMaxX

X coordinate of lower right corner of the defined window

Declaration

Source position: crth.inc line 65

var WindMaxX: DWord = ;

See also

WindMax | Lower right corner of currently defined window
WindMaxY | Y coordinate of lower right corner of the defined window
WindMin | Upper left corner of currently defined window
WindMinX | X coordinate of upper left corner of the defined window
WindMinY | Y coordinate of upper left corner of the defined window
Window | Create new window on screen.


WindMaxY

Y coordinate of lower right corner of the defined window

Declaration

Source position: crth.inc line 67

var WindMaxY: DWord = ;

See also

WindMax | Lower right corner of currently defined window
WindMaxY | Y coordinate of lower right corner of the defined window
WindMin | Upper left corner of currently defined window
WindMinX | X coordinate of upper left corner of the defined window
WindMinY | Y coordinate of upper left corner of the defined window
Window | Create new window on screen.


WindMin

Upper left corner of currently defined window

Declaration

Source position: crth.inc line 61

var WindMin: Word = $0;

Description

The upper byte of WindMin contains the Y coordinate while the lower byte contains the X coordinate. The use of this variable is deprecated, use WindMinX and WindMinY instead.


WindMinX

X coordinate of upper left corner of the defined window

Declaration

Source position: crth.inc line 64

var WindMinX: DWord = ;

See also

WindMax | Lower right corner of currently defined window
WindMaxX | X coordinate of lower right corner of the defined window
WindMaxY | Y coordinate of lower right corner of the defined window
WindMin | Upper left corner of currently defined window
WindMinY | Y coordinate of upper left corner of the defined window
Window | Create new window on screen.


WindMinY

Y coordinate of upper left corner of the defined window

Declaration

Source position: crth.inc line 66

var WindMinY: DWord = ;

See also

WindMax | Lower right corner of currently defined window
WindMaxX | X coordinate of lower right corner of the defined window
WindMaxY | Y coordinate of lower right corner of the defined window
WindMin | Upper left corner of currently defined window
WindMinX | X coordinate of upper left corner of the defined window
Window | Create new window on screen.


Yellow

Yellow color attribute

Declaration

Source position: crth.inc line 46

const Yellow = 14;


Reference for unit 'cthreads'

Initialize the thread manager with a POSIX thread manager

uses

  System;

The system unit

Overview

The CThreads unit initializes the system unit's thread management routines with an implementation based on the POSIX thread managing routines in the C library. This assures that C libraries that are thread-aware still work if they are linked to by a FPC program.

It doesn't offer any API by itself: the initialization section of the unit just initializes the ThreadManager record in the System unit. This is done using the SetCThreadManager call

The cthreads unit simply needs to be included in the uses clause of the program, preferably the very first unit, and the initialization section of the unit will do all the work.

Note that including this unit links your program to the C library of the system.

It makes no sense to use this unit on a non-posix system: Windows, OS/2 or DOS, therefor it should always between an ifdef statement:

program myprogram;

uses
  {$ifdef unix}cthreads{$endif},
   classes, sysutils;

The Lazarus IDE inserts this conditional automatically for each new started program.


Reference for unit 'cthreads': Procedures and functions

SetCThreadManager

Sets the thread manager to the C thread manager


Index of all identifiers in unit 'cthreads'

S

S

SetCThreadManager


cbool

C boolean (longbool)

Declaration

Source position: aliasctp.inc line 45

type cbool = UnixType.cbool;


cchar

C character type (No signedness specification, 8 bit integer)

Declaration

Source position: aliasctp.inc line 21

type cchar = UnixType.cchar;


cdouble

Double precision floating point type (double)

Declaration

Source position: aliasctp.inc line 53

type cdouble = UnixType.cdouble;


cfloat

Single precision floating point type (single)

Declaration

Source position: aliasctp.inc line 52

type cfloat = UnixType.cfloat;


cint

C integer (commonly 32 bit)

Declaration

Source position: aliasctp.inc line 33

type cint = UnixType.cint;


cint8

8-bit signed integer

Declaration

Source position: aliasctp.inc line 19

type cint8 = UnixType.cint8;


cint16

16-bit signed integer.

Declaration

Source position: aliasctp.inc line 25

type cint16 = UnixType.cint16;


cint32

32-bit signed integer (commonly: int)

Declaration

Source position: aliasctp.inc line 31

type cint32 = UnixType.cint32;


cint64

64-bit integer

Declaration

Source position: aliasctp.inc line 39

type cint64 = UnixType.cint64;


clong

long integer (32/64 bit, depending on CPU register size)

Declaration

Source position: aliasctp.inc line 47

type clong = UnixType.clong;


clongdouble

Long precision floating point type (extended/double, depending on CPU)

Declaration

Source position: ctypes.pp line 115

type clongdouble = Double;


clonglong

Long (64-bit) integer

Declaration

Source position: aliasctp.inc line 41

type clonglong = UnixType.clonglong;


coff_t

Generic type to indicate offset

Declaration

Source position: aliasctp.inc line 59

type coff_t = UnixType.TOff;


cschar

C signed character type (8 bit signed integer)

Declaration

Source position: aliasctp.inc line 22

type cschar = UnixType.cschar;


cshort

Short integer (16 bit)

Declaration

Source position: aliasctp.inc line 27

type cshort = UnixType.cshort;


csigned

Signed integer (commonly 32 bit)

Declaration

Source position: aliasctp.inc line 36

type csigned = UnixType.csigned;


csint

Signed integer (commonly 32 bit)

Declaration

Source position: aliasctp.inc line 34

type csint = UnixType.csint;


csize_t

Generic type to contain a size of all kinds of structures

Declaration

Source position: aliasctp.inc line 57

type csize_t = UnixType.size_t;


cslong

Signed long integer (32/64 bit, depending on CPU register size)

Declaration

Source position: aliasctp.inc line 48

type cslong = UnixType.cslong;


cslonglong

Signed long (64-bit) integer

Declaration

Source position: aliasctp.inc line 42

type cslonglong = UnixType.cslonglong;


csshort

Short signed integer (16 bit)

Declaration

Source position: aliasctp.inc line 28

type csshort = UnixType.csshort;


cuchar

C unsigned character type (8 bit unsigned integer).

Declaration

Source position: aliasctp.inc line 23

type cuchar = UnixType.cuchar;


cuint

Unsigned integer (commonly 32 bit)

Declaration

Source position: aliasctp.inc line 35

type cuint = UnixType.cuint;


cuint8

8-bit unsigned integer

Declaration

Source position: aliasctp.inc line 20

type cuint8 = UnixType.cuint8;


cuint16

16-bit unsigned integer.

Declaration

Source position: aliasctp.inc line 26

type cuint16 = UnixType.cuint16;


cuint32

32-bit unsigned integer

Declaration

Source position: aliasctp.inc line 32

type cuint32 = UnixType.cuint32;


cuint64

Unsigned 64-bit integer

Declaration

Source position: aliasctp.inc line 40

type cuint64 = UnixType.cuint64;


culong

Unsigned long integer (32/64 bit, depending on CPU register size)

Declaration

Source position: aliasctp.inc line 49

type culong = UnixType.culong;


culonglong

Unsigned long (64-bit) integer

Declaration

Source position: aliasctp.inc line 43

type culonglong = UnixType.culonglong;


cunsigned

Unsigned integer (commonly 32 bit)

Declaration

Source position: aliasctp.inc line 37

type cunsigned = UnixType.cunsigned;


cushort

Short unsigned integer (16 bit)

Declaration

Source position: aliasctp.inc line 29

type cushort = UnixType.cushort;


Reference for unit 'ctypes'

Common C type definitions

uses
System, | The system unit
unixtype; | Basic unix types

Overview

The ctypes unit contains the definitions of commonly found C types. It can be used when interfaces to C libraries need to be defined. The types here are correct on all platforms, 32 or 64 bit.

The main advantage of using this file is to make sure that all C header import units use the same definitions for basic C types.

The h2pas program can include the ctypes unit automatically in the units it generates. The -C command-line switch can be used for this.


Reference for unit 'ctypes': Types

cbool | C boolean (longbool)
cchar | C character type (No signedness specification, 8 bit integer)
cdouble | Double precision floating point type (double)
cfloat | Single precision floating point type (single)
cint | C integer (commonly 32 bit)
cint16 | 16-bit signed integer.
cint32 | 32-bit signed integer (commonly: int)
cint64 | 64-bit integer
cint8 | 8-bit signed integer
clong | long integer (32/64 bit, depending on CPU register size)
clongdouble | Long precision floating point type (extended/double, depending on CPU)
clonglong | Long (64-bit) integer
coff_t | Generic type to indicate offset
cschar | C signed character type (8 bit signed integer)
cshort | Short integer (16 bit)
csigned | Signed integer (commonly 32 bit)
csint | Signed integer (commonly 32 bit)
csize_t | Generic type to contain a size of all kinds of structures
cslong | Signed long integer (32/64 bit, depending on CPU register size)
cslonglong | Signed long (64-bit) integer
csshort | Short signed integer (16 bit)
cuchar | C unsigned character type (8 bit unsigned integer).
cuint | Unsigned integer (commonly 32 bit)
cuint16 | 16-bit unsigned integer.
cuint32 | 32-bit unsigned integer
cuint64 | Unsigned 64-bit integer
cuint8 | 8-bit unsigned integer
culong | Unsigned long integer (32/64 bit, depending on CPU register size)
culonglong | Unsigned long (64-bit) integer
cunsigned | Unsigned integer (commonly 32 bit)
cushort | Short unsigned integer (16 bit)
pcbool | Pointer to cbool type.
pcchar | Pointer to cchar type.
pcdouble | Pointer to cdouble type.
pcfloat | Pointer to cfloat type.
pcint | Pointer to cint type.
pcint16 | Pointer to cint16 type.
pcint32 | Pointer to cint32 type.
pcint64 | Pointer to cint64 type.
pcint8 | Pointer to cint8 type.
pclong | Pointer to clong type.
Pclongdouble | Pointer to clongdouble type.
pclonglong | Pointer to clonglong type.
pcschar | Pointer to cschar type.
pcshort | Pointer to cshort type.
pcsigned | Pointer to csigned type.
pcsint | Pointer to csint type.
pcsize_t | Pointer to generic size type
pcslong | Pointer to cslong type.
pcslonglong | Pointer to cslonglong type.
pcsshort | Pointer to csshort type.
pcuchar | Pointer to cuchar type.
pcuint | Pointer to cuint type.
pcuint16 | Pointer to cuint16 type.
pcuint32 | Pointer to cuint32 type.
pcuint64 | Pointer to cuint64 type.
pcuint8 | Pointer to cuint8 type.
pculong | Pointer to culong type.
pculonglong | Pointer to culonglong type.
pcunsigned | Pointer to cunsigned type.
pcushort | Pointer to cushort type.


Index of all identifiers in unit 'ctypes'

C P

C

cbool | clonglong | cuint
cchar | coff_t | cuint16
cdouble | cschar | cuint32
cfloat | cshort | cuint64
cint | csigned | cuint8
cint16 | csint | culong
cint32 | csize_t | culonglong
cint64 | cslong | cunsigned
cint8 | cslonglong | cushort
clong | csshort |
clongdouble | cuchar |

P

pcbool | Pclongdouble | pcuchar
pcchar | pclonglong | pcuint
pcdouble | pcschar | pcuint16
pcfloat | pcshort | pcuint32
pcint | pcsigned | pcuint64
pcint16 | pcsint | pcuint8
pcint32 | pcsize_t | pculong
pcint64 | pcslong | pculonglong
pcint8 | pcslonglong | pcunsigned
pclong | pcsshort | pcushort


pcbool

Pointer to cbool type.

Declaration

Source position: aliasctp.inc line 45

type pcbool = UnixType.pcbool;


pcchar

Pointer to cchar type.

Declaration

Source position: aliasctp.inc line 21

type pcchar = UnixType.pcchar;


pcint

Pointer to cint type.

Declaration

Source position: aliasctp.inc line 33

type pcint = UnixType.pcint;


pcint8

Pointer to cint8 type.

Declaration

Source position: aliasctp.inc line 19

type pcint8 = UnixType.pcint8;


pcint16

Pointer to cint16 type.

Declaration

Source position: aliasctp.inc line 25

type pcint16 = UnixType.pcint16;


pcint32

Pointer to cint32 type.

Declaration

Source position: aliasctp.inc line 31

type pcint32 = UnixType.pcint32;


pcint64

Pointer to cint64 type.

Declaration

Source position: aliasctp.inc line 39

type pcint64 = UnixType.pcint64;


pclong

Pointer to clong type.

Declaration

Source position: aliasctp.inc line 47

type pclong = UnixType.pclong;


Pclongdouble

Pointer to clongdouble type.

Declaration

Source position: ctypes.pp line 124

type Pclongdouble = ^clongdouble;


pclonglong

Pointer to clonglong type.

Declaration

Source position: aliasctp.inc line 41

type pclonglong = UnixType.pclonglong;


pcschar

Pointer to cschar type.

Declaration

Source position: aliasctp.inc line 22

type pcschar = UnixType.pcschar;


pcshort

Pointer to cshort type.

Declaration

Source position: aliasctp.inc line 27

type pcshort = UnixType.pcshort;


pcsigned

Pointer to csigned type.

Declaration

Source position: aliasctp.inc line 36

type pcsigned = UnixType.pcsigned;


pcsint

Pointer to csint type.

Declaration

Source position: aliasctp.inc line 34

type pcsint = UnixType.pcsint;


pcsize_t

Pointer to generic size type

Declaration

Source position: aliasctp.inc line 57

type pcsize_t = UnixType.psize_t;


pcslong

Pointer to cslong type.

Declaration

Source position: aliasctp.inc line 48

type pcslong = UnixType.pcslong;


pcslonglong

Pointer to cslonglong type.

Declaration

Source position: aliasctp.inc line 42

type pcslonglong = UnixType.pcslonglong;


pcsshort

Pointer to csshort type.

Declaration

Source position: aliasctp.inc line 28

type pcsshort = UnixType.pcsshort;


pcuchar

Pointer to cuchar type.

Declaration

Source position: aliasctp.inc line 23

type pcuchar = UnixType.pcuchar;


pcuint

Pointer to cuint type.

Declaration

Source position: aliasctp.inc line 35

type pcuint = UnixType.pcuint;


pcuint8

Pointer to cuint8 type.

Declaration

Source position: aliasctp.inc line 20

type pcuint8 = UnixType.pcuint8;


pcuint16

Pointer to cuint16 type.

Declaration

Source position: aliasctp.inc line 26

type pcuint16 = UnixType.pcuint16;


pcuint32

Pointer to cuint32 type.

Declaration

Source position: aliasctp.inc line 32

type pcuint32 = UnixType.pcuint32;


pcuint64

Pointer to cuint64 type.

Declaration

Source position: aliasctp.inc line 40

type pcuint64 = UnixType.pcuint64;


pculong

Pointer to culong type.

Declaration

Source position: aliasctp.inc line 49

type pculong = UnixType.pculong;


pculonglong

Pointer to culonglong type.

Declaration

Source position: aliasctp.inc line 43

type pculonglong = UnixType.pculonglong;


pcunsigned

Pointer to cunsigned type.

Declaration

Source position: aliasctp.inc line 37

type pcunsigned = UnixType.pcunsigned;


pcushort

Pointer to cushort type.

Declaration

Source position: aliasctp.inc line 29

type pcushort = UnixType.pcushort;


Reference for unit 'cwstring'

Implement the widestring manager with a C library based implementation

uses

  System;

The system unit

Overview

The cwstring unit offers no API by itself: it just initializes the widestring manager record of the system unit with an implementation that uses collation and conversion routines which are provided by the C library found on most Unix or Linux systems that are POSIX compliant.

The cwstring should simply be included in the uses clause of the program, preferably as one of the first units, and the initialization section of the unit will do all the work.

Note that including this unit links your program to the C library of the system.

It makes no sense to use this unit on a non-POSIX system like Windows, OS/2 or DOS. Therefor it should always be enclosed with an ifdef statement:

program myprogram;

uses
  {$ifdef unix}cwstring,{$endif}
   classes, sysutils;


Reference for unit 'cwstring': Procedures and functions

SetCWidestringManager

Set the Widestring manager of the system unit to the C version


Index of all identifiers in unit 'cwstring'

S

S

SetCWidestringManager


ApproxDaysPerMonth

Average number of days in a month, measured over a year. Used in MonthsBetween.

Declaration

Source position: dateutil.inc line 67

const ApproxDaysPerMonth: Double = 30.4375;


ApproxDaysPerYear

Average number of days in a year, measured over 4 years. Used in YearsBetween.

Declaration

Source position: dateutil.inc line 68

const ApproxDaysPerYear: Double = 365.25;


DayFriday

ISO day number for Friday

Declaration

Source position: dateutil.inc line 43

const DayFriday = 5;


DayMonday

ISO day number for Monday

Declaration

Source position: dateutil.inc line 39

const DayMonday = 1;


DaySaturday

ISO day number for Saturday

Declaration

Source position: dateutil.inc line 44

const DaySaturday = 6;


DaysPerWeek

Number of days in a week.

Declaration

Source position: dateutil.inc line 31

const DaysPerWeek = 7;


DaysPerYear

Array with number of days in a year. The boolean index indicates whether it is a leap year or not.

Declaration

Source position: dateutil.inc line 54

const DaysPerYear: array [Boolean] of Word = (365, 366);


DaySunday

ISO day number for Sunday

Declaration

Source position: dateutil.inc line 45

const DaySunday = 7;


DayThursday

ISO day number for Thursday

Declaration

Source position: dateutil.inc line 42

const DayThursday = 4;


DayTuesday

ISO day number for Tuesday

Declaration

Source position: dateutil.inc line 40

const DayTuesday = 2;


DayWednesday

ISO day number for Wednesday

Declaration

Source position: dateutil.inc line 41

const DayWednesday = 3;


Reference for unit 'dateutils'

Date/Time manipulation routines.

uses
System, | The system unit
sysutils, | Various system utilities.
math; | Additional mathematical routines.

Overview

DateUtils contains a large number of date/time manipulation routines, all based on the TDateTime type. There are routines for date/time math, for comparing dates and times, for composing dates and decomposing dates in their constituent parts.


Reference for unit 'dateutils': Constants

ApproxDaysPerMonth | Average number of days in a month, measured over a year. Used in MonthsBetween.
ApproxDaysPerYear | Average number of days in a year, measured over 4 years. Used in YearsBetween.
DayFriday | ISO day number for Friday
DayMonday | ISO day number for Monday
DaySaturday | ISO day number for Saturday
DaysPerWeek | Number of days in a week.
DaysPerYear | Array with number of days in a year. The boolean index indicates whether it is a leap year or not.
DaySunday | ISO day number for Sunday
DayThursday | ISO day number for Thursday
DayTuesday | ISO day number for Tuesday
DayWednesday | ISO day number for Wednesday
MonthsPerYear | Number of months in a year
OneHour | One hour as a fraction of a day (suitable for TDateTime)
OneMillisecond | One millisecond as a fraction of a day (suitable for TDateTime)
OneMinute | One minute as a fraction of a day (suitable for TDateTime)
OneSecond | One second as a fraction of a day (suitable for TDateTime)
RecodeLeaveFieldAsIs | Bitmask deciding what to do with each TDateTime field in recode routines
WeeksPerFortnight | Number of weeks in fortnight
YearsPerCentury | Number of years in a century
YearsPerDecade | Number of years in a decade
YearsPerMillennium | Number of years in a millenium


Reference for unit 'dateutils': Procedures and functions

CompareDate | Compare 2 dates, disregarding the time of day
CompareDateTime | Compare 2 dates, taking into account the time of day
CompareTime | Compares two times of the day, disregarding the date part.
DateOf | Extract the date part from a DateTime indication.
DateTimeToDosDateTime | Convert TDateTime format to DOS date/time format
DateTimeToJulianDate | Converts a TDateTime value to a Julian date representation
DateTimeToMac | Convert a TDateTime timestamp to a Mac timestamp
DateTimeToModifiedJulianDate | Convert a TDateTime value to a modified Julian date representation
DateTimeToUnix | Convert a TDateTime value to Unix epoch time
DayOf | Extract the day (of month) part from a DateTime value
DayOfTheMonth | Extract the day (of month) part of a DateTime value
DayOfTheWeek | Extracts the day of the week from a DateTime value
DayOfTheYear | Extracts the day of the year from a TDateTime value
DaysBetween | Number of whole days between two DateTime values.
DaysInAMonth | Number of days in a month of a certain year.
DaysInAYear | Number of days in a particular year.
DaysInMonth | Return the number of days in the month in which a date occurs.
DaysInYear | Return the number of days in the year in which a date occurs.
DaySpan | Calculate the approximate number of days between two DateTime values.
DecodeDateDay | Decode a DateTime value in year and year of day.
DecodeDateMonthWeek | Decode a DateTime value in a month, week of month and day of week
DecodeDateTime | Decode a datetime value in a date and time value
DecodeDateWeek | Decode a DateTime value in a week of year and day of week.
DecodeDayOfWeekInMonth | Decode a DateTime value in year, month, day of week parts
DosDateTimeToDateTime | Convert DOS date/time format to TDateTime format
EncodeDateDay | Encodes a year and day of year to a DateTime value
EncodeDateMonthWeek | Encodes a year, month, week of month and day of week to a DateTime value
EncodeDateTime | Encodes a DateTime value from all its parts
EncodeDateWeek | Encode a TDateTime value from a year, week and day of week triplet
EncodeDayOfWeekInMonth | Encodes a year, month, week, day of week specification to a TDateTime value
EncodeTimeInterval | Encode an interval as a TDateTime value.
EndOfADay | Calculates a DateTime value representing the end of a specified day
EndOfAMonth | Calculate a datetime value representing the last day of the indicated month
EndOfAWeek | Return the last moment of day of the week, given a year and a week in the year.
EndOfAYear | Calculate a DateTime value representing the last day of a year
EndOfTheDay | Calculate a datetime value that represents the end of a given day.
EndOfTheMonth | Calculate a DateTime value representing the last day of the month, given a day in that month.
EndOfTheWeek | Calculate a DateTime value which represents the end of a week, given a date in that week.
EndOfTheYear | Calculate a DateTime value representing the last day of a year, given a date in that year.
HourOf | Extract the hour part from a DateTime value.
HourOfTheDay | Calculate the hour of a given DateTime value
HourOfTheMonth | Calculate the number of hours passed since the start of the month.
HourOfTheWeek | Calculate the number of hours elapsed since the start of the week.
HourOfTheYear | Calculate the number of hours passed since the start of the year.
HoursBetween | Calculate the number of whole hours between two DateTime values.
HourSpan | Calculate the approximate number of hours between two DateTime values.
IncDay | Increase a DateTime value with a number of days.
IncHour | Increase a DateTime value with a number of hours.
IncMilliSecond | Increase a DateTime value with a number of milliseconds.
IncMinute | Increase a DateTime value with a number of minutes.
IncSecond | Increase a DateTime value with a number of seconds.
IncWeek | Increase a DateTime value with a number of weeks.
IncYear | Increase a DateTime value with a number of years.
InvalidDateDayError | Raise an EConvertError exception when a day is not a valid day of a year.
InvalidDateMonthWeekError | Raise an EConvertError exception when a Year,Month,WeekOfMonth,DayofWeek is invalid.
InvalidDateTimeError | Raise an EConvertError about an invalid date-time specification.
InvalidDateWeekError | Raise an EConvertError with an invalid Year, WeekOfyear and DayOfWeek specification
InvalidDayOfWeekInMonthError | Raise an EConvertError exception when a Year,Month,NthDayofWeek,DayofWeek is invalid.
IsInLeapYear | Determine whether a date is in a leap year.
IsPM | Determine whether a time is PM or AM.
IsSameDay | Check if two date/time indications are the same day.
IsSameMonth | Check if 2 dates are in the same month.
IsToday | Check whether a given date is today.
IsValidDate | Check whether a set of values is a valid date indication.
IsValidDateDay | Check whether a given year/day of year combination is a valid date.
IsValidDateMonthWeek | Check whether a given year/month/week/day of the week combination is a valid day
IsValidDateTime | Check whether a set of values is a valid date and time indication.
IsValidDateWeek | Check whether a given year/week/day of the week combination is a valid day.
IsValidTime | Check whether a set of values is a valid time indication.
JulianDateToDateTime | Convert a Julian date representation to a TDateTime value.
LocalTimeToUniversal | Convert local time to UTC time
MacTimeStampToUnix | Convert a Mac timestamp to a Unix timestamp
MacToDateTime | Convert a Mac timestamp to a TDateTime timestamp
MilliSecondOf | Extract the millisecond part from a DateTime value.
MilliSecondOfTheDay | Calculate the number of milliseconds elapsed since the start of the day
MilliSecondOfTheHour | Calculate the number of milliseconds elapsed since the start of the hour
MilliSecondOfTheMinute | Calculate the number of milliseconds elapsed since the start of the minute
MilliSecondOfTheMonth | Calculate number of milliseconds elapsed since the start of the month.
MilliSecondOfTheSecond | Calculate the number of milliseconds elapsed since the start of the second
MilliSecondOfTheWeek | Calculate the number of milliseconds elapsed since the start of the week
MilliSecondOfTheYear | Calculate the number of milliseconds elapsed since the start of the year.
MilliSecondsBetween | Calculate the number of whole milliseconds between two DateTime values.
MilliSecondSpan | Calculate the approximate number of milliseconds between two DateTime values.
MinuteOf | Extract the minute part from a DateTime value.
MinuteOfTheDay | Calculate the number of minutes elapsed since the start of the day
MinuteOfTheHour | Calculate the number of minutes elapsed since the start of the hour
MinuteOfTheMonth | Calculate number of minutes elapsed since the start of the month.
MinuteOfTheWeek | Calculate the number of minutes elapsed since the start of the week
MinuteOfTheYear | Calculate the number of minutes elapsed since the start of the year
MinutesBetween | Calculate the number of whole minutes between two DateTime values.
MinuteSpan | Calculate the approximate number of minutes between two DateTime values.
ModifiedJulianDateToDateTime | Convert a modified Julian date representation to a TDateTime value.
MonthOf | Extract the month from a given date.
MonthOfTheYear | Extract the month of a DateTime indication.
MonthsBetween | Calculate the number of whole months between two DateTime values
MonthSpan | Calculate the approximate number of months between two DateTime values.
NthDayOfWeek | Calculate which occurrence of weekday in the month a given day represents
PeriodBetween | Return the period (in years, months, days) between two dates
PreviousDayOfWeek | Given a day of the week, return the previous day of the week.
RecodeDate | Replace date part of a TDateTime value with another date.
RecodeDateTime | Replace selected parts of a TDateTime value with other values
RecodeDay | Replace day part of a TDateTime value with another day.
RecodeHour | Replace hours part of a TDateTime value with another hour.
RecodeMilliSecond | Replace milliseconds part of a TDateTime value with another millisecond.
RecodeMinute | Replace minutse part of a TDateTime value with another minute.
RecodeMonth | Replace month part of a TDateTime value with another month.
RecodeSecond | Replace seconds part of a TDateTime value with another second.
RecodeTime | Replace time part of a TDateTime value with another time.
RecodeYear | Replace year part of a TDateTime value with another year.
SameDate | Check whether two TDateTime values have the same date part.
SameDateTime | Check whether two TDateTime values have the same date and time parts.
SameTime | Check whether two TDateTime values have the same time part.
ScanDateTime | Scans a string for a DateTime pattern and returns the date/time
SecondOf | Extract the second part from a DateTime value.
SecondOfTheDay | Calculate the number of seconds elapsed since the start of the day
SecondOfTheHour | Calculate the number of seconds elapsed since the start of the hour
SecondOfTheMinute | Calculate the number of seconds elapsed since the start of the minute
SecondOfTheMonth | Calculate number of seconds elapsed since the start of the month.
SecondOfTheWeek | Calculate the number of seconds elapsed since the start of the week
SecondOfTheYear | Calculate the number of seconds elapsed since the start of the year.
SecondsBetween | Calculate the number of whole seconds between two DateTime values.
SecondSpan | Calculate the approximate number of seconds between two DateTime values.
StartOfADay | Return the start of a day as a DateTime value, given a day indication
StartOfAMonth | Return first date of month, given a year/month pair.
StartOfAWeek | Return a day of the week, given a year, week and day in the week.
StartOfAYear | Return the first day of a given year.
StartOfTheDay | Calculate the start of the day as a DateTime value, given a moment in the day.
StartOfTheMonth | Calculate the first day of the month, given a date in that month.
StartOfTheWeek | Return the first day of the week, given a date.
StartOfTheYear | Return the first day of the year, given a date in this year.
TimeOf | Extract the time part from a DateTime indication.
Today | Return the current date
Tomorrow | Return the next day
TryEncodeDateDay | Encode a year and day of year to a TDateTime value
TryEncodeDateMonthWeek | Encode a year, month, week of month and day of week to a TDateTime value
TryEncodeDateTime | Encode a Year, Month, Day, Hour, minute, seconds, milliseconds tuplet to a TDateTime value
TryEncodeDateWeek | Encode a year, week and day of week triplet to a TDateTime value
TryEncodeDayOfWeekInMonth | Encode a year, month, week, day of week triplet to a TDateTime value
TryEncodeTimeInterval | Try to encode an interval as a TDateTime value.
TryJulianDateToDateTime | Convert a Julian date representation to a TDateTime value.
TryModifiedJulianDateToDateTime | Convert a modified Julian date representation to a TDateTime value.
TryRecodeDateTime | Replace selected parts of a TDateTime value with other values
UniversalTimeToLocal | Convert UTC time to local time
UnixTimeStampToMac | Convert Unix Timestamp to a Mac Timestamp
UnixToDateTime | Convert Unix epoch time to a TDateTime value
WeekOf | Extract week (of the year) from a given date.
WeekOfTheMonth | Extract the week of the month (and optionally month and year) from a DateTime value
WeekOfTheYear | Extract the week of the year (and optionally year) of a DateTime indication.
WeeksBetween | Calculate the number of whole weeks between two DateTime values
WeeksInAYear | Return the number of weeks in a given year
WeeksInYear | return the number of weeks in the year, given a date
WeekSpan | Calculate the approximate number of weeks between two DateTime values.
WithinPastDays | Check whether two datetimes are only a number of days apart
WithinPastHours | Check whether two datetimes are only a number of hours apart
WithinPastMilliSeconds | Check whether two datetimes are only a number of milliseconds apart
WithinPastMinutes | Check whether two datetimes are only a number of minutes apart
WithinPastMonths | Check whether two datetimes are only a number of months apart
WithinPastSeconds | Check whether two datetimes are only a number of seconds apart
WithinPastWeeks | Check whether two datetimes are only a number of weeks apart
WithinPastYears | Check whether two datetimes are only a number of years apart
YearOf | Extract the year from a given date.
YearsBetween | Calculate the number of whole years between two DateTime values
YearSpan | Calculate the approximate number of years between two DateTime values.
Yesterday | Return the previous day.


Index of all identifiers in unit 'dateutils'

A C D E H I J L M N O P R S T U W Y

A

ApproxDaysPerMonth ApproxDaysPerYear

C

CompareDate CompareDateTime CompareTime

D

DateOf | DayOfTheYear | DayThursday
DateTimeToDosDateTime | DaySaturday | DayTuesday
DateTimeToJulianDate | DaysBetween | DayWednesday
DateTimeToMac | DaysInAMonth | DecodeDateDay
DateTimeToModifiedJulianDate | DaysInAYear | DecodeDateMonthWeek
DateTimeToUnix | DaysInMonth | DecodeDateTime
DayFriday | DaysInYear | DecodeDateWeek
DayMonday | DaySpan | DecodeDayOfWeekInMonth
DayOf | DaysPerWeek | DosDateTimeToDateTime
DayOfTheMonth | DaysPerYear |
DayOfTheWeek | DaySunday |

E

EncodeDateDay | EncodeTimeInterval | EndOfTheDay
EncodeDateMonthWeek | EndOfADay | EndOfTheMonth
EncodeDateTime | EndOfAMonth | EndOfTheWeek
EncodeDateWeek | EndOfAWeek | EndOfTheYear
EncodeDayOfWeekInMonth | EndOfAYear |

H

HourOf | HourOfTheWeek | HourSpan
HourOfTheDay | HourOfTheYear |
HourOfTheMonth | HoursBetween |

I

IncDay | InvalidDateMonthWeekError | IsToday
IncHour | InvalidDateTimeError | IsValidDate
IncMilliSecond | InvalidDateWeekError | IsValidDateDay
IncMinute | InvalidDayOfWeekInMonthError | IsValidDateMonthWeek
IncSecond | IsInLeapYear | IsValidDateTime
IncWeek | IsPM | IsValidDateWeek
IncYear | IsSameDay | IsValidTime
InvalidDateDayError | IsSameMonth |

J

JulianDateToDateTime

L

LocalTimeToUniversal

M

MacTimeStampToUnix | MilliSecondOfTheYear | MinutesBetween
MacToDateTime | MilliSecondsBetween | MinuteSpan
MilliSecondOf | MilliSecondSpan | ModifiedJulianDateToDateTime
MilliSecondOfTheDay | MinuteOf | MonthOf
MilliSecondOfTheHour | MinuteOfTheDay | MonthOfTheYear
MilliSecondOfTheMinute | MinuteOfTheHour | MonthsBetween
MilliSecondOfTheMonth | MinuteOfTheMonth | MonthSpan
MilliSecondOfTheSecond | MinuteOfTheWeek | MonthsPerYear
MilliSecondOfTheWeek | MinuteOfTheYear |

N

NthDayOfWeek

O

OneHour | OneMinute
OneMillisecond | OneSecond

P

PeriodBetween PreviousDayOfWeek

R

RecodeDate | RecodeLeaveFieldAsIs | RecodeSecond
RecodeDateTime | RecodeMilliSecond | RecodeTime
RecodeDay | RecodeMinute | RecodeYear
RecodeHour | RecodeMonth |

S

SameDate | SecondOfTheMinute | StartOfAMonth
SameDateTime | SecondOfTheMonth | StartOfAWeek
SameTime | SecondOfTheWeek | StartOfAYear
ScanDateTime | SecondOfTheYear | StartOfTheDay
SecondOf | SecondsBetween | StartOfTheMonth
SecondOfTheDay | SecondSpan | StartOfTheWeek
SecondOfTheHour | StartOfADay | StartOfTheYear

T

TimeOf | TryEncodeDateMonthWeek | TryEncodeTimeInterval
Today | TryEncodeDateTime | TryJulianDateToDateTime
Tomorrow | TryEncodeDateWeek | TryModifiedJulianDateToDateTime
TryEncodeDateDay | TryEncodeDayOfWeekInMonth | TryRecodeDateTime

U

UniversalTimeToLocal UnixTimeStampToMac UnixToDateTime

W

WeekOf | WeekSpan | WithinPastMonths
WeekOfTheMonth | WeeksPerFortnight | WithinPastSeconds
WeekOfTheYear | WithinPastDays | WithinPastWeeks
WeeksBetween | WithinPastHours | WithinPastYears
WeeksInAYear | WithinPastMilliSeconds |
WeeksInYear | WithinPastMinutes |

Y

YearOf | YearsPerCentury | Yesterday
YearsBetween | YearsPerDecade |
YearSpan | YearsPerMillennium |


MonthsPerYear

Number of months in a year

Declaration

Source position: dateutil.inc line 33

const MonthsPerYear = 12;


OneHour

One hour as a fraction of a day (suitable for TDateTime)

Declaration

Source position: dateutil.inc line 48

const OneHour = TDateTime(1) / HoursPerDay;


OneMillisecond

One millisecond as a fraction of a day (suitable for TDateTime)

Declaration

Source position: dateutil.inc line 51

const OneMillisecond = TDateTime(1) / MSecsPerDay;


OneMinute

One minute as a fraction of a day (suitable for TDateTime)

Declaration

Source position: dateutil.inc line 49

const OneMinute = TDateTime(1) / MinsPerDay;


OneSecond

One second as a fraction of a day (suitable for TDateTime)

Declaration

Source position: dateutil.inc line 50

const OneSecond = TDateTime(1) / SecsPerDay;


RecodeLeaveFieldAsIs

Bitmask deciding what to do with each TDateTime field in recode routines

Declaration

Source position: dateutil.inc line 58

const RecodeLeaveFieldAsIs = High(Word);


WeeksPerFortnight

Number of weeks in fortnight

Declaration

Source position: dateutil.inc line 32

const WeeksPerFortnight = 2;


YearsPerCentury

Number of years in a century

Declaration

Source position: dateutil.inc line 35

const YearsPerCentury = 100;


YearsPerDecade

Number of years in a decade

Declaration

Source position: dateutil.inc line 34

const YearsPerDecade = 10;


YearsPerMillennium

Number of years in a millenium

Declaration

Source position: dateutil.inc line 36

const YearsPerMillennium = 1000;


anyfile

Match any file attribute

Declaration

Source position: dosh.inc line 49

const anyfile = $3F;


archive

Archive file attribute

Declaration

Source position: dosh.inc line 48

const archive = $20;


ComStr

Command-line string type

Declaration

Source position: dosh.inc line 60

type ComStr = string;


DateTime

Record containing a date/time description

Declaration

Source position: dosh.inc line 66

type DateTime = packed record
Year: Word; | Year part
Month: Word; | Month of the year
Day: Word; | Day of the month
Hour: Word; | Hour of the day
Min: Word; | Minute of the hour
Sec: Word; | Second in the minute
end;

Description

The DateTime type is used in PackTime and UnPackTime for setting/reading file times with GetFTime and SetFTime.


directory

Directory file attribute

Declaration

Source position: dosh.inc line 47

const directory = $10;


DirStr

Full directory string type.

Declaration

Source position: dosh.inc line 62

type DirStr = string;


Directory and disk handling

Routines to handle disk information.

Name | Description
AddDisk | Add disk to list of disks (UNIX only)
DiskFree | Return size of free disk space
DiskSize | Return total disk size


DosError

Last OS (MS-DOS) error

Declaration

Source position: dosh.inc line 76

var DosError: Integer = ;

Description

The DosError variable is used by the procedures in the Dos unit to report errors. It can have the following values :

Dos error codes
Value | Meaning
2 | File not found.
3 | Path not found.
5 | Access denied.
6 | Invalid handle.
8 | Not enough memory.
10 | Invalid environment.
11 | Invalid format.
18 | No more files.

Other values are possible, but are not documented.


ExtStr

Filename extension string type.

Declaration

Source position: dosh.inc line 64

type ExtStr = string;


fauxiliary

CPU auxiliary flag. Not used.

Declaration

Source position: dosh.inc line 37

const fauxiliary = $0010;


fcarry

CPU carry flag. Not used.

Declaration

Source position: dosh.inc line 35

const fcarry = $0001;


File attributes

The File Attribute constants are used in FindFirst, FindNext to determine what type of special file to search for in addition to normal files. These flags are also used in the SetFAttr and GetFAttr routines to set and retrieve attributes of files. For their definitions consult fileattributes.

Possible file attributes
Constant | Description | Value
readonly | Read-Only file attribute | $01
hidden | Hidden file attribute | $02
sysfile | System file attribute | $04
volumeid | Volumd ID file attribute | $08
directory | Directory file attribute | $10
archive | Archive file attribute | $20
anyfile | Match any file attribute | $3F


File handling

Routines to handle files on disk.

Name | Description
FExpand | Expand filename to full path
FindClose | Close finfirst/findnext session
FindFirst | Start find of file
FindNext | Find next file
FSearch | Search for file in a path
FSplit | Split filename in parts
GetFAttr | Return file attributes
GetFTime | Return file time
GetLongName | Convert short filename to long filename (DOS only)
GetShortName | Convert long filename to short filename (DOS only)
SetFAttr | Set file attributes
SetFTime | Set file time


File open mode constants.

These constants are used in the Mode field of the TextRec record. Gives information on the filemode of the text I/O. For their definitions consult the following table:

Possible mode constants
Constant | Description | Value
fmclosed | File is closed | $D7B0
fminput | File is read only | $D7B1
fmoutput | File is write only | $D7B2
fminout | File is read and write | $D7B3


FileNameLen

Maximum length of a filename

Declaration

Source position: dos.pp line 20

const FileNameLen = 255;


fmclosed

File is closed

Declaration

Source position: dosh.inc line 52

const fmclosed = $D7B0;


fminout

File is read and write

Declaration

Source position: dosh.inc line 55

const fminout = $D7B3;


fminput

File is read only

Declaration

Source position: dosh.inc line 53

const fminput = $D7B1;


fmoutput

File is write only

Declaration

Source position: dosh.inc line 54

const fmoutput = $D7B2;


foverflow

CPU overflow flag. Not used.

Declaration

Source position: dosh.inc line 40

const foverflow = $0800;


fparity

CPU parity flag. Not used.

Declaration

Source position: dosh.inc line 36

const fparity = $0004;


fsign

CPU sign flag. Not used.

Declaration

Source position: dosh.inc line 39

const fsign = $0080;


fzero

CPU zero flag. Not used.

Declaration

Source position: dosh.inc line 38

const fzero = $0040;


hidden

Hidden file attribute

Declaration

Source position: dosh.inc line 44

const hidden = $02;


Reference for unit 'Dos'

DOS - Turbo Pascal MS-DOS interface

uses
System, | The system unit
BaseUnix; | Basic Unix functionality

Overview

The DOS unit gives access to some operating system calls related to files, the file system, date and time. Except for the PalmOS target, this unit is available to all supported platforms.

The unit was first written for Dos by Florian Klaempfl. It was ported to Linux by Mark May and enhanced by Michael Van Canneyt. The Amiga version was ported by Nils Sjoholm.

Under non-DOS systems, some of the functionality is lost, as it is either impossible or meaningless to implement it. Other than that, the functionality is the same for all operating systems.

Because the DOS unit is a Turbo Pascal compatibility unit, it is no longer actively developed: the interface is frozen and it is maintained only for the purpose of porting Turbo Pascal programs. For new development, it is recommended to use the sysutils unit instead.

Related topics

sysinfo | System information
process | Process handling
diskhandling | Directory and disk handling
filehandling | File handling
filemodes | File open mode constants.
fileattributes | File attributes


Reference for unit 'Dos': Constants

anyfile | Match any file attribute
archive | Archive file attribute
directory | Directory file attribute
fauxiliary | CPU auxiliary flag. Not used.
fcarry | CPU carry flag. Not used.
FileNameLen | Maximum length of a filename
fmclosed | File is closed
fminout | File is read and write
fminput | File is read only
fmoutput | File is write only
foverflow | CPU overflow flag. Not used.
fparity | CPU parity flag. Not used.
fsign | CPU sign flag. Not used.
fzero | CPU zero flag. Not used.
hidden | Hidden file attribute
readonly | Read-Only file attribute
sysfile | System file attribute
volumeid | Volumd ID file attribute


Reference for unit 'Dos': Types

ComStr | Command-line string type
DateTime | Record containing a date/time description
DirStr | Full directory string type.
ExtStr | Filename extension string type.
NameStr | Fill filename string type.
PathStr | Full File path string type.
Registers | Record to keep CPU registers for MSDos call. Unused.
SearchRec | File Search Results record


Reference for unit 'Dos': Procedures and functions

AddDisk | Add disk definition to list if drives (Unix only)
DiskFree | Get free size on Disk.
DiskSize | Get total size of disk.
DosExitCode | Exit code of last executed program.
DosVersion | Current OS version
DTToUnixDate | Convert a DateTime to Unix timestamp
EnvCount | Return the number of environment variables
EnvStr | Return environment variable by index
Exec | Execute another program, and wait for it to finish.
FExpand | Expand a relative path to an absolute path
FindClose | Dispose resources allocated by a FindFirst/FindNext sequence.
FindFirst | Start search for one or more files.
FindNext | Find next matching file after FindFirst
FSearch | Search a file in searchpath
FSplit | Split a full-path filename in parts.
GetCBreak | Get control-Break flag
GetDate | Get the current date
GetEnv | Get environment variable by name.
GetFAttr | Get file attributes
GetFTime | Get file last modification time.
GetIntVec | Get interrupt vector
GetLongName | Get the long filename of a DOS 8.3 filename.
GetMsCount | Number of milliseconds since a starting point.
GetShortName | Get the short (8.3) filename of a long filename.
GetTime | Return the current time
GetVerify | Get verify flag
Intr | Execute interrupt
Keep | Terminate and stay resident.
MSDos | Execute MS-DOS system call
PackTime | Pack DateTime value to a packed-time format.
SetCBreak | Set Control-Break flag status
SetDate | Set system date
SetFAttr | Set file attributes
SetFTime | Set file modification time.
SetIntVec | Set interrupt vector
SetTime | Set system time
SetVerify | Set verify flag
SwapVectors | Swap interrupt vectors
UnixDateToDt | Convert a Unix timestamp to a DateTime record
UnpackTime | Unpack packed file time to a DateTime value
weekday | Return the day of the week


[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'Dos' (#rtl)

Reference for unit 'Dos': Variables

DosError

Last OS (MS-DOS) error


Index of all identifiers in unit 'Dos'

A C D E F G H I K M N P R S U V W

A

AddDisk anyfile archive

C

ComStr

D

DateTime | DiskFree | DosExitCode
directory | DiskSize | DosVersion
DirStr | DosError | DTToUnixDate

E

EnvCount | Exec
EnvStr | ExtStr

F

fauxiliary | FindNext | fparity
fcarry | fmclosed | FSearch
FExpand | fminout | fsign
FileNameLen | fminput | FSplit
FindClose | fmoutput | fzero
FindFirst | foverflow |

G

GetCBreak | GetFTime | GetShortName
GetDate | GetIntVec | GetTime
GetEnv | GetLongName | GetVerify
GetFAttr | GetMsCount |

H

hidden

I

Intr

K

Keep

M

MSDos

N

NameStr

P

PackTime PathStr

R

readonly Registers

S

SearchRec | SetFTime | SwapVectors
SetCBreak | SetIntVec | sysfile
SetDate | SetTime |
SetFAttr | SetVerify |

U

UnixDateToDt UnpackTime

V

volumeid

W

weekday


NameStr

Fill filename string type.

Declaration

Source position: dosh.inc line 63

type NameStr = string;


PathStr

Full File path string type.

Declaration

Source position: dosh.inc line 61

type PathStr = string;


Process handling

Functions to handle process information and starting new processes.

Name | Description
DosExitCode | Exit code of last executed program
EnvCount | Return number of environment variables
EnvStr | Return environment string pair
Exec | Execute program
GetEnv | Return specified environment string


readonly

Read-Only file attribute

Declaration

Source position: dosh.inc line 43

const readonly = $01;


Registers

Record to keep CPU registers for MSDos call. Unused.

Declaration

Source position: dosh.inc line 24

type Registers = packed record
case i: Integer of
0: (
ax: Word; | AX register
f1: Word; | F1 register
bx: Word; | BX register
f2: Word; | F2 register
cx: Word; | CX register
f3: Word; | F3 register
dx: Word; | DX register
f4: Word; | F4 register
bp: Word; | BP register
f5: Word; | F5 register
si: Word; | SI register
f51: Word; | F51 register
di: Word; | DI register
f6: Word; | F6 register
ds: Word; | DS register
f7: Word; | F7 register
es: Word; | ES register
f8: Word; | F8 register
flags: Word; | Flags
fs: Word; | FS register
gs: Word; | GS register
);
1: (
al: Byte; | AL register
ah: Byte; | AH register
f9: Byte; | F9 register
f10: Byte; | F10 register
bl: Byte; | BL register
bh: Byte; | BH register
f11: Byte; | F11 register
f12: Byte; | F12 register
cl: Byte; | CL register
ch: Byte; | CH register
f13: Byte; | F13 register
f14: Byte; | F14 register
dl: Byte; | DL register
dh: Byte; | DH register
);
2: (
eax: LongInt; | EAX register
ebx: LongInt; | EBX register
ecx: LongInt; | ECX register
edx: LongInt; | EDX register
ebp: LongInt; | EBP register
esi: LongInt; | ESI register
edi: LongInt; | EDI register
);
end;

Description

This structure is only defined on a i386 compatible 32-bit platform, and is not used anywhere: it is defined for Turbo Pascal backwards compatibility only.


SearchRec

File Search Results record

Declaration

Source position: dos.pp line 23

type SearchRec = packed record
SearchPos: TOff; | Current search position
SearchNum: LongInt; | Current search number
DirPtr: Pointer; | Pointer to directory
SearchType: Byte; | Type of search
SearchAttr: Byte; | Attributes specified at findfirst.
Mode: Word; | File mode for Unix systems
Fill: array [1..1] of Byte; | Padding bytes
Attr: Byte; | Attributes of the file.
Time: LongInt; | Timestamp of the file
Size: LongInt; | Size of the file
Reserved: Word; | Reserved for future use
Name: string; | Name fo the file
SearchSpec: string; | Wildcard specs specified at findfirst
NamePos: Word; | Name position
end;

Description

SearchRec is filled by the FindFirst call and can be used in subsequent FindNext calls to search for files. The structure of this record depends on the platform. Only the following fields are present on all platforms:

Attr
File attributes.
Time
File modification time.
Size
File size
Name
File name (name part only, no path)
Mode
File access mode (Linux only)


sysfile

System file attribute

Declaration

Source position: dosh.inc line 45

const sysfile = $04;


System information

Functions for retrieving and setting general system information such as date and time.

Name | Description
DosVersion | Get OS version
GetCBreak | Get setting of control-break handling flag
GetDate | Get system date
GetIntVec | Get interrupt vector status
GetTime | Get system time
GetVerify | Get verify flag
Intr | Execute an interrupt
Keep | Keep process in memory and exit
MSDos | Execute MS-Dos function call
PackTime | Pack time for file time
SetCBreak | Set control-break handling flag
SetDate | Set system date
SetIntVec | Set interrupt vectors
SetTime | Set system time
SetVerify | Set verify flag
SwapVectors | Swap interrupt vectors
UnPackTime | Unpack file time


volumeid

Volumd ID file attribute

Declaration

Source position: dosh.inc line 46

const volumeid = $08;


Reference for unit 'dxeload'

Load DXE file in to memory

uses

  System;

The system unit

Overview

The dxeload unit was implemented by Pierre Mueller for dos, it allows to load a DXE file (an object file with 1 entry point) into memory and return a pointer to the entry point.

It exists only for dos.


Reference for unit 'dxeload': Procedures and functions

dxe_load

Load DXE file in memory


Index of all identifiers in unit 'dxeload'

D

D

dxe_load


HModule

Alias for TLibHandle type.

Declaration

Source position: dynlibs.pas line 61

type HModule = TLibHandle;


Reference for unit 'dynlibs'

Cross-platform support for dynamically loadable libraries

uses

  System;

The system unit

Overview

The Dynlibs unit provides support for dynamically loading shared libraries. It is available only on those platforms that support shared libraries. The functionality available here may only be a part of the functionality available on each separate platform, in the interest of portability.

On unix platforms, using this unit will cause the program to be linked to the C library, as most shared libraries are implemented in C and the dynamical linker too.


Reference for unit 'dynlibs': Constants

NilHandle | Correctly typed Nil handle - returned on error by LoadLibrary
SharedSuffix | Extension of shared library


Reference for unit 'dynlibs': Types

HModule | Alias for TLibHandle type.
TLibHandle | Library handle type
TOrdinalEntry | Opaque type for retrieving addresses using ordinal IDs


Reference for unit 'dynlibs': Procedures and functions

FreeLibrary | For compatibility with Delphi/Windows: Unload a library
GetLoadErrorStr | Return a textual description of the last load error
GetProcAddress | For compatibility with Delphi/Windows: Get the address of a procedure
GetProcedureAddress | Get the address of a procedure or symbol in a dynamic library.
LoadLibrary | Load a dynamic library and return a handle to it.
SafeLoadLibrary | Saves the control word and loads a library
UnloadLibrary | Unload a previously loaded library


Index of all identifiers in unit 'dynlibs'

F G H L N S T U

F

FreeLibrary

G

GetLoadErrorStr GetProcAddress GetProcedureAddress

H

HModule

L

LoadLibrary

N

NilHandle

S

SafeLoadLibrary SharedSuffix

T

TLibHandle TOrdinalEntry

U

UnloadLibrary


NilHandle

Correctly typed Nil handle - returned on error by LoadLibrary

Declaration

Source position: dynlibs.inc line 27

const NilHandle = TLibHandle(0);


SharedSuffix

Extension of shared library

Declaration

Source position: dynlibs.inc line 34

const SharedSuffix = 'so';

Description

SharedSuffix contains the extension of a shared library (dynamically loadable library) on the current platform. It does not contain the . (dot) character. This can be used to determine the name of a shared library in a platform independent way.

See also

HModule | Alias for TLibHandle type.
TLibHandle | Library handle type


TLibHandle

Library handle type

Declaration

Source position: dynlibs.inc line 24

type TLibHandle = PtrInt;

Description

TLibHandle should be considered an opaque type. It is defined differently on various platforms. The definition shown here depends on the platform for which the documentation was generated.

See also

LoadLibrary | Load a dynamic library and return a handle to it.
UnloadLibrary | Unload a previously loaded library


TOrdinalEntry

Opaque type for retrieving addresses using ordinal IDs

Declaration

Source position: dynlibs.pas line 42

type TOrdinalEntry = SizeUInt;

Description

TOrdinalEntry is mainly used on Windows and OS/2 operating systems to retrieve the address of a procedure using the index (ordinal) of the procedure. On these operating systems, entry points can be loaded using name or ordinal value.

See also

GetProcedureAddress

Get the address of a procedure or symbol in a dynamic library.


Reference for unit 'emu387'

Load coprocessor emulation support

uses

  System;

The system unit

Overview

The emu387 unit was written by Pierre Mueller for dos. It sets up the coprocessor emulation for FPC under dos. It is not necessary to use this unit on other OS platforms because they either simply do not run on a machine without coprocessor, or they provide the coprocessor emulation themselves.

It shouldn't be necessary to use the function in this unit, it should be enough to place this unit in the uses clause of your program to enable the coprocessor emulation under dos. The unit initialization code will try and load the coprocessor emulation code and initialize it.


Reference for unit 'emu387': Procedures and functions

npxsetup

Set up coprocessor emulation.


Index of all identifiers in unit 'emu387'

N

N

npxsetup


Reference for unit 'errors'

Convert unix error codes to string message

uses
System, | The system unit
unixtype; | Basic unix types

Overview

The errors unit contains routines to convert a unix system call error code to an error message: StrError. It is only available on unix platforms.


Reference for unit 'errors': Constants

sys_errlist | Error codes in an array
sys_errn | Number of error codes


Reference for unit 'errors': Procedures and functions

PError | Print error on standard error routput
StrError | Convert an error code to a string


Index of all identifiers in unit 'errors'

P S

P

PError

S

StrError sys_errlist sys_errn


sys_errlist

Error codes in an array

Declaration

Source position: errnostr.inc line 18

const sys_errlist: array [0..sys_errn-1] of PChar = ('Success', 'Operation not permitted', 'No such file or directory', 'No such process', 'Interrupted system call', 'I/O error', 'No such device or address', 'Arg list too long', 'Exec format error', 'Bad file number', 'No child processes', 'Try again', 'Out of memory', 'Permission denied', 'Bad address', 'Block device required', 'Device or resource busy', 'File exists', 'Cross-device link', 'No such device', 'Not a directory', 'Is a directory', 'Invalid argument', 'File table overflow', 'Too many open files', 'Not a typewriter', 'Text (code segment) file busy', 'File too large', 'No space left on device', 'Illegal seek', 'Read-only file system', 'Too many links', 'Broken pipe', 'Math argument out of domain of func', 'Math result not representable', 'Resource deadlock would occur', 'File name too long', 'No record locks available', 'Function not implemented', 'Directory not empty', 'Too many symbolic links encountered', 'Operation would block', 'No message of desired type', 'Identifier removed', 'Channel number out of range', 'Level 2 not synchronized', 'Level 3 halted', 'Level 3 reset', 'Link number out of range', 'Protocol driver not attached', 'No CSI structure available', 'Level 2 halted', 'Invalid exchange', 'Invalid request descriptor', 'Exchange full', 'No anode', 'Invalid request code', 'Invalid slot', 'File locking deadlock error', 'Bad font file format', 'Device not a stream', 'No data available', 'Timer expired', 'Out of streams resources', 'Machine is not on the network', 'Package not installed', 'Object is remote', 'Link has been severed', 'Advertise error', 'Srmount error', 'Communication error on send', 'Protocol error', 'Multihop attempted', 'RFS specific error', 'Not a data message', 'Value too large for defined data type', 'Name not unique on network', 'File descriptor in bad state', 'Remote address changed', 'Can not access a needed shared library', 'Accessing a corrupted shared library', '.lib section in a.out corrupted', 'Attempting to link in too many shared libraries', 'Cannot exec a shared library directly', 'Illegal byte sequence', 'Interrupted system call should be restarted', 'Streams pipe error', 'Too many users', 'Socket operation on non-socket', 'Destination address required', 'Message too long', 'Protocol wrong type for socket', 'Protocol not available', 'Protocol not supported', 'Socket type not supported', 'Operation not supported on transport endpoint', 'Protocol family not supported', 'Address family not supported by protocol', 'Address already in use', 'Cannot assign requested address', 'Network is down', 'Network is unreachable', 'Network dropped connection because of reset', 'Software caused connection abort', 'Connection reset by peer', 'No buffer space available', 'Transport endpoint is already connected', 'Transport endpoint is not connected', 'Cannot send after transport endpoint shutdown', 'Too many references: cannot splice', 'Connection timed out', 'Connection refused', 'Host is down', 'No route to host', 'Operation already in progress', 'Operation now in progress', 'Stale NFS file handle', 'Structure needs cleaning', 'Not a XENIX named type file', 'No XENIX semaphores available', 'Is a named type file', 'Remote I/O error', 'Quota exceeded', 'No medium found', 'Wrong medium type');

Description

sys_errn is an array with then error codes for the current operating system. It should not be used directly, instead use StrError.

See also

StrError

Convert an error code to a string


sys_errn

Number of error codes

Declaration

Source position: errnostr.inc line 17

const sys_errn = 125;

Description

sys_errn is the number of error codes for the current operating system. It should not be used directly, instead use StrError.

See also

StrError

Convert an error code to a string


Reference for unit 'exeinfo'

Return executable information

uses

  System;

The system unit

Overview

The exeinfo unit implements some cross-platform routines to examine the contents of an executable: information about sections, mapping addresses to loaded modules etc.

It is mainly used by the lineinfo and lnfodwrf unit to examine the binary for debug info.


Reference for unit 'exeinfo': Types

TExeFile

Structure describing the binary.


Reference for unit 'exeinfo': Procedures and functions

CloseExeFile | Close a previously opened file.
FindExeSection | Find a section in the binary image.
GetModuleByAddr | Return the module name by address
OpenExeFile | Open an executable file
ReadDebugLink | Read the location of a debug info filename


Index of all identifiers in unit 'exeinfo'

C F G O R T

C

CloseExeFile

F

FindExeSection

G

GetModuleByAddr

O

OpenExeFile

R

ReadDebugLink

T

TExeFile


TExeFile

Structure describing the binary.

Declaration

Source position: exeinfo.pp line 32

type TExeFile = record
f: file; | File handle to the executable image on disk.
size: Int64; | Size of the executable
isopen: Boolean; | Is the file handle f open ?
nsects: LongInt; | Number of sections in the binary
sechdrofs: PtrUInt; | Section header offset
secstrofs: PtrUInt; | Section strings offset.
processaddress: PtrUInt; | Used on BEOS only
FunctionRelative: Boolean; | Internal variable
ImgOffset: PtrUInt; | Image offset
filename: string; | Filename of binary file
buf: array [0..4095] of Byte; | Buffer used in internal read operations
bufsize: LongInt; | Size of internal buffer
bufcnt: LongInt; | Number of bytes in the buffer.
end;

Description

TExeFile is a record used in the various calls of this unit. It contains a file descriptor, and various fields that describe the executable.

The structure of TExeFile is opaque, that is, one shouldn't rely on the exactness of this structure, it may change any time in the future.

See also

OpenExeFile | Open an executable file
CloseExeFile | Close a previously opened file.


Reference for unit 'fgl'

Free Pascal Generic Lists

uses
System, | The system unit
Types, | Various types
sysutils; | Various system utilities.

Overview

The fgl unit contains some basic list-related generic classes.


Reference for unit 'fgl': Constants

MaxGListSize | TFPGList maxmimum list size
MaxListSize | Maximum amount of elements in a list


Reference for unit 'fgl': Types

TFPSListCompareFunc

Compare list items callback signature


Reference for unit 'fgl': Classes

EListError | Exception thrown when a list-related error occurs
TFPGInterfacedObjectList | Generic interfaced object list
TFPGList | Generic list
TFPGListEnumerator | Generic list enumerator
TFPGMap | Generic map
TFPGMapInterfacedObjectData | Generic map for reference counted objects
TFPGMapObject | Generic map
TFPGObjectList | Generic object list
TFPSList | Basic list of memory blocks
TFPSMap | Basic map object, used in generic maps


Index of all identifiers in unit 'fgl'

E M T

E

EListError

M

MaxGListSize MaxListSize

T

TFPGInterfacedObjectList | TFPGMapInterfacedObjectData | TFPSListCompareFunc
TFPGList | TFPGMapObject | TFPSMap
TFPGListEnumerator | TFPGObjectList |
TFPGMap | TFPSList |


MaxGListSize

TFPGList maxmimum list size

Declaration

Source position: fgl.pp line 99

const MaxGListSize = MaxInt div 1024;

Description

MaxGListSize is the maximum number of elements in the TFPGList list.

See also

TFPGList

Generic list


MaxListSize

Maximum amount of elements in a list

Declaration

Source position: fgl.pp line 36

const MaxListSize = Maxint div 16;

Description

MaxListSize is the maximum number of elements a list can contain before the memory runs out.

See also

TFPSList.Capacity

Current capacity of the list


DefaultCollationName

Default collation for new threads.

Declaration

Source position: fpwidestring.pp line 16

var DefaultCollationName: TCollationName = '';

Description

DefaultCollationName is the collation name for new threads. It is empty by default.

See also

SetActiveCollation | Set the active collation for the current thread.
GetActiveCollation | Return the currently active collation for the current thread


Reference for unit 'fpwidestring'

Native Object Pascal Unicode string support

uses
System, | The system unit
unicodedata; | Unicode data management

Overview

fpwidestring implements unicode string support for the Free Pascal RTL using native Object Pascal routines. It is meant to be used on operating systems where the operating system does not natively support Unicode transformations and operations.

In general, it is sufficient to include the unit in the uses clause of a program. The initialization code of the unit will set the unicode string manager of the system unit to the object pascal implementation contained in this unit.

This unit needs unicode collation and character set tables in order to be able to do its work correctly. These must be registered using the routines of the unicodedata unit: the FPC project distributes some unicode collation data in .bco files which can be loaded using the LoadCollation routine.

In order for sorting and comparing of strings to work, a collation must be used. The collation in general depends on the internationalization of the application. Since the system unit does not know about collations, the collation must be set in the fpWideString unit using the SetActiveCollation function. The collation can be set on a per-thread basis.

New threads get DefaultCollationName as the active collation name.

The fpwidestring unit performs conversions between unicode and single-byte ansistring conversions (excluding UTF8). Support for various single-byte encodings are based on the charset unit. This unit can be used to load single byte code pages. Various code page units such as cp895, cp932, cp950 are provided by the "rtl-unicode" package.

The fpwidestring requires at least the Default Unicode Collation Element Table to be registered (called DUCET). The DUCET encoding is provided by the unicodeducet unit. More information can be found in the unicodedata unit.


Reference for unit 'fpwidestring': Procedures and functions

GetActiveCollation | Return the currently active collation for the current thread
SetActiveCollation | Set the active collation for the current thread.


Reference for unit 'fpwidestring': Variables

DefaultCollationName

Default collation for new threads.


Index of all identifiers in unit 'fpwidestring'

D G S

D

DefaultCollationName

G

GetActiveCollation

S

SetActiveCollation


EndOfOptions

Returned by getopt,getlongopts to indicate that there are no more options.

Declaration

Source position: getopts.pp line 23

const EndOfOptions = #255;


Reference for unit 'getopts'

GNU compatible access to command-line options.

uses

  System;

The system unit

Overview

This document describes the GETOPTS unit for Free Pascal. It was written for Linux by Michael Van Canneyt. It now also works for all supported platforms.

The getopts unit provides a mechanism to handle command-line options in a structured way, much like the GNU getopts mechanism. It allows you to define the valid options for you program, and the unit will then parse the command-line options for you, and inform you of any errors.


Reference for unit 'getopts': Constants

EndOfOptions | Returned by getopt,getlongopts to indicate that there are no more options.
No_Argument | Specifies that a long option does not take an argument.
Optional_Argument | Specifies that a long option optionally takes an argument.
OptSpecifier | Character indicating an option on the command-line.
Required_Argument | Specifies that a long option needs an argument.


Reference for unit 'getopts': Types

Orderings | Command-line ordering options.
POption | Pointer to TOption record.
TOption | Long option description record


Reference for unit 'getopts': Procedures and functions

GetLongOpts | Return next long option.
GetOpt | Get next short option.


Reference for unit 'getopts': Variables

OptArg | Set to the argument of an option, if the option needs one.
OptErr | Indicates whether getopt() prints error messages.
OptInd | Index of the current paramstr().
OptOpt | In case of an error, contains the character causing the error.


Index of all identifiers in unit 'getopts'

E G N O P R T

E

EndOfOptions

G

GetLongOpts GetOpt

N

No_Argument

O

OptArg | Optional_Argument | Orderings
OptErr | OptOpt |
OptInd | OptSpecifier |

P

permute POption

R

Required_Argument require_order return_in_order

T

TOption


No_Argument

Specifies that a long option does not take an argument.

Declaration

Source position: getopts.pp line 20

const No_Argument = 0;


OptArg

Set to the argument of an option, if the option needs one.

Declaration

Source position: getopts.pp line 40

var OptArg: string = ;


OptErr

Indicates whether getopt() prints error messages.

Declaration

Source position: getopts.pp line 42

var OptErr: Boolean = ;


OptInd

Index of the current paramstr().

Declaration

Source position: getopts.pp line 41

var OptInd: LongInt = ;

Description

when all options have been processed, optind is the index of the first non-option parameter. This is a read-only variable. Note that it can become equal to paramcount+1.


Optional_Argument

Specifies that a long option optionally takes an argument.

Declaration

Source position: getopts.pp line 22

const Optional_Argument = 2;


OptOpt

In case of an error, contains the character causing the error.

Declaration

Source position: getopts.pp line 43

var OptOpt: Char = ;


OptSpecifier

Character indicating an option on the command-line.

Declaration

Source position: getopts.pp line 37

const OptSpecifier: = ['-'];


Orderings

Command-line ordering options.

Declaration

Source position: getopts.pp line 34

type Orderings = (
require_order, | Don't touch the ordering of the command-line options
permute, | Change command-line options.
return_in_order | Return options in the correct order.
);


POption

Pointer to TOption record.

Declaration

Source position: getopts.pp line 26

type POption = ^TOption;


Required_Argument

Specifies that a long option needs an argument.

Declaration

Source position: getopts.pp line 21

const Required_Argument = 1;


TOption

Long option description record

Declaration

Source position: getopts.pp line 27

type TOption = record
Name: string; | Long option name
Has_arg: Integer; | Does the option have arguments (values)
Flag: PChar; | Where to write Value if the option is found.
Value: Char; | Value to return when option is encountered
end;

Description

The TOption type is used to communicate the long options to GetLongOpts. The Name field is the name of the option. Has_arg specifies if the option wants an argument, Flag is a pointer to a char, which is set to Value, if it is non-nil.


auxcarryflag

Check for auxiliary carry flag in trealregs

Declaration

Source position: go32.pp line 32

const auxcarryflag = $010;


carryflag

Check for carry flag in trealregs

Declaration

Source position: go32.pp line 30

const carryflag = $001;


Creating your own interrupt handlers

Interrupt redirection with FPC pascal is done via the set_pm_interrupt() for protected mode interrupts or via the set_rm_interrupt() for real mode interrupts.


directionflag

Check for direction flag in trealregs

Declaration

Source position: go32.pp line 37

const directionflag = $400;


Disabling interrupts

The GO32 unit provides the two procedures disable() and enable() to disable and enable all interrupts.


dosmemfillchar

Fill a region of DOS memory with a specific byte-sized value

Declaration

Source position: go32.pp line 193

const dosmemfillchar: procedure( = @ dpmi_dosmemfillchar;

  seg: Word;

  ofs: Word;

  count: LongInt;

  c: Char

)

Description

Sets a region of dos memory to a specific byte value.

Parameters:

seg
real mode segment.
ofs
real mode offset.
count
number of bytes to set.
c
value to set memory to.

Notes: No range check is performed.

Errors

None.

See also

dosmemput | Copy data from the heap to DOS real mode memory
dosmemget | Copy data from DOS memory to the heap.
dosmemmove | Move data between 2 DOS real mode memory locations
dosmemfillword | Fill a region of DOS memory with a specific word-sized value
seg_move | Move data between 2 locations
seg_fillchar | Fill segment with byte value
seg_fillword | Fill segment with word value

Example

{ This example copies around some blocks of memory in DOS memory
space.

In more detail, the program copies a string randomly to the text
mode screen. Aditionally it messes around a bit with the color
attributes of the string.
Before doing this it saves the entire screen contents to the heap
and restores it afterwards.

Some additional background:

The text screen of a VGA card has it's address space at $B800:0;
screen memory is organized in a linear fashion, e.g. the second line
comes directly after the first, where each cell occupies 2 bytes of
memory (1 byte character data, 1 byte attributes). It is 32 kb in
size.

Hence the offset of a single memory cell from its origin is:

Y*columns*2 + X*2

where X and Y mark the point and columns is the number of character
cells per line
}

uses
        crt,
        go32;

const
        { number of columns on screen }
        columns = 80;
        { number of rows on screen }
        rows = 25;
        screensize = rows*columns*2;

        { sample text string }
        text = '! Hello world !';

var
        textofs : Longint;
        { this variable holds the entire screen contents }
        save_screen : array[0..screensize-1] of byte;
        { These two hold the previous cursor coordinates }
    curx, cury : Integer;

begin
        randomize;
        { save screen contents to save_screen variable }
        dosmemget($B800, 0, save_screen, screensize);
        { save current cursor coordinates }
        curx := wherex; cury := wherey;
        { This is our demo text }
        gotoxy(1, 1); Write(text);
        { calculate the address in offscreen memory (to be sure it will
        not be overwritten by the copy process later, we don't put it
        exactly at the end of the visible screen area) }
        textofs := screensize + length(text)*2;
        { copy it to offscreen memory }
        dosmemmove($B800, 0, $B800, textofs, length(text)*2);
        { clear the screen by writing zeros on the whole visible screen}
        dosmemfillchar($B800, 0, screensize, #0);
        while (not keypressed) do begin
                { set the attribute field (byte 2 of every cell) of the
                text in offscreen memory to random values }
                dosmemfillchar($B800, textofs + random(length(text))*2 + 1,
                        1, char(random(255)));
                { copy the string from offscreen to visibly screen by calculating
                it's destination address randomly }
                dosmemmove($B800, textofs, $B800,
                        random(columns)*2+random(rows)*columns*2,
                        length(text)*2);
                { small delay, else it is too fast }
                delay(1);
        end;
        { clear the keyboard buffer }
        readkey;
        { wait for a keypress }
        readkey;
        { restore old screen contents afterwards }
        dosmemput($B800, 0, save_screen, screensize);
        gotoxy(curx, cury);
end.


dosmemfillword

Fill a region of DOS memory with a specific word-sized value

Declaration

Source position: go32.pp line 194

const dosmemfillword: procedure( = @ dpmi_dosmemfillword;

  seg: Word;

  ofs: Word;

  count: LongInt;

  w: Word

)

Description

Sets a region of dos memory to a specific word value.

Parameters:

seg
real mode segment.
ofs
real mode offset.
count
number of words to set.
w
value to set memory to.

Notes: No range check is performed.

Errors

None.

See also

dosmemput | Copy data from the heap to DOS real mode memory
dosmemget | Copy data from DOS memory to the heap.
dosmemmove | Move data between 2 DOS real mode memory locations
dosmemfillchar | Fill a region of DOS memory with a specific byte-sized value
seg_move | Move data between 2 locations
seg_fillchar | Fill segment with byte value
seg_fillword | Fill segment with word value


dosmemget

Copy data from DOS memory to the heap.

Declaration

Source position: go32.pp line 191

const dosmemget: procedure( = @ dpmi_dosmemget;

  seg: Word;

  ofs: Word;

  var data;

  count: LongInt

)

Description

Copies data from the dos memory onto the heap.

Parameters:

seg
source real mode segment.
ofs
source real mode offset.
data
destination.
count
number of bytes to copy.

Notes: No range checking is performed.

For an example, see global_dos_alloc.

Errors

None.

See also

dosmemput | Copy data from the heap to DOS real mode memory
dosmemmove | Move data between 2 DOS real mode memory locations
dosmemfillchar | Fill a region of DOS memory with a specific byte-sized value
dosmemfillword | Fill a region of DOS memory with a specific word-sized value
seg_move | Move data between 2 locations
seg_fillchar | Fill segment with byte value
seg_fillword | Fill segment with word value


dosmemmove

Move data between 2 DOS real mode memory locations

Declaration

Source position: go32.pp line 192

const dosmemmove: procedure( = @ dpmi_dosmemmove;

  sseg: Word;

  sofs: Word;

  dseg: Word;

  dofs: Word;

  count: LongInt

)

Description

Copies count bytes of data between two dos real mode memory locations.

Parameters:

sseg
source real mode segment.
sofs
source real mode offset.
dseg
destination real mode segment.
dofs
destination real mode offset.
count
number of bytes to copy.

Notes: No range check is performed in any way.

Errors

None.

See also

dosmemput | Copy data from the heap to DOS real mode memory
dosmemget | Copy data from DOS memory to the heap.
dosmemfillchar | Fill a region of DOS memory with a specific byte-sized value
dosmemfillword | Fill a region of DOS memory with a specific word-sized value
seg_move | Move data between 2 locations
seg_fillchar | Fill segment with byte value
seg_fillword | Fill segment with word value


dos memory access

Dos memory is accessed by the predefined dosmemselector selector; the GO32 unit additionally provides some functions to help you with standard tasks, like copying memory from heap to dos memory and the likes. Because of this it is strongly recommened to use them, but you are still free to use the provided standard memory accessing functions which use 48 bit pointers. The third, but only thought for compatibility purposes, is using the mem[]-arrays. These arrays map the whole 1 Mb dos space. They shouldn't be used within new programs. To convert a segment:offset real mode address to a protected mode linear address you have to multiply the segment by 16 and add its offset. This linear address can be used in combination with the DOSMEMSELECTOR variable.

See also

dosmemget | Copy data from DOS memory to the heap.
dosmemput | Copy data from the heap to DOS real mode memory
dosmemmove | Move data between 2 DOS real mode memory locations
dosmemfillchar | Fill a region of DOS memory with a specific byte-sized value
dosmemfillword | Fill a region of DOS memory with a specific word-sized value
seg_move | Move data between 2 locations
seg_fillchar | Fill segment with byte value
seg_fillword | Fill segment with word value


dosmemput

Copy data from the heap to DOS real mode memory

Declaration

Source position: go32.pp line 190

const dosmemput: procedure( = @ dpmi_dosmemput;

  seg: Word;

  ofs: Word;

  var data;

  count: LongInt

)

Description

Copies heap data to dos real mode memory.

Parameters:

seg
destination real mode segment.
ofs
destination real mode offset.
data
source.
count
number of bytes to copy.

Notes: No range checking is performed.

For an example, see global_dos_alloc.

Errors

None.

See also

dosmemget | Copy data from DOS memory to the heap.
dosmemmove | Move data between 2 DOS real mode memory locations
dosmemfillchar | Fill a region of DOS memory with a specific byte-sized value
dosmemfillword | Fill a region of DOS memory with a specific word-sized value
seg_move | Move data between 2 locations
seg_fillchar | Fill segment with byte value
seg_fillword | Fill segment with word value


dosmemselector

Selector to DOS memory

Declaration

Source position: go32.pp line 113

var dosmemselector: Word = ;

Description

Selector to the dos memory. The whole dos memory is automatically mapped to this single descriptor at startup. This selector is the recommened way to access dos memory.


What is DPMI

The dos Protected Mode Interface helps you with various aspects of protected mode programming. These are roughly divided into descriptor handling, access to dos memory, management of interrupts and exceptions, calls to real mode functions and other stuff. Additionally it automatically provides swapping to disk for memory intensive applications. A DPMI host (either a Windows dos box or CWSDPMI.EXE) provides these functions for your programs.


Handling interrupts with DPMI

The interrupt functions are real-mode procedures; they normally can't be called in protected mode without the risk of an protection fault. So the DPMI host creates an interrupt descriptor table for the application. Initially all software interrupts (except for int 31h, 2Fh and 21h function 4Ch) or external hardware interrupts are simply directed to a handler that reflects the interrupt in real-mode, i.e. the DPMI host's default handlers switch the CPU to real-mode, issue the interrupt and switch back to protected mode. The contents of general registers and flags are passed to the real mode handler and the modified registers and flags are returned to the protected mode handler. Segment registers and stack pointer are not passed between modes.


Protected mode interrupts vs. Real mode interrupts

As mentioned before, there's a distinction between real mode interrupts and protected mode interrupts; the latter are protected mode programs, while the former must be real mode programs. To call a protected mode interrupt handler, an assembly 'int' call must be issued, while the other is called via the realintr() or intr() function. Consequently, a real mode interrupt then must either reside in dos memory (<1MB) or the application must allocate a real mode callback address via the get_rm_callback() function.


Executing software interrupts

Simply execute a realintr() call with the desired interrupt number and the supplied register data structure. But some of these interrupts require you to supply them a pointer to a buffer where they can store data to or obtain data from in memory. These interrupts are real mode functions and so they only can access the first Mb of linear address space, not FPC's data segment. For this reason FPC supplies a pre-initialized dos memory location within the GO32 unit. This buffer is internally used for dos functions too and so it's contents may change when calling other procedures. It's size can be obtained with tb_size and it's linear address via transfer_buffer. Another way is to allocate a completely new dos memory area via the global_dos_alloc function for your use and supply its real mode address.

See also

tb_size | Return DOS transfer memory buffer size
transfer_buffer | Return offset of DOS transfer buffer
global_dos_alloc | Allocate DOS real mode memory
global_dos_free | Free DOS memory block
realintr | Simulate interrupt

Example

{ Executes a real mode software interrupt

Exactly the interrupt call to get the DOS version.

get DOS version Int 21h / function 30h
Input:
        AH = $30
        AL = $1
Return:
        AL = major version number
        AH = minor version number
}

uses
        go32;

var
        r : trealregs;

begin
        r.ah := $30;
        r.al := $01;
        realintr($21, r);
        Writeln('DOS v', r.al,'.',r.ah, ' detected');
end.

Example

{ This example shows the difference between protected and real mode
interrupts; it redirects the protected mode handler to an own handler
which returns an impossible function result and calls it afterwards.
Then the real mode handler is called directly, to show the difference
between the two.

Used Interrupt:
get DOS version Int 21h / function 30h
     Input: AH = $30
            AL = $1
     Return: AL = major version number
             AH = minor version number
}

uses
        crt,
        go32;

var
        r : trealregs;
        { temporary variable used for the protected mode int call }
        axreg : Word;

        oldint21h : tseginfo;
        newint21h : tseginfo;

{ this is our int 21h protected mode interupt handler. It catches
the function call to get the DOS version, all other int 21h calls
are redirected to the old handler; it is written in assembly
because the old handler can't be called with pascal }
procedure int21h_handler; assembler;
asm
        cmpw $0x3001, %ax
        jne .LCallOld
        movw $0x3112, %ax
        iret

.LCallOld:
        ljmp %cs:oldint21h
end;

{ a small helper procedure, which waits for a keypress }
procedure resume;
begin
        Writeln;
        Write('-- press any key to resume --'); readkey;
        gotoxy(1, wherey); clreol;
end;

begin
        { see the text messages for further detail }
        clrscr;
        Writeln('Executing real mode interrupt');
        resume;
        r.ah := $30; r.al := $01;  realintr($21, r);
        Writeln('DOS v', r.al,'.',r.ah, ' detected');
        resume;
        Writeln('Executing protected mode interrupt without our own',
                ' handler');
        Writeln;
        asm
                movb $0x30, %ah
                movb $0x01, %al
                int $0x21
                movw %ax, axreg
        end;
        Writeln('DOS v', r.al,'.',r.ah, ' detected');
        resume;
        Writeln('As you can see the DPMI hosts default protected mode',
                'handler');
        Writeln('simply redirects it to the real mode handler');
        resume;
        Writeln('Now exchanging the protected mode interrupt with our ',
                'own handler');
        resume;

        newint21h.offset := @int21h_handler;
        newint21h.segment := get_cs;
        get_pm_interrupt($21, oldint21h);
        set_pm_interrupt($21, newint21h);

        Writeln('Executing real mode interrupt again');
        resume;
        r.ah := $30; r.al := $01; realintr($21, r);
        Writeln('DOS v', r.al,'.',r.ah, ' detected');
        Writeln;
        Writeln('See, it didn''t change in any way.');
        resume;
        Writeln('Now calling protected mode interrupt');
        resume;
        asm
                movb $0x30, %ah
                movb $0x01, %al
                int $0x21
                movw %ax, axreg
        end;
        Writeln('DOS v', lo(axreg),'.',hi(axreg), ' detected');
        Writeln;
        Writeln('Now you can see that there''s a distinction between ',
                'the two ways of calling interrupts...');
        set_pm_interrupt($21, oldint21h);
end.


FPC specialities

The %ds and %es selector MUST always contain the same value or some system routines may crash when called. The %fs selector is preloaded with the DOSMEMSELECTOR variable at startup, and it MUST be restored after use, because again FPC relys on this for some functions. Luckily we asm programmers can still use the %gs selector for our own purposes, but for how long ?

See also

get_cs | Get CS selector
get_ds | Get DS Selector
get_ss | Return SS selector
allocate_ldt_descriptors | Allocate a number of descriptors
free_ldt_descriptor | Free a descriptor
segment_to_descriptor | Map segment address to descriptor
get_next_selector_increment_value | Return selector increment value
get_segment_base_address | Return base address from descriptor table
set_segment_base_address | Set descriptor's base address
set_segment_limit | Set descriptor limit
create_code_segment_alias_descriptor | Create new descriptor from existing descriptor


Hardware interrupts

Hardware interrupts are generated by hardware devices when something unusual happens; this could be a keypress or a mouse move or any other action. This is done to minimize CPU time, else the CPU would have to check all installed hardware for data in a big loop (this method is called 'polling') and this would take much time. A standard IBM-PC has two interrupt controllers, that are responsible for these hardware interrupts: both allow up to 8 different interrupt sources (IRQs, interrupt requests). The second controller is connected to the first through IRQ 2 for compatibility reasons, e.g. if controller 1 gets an IRQ 2, he hands the IRQ over to controller 2. Because of this up to 15 different hardware interrupt sources can be handled. IRQ 0 through IRQ 7 are mapped to interrupts 8h to Fh and the second controller (IRQ 8 to 15) is mapped to interrupt 70h to 77h. All of the code and data touched by these handlers MUST be locked (via the various locking functions) to avoid page faults at interrupt time. Because hardware interrupts are called (as in real mode) with interrupts disabled, the handler has to enable them before it returns to normal program execution. Additionally a hardware interrupt must send an EOI (end of interrupt) command to the responsible controller; this is acomplished by sending the value 20h to port 20h (for the first controller) or A0h (for the second controller). The following example shows how to redirect the keyboard interrupt.

Example

{ This example demonstrates how to chain to a hardware interrupt.

In more detail, it hooks the keyboard interrupt, calls a user
procedure which in this case simply turns the PC speaker on and off.
Then the old interrupt is called.
}

{$ASMMODE ATT}
{$MODE FPC}

uses
        crt,
        go32;

const
        { keyboard is IRQ 1 -> interrupt 9 }
        kbdint = $9;

var
        { holds old PM interrupt handler address }
        oldint9_handler : tseginfo;
        { new PM interrupt handler }
        newint9_handler : tseginfo;

        { pointer to interrupt handler }
        clickproc : pointer;
        { the data segment selector }
        backupDS : Word; external name '___v2prt0_ds_alias';

{ interrupt handler }
procedure int9_handler; assembler;
asm
        cli
        { save all registers, because we don't know which the compiler
        uses for the called procedure }
        pushl %ds
        pushl %es
        pushl %fs
        pushl %gs
        pushal
        { set up to call a FPC procedure }
        movw %cs:backupDS, %ax
        movw %ax, %ds
        movw %ax, %es
        movw dosmemselector, %ax
        movw %ax, %fs
        { call user procedure }
        call *clickproc
        { restore all registers }
        popal
        popl %gs
        popl %fs
        popl %es
        popl %ds
        { note: in go32v2 mode %cs=%ds=%es !!!}
        ljmp %cs:oldint9_handler { call old handler }
        { we don't need to do anything more, because the old interrupt
        handler does this for us (send EOI command, iret, sti...) }
end;
{ dummy procedure to retrieve exact length of handler, for locking
and unlocking functions  }
procedure int9_dummy; begin end;

{ demo user procedure, simply clicks on every keypress }
procedure clicker;
begin
        sound(500); delay(10); nosound;
end;
{ dummy procedure to retrieve exact length of user procedure for
locking and unlocking functions }
procedure clicker_dummy; begin end;

{ installs our new handler }
procedure install_click;
begin
        clickproc := @clicker;
        { lock used code and data }
        lock_data(clickproc, sizeof(clickproc));
        lock_data(dosmemselector, sizeof(dosmemselector));

        lock_code(@clicker,
                longint(@clicker_dummy) - longint(@clicker));
        lock_code(@int9_handler,
                longint(@int9_dummy)-longint(@int9_handler));
        { fill in new handler's 48 bit pointer }
        newint9_handler.offset := @int9_handler;
        newint9_handler.segment := get_cs;
        { get old PM interrupt handler }
        get_pm_interrupt(kbdint, oldint9_handler);
        { set the new interrupt handler }
        set_pm_interrupt(kbdint, newint9_handler);
end;

{ deinstalls our interrupt handler }
procedure remove_click;
begin
        { set old handler }
        set_pm_interrupt(kbdint, oldint9_handler);
        { unlock used code & data }
        unlock_data(dosmemselector, sizeof(dosmemselector));
        unlock_data(clickproc, sizeof(clickproc));

        unlock_code(@clicker,
                longint(@clicker_dummy)-longint(@clicker));
        unlock_code(@int9_handler,
                longint(@int9_dummy)-longint(@int9_handler));
end;

var
        ch : char;

begin
        install_click;
        Writeln('Enter any message. Press return when finished');
        while (ch <> #13) do begin
                ch := readkey; write(ch);
        end;
        remove_click;
end.


Reference for unit 'go32'

GO32 - acces to the 32-bit DOS extender

uses

  System;

The system unit

Overview

This document describes the GO32 unit for the Free Pascal compiler under dos. It was donated by Thomas Schatzl (tom_at_work@geocities.com), for which my thanks. This unit was first written for dos by Florian Klaempfl.

Only the GO32V2 DPMI mode is discussed by me here due to the fact that new applications shouldn't be created with the older GO32V1 model. The go32v2 version is much more advanced and better. Additionally a lot of functions only work in DPMI mode anyway. I hope the following explanations and introductions aren't too confusing at all. If you notice an error or bug send it to the FPC mailing list or directly to me. So let's get started and happy and error free coding I wish you.... Thomas Schatzl, 25. August 1998

Related topics

RealModeCallBacks | Real mode callbacks
ExecutingInterrupts | Executing software interrupts
SoftwareInterrupts | Software interrupts
HardwareInterrupts | Hardware interrupts
DisablingInterrupts | Disabling interrupts
CreatingInterruptHandlers | Creating your own interrupt handlers
DPMIvsProtectedInterrupts | Protected mode interrupts vs. Real mode interrupts
DPMIInterrupts | Handling interrupts with DPMI
InterruptHandling | Interrupt redirection
ProcessorAccess | Processor access
IOPorts | I/O port access
DosMemory | dos memory access
FPCspecs | FPC specialities
SelectorsDescriptors | Selectors and descriptors
DPMI | What is DPMI


Reference for unit 'go32': Constants

auxcarryflag | Check for auxiliary carry flag in trealregs
carryflag | Check for carry flag in trealregs
directionflag | Check for direction flag in trealregs
dosmemfillchar | Fill a region of DOS memory with a specific byte-sized value
dosmemfillword | Fill a region of DOS memory with a specific word-sized value
dosmemget | Copy data from DOS memory to the heap.
dosmemmove | Move data between 2 DOS real mode memory locations
dosmemput | Copy data from the heap to DOS real mode memory
interruptflag | Check for interrupt flag in trealregs
overflowflag | Check for overflow flag in trealregs
parityflag | Check for parity flag in trealregs
rm_dpmi | get_run_mode return value: DPMI (e.g. dos box or 386Max)
rm_raw | get_run_mode return value: raw (without HIMEM)
rm_unknown | get_run_mode return value: Unknown runmode
rm_vcpi | get_run_mode return value: VCPI (with HIMEM and EMM386)
rm_xms | get_run_mode return value: XMS (with HIMEM, without EMM386)
signflag | Check for sign flag in trealregs
trapflag | Check for trap flag in trealregs
zeroflag | Check for zero flag in trealregs


Reference for unit 'go32': Types

registers | Alias for trealregs
tdpmiversioninfo | Structure describing DPMI version
tmeminfo | Memory information record
trealregs | Record describing all processor registers
tseginfo | Record to store 48-bits pointer


Reference for unit 'go32': Procedures and functions

allocate_ldt_descriptors | Allocate a number of descriptors
allocate_memory_block | Allocate a block of linear memory
copyfromdos | Copy data from DOS to heap
copytodos | Copy data from heap to DOS memory
create_code_segment_alias_descriptor | Create new descriptor from existing descriptor
disable | Disable hardware interrupts
dpmi_dosmemfillchar | Fill DOS memory with a character
dpmi_dosmemfillword | Fill DOS memory with a word value
dpmi_dosmemget | Move data from DOS memory to DPMI memory
dpmi_dosmemmove | Move DOS memory
dpmi_dosmemput | Move data from DPMI memory to DOS memory.
enable | Enable hardware interrupts
free_ldt_descriptor | Free a descriptor
free_linear_addr_mapping | ? No description available
free_memory_block | Free allocated memory block
free_rm_callback | Release real mode callback.
get_cs | Get CS selector
get_descriptor_access_right | Get descriptor's access rights
get_dpmi_version | Return DPMI information
get_ds | Get DS Selector
get_exception_handler | Return current exception handler
get_linear_addr | Convert physical to linear address
get_meminfo | Return information on the available memory
get_next_selector_increment_value | Return selector increment value
get_page_attributes | ? No description available
get_page_size | Return the page size
get_pm_exception_handler | Get protected mode exception handler
get_pm_interrupt | Return protected mode interrupt handler
get_rm_callback | Return real mode callback
get_rm_interrupt | Get real mode interrupt vector
get_run_mode | Return current run mode
get_segment_base_address | Return base address from descriptor table
get_segment_limit | Return segment limite from descriptor
get_ss | Return SS selector
global_dos_alloc | Allocate DOS real mode memory
global_dos_free | Free DOS memory block
inportb | Read byte from I/O port
inportl | Read longint from I/O port
inportw | Read word from I/O port
lock_code | Lock code memory range
lock_data | Lock data memory range
lock_linear_region | Lock linear memory region
map_device_in_memory_block | Map a device into program's memory space
outportb | Write byte to I/O port
outportl | Write longint to I/O port
outportw | Write word to I/O port
realintr | Simulate interrupt
request_linear_region | Request linear address region.
segment_to_descriptor | Map segment address to descriptor
seg_fillchar | Fill segment with byte value
seg_fillword | Fill segment with word value
seg_move | Move data between 2 locations
set_descriptor_access_right | Set access rights to memory descriptor
set_exception_handler | Set exception handler
set_page_attributes | ? No description available
set_pm_exception_handler | Set protected mode exception handler
set_pm_interrupt | Set protected mode interrupt handler
set_rm_interrupt | Set real mode interrupt handler
set_segment_base_address | Set descriptor's base address
set_segment_limit | Set descriptor limit
tb_offset | Return DOS transfer buffer offset
tb_segment | Return DOS transfer buffer segment
tb_size | Return DOS transfer memory buffer size
transfer_buffer | Return offset of DOS transfer buffer
unlock_code | Unlock code segment
unlock_data | Unlock data segment
unlock_linear_region | Unlock linear memory region


Reference for unit 'go32': Variables

dosmemselector | Selector to DOS memory
int31error | DPMI interrupt call result


Index of all identifiers in unit 'go32'

A C D E F G I L M O P R S T U Z

A

allocate_ldt_descriptors allocate_memory_block auxcarryflag

C

carryflag | copytodos
copyfromdos | create_code_segment_alias_descriptor

D

directionflag | dosmemmove | dpmi_dosmemget
disable | dosmemput | dpmi_dosmemmove
dosmemfillchar | dosmemselector | dpmi_dosmemput
dosmemfillword | dpmi_dosmemfillchar |
dosmemget | dpmi_dosmemfillword |

E

enable

F

free_ldt_descriptor | free_memory_block
free_linear_addr_mapping | free_rm_callback

G

get_cs | get_next_selector_increment_value | get_run_mode
get_descriptor_access_right | get_page_attributes | get_segment_base_address
get_dpmi_version | get_page_size | get_segment_limit
get_ds | get_pm_exception_handler | get_ss
get_exception_handler | get_pm_interrupt | global_dos_alloc
get_linear_addr | get_rm_callback | global_dos_free
get_meminfo | get_rm_interrupt |

I

inportb | inportw | interruptflag
inportl | int31error |

L

lock_code lock_data lock_linear_region

M

map_device_in_memory_block

O

outportb | outportw
outportl | overflowflag

P

parityflag

R

realintr | rm_dpmi | rm_vcpi
registers | rm_raw | rm_xms
request_linear_region | rm_unknown |

S

seg_fillchar | set_exception_handler | set_segment_base_address
seg_fillword | set_page_attributes | set_segment_limit
segment_to_descriptor | set_pm_exception_handler | signflag
seg_move | set_pm_interrupt |
set_descriptor_access_right | set_rm_interrupt |

T

tb_offset | tdpmiversioninfo | trapflag
tb_segment | tmeminfo | trealregs
tb_size | transfer_buffer | tseginfo

U

unlock_code unlock_data unlock_linear_region

Z

zeroflag


int31error

DPMI interrupt call result

Declaration

Source position: go32.pp line 115

var int31error: Word = ;

Description

This variable holds the result of a DPMI interrupt call. Any nonzero value must be treated as a critical failure.


interruptflag

Check for interrupt flag in trealregs

Declaration

Source position: go32.pp line 36

const interruptflag = $200;


Interrupt redirection

Interrupts are program interruption requests, which in one or another way get to the processor; there's a distinction between software and hardware interrupts. The former are explicitely called by an 'int' instruction and are a bit comparable to normal functions. Hardware interrupts come from external devices like the keyboard or mouse. Functions that handle hardware interrupts are called handlers.


I/O port access

The I/O port access is done via the various inportb, outportb functions which are available. Additionally Free Pascal supports the Turbo Pascal PORT[]-arrays but it is by no means recommened to use them, because they're only for compatibility purposes.

See also

outportb | Write byte to I/O port
inportb | Read byte from I/O port


overflowflag

Check for overflow flag in trealregs

Declaration

Source position: go32.pp line 38

const overflowflag = $800;


parityflag

Check for parity flag in trealregs

Declaration

Source position: go32.pp line 31

const parityflag = $004;


Processor access

These are some functions to access various segment registers (%cs, %ds, %ss) which makes your work a bit easier.

See also

get_cs | Get CS selector
get_ds | Get DS Selector
get_ss | Return SS selector


Real mode callbacks

The callback mechanism can be thought of as the converse of calling a real mode procedure (i.e. interrupt), which allows your program to pass information to a real mode program, or obtain services from it in a manner that's transparent to the real mode program. In order to make a real mode callback available, you must first get the real mode callback address of your procedure and the selector and offset of a register data structure. This real mode callback address (this is a segment:offset address) can be passed to a real mode program via a software interrupt, a dos memory block or any other convenient mechanism. When the real mode program calls the callback (via a far call), the DPMI host saves the registers contents in the supplied register data structure, switches into protected mode, and enters the callback routine with the following settings:

  • interrupts disabled
  • %CS:%EIP = 48 bit pointer specified in the original call to get_rm_callback
  • %DS:%ESI = 48 bit pointer to real mode SS:SP
  • %ES:%EDI = 48 bit pointer of real mode register data structure.
  • %SS:%ESP = locked protected mode stack
  • All other registers undefined

The callback procedure can then extract its parameters from the real mode register data structure and/or copy parameters from the real mode stack to the protected mode stack. Recall that the segment register fields of the real mode register data structure contain segment or paragraph addresses that are not valid in protected mode. Far pointers passed in the real mode register data structure must be translated to virtual addresses before they can be used with a protected mode program. The callback procedure exits by executing an IRET with the address of the real mode register data structure in %ES:%EDI, passing information back to the real mode caller by modifying the contents of the real mode register data structure and/or manipulating the contents of the real mode stack. The callback procedure is responsible for setting the proper address for resumption of real mode execution into the real mode register data structure; typically, this is accomplished by extracting the return address from the real mode stack and placing it into the %CS:%EIP fields of the real mode register data structure. After the IRET, the DPMI host switches the CPU back into real mode, loads ALL registers with the contents of the real mode register data structure, and finally returns control to the real mode program. All variables and code touched by the callback procedure MUST be locked to prevent page faults.

See also

get_rm_callback | Return real mode callback
free_rm_callback | Release real mode callback.
lock_code | Lock code memory range
lock_data | Lock data memory range


registers

Alias for trealregs

Declaration

Source position: go32.pp line 77

type registers = trealregs;


rm_dpmi

get_run_mode return value: DPMI (e.g. dos box or 386Max)

Declaration

Source position: go32.pp line 27

const rm_dpmi = 4;


rm_raw

get_run_mode return value: raw (without HIMEM)

Declaration

Source position: go32.pp line 24

const rm_raw = 1;


rm_unknown

get_run_mode return value: Unknown runmode

Declaration

Source position: go32.pp line 23

const rm_unknown = 0;


rm_vcpi

get_run_mode return value: VCPI (with HIMEM and EMM386)

Declaration

Source position: go32.pp line 26

const rm_vcpi = 3;


rm_xms

get_run_mode return value: XMS (with HIMEM, without EMM386)

Declaration

Source position: go32.pp line 25

const rm_xms = 2;


Selectors and descriptors

Descriptors are a bit like real mode segments; they describe (as the name implies) a memory area in protected mode. A descriptor contains information about segment length, its base address and the attributes of it (i.e. type, access rights, ...). These descriptors are stored internally in a so-called descriptor table, which is basically an array of such descriptors. Selectors are roughly an index into this table. Because these 'segments' can be up to 4 GB in size, 32 bits aren't sufficient anymore to describe a single memory location like in real mode. 48 bits are now needed to do this, a 32 bit address and a 16 bit sized selector. The GO32 unit provides the tseginfo record to store such a pointer. But due to the fact that most of the time data is stored and accessed in the %ds selector, FPC assumes that all pointers point to a memory location of this selector. So a single pointer is still only 32 bits in size. This value represents the offset from the data segment base address to this memory location.


signflag

Check for sign flag in trealregs

Declaration

Source position: go32.pp line 34

const signflag = $080;


Software interrupts

Ordinarily, a handler installed with set_pm_interrupt only services software interrupts that are executed in protected mode; real mode software interrupts can be redirected by set_rm_interrupt.

See also

set_rm_interrupt | Set real mode interrupt handler
get_rm_interrupt | Get real mode interrupt vector
set_pm_interrupt | Set protected mode interrupt handler
get_pm_interrupt | Return protected mode interrupt handler
lock_data | Lock data memory range
lock_code | Lock code memory range
enable | Enable hardware interrupts
disable | Disable hardware interrupts
outportb | Write byte to I/O port


tdpmiversioninfo

Structure describing DPMI version

Declaration

Source position: go32.pp line 79

type tdpmiversioninfo = record
major: Byte; | Major version number
minor: Byte; | Minor version number
flags: Word; | Flags
cpu: Byte; | CPU type
master_pic: Byte; | PIC master
slave_pic: Byte; | PIC slave
end;

Description

tdpmiversioninfo describes the dpmi version information, as returned by get_dpmi_version. The CPU field can have the following values:

$02H
80286
$03H
80386
$04H
80486
$05H-
Newer than 80486

The flags field is a bitmask with the following bits:

0
0 for 16 bit DPMI, 1 for 32-bit
1
0 for virtual 86 mode for reflected interrupts, 1 for return to real mode.
2
0 for no virtual memory support, 1 for virtual memory support.

See also

get_dpmi_version

Return DPMI information


tmeminfo

Memory information record

Declaration

Source position: go32.pp line 41

type tmeminfo = record
available_memory: LongInt; | Largest available free block in bytes.
available_pages: LongInt; | Maximum unlocked page allocation in pages
available_lockable_pages: LongInt; | Maximum locked page allocation in pages.
linear_space: LongInt; | Linear address space size in pages.
unlocked_pages: LongInt; | Total number of unlocked pages.
available_physical_pages: LongInt; | Total number of free pages.
total_physical_pages: LongInt; | Total number of physical pages.
free_linear_space: LongInt; | Free linear address space in pages.
max_pages_in_paging_file: LongInt; | Size of paging file/partition in pages
reserved0: LongInt; | Unused
reserved1: LongInt; | Unused
reserved2: LongInt; | Unused
end;

Description

tmeminfo Holds information about the memory allocation, etc.

NOTE: The value of a field is -1 (0ffffffffh) if the value is unknown, it's only guaranteed, that available_memory contains a valid value. The size of the pages can be determined by the get_page_size() function.


trapflag

Check for trap flag in trealregs

Declaration

Source position: go32.pp line 35

const trapflag = $100;


trealregs

Record describing all processor registers

Declaration

Source position: go32.pp line 61

type trealregs = record
case Integer of
1: (
EDI: LongInt; | EDI register
ESI: LongInt; | ESI register
EBP: LongInt; | EBP register
Res: LongInt; | RES register
EBX: LongInt; | EBX register
EDX: LongInt; | EDX register
ECX: LongInt; | ECX register
EAX: LongInt; | EAX register
Flags: Word; | Flags register
ES: Word; | ES register
DS: Word; | DS register
FS: Word; | FS register
GS: Word; | GS register
IP: Word; | IP register
CS: Word; | CS register
SP: Word; | SP register
SS: Word; | SS register
);
2: (
DI: Word; | DI register
DI2: Word; | DI2 register
SI: Word; | SI register
SI2: Word; | SI2 register
BP: Word; | BP register
BP2: Word; | BP2 register
R1: Word; | R1 register
R2: Word; | R2 register
BX: Word; | BX register
BX2: Word; | BX2 register
DX: Word; | DX register
DX2: Word; | DX2 register
CX: Word; | CX register
CX2: Word; | CX2 register
AX: Word; | AX register
AX2: Word; | AX2 register
);
3: (
stuff: array [1..4] of LongInt; | Pad data
BL: Byte; | BL register
BH: Byte; | BH register
BL2: Byte; | BL2 register
BH2: Byte; | BH2 register
DL: Byte; | DL register
DH: Byte; | DH register
DL2: Byte; | DL2 register
DH2: Byte; | DH register
CL: Byte; | CL register
CH: Byte; | CH register
CL2: Byte; | CL2 register
CH2: Byte; | CH2 register
AL: Byte; | AL register
AH: Byte; | AH register
AL2: Byte; | AL2 register
AH2: Byte; | AH2 register
);
4: (
RealEDI: LongInt; | Real EDI register
RealESI: LongInt; | Real ESI register
RealEBP: LongInt; | Real EBP register
RealRES: LongInt; | Real RES register
RealEBX: LongInt; | Real EBX register
RealEDX: LongInt; | Real EDX register
RealECX: LongInt; | Real ECX register
RealEAX: LongInt; | Real EAX register
RealFlags: Word; | Real flags
RealES: Word; | Real ES register
RealDS: Word; | Real DS register
RealFS: Word; | Real GS register
RealGS: Word; | Real GS register
RealIP: Word; | Real IP register
RealCS: Word; | Real CS register
RealSP: Word; | Real SP register
RealSS: Word; | Real SS register
);
end;

Description

The trealregs type contains the data structure to pass register values to a interrupt handler or real mode callback.


tseginfo

Record to store 48-bits pointer

Declaration

Source position: go32.pp line 56

type tseginfo = record
offset: pointer; | Offset in segment
segment: Word; | Segment
end;

Description

This record is used to store a full 48-bit pointer. This may be either a protected mode selector:offset address or in real mode a segment:offset address, depending on application.

See also: Selectors and descriptors, dos memory access, Interrupt redirection


zeroflag

Check for zero flag in trealregs

Declaration

Source position: go32.pp line 33

const zeroflag = $040;


_PATH_DEV

Location of /dev directory.

Declaration

Source position: gpm.pp line 42

const _PATH_DEV = '/dev/';


_PATH_VARRUN

Location of run PID files directory.

Declaration

Source position: gpm.pp line 41

const _PATH_VARRUN = '/var/run/';


GPM_B_LEFT

Left mouse button identifier.

Declaration

Source position: gpm.pp line 50

const GPM_B_LEFT = 4;


GPM_B_MIDDLE

Middle mouse button identifier.

Declaration

Source position: gpm.pp line 51

const GPM_B_MIDDLE = 2;


GPM_B_RIGHT

Right mouse button identifier.

Declaration

Source position: gpm.pp line 52

const GPM_B_RIGHT = 1;


GPM_BOT

Bottom of area.

Declaration

Source position: gpm.pp line 72

const GPM_BOT = 2;


gpm_current_roi

Internal gpm library variable. Do not use.

Declaration

Source position: gpm.pp line 153

var gpm_current_roi: Pgpm_roi = ;


GPM_DOUBLE

Mouse double click event.

Declaration

Source position: gpm.pp line 64

const GPM_DOUBLE = 32;


GPM_DOWN

Mouse button down event.

Declaration

Source position: gpm.pp line 61

const GPM_DOWN = 4;


GPM_DRAG

Mouse drag event.

Declaration

Source position: gpm.pp line 60

const GPM_DRAG = 2;


GPM_ENTER

Enter area event.

Declaration

Source position: gpm.pp line 68

const GPM_ENTER = 512;


gpm_handler

Internal gpm library variable. Do not use.

Declaration

Source position: gpm.pp line 152

var gpm_handler: TGpmHandler = ;


GPM_HARD

?

Declaration

Source position: gpm.pp line 67

const GPM_HARD = 256;


GPM_LEAVE

Leave area event.

Declaration

Source position: gpm.pp line 69

const GPM_LEAVE = 1024;


GPM_LFT

Left side of area.

Declaration

Source position: gpm.pp line 73

const GPM_LFT = 4;


GPM_MAGIC

Constant identifying GPM in Gpm_Open.

Declaration

Source position: gpm.pp line 98

const GPM_MAGIC = $47706D4C;


GPM_MFLAG

Motion flag.

Declaration

Source position: gpm.pp line 66

const GPM_MFLAG = 128;


GPM_MOVE

Mouse move event.

Declaration

Source position: gpm.pp line 59

const GPM_MOVE = 1;


GPM_NODE_CTL

Control socket

Declaration

Source position: gpm.pp line 47

const GPM_NODE_CTL = GPM_NODE_DEV;


GPM_NODE_DEV

Device socket filename

Declaration

Source position: gpm.pp line 46

const GPM_NODE_DEV = '/dev/gpmctl';


GPM_NODE_DIR

Where to write socket.

Declaration

Source position: gpm.pp line 43

const GPM_NODE_DIR = _PATH_VARRUN;


GPM_NODE_DIR_MODE

Mode of socket.

Declaration

Source position: gpm.pp line 44

const GPM_NODE_DIR_MODE = 0775;


GPM_NODE_FIFO

FIFO name

Declaration

Source position: gpm.pp line 48

const GPM_NODE_FIFO = '/dev/gpmdata';


GPM_NODE_PID

Name of PID file.

Declaration

Source position: gpm.pp line 45

const GPM_NODE_PID = '/var/run/gpm.pid';


GPM_RGT

Right side of area.

Declaration

Source position: gpm.pp line 74

const GPM_RGT = 8;


gpm_roi

Internal gpm library variable. Do not use.

Declaration

Source position: gpm.pp line 151

var gpm_roi: Pgpm_roi = ;


gpm_roi_data

Internal gpm library variable. Do not use.

Declaration

Source position: gpm.pp line 154

var gpm_roi_data: pointer = ;


gpm_roi_handler

Internal gpm library variable. Do not use.

Declaration

Source position: gpm.pp line 152

var gpm_roi_handler: TGpmHandler = ;


GPM_SINGLE

Mouse single click event.

Declaration

Source position: gpm.pp line 63

const GPM_SINGLE = 16;


GPM_TOP

Top of area.

Declaration

Source position: gpm.pp line 71

const GPM_TOP = 1;


GPM_TRIPLE

Mouse triple click event.

Declaration

Source position: gpm.pp line 65

const GPM_TRIPLE = 64;


GPM_UP

Mouse button up event.

Declaration

Source position: gpm.pp line 62

const GPM_UP = 8;


Reference for unit 'gpm'

Interface to GPM (General Purpose Mouse) library

uses
System, | The system unit
BaseUnix; | Basic Unix functionality

Overview

The GPM unit implements an interface to libgpm, the console program for mouse handling. This unit was created by Peter Vreman, and is only available on Linux.

When this unit is used, your program is linked to the C libraries, so you must take care of the C library version. Also, it will only work with version 1.17 or higher of the libgpm library.


Reference for unit 'gpm': Constants

GPM_BOT | Bottom of area.
GPM_B_LEFT | Left mouse button identifier.
GPM_B_MIDDLE | Middle mouse button identifier.
GPM_B_RIGHT | Right mouse button identifier.
GPM_DOUBLE | Mouse double click event.
GPM_DOWN | Mouse button down event.
GPM_DRAG | Mouse drag event.
GPM_ENTER | Enter area event.
GPM_HARD | ?
GPM_LEAVE | Leave area event.
GPM_LFT | Left side of area.
GPM_MAGIC | Constant identifying GPM in Gpm_Open.
GPM_MFLAG | Motion flag.
GPM_MOVE | Mouse move event.
GPM_NODE_CTL | Control socket
GPM_NODE_DEV | Device socket filename
GPM_NODE_DIR | Where to write socket.
GPM_NODE_DIR_MODE | Mode of socket.
GPM_NODE_FIFO | FIFO name
GPM_NODE_PID | Name of PID file.
GPM_RGT | Right side of area.
GPM_SINGLE | Mouse single click event.
GPM_TOP | Top of area.
GPM_TRIPLE | Mouse triple click event.
GPM_UP | Mouse button up event.
_PATH_DEV | Location of /dev directory.
_PATH_VARRUN | Location of run PID files directory.


Reference for unit 'gpm': Types

Pgpmconnect | Pointer to TGpmConnect record.
Pgpmevent | Pointer to TGpmEvent record
Pgpmroi | Pointer to TGpmRoi record.
Pgpm_connect | Pointer to TGpm_Connect record.
Pgpm_event | Pointer to TGpm_Event record
Pgpm_roi | Pointer to Tgpm_roi record.
Tgpmconnect | Alias for TGpm_Connect record.
TGpmEtype | Type for event type.
Tgpmevent | Alias for TGPM_EVent record
TGpmHandler | Mouse event handler callback.
TGpmMargin | Type to hold area margin.
Tgpmroi | Alias for TGpm_roiRecord
Tgpm_connect | GPM server connection information.
Tgpm_event | GPM event record
Tgpm_roi | Record used to define regions of interest.


Reference for unit 'gpm': Procedures and functions

Gpm_AnyDouble | Check whether event has double click event.
Gpm_AnySingle | Check whether event has a single click event.
Gpm_AnyTriple | Check whether event has a triple click event.
gpm_close | Close connection to GPM server.
gpm_fitvalues | Change coordinates to fit physical screen.
gpm_fitvaluesM | Change coordinates to fit margin.
gpm_getevent | Get event from event queue.
gpm_getsnapshot | Return servers' current image of mouse state.
gpm_lowerroi | Lower a region of interest in the stack.
gpm_open | Open connection to GPM server.
gpm_poproi | Pop region of interest from the stack.
gpm_pushroi | Push region of interest on the stack.
gpm_raiseroi | Raise region of interest in the stack.
gpm_repeat | Check for presence of mouse event.
Gpm_StrictDouble | Check whether event contains only a double-click event.
Gpm_StrictSingle | Check whether event contains only a single-click event.
Gpm_StrictTriple | Check whether event contains only a triple-click event.


Reference for unit 'gpm': Variables

gpm_current_roi | Internal gpm library variable. Do not use.
gpm_handler | Internal gpm library variable. Do not use.
gpm_roi | Internal gpm library variable. Do not use.
gpm_roi_data | Internal gpm library variable. Do not use.
gpm_roi_handler | Internal gpm library variable. Do not use.


Index of all identifiers in unit 'gpm'

A G P T

A

_PATH_DEV _PATH_VARRUN

G

Gpm_AnyDouble | gpm_getsnapshot | gpm_poproi
Gpm_AnySingle | gpm_handler | gpm_pushroi
Gpm_AnyTriple | GPM_HARD | gpm_raiseroi
GPM_B_LEFT | GPM_LEAVE | gpm_repeat
GPM_B_MIDDLE | GPM_LFT | GPM_RGT
GPM_BOT | gpm_lowerroi | gpm_roi
GPM_B_RIGHT | GPM_MAGIC | gpm_roi_data
gpm_close | GPM_MFLAG | gpm_roi_handler
gpm_current_roi | GPM_MOVE | GPM_SINGLE
GPM_DOUBLE | GPM_NODE_CTL | Gpm_StrictDouble
GPM_DOWN | GPM_NODE_DEV | Gpm_StrictSingle
GPM_DRAG | GPM_NODE_DIR | Gpm_StrictTriple
GPM_ENTER | GPM_NODE_DIR_MODE | GPM_TOP
gpm_fitvalues | GPM_NODE_FIFO | GPM_TRIPLE
gpm_fitvaluesM | GPM_NODE_PID | GPM_UP
gpm_getevent | gpm_open |

P

Pgpmconnect | Pgpmevent | Pgpmroi
Pgpm_connect | Pgpm_event | Pgpm_roi

T

Tgpmconnect | Tgpmevent | TGpmMargin
Tgpm_connect | Tgpm_event | Tgpmroi
TGpmEtype | TGpmHandler | Tgpm_roi


Pgpm_connect

Pointer to TGpm_Connect record.

Declaration

Source position: gpm.pp line 101

type Pgpm_connect = ^TGpm_connect;


Pgpm_event

Pointer to TGpm_Event record

Declaration

Source position: gpm.pp line 78

type Pgpm_event = ^Tgpm_event;


Pgpm_roi

Pointer to Tgpm_roi record.

Declaration

Source position: gpm.pp line 114

type Pgpm_roi = ^Tgpm_roi;


Pgpmconnect

Pointer to TGpmConnect record.

Declaration

Source position: gpm.pp line 111

type Pgpmconnect = Pgpm_connect;


Pgpmevent

Pointer to TGpmEvent record

Declaration

Source position: gpm.pp line 92

type Pgpmevent = Pgpm_event;


Pgpmroi

Pointer to TGpmRoi record.

Declaration

Source position: gpm.pp line 126

type Pgpmroi = Pgpm_roi;


Tgpm_connect

GPM server connection information.

Declaration

Source position: gpm.pp line 102

type Tgpm_connect = record
eventMask: Word; | Mask with events which client is interested in
defaultMask: Word; | Mask with events that should be handled with defaults
minMod: Word; | Minimum amount of modifiers required for client
maxMod: Word; | Maximum amount of modifiers client can handle
pid: LongInt; | PID of connecting application
vc: LongInt; | Virtual console that should be handled.
end;


Tgpm_event

GPM event record

Declaration

Source position: gpm.pp line 79

type Tgpm_event = record
buttons: Byte; | Pressed buttons
modifiers: Byte; | Modifier flags
vc: Word; | Virtual console
dx: Word; | Change in horizontal position since last event
dy: Word; | Change in vertical position since last event
x: Word; | Horizontal position of event
y: Word; | Vertical position of event
EventType: TGpmEtype; | Event type
clicks: LongInt; | Number of clicks
margin: TGpmMargin; | Position where mouse cursor left the screen.
wdx: Word; | Horizontal size
wdy: Word; | Vertical size
end;

Description

Tgpm_event describes the events that are reported by GPM.


Tgpm_roi

Record used to define regions of interest.

Declaration

Source position: gpm.pp line 115

type Tgpm_roi = record
xmin: Integer; | Minimum horizontal position.
xmax: Integer; | Maximum horizontal position.
ymin: Integer; | Minimum vertical position.
ymax: Integer; | Maximum horizontal position.
minmod: Word; | Minimum modifiers required
maxmod: Word; | Maximum modifiers allowed
eventmask: Word; | Events to signal
owned: Word; | ?
handler: TGpmHandler; | Handler to call in case of event.
clientdata: pointer; | Clientdata to pass to event handler
prev: Pgpm_roi; | Previous region of interest.
next: Pgpm_roi; | Next region of interest.
end;


Tgpmconnect

Alias for TGpm_Connect record.

Declaration

Source position: gpm.pp line 112

type Tgpmconnect = Tgpm_connect;


TGpmEtype

Type for event type.

Declaration

Source position: gpm.pp line 55

type TGpmEtype = LongInt;


Tgpmevent

Alias for TGPM_EVent record

Declaration

Source position: gpm.pp line 93

type Tgpmevent = Tgpm_event;


TGpmHandler

Mouse event handler callback.

Declaration

Source position: gpm.pp line 95

type TGpmHandler = function(

  var event: Tgpmevent;

  clientdata: pointer

):LongInt;


TGpmMargin

Type to hold area margin.

Declaration

Source position: gpm.pp line 56

type TGpmMargin = LongInt;


Tgpmroi

Alias for TGpm_roiRecord

Declaration

Source position: gpm.pp line 127

type Tgpmroi = Tgpm_roi;


AndPut

Draw operation: use AND

Declaration

Source position: graphh.inc line 310

const AndPut = 3;


AnsiToASCIITransTable

Default ansi transliteration table.

Declaration

Source position: graphh.inc line 696

const AnsiToASCIITransTable: TCharsetTransTable = (#$00, #$01, #$02, #$03, #$04, #$05, #$06, #$07, #$08, #$09, #$0a, #$0b, #$0c, #$0d, #$0e, #$0f, #$10, #$11, #$12, #$13, #$14, #$15, #$16, #$17, #$18, #$19, #$1a, #$1b, #$1c, #$1d, #$1e, #$1f, #$20, #$21, #$22, #$23, #$24, #$25, #$26, #$27, #$28, #$29, #$2a, #$2b, #$2c, #$2d, #$2e, #$2f, #$30, #$31, #$32, #$33, #$34, #$35, #$36, #$37, #$38, #$39, #$3a, #$3b, #$3c, #$3d, #$3e, #$3f, #$40, #$41, #$42, #$43, #$44, #$45, #$46, #$47, #$48, #$49, #$4a, #$4b, #$4c, #$4d, #$4e, #$4f, #$50, #$51, #$52, #$53, #$54, #$55, #$56, #$57, #$58, #$59, #$5a, #$5b, #$5c, #$5d, #$5e, #$5f, #$60, #$61, #$62, #$63, #$64, #$65, #$66, #$67, #$68, #$69, #$6a, #$6b, #$6c, #$6d, #$6e, #$6f, #$70, #$71, #$72, #$73, #$74, #$75, #$76, #$77, #$78, #$79, #$7a, #$7b, #$7c, #$7d, #$7e, #$7f, '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', #$ff, #$ad, #$9b, #$9c, '?', #$9d, '?', '?', '?', '?', #$a6, #$ae, #$aa, '?', '?', '?', #$f8, #$f1, #$fd, '?', '?', #$e6, '?', #$fa, '?', '?', #$a7, #$af, #$ac, #$ab, '?', #$a8, '?', '?', '?', '?', #$8e, #$8f, #$92, #$80, '?', #$90, '?', '?', '?', '?', '?', '?', '?', #$a5, '?', '?', '?', '?', #$99, '?', '?', '?', '?', '?', #$9a, '?', '?', #$e1, #$85, #$a0, #$83, '?', #$84, #$86, #$91, #$87, #$8a, #$82, #$88, #$89, #$8d, #$a1, #$8c, #$8b, '?', #$a4, #$95, #$a2, #$93, '?', #$94, #$f6, '?', #$97, #$a3, #$96, #$81, '?', '?', #$98);


BkSlashFill

Fill style: Diagonal (backslash) lines

Declaration

Source position: graphh.inc line 296

const BkSlashFill = 5;


black

Color code: black.

Declaration

Source position: graphh.inc line 219

const black = 0;


blue

Color code: blue

Declaration

Source position: graphh.inc line 220

const blue = 1;


BoldFont

Font number: Bold font.

Declaration

Source position: graphh.inc line 276

const BoldFont = 10;


BottomText

Vertical text alignment: Align text to bottom

Declaration

Source position: graphh.inc line 318

const BottomText = 0;


brown

Color code: brown

Declaration

Source position: graphh.inc line 225

const brown = 6;


CenterLn

Line style: centered line

Declaration

Source position: graphh.inc line 258

const CenterLn = 2;


CenterText

Horizontal text alignment: Center text

Declaration

Source position: graphh.inc line 315

const CenterText = 1;


CGA

Graphic driver for CGA cards

Declaration

Source position: graphh.inc line 324

const CGA = 1;


CGAC0

CGA Graphic driver mode C0

Declaration

Source position: graphh.inc line 355

const CGAC0 = 0;


CGAC1

CGA Graphic driver mode C1

Declaration

Source position: graphh.inc line 356

const CGAC1 = 1;


CGAC2

CGA Graphic driver mode C2

Declaration

Source position: graphh.inc line 357

const CGAC2 = 2;


CGAC3

CGA Graphic driver mode C3

Declaration

Source position: graphh.inc line 358

const CGAC3 = 3;


CGAHi

CGA Graphic driver Hi-res mode

Declaration

Source position: graphh.inc line 359

const CGAHi = 4;


Circle

Draw a complete circle

Declaration

Source position: graphh.inc line 678

var Circle: CircleProc = ;

Description

Circle draws a complete circle with center at (X,Y), radius radius.

Errors

None.

See also

Ellipse | Draw an ellipse
Arc | Draw part of a circle
GetArcCoords | Return coordinates of last drawn arc or ellipse.
PieSlice | Draw a pie-slice
Sector | Draw and fill a sector of an ellipse


CircleProc

Standard circle drawing routine prototype.

Declaration

Source position: graphh.inc line 590

type CircleProc = procedure(

  X: SmallInt;

  Y: SmallInt;

  Radius: Word

);


ClearViewPort

Clear the current viewport

Declaration

Source position: graphh.inc line 654

var ClearViewPort: clrviewproc = ;

Description

Clears the current viewport. The current background color is used as filling color. The pointer is set at (0,0).

Errors

None.

See also

ClearDevice | Clear the complete screen
SetViewPort | Set the graphical drawing window
SetBkColor | Set background drawing color


ClipOff

Viewport clipping off

Declaration

Source position: graphh.inc line 284

const ClipOff = False;


ClipOn

Viewport clipping on

Declaration

Source position: graphh.inc line 283

const ClipOn = True;


CloseDotFill

Fill style: Closely spaced dotted lines

Declaration

Source position: graphh.inc line 302

const CloseDotFill = 11;


clrviewproc

Standard clearviewport routine prototype

Declaration

Source position: graphh.inc line 525

type clrviewproc = procedure;


CopyPut

Draw operation: use Copy

Declaration

Source position: graphh.inc line 307

const CopyPut = 0;


CurrentDriver

Currently used driver

Declaration

Source position: graphh.inc line 322

const CurrentDriver = - 128;


cyan

Color code: Cyan

Declaration

Source position: graphh.inc line 222

const cyan = 3;


D1bit

Mode: Depth 1 bit

Declaration

Source position: graphh.inc line 335

const D1bit = 11;


D2bit

Mode: Depth 2 bit

Declaration

Source position: graphh.inc line 336

const D2bit = 12;


D4bit

Mode: Depth 4 bit

Declaration

Source position: graphh.inc line 337

const D4bit = 13;


D6bit

Mode: Depth 6 bit

Declaration

Source position: graphh.inc line 338

const D6bit = 14;


D8bit

Mode: Depth 8 bit

Declaration

Source position: graphh.inc line 339

const D8bit = 15;


D12bit

Mode: Depth 12 bit

Declaration

Source position: graphh.inc line 340

const D12bit = 16;


D15bit

Mode: Depth 15 bit

Declaration

Source position: graphh.inc line 341

const D15bit = 17;


D16bit

Mode: Depth 16 bit

Declaration

Source position: graphh.inc line 342

const D16bit = 18;


D24bit

Mode: Depth 24 bit

Declaration

Source position: graphh.inc line 343

const D24bit = 19;


D32bit

Mode: Depth 32 bit

Declaration

Source position: graphh.inc line 344

const D32bit = 20;


D64bit

Mode: Depth 64 bit

Declaration

Source position: graphh.inc line 345

const D64bit = 21;


darkgray

Color code: Dark gray

Declaration

Source position: graphh.inc line 227

const darkgray = 8;


DashedLn

Line style: dashed line

Declaration

Source position: graphh.inc line 259

const DashedLn = 3;


Default

Default mode

Declaration

Source position: graphh.inc line 352

const Default = 0;


DefaultFont

Font number: Normal font

Declaration

Source position: graphh.inc line 266

const DefaultFont = 0;


defpixelproc

Standard pixel drawing routine prototype.

Declaration

Source position: graphh.inc line 518

type defpixelproc = procedure(

  X: SmallInt;

  Y: SmallInt

);

Description

This is the standard putpixel routine used by all function drawing routines, it will use the viewport settings, as well as clip, and use the current foreground color to plot the desired pixel.


Detect

Mode: Detect mode.

Declaration

Source position: graphh.inc line 323

const Detect = 0;


detectMode

Mode: Autodetect optimal mode

Declaration

Source position: graphh.inc line 391

const detectMode = 30000;


DirectPutPixel

Hook to directly draw a pixel on the screen.

Declaration

Source position: graphh.inc line 653

var DirectPutPixel: defpixelproc = ;


DottedLn

Line style: Dotted line

Declaration

Source position: graphh.inc line 257

const DottedLn = 1;


DrawTextBackground

Should the background of texts be drawn or should it be left untouched ?

Declaration

Source position: graphh.inc line 732

const DrawTextBackground: Boolean = False;


EGA

Graphic driver for EGA cards

Declaration

Source position: graphh.inc line 326

const EGA = 3;


EGA64

Graphic driver for EGA 64 cards

Declaration

Source position: graphh.inc line 327

const EGA64 = 4;


EGA64Hi

EGA64 graphic driver high resolution mode

Declaration

Source position: graphh.inc line 375

const EGA64Hi = 1;


EGA64Lo

EGA64 graphic driver low resolution mode

Declaration

Source position: graphh.inc line 374

const EGA64Lo = 0;


EGABlack

Color code: EGA Black

Declaration

Source position: graphh.inc line 236

const EGABlack = 0;


EGABlue

Color code: EGA blue

Declaration

Source position: graphh.inc line 237

const EGABlue = 1;


EGABrown

Color code: EGA brown

Declaration

Source position: graphh.inc line 243

const EGABrown = 20;


EGACyan

Color code: EGA cyan

Declaration

Source position: graphh.inc line 239

const EGACyan = 3;


EGADarkgray

Color code: EGA dark gray

Declaration

Source position: graphh.inc line 244

const EGADarkgray = 56;


EGAGreen

Color code: EGA green

Declaration

Source position: graphh.inc line 238

const EGAGreen = 2;


EGAHi

EGA graphic driver high resolution mode

Declaration

Source position: graphh.inc line 371

const EGAHi = 1;


EGALightblue

Color code: EGA Light blue

Declaration

Source position: graphh.inc line 245

const EGALightblue = 57;


EGALightcyan

Color code: EGA Light cyan

Declaration

Source position: graphh.inc line 247

const EGALightcyan = 59;


EGALightgray

Color code: EGA Light gray

Declaration

Source position: graphh.inc line 242

const EGALightgray = 7;


EGALightgreen

Color code: EGA Light green

Declaration

Source position: graphh.inc line 246

const EGALightgreen = 58;


EGALightmagenta

Color code: EGA light magenta

Declaration

Source position: graphh.inc line 249

const EGALightmagenta = 61;


EGALightred

Color code: EGA light red

Declaration

Source position: graphh.inc line 248

const EGALightred = 60;


EGALo

EGA graphic driver low resolution mode

Declaration

Source position: graphh.inc line 370

const EGALo = 0;


EGAMagenta

Color code: EGA magenta

Declaration

Source position: graphh.inc line 241

const EGAMagenta = 5;


EGAMono

Graphic driver for EGA monochrome cards

Declaration

Source position: graphh.inc line 328

const EGAMono = 5;


EGAMonoHi

EGAMono graphic driver high resolution mode

Declaration

Source position: graphh.inc line 378

const EGAMonoHi = 3;


EGARed

Color code: EGA red

Declaration

Source position: graphh.inc line 240

const EGARed = 4;


EGAWhite

Color code: EGA white

Declaration

Source position: graphh.inc line 251

const EGAWhite = 63;


EGAYellow

Color code: EGA yellow

Declaration

Source position: graphh.inc line 250

const EGAYellow = 62;


EmptyFill

Fill style: Do not fill

Declaration

Source position: graphh.inc line 291

const EmptyFill = 0;


EuroFont

Font number: ?

Declaration

Source position: graphh.inc line 275

const EuroFont = 9;


fillpatternTable

Table with standard fill patterns

Declaration

Source position: graphh.inc line 487

const fillpatternTable: array [0..12] of FillPatternType = (($00, $00, $00, $00, $00, $00, $00, $00), ($ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff), ($ff, $ff, $00, $00, $ff, $ff, $00, $00), ($01, $02, $04, $08, $10, $20, $40, $80), ($07, $0e, $1c, $38, $70, $e0, $c1, $83), ($07, $83, $c1, $e0, $70, $38, $1c, $0e), ($5a, $2d, $96, $4b, $a5, $d2, $69, $b4), ($ff, $88, $88, $88, $ff, $88, $88, $88), ($18, $24, $42, $81, $81, $42, $24, $18), ($cc, $33, $cc, $33, $cc, $33, $cc, $33), ($80, $00, $08, $00, $80, $00, $08, $00), ($88, $00, $22, $00, $88, $00, $22, $00), (0, 0, 0, 0, 0, 0, 0, 0));


FillPatternType

Bit pattern used when drawing lines. Set bits are drawn.

Declaration

Source position: graphh.inc line 467

type FillPatternType = array [1..8] of Byte;


FillSettingsType

Record describing fill mode

Declaration

Source position: graphh.inc line 462

type FillSettingsType = record
pattern: Word; | Fill bit pattern. Set bits are drawn..
color: Word; | Color used to fill
end;


Categorized functions: Color management

All functions related to color management.

Name | Description
GetBkColor | Get current background color
GetColor | Get current foreground color
GetDefaultPalette | Get default palette entries
GetMaxColor | Get maximum valid color
GetPaletteSize | Get size of palette for current mode
GetPixel | Get color of selected pixel
GetPalette | Get palette entry
SetAllPalette | Set all colors in palette
SetBkColor | Set background color
SetColor | Set foreground color
SetPalette | Set palette entry
SetRGBPalette | Set palette entry with RGB values


Categorized functions: Drawing primitives

Functions for simple drawing.

Name | Description
Arc | Draw an arc
Circle | Draw a complete circle
DrawPoly | Draw a polygone with N points
Ellipse | Draw an ellipse
GetArcCoords | Get arc coordinates
GetLineSettings | Get current line drawing settings
Line | Draw line between 2 points
LineRel | Draw line relative to current position
LineTo | Draw line from current position to absolute position
MoveRel | Move cursor relative to current position
MoveTo | Move cursor to absolute position
PieSlice | Draw a pie slice
PutPixel | Draw 1 pixel
Rectangle | Draw a non-filled rectangle
Sector | Draw a sector
SetLineStyle | Set current line drawing style


Categorized functions: Filled drawings

Functions for drawing filled regions.

Name | Description
Bar3D | Draw a filled 3D-style bar
Bar | Draw a filled rectangle
FloodFill | Fill starting from coordinate
FillEllipse | Draw a filled ellipse
FillPoly | Draw a filled polygone
GetFillPattern | Get current fill pattern
GetFillSettings | Get current fill settings
SetFillPattern | Set current fill pattern
SetFillStyle | Set current fill settings


Categorized functions: Initialization

Initialization of the graphics screen.

Name | Description
ClearDevice | Empty the graphics screen
CloseGraph | Finish drawing session, return to text mode
DetectGraph | Detect graphical modes
GetAspectRatio | Get aspect ratio of screen
GetModeRange | Get range of valid modes for current driver
GraphDefaults | Set defaults
GetDriverName | Return name of graphical driver
GetGraphMode | Return current or last used graphics mode
GetMaxMode | Get maximum mode for current driver
GetModeName | Get name of current mode
GraphErrorMsg | String representation of graphical error
GraphResult | Result of last drawing operation
InitGraph | Initialize graphics drivers
InstallUserDriver | Install a new driver
RegisterBGIDriver | Register a new driver
RestoreCRTMode | Go back to text mode
SetGraphMode | Set graphical mode


Categorized functions: Screen management

General drawing screen management functions.

Name | Description
ClearViewPort | Clear the current viewport
GetImage | Copy image from screen to memory
GetMaxX | Get maximum X coordinate
GetMaxY | Get maximum Y coordinate
GetX | Get current X position
GetY | Get current Y position
ImageSize | Get size of selected image
GetViewSettings | Get current viewport settings
PutImage | Copy image from memory to screen
SetActivePage | Set active video page
SetAspectRatio | Set aspect ratio for drawing routines
SetViewPort | Set current viewport
SetVisualPage | Set visual page
SetWriteMode | Set write mode for screen operations


Categorized functions: Text and font handling

Functions to set texts on the screen.

Name | Description
GetTextSettings | Get current text settings
InstallUserFont | Install a new font
OutText | Write text at current cursor position
OutTextXY | Write text at coordinates X,Y
RegisterBGIFont | Register a new font
SetTextJustify | Set text justification
SetTextStyle | Set text style
SetUserCharSize | Set text size
TextHeight | Calculate height of text
TextWidth | Calculate width of text


G320x200x16

Mode: Resulution 320x200, 16 colors

Declaration

Source position: graph.pp line 24

const G320x200x16 = 1;


G320x200x16M

Mode: Resolution 320x200, 16M colors

Declaration

Source position: graph.pp line 42

const G320x200x16M = 16;


G320x200x16M32

Mode: Resolution 320x200, 16M 32-bit colors

Declaration

Source position: graph.pp line 62

const G320x200x16M32 = 33;


G320x200x32K

Mode: Resolution 320x200, 32K colors

Declaration

Source position: graph.pp line 40

const G320x200x32K = 14;


G320x200x64K

Mode: Resolution 320x200, 64K colors

Declaration

Source position: graph.pp line 41

const G320x200x64K = 15;


G320x200x256

Mode: Resolution 320x200, 256 colors

Declaration

Source position: graph.pp line 28

const G320x200x256 = 5;


G320x240x256

Mode: Resolution 320x240, 256 colors

Declaration

Source position: graph.pp line 29

const G320x240x256 = 6;


G320x400x256

Mode: Resolution 320x400, 256 colors

Declaration

Source position: graph.pp line 30

const G320x400x256 = 7;


G360x480x256

Mode: Resolution 360x480, 256 colors

Declaration

Source position: graph.pp line 31

const G360x480x256 = 8;


G640x200x16

Mode: Resolution x, colors

Declaration

Source position: graph.pp line 25

const G640x200x16 = 2;


G640x350x16

Mode: Resolution x, colors

Declaration

Source position: graph.pp line 26

const G640x350x16 = 3;


G640x480x2

Mode: Resolution 640x480, 2 colors

Declaration

Source position: graph.pp line 32

const G640x480x2 = 9;


G640x480x16

Mode: Resolution x, colors

Declaration

Source position: graph.pp line 27

const G640x480x16 = 4;


G640x480x16M

Mode: Resolution 640x480, 16M colors

Declaration

Source position: graph.pp line 45

const G640x480x16M = 19;


G640x480x16M32

Mode: Resolution 640x480, 16M 32-bit colors

Declaration

Source position: graph.pp line 63

const G640x480x16M32 = 34;


G640x480x32K

Mode: Resolution 640x480, 32K colors

Declaration

Source position: graph.pp line 43

const G640x480x32K = 17;


G640x480x64K

Mode: Resolution 640x480, 64K colors

Declaration

Source position: graph.pp line 44

const G640x480x64K = 18;


G640x480x256

Mode: Resolution 640x480, 256 colors

Declaration

Source position: graph.pp line 34

const G640x480x256 = 10;


G720x348x2

Mode: Resolution 720x348, 2 colors

Declaration

Source position: graph.pp line 60

const G720x348x2 = 32;


G800x600x16

Mode: Resolution 800x600, 16 colors

Declaration

Source position: graph.pp line 56

const G800x600x16 = 29;


G800x600x16M

Mode: Resolution 800x600, 16M colors

Declaration

Source position: graph.pp line 48

const G800x600x16M = 22;


G800x600x16M32

Mode: Resolution 800x600, 16M 32-bit colors

Declaration

Source position: graph.pp line 64

const G800x600x16M32 = 35;


G800x600x32K

Mode: Resolution 800x600, 32K colors

Declaration

Source position: graph.pp line 46

const G800x600x32K = 20;


G800x600x64K

Mode: Resolution 800x600, 64K colors

Declaration

Source position: graph.pp line 47

const G800x600x64K = 21;


G800x600x256

Mode: Resolution 800x600, 256 colors

Declaration

Source position: graph.pp line 35

const G800x600x256 = 11;


G1024x768x16

Mode: Resolution 1024x768, 16 colors

Declaration

Source position: graph.pp line 57

const G1024x768x16 = 30;


G1024x768x16M

Mode: Resolution 1024x768, 16M colors

Declaration

Source position: graph.pp line 51

const G1024x768x16M = 25;


G1024x768x16M32

Mode: Resolution 1024x758, 16M 32-bit colors

Declaration

Source position: graph.pp line 65

const G1024x768x16M32 = 36;


G1024x768x32K

Mode: Resolution 1024x768, 32K colors

Declaration

Source position: graph.pp line 49

const G1024x768x32K = 23;


G1024x768x64K

Mode: Resolution 1024x768, 64K colors

Declaration

Source position: graph.pp line 50

const G1024x768x64K = 24;


G1024x768x256

Mode: Resolution 1024x768, 256 colors

Declaration

Source position: graph.pp line 36

const G1024x768x256 = 12;


G1152x864x16

Mode: Resolution 1152x864, 16 colors

Declaration

Source position: graph.pp line 69

const G1152x864x16 = 38;


G1152x864x16M

Mode: Resolution 1152x864, 16M colors

Declaration

Source position: graph.pp line 73

const G1152x864x16M = 42;


G1152x864x16M32

Mode: Resolution 1152x864, 16M 32-bitcolors

Declaration

Source position: graph.pp line 74

const G1152x864x16M32 = 43;


G1152x864x32K

Mode: Resolution 1152x864, 32K colors

Declaration

Source position: graph.pp line 71

const G1152x864x32K = 40;


G1152x864x64K

Mode: Resolution 1152x864, 64K colors

Declaration

Source position: graph.pp line 72

const G1152x864x64K = 41;


G1152x864x256

Mode: Resolution 1152x864, 256 colors

Declaration

Source position: graph.pp line 70

const G1152x864x256 = 39;


G1280x1024x16

Mode: Resolution 1280x1024, 16 colors

Declaration

Source position: graph.pp line 58

const G1280x1024x16 = 31;


G1280x1024x16M

Mode: Resolution 1280x1024, 16M colors

Declaration

Source position: graph.pp line 54

const G1280x1024x16M = 28;


G1280x1024x16M32

Mode: Resolution 1280x1024, 16M 32-bit colors

Declaration

Source position: graph.pp line 66

const G1280x1024x16M32 = 37;


G1280x1024x32K

Mode: Resolution 1280x1024, 32K colors

Declaration

Source position: graph.pp line 52

const G1280x1024x32K = 26;


G1280x1024x64K

Mode: Resolution 1280x1024, 64K colors

Declaration

Source position: graph.pp line 53

const G1280x1024x64K = 27;


G1280x1024x256

Mode: Resolution 1280x1024, 256 colors

Declaration

Source position: graph.pp line 38

const G1280x1024x256 = 13;


G1600x1200x16

Mode: Resolution 1600x1200, 16 colors

Declaration

Source position: graph.pp line 76

const G1600x1200x16 = 44;


G1600x1200x16M

Mode: Resolution 1600x1200, 16M colors

Declaration

Source position: graph.pp line 80

const G1600x1200x16M = 48;


G1600x1200x16M32

Mode: Resolution 1600x1200, 16M 32-bit colors

Declaration

Source position: graph.pp line 81

const G1600x1200x16M32 = 49;


G1600x1200x32K

Mode: Resolution 1600x1200, 32K colors

Declaration

Source position: graph.pp line 78

const G1600x1200x32K = 46;


G1600x1200x64K

Mode: Resolution 1600x1200, 64K colors

Declaration

Source position: graph.pp line 79

const G1600x1200x64K = 47;


G1600x1200x256

Mode: Resolution 1600x1200, 256 colors

Declaration

Source position: graph.pp line 77

const G1600x1200x256 = 45;


GetBkColor

Return current background color

Declaration

Source position: graphh.inc line 667

var GetBkColor: GetBkColorProc = ;

Description

GetBkColor returns the current background color (the palette entry).

Errors

None.

See also

GetColor | Return current drawing color
SetBkColor | Set background drawing color


GetBkColorProc

GetBKColor callback prototype

Declaration

Source position: graphh.inc line 593

type GetBkColorProc = function: Word;

Description

GetBkColorProc is the procedure prototype for the GetBkColor method handler in TModeInfo. The function should return the color code of the background color.


GetImage

Return a copy of a screen area

Declaration

Source position: graphh.inc line 657

var GetImage: getimageproc = ;

Description

GetImage Places a copy of the screen area (X1,Y1) to X2,Y2 in BitMap

Errors

Bitmap must have enough room to contain the image.

See also

ImageSize | Return size to store image
PutImage | Draw an in-memory image to the screen


getimageproc

Standard GetImage procedure prototype.

Declaration

Source position: graphh.inc line 529

type getimageproc = procedure(

  X1: SmallInt;

  Y1: SmallInt;

  X2: SmallInt;

  Y2: SmallInt;

  var Bitmap

);


GetPixel

Return color of pixel

Declaration

Source position: graphh.inc line 659

var GetPixel: getpixelproc = ;

Description

GetPixel returns the color of the point at (X,Y)

Errors

None.

See also

PutPixel

Draw a pixel on the screen


getpixelproc

Standard pixel fetching routine prototype

Declaration

Source position: graphh.inc line 521

type getpixelproc = function(

  X: SmallInt;

  Y: SmallInt

):Word;


GetRGBPalette

Hook to set a RGB palette entries.

Declaration

Source position: graphh.inc line 663

var GetRGBPalette: getrgbpaletteproc = ;


getrgbpaletteproc

This routine prototype is a hook for GetRGBPalette

Declaration

Source position: graphh.inc line 582

type getrgbpaletteproc = procedure(

  ColorNum: SmallInt;

  var RedValue: SmallInt;

  var GreenValue: SmallInt;

  var BlueValue: SmallInt

);


GetScanLine

Hook to get a scan line from the screen.

Declaration

Source position: graphh.inc line 672

var GetScanLine: getscanlineproc = ;


getscanlineproc

Standard getscanline routine prototype

Declaration

Source position: graphh.inc line 561

type getscanlineproc = procedure(

  X1: SmallInt;

  X2: SmallInt;

  Y: SmallInt;

  var data

);

Description

This routine is used for FloodFill It returns an entire screen scan line with a word for each pixel in the scanline. Also handy for GetImage.


GothicFont

Font number: Gothic font

Declaration

Source position: graphh.inc line 270

const GothicFont = 4;


graph_float

The platform's preferred floating point size for fast graph operations

Declaration

Source position: graphh.inc line 484

type graph_float = single;


graphfreememprc

Procedure prototype, used when heap memory is freed by the graph routines.

Declaration

Source position: graphh.inc line 532

type graphfreememprc = procedure(

  var P: Pointer;

  size: Word

);


GraphFreeMemPtr

Hook to free heap memory.

Declaration

Source position: graphh.inc line 669

var GraphFreeMemPtr: graphfreememprc = ;


graphgetmemprc

Procedure prototype, used when heap memory is needed by the graph routines.

Declaration

Source position: graphh.inc line 533

type graphgetmemprc = procedure(

  var P: pointer;

  size: Word

);


GraphGetMemPtr

Hook to get heap memory

Declaration

Source position: graphh.inc line 670

var GraphGetMemPtr: graphgetmemprc = ;


GraphStringTransTable

Table used when transliterating strings.

Declaration

Source position: graphh.inc line 731

const GraphStringTransTable: PCharsetTransTable = Nil;


green

Color code: green

Declaration

Source position: graphh.inc line 221

const green = 2;


grError

Error: Unknown error.

Declaration

Source position: graphh.inc line 211

const grError = - 11;


grFileNotFound

Error: File for driver not found.

Declaration

Source position: graphh.inc line 203

const grFileNotFound = - 3;


grFontNotFound

Error: font description file not found.

Declaration

Source position: graphh.inc line 208

const grFontNotFound = - 8;


grInvalidDriver

Error: Invalid driver specified

Declaration

Source position: graphh.inc line 204

const grInvalidDriver = - 4;


grInvalidFont

Error: Invalid font description

Declaration

Source position: graphh.inc line 213

const grInvalidFont = - 13;


grInvalidFontNum

Error: Invalid font number

Declaration

Source position: graphh.inc line 214

const grInvalidFontNum = - 14;


grInvalidMode

Error: Invalid mode specified.

Declaration

Source position: graphh.inc line 210

const grInvalidMode = - 10;


grInvalidVersion

Error: Invalid version.

Declaration

Source position: graphh.inc line 215

const grInvalidVersion = - 18;


grIOerror

Error: Unspecified Input/Output error.

Declaration

Source position: graphh.inc line 212

const grIOerror = - 12;


grNoFloodMem

Error: Could not allocate memory for flood operation.

Declaration

Source position: graphh.inc line 207

const grNoFloodMem = - 7;


grNoFontMem

Error: Not enough memory to load font.

Declaration

Source position: graphh.inc line 209

const grNoFontMem = - 9;


grNoInitGraph

Error: Graphical system not initialized

Declaration

Source position: graphh.inc line 201

const grNoInitGraph = - 1;


grNoLoadMem

Error: Memory error.

Declaration

Source position: graphh.inc line 205

const grNoLoadMem = - 5;


grNoScanMem

Error: Could not allocate memory for scan

Declaration

Source position: graphh.inc line 206

const grNoScanMem = - 6;


grNotDetected

Error: Graphics device not detected.

Declaration

Source position: graphh.inc line 202

const grNotDetected = - 2;


grOk

Graphical operation went OK.

Declaration

Source position: graphh.inc line 200

const grOk = 0;


HatchFill

Fill style: Hatch lines

Declaration

Source position: graphh.inc line 298

const HatchFill = 7;


HercMono

Mode: Hercules, mono color

Declaration

Source position: graphh.inc line 330

const HercMono = 7;


HercMonoHi

Mode: Hercules card, monochrome, high resolution

Declaration

Source position: graphh.inc line 430

const HercMonoHi = 0;


highNewDriver

Mode: highest number for new driver

Declaration

Source position: graphh.inc line 348

const highNewDriver = 21;


highNewMode

Mode: Highest possible value of the new modes.

Declaration

Source position: graphh.inc line 409

const highNewMode = m2048x1536;


HLine

Hook to draw a solid horizontal line

Declaration

Source position: graphh.inc line 676

var HLine: hlineproc = ;


hlineproc

Standard procedure prototype to draw a single horizontal line

Declaration

Source position: graphh.inc line 539

type hlineproc = procedure(

  x: SmallInt;

  x2: SmallInt;

  y: SmallInt

);


HorizDir

Text write direction: Horizontal

Declaration

Source position: graphh.inc line 278

const HorizDir = 0;


ImageSize

Return size to store image

Declaration

Source position: graphh.inc line 658

var ImageSize: imagesizeproc = ;

Description

ImageSize returns the number of bytes needed to store the image in the rectangle defined by (X1,Y1) and (X2,Y2).

Errors

None.

See also

GetImage

Return a copy of a screen area


imagesizeproc

Standard ImageSize calculation procedure prototype.

Declaration

Source position: graphh.inc line 530

type imagesizeproc = function(

  X1: SmallInt;

  Y1: SmallInt;

  X2: SmallInt;

  Y2: SmallInt

):LongInt;


Reference for unit 'Graph'

TP compatible unit to handle screen graphics.

uses

  System;

The system unit

Overview

This document describes the GRAPH unit for Free Pascal, for all platforms. The unit was first written for dos by Florian Klaempfl, but was later completely rewritten by Carl-Eric Codere to be completely portable. The unit is provided for compatibility only: It is recommended to use more modern graphical systems. The graph unit will allow to recompile old programs. They will work to some extent, but if the application has heavy graphical needs, it's recommended to use another set of graphical routines, suited to the platform the program should work on.

Related topics

FuncTextHandling | Categorized functions: Text and font handling
FuncFilledDrawing | Categorized functions: Filled drawings
FuncDrawing | Categorized functions: Drawing primitives
FuncColorManagement | Categorized functions: Color management
FuncScreen | Categorized functions: Screen management
FuncInitializion | Categorized functions: Initialization
TargetIssuesWindows | Target specific issues: Linux
TargetIssuesDos | Target specific issues: DOS
Modes | A word about mode selection
Requirements | Requirements


Reference for unit 'Graph': Constants

AndPut | Draw operation: use AND
AnsiToASCIITransTable | Default ansi transliteration table.
BkSlashFill | Fill style: Diagonal (backslash) lines
black | Color code: black.
blue | Color code: blue
BoldFont | Font number: Bold font.
BottomText | Vertical text alignment: Align text to bottom
brown | Color code: brown
CenterLn | Line style: centered line
CenterText | Horizontal text alignment: Center text
CGA | Graphic driver for CGA cards
CGAC0 | CGA Graphic driver mode C0
CGAC1 | CGA Graphic driver mode C1
CGAC2 | CGA Graphic driver mode C2
CGAC3 | CGA Graphic driver mode C3
CGAHi | CGA Graphic driver Hi-res mode
ClipOff | Viewport clipping off
ClipOn | Viewport clipping on
CloseDotFill | Fill style: Closely spaced dotted lines
CopyPut | Draw operation: use Copy
CurrentDriver | Currently used driver
cyan | Color code: Cyan
D12bit | Mode: Depth 12 bit
D15bit | Mode: Depth 15 bit
D16bit | Mode: Depth 16 bit
D1bit | Mode: Depth 1 bit
D24bit | Mode: Depth 24 bit
D2bit | Mode: Depth 2 bit
D32bit | Mode: Depth 32 bit
D4bit | Mode: Depth 4 bit
D64bit | Mode: Depth 64 bit
D6bit | Mode: Depth 6 bit
D8bit | Mode: Depth 8 bit
darkgray | Color code: Dark gray
DashedLn | Line style: dashed line
Default | Default mode
DefaultFont | Font number: Normal font
Detect | Mode: Detect mode.
detectMode | Mode: Autodetect optimal mode
DottedLn | Line style: Dotted line
DrawTextBackground | Should the background of texts be drawn or should it be left untouched ?
EGA | Graphic driver for EGA cards
EGA64 | Graphic driver for EGA 64 cards
EGA64Hi | EGA64 graphic driver high resolution mode
EGA64Lo | EGA64 graphic driver low resolution mode
EGABlack | Color code: EGA Black
EGABlue | Color code: EGA blue
EGABrown | Color code: EGA brown
EGACyan | Color code: EGA cyan
EGADarkgray | Color code: EGA dark gray
EGAGreen | Color code: EGA green
EGAHi | EGA graphic driver high resolution mode
EGALightblue | Color code: EGA Light blue
EGALightcyan | Color code: EGA Light cyan
EGALightgray | Color code: EGA Light gray
EGALightgreen | Color code: EGA Light green
EGALightmagenta | Color code: EGA light magenta
EGALightred | Color code: EGA light red
EGALo | EGA graphic driver low resolution mode
EGAMagenta | Color code: EGA magenta
EGAMono | Graphic driver for EGA monochrome cards
EGAMonoHi | EGAMono graphic driver high resolution mode
EGARed | Color code: EGA red
EGAWhite | Color code: EGA white
EGAYellow | Color code: EGA yellow
EmptyFill | Fill style: Do not fill
EuroFont | Font number: ?
fillpatternTable | Table with standard fill patterns
G1024x768x16 | Mode: Resolution 1024x768, 16 colors
G1024x768x16M | Mode: Resolution 1024x768, 16M colors
G1024x768x16M32 | Mode: Resolution 1024x758, 16M 32-bit colors
G1024x768x256 | Mode: Resolution 1024x768, 256 colors
G1024x768x32K | Mode: Resolution 1024x768, 32K colors
G1024x768x64K | Mode: Resolution 1024x768, 64K colors
G1152x864x16 | Mode: Resolution 1152x864, 16 colors
G1152x864x16M | Mode: Resolution 1152x864, 16M colors
G1152x864x16M32 | Mode: Resolution 1152x864, 16M 32-bitcolors
G1152x864x256 | Mode: Resolution 1152x864, 256 colors
G1152x864x32K | Mode: Resolution 1152x864, 32K colors
G1152x864x64K | Mode: Resolution 1152x864, 64K colors
G1280x1024x16 | Mode: Resolution 1280x1024, 16 colors
G1280x1024x16M | Mode: Resolution 1280x1024, 16M colors
G1280x1024x16M32 | Mode: Resolution 1280x1024, 16M 32-bit colors
G1280x1024x256 | Mode: Resolution 1280x1024, 256 colors
G1280x1024x32K | Mode: Resolution 1280x1024, 32K colors
G1280x1024x64K | Mode: Resolution 1280x1024, 64K colors
G1600x1200x16 | Mode: Resolution 1600x1200, 16 colors
G1600x1200x16M | Mode: Resolution 1600x1200, 16M colors
G1600x1200x16M32 | Mode: Resolution 1600x1200, 16M 32-bit colors
G1600x1200x256 | Mode: Resolution 1600x1200, 256 colors
G1600x1200x32K | Mode: Resolution 1600x1200, 32K colors
G1600x1200x64K | Mode: Resolution 1600x1200, 64K colors
G320x200x16 | Mode: Resulution 320x200, 16 colors
G320x200x16M | Mode: Resolution 320x200, 16M colors
G320x200x16M32 | Mode: Resolution 320x200, 16M 32-bit colors
G320x200x256 | Mode: Resolution 320x200, 256 colors
G320x200x32K | Mode: Resolution 320x200, 32K colors
G320x200x64K | Mode: Resolution 320x200, 64K colors
G320x240x256 | Mode: Resolution 320x240, 256 colors
G320x400x256 | Mode: Resolution 320x400, 256 colors
G360x480x256 | Mode: Resolution 360x480, 256 colors
G640x200x16 | Mode: Resolution x, colors
G640x350x16 | Mode: Resolution x, colors
G640x480x16 | Mode: Resolution x, colors
G640x480x16M | Mode: Resolution 640x480, 16M colors
G640x480x16M32 | Mode: Resolution 640x480, 16M 32-bit colors
G640x480x2 | Mode: Resolution 640x480, 2 colors
G640x480x256 | Mode: Resolution 640x480, 256 colors
G640x480x32K | Mode: Resolution 640x480, 32K colors
G640x480x64K | Mode: Resolution 640x480, 64K colors
G720x348x2 | Mode: Resolution 720x348, 2 colors
G800x600x16 | Mode: Resolution 800x600, 16 colors
G800x600x16M | Mode: Resolution 800x600, 16M colors
G800x600x16M32 | Mode: Resolution 800x600, 16M 32-bit colors
G800x600x256 | Mode: Resolution 800x600, 256 colors
G800x600x32K | Mode: Resolution 800x600, 32K colors
G800x600x64K | Mode: Resolution 800x600, 64K colors
GothicFont | Font number: Gothic font
GraphStringTransTable | Table used when transliterating strings.
green | Color code: green
grError | Error: Unknown error.
grFileNotFound | Error: File for driver not found.
grFontNotFound | Error: font description file not found.
grInvalidDriver | Error: Invalid driver specified
grInvalidFont | Error: Invalid font description
grInvalidFontNum | Error: Invalid font number
grInvalidMode | Error: Invalid mode specified.
grInvalidVersion | Error: Invalid version.
grIOerror | Error: Unspecified Input/Output error.
grNoFloodMem | Error: Could not allocate memory for flood operation.
grNoFontMem | Error: Not enough memory to load font.
grNoInitGraph | Error: Graphical system not initialized
grNoLoadMem | Error: Memory error.
grNoScanMem | Error: Could not allocate memory for scan
grNotDetected | Error: Graphics device not detected.
grOk | Graphical operation went OK.
HatchFill | Fill style: Hatch lines
HercMono | Mode: Hercules, mono color
HercMonoHi | Mode: Hercules card, monochrome, high resolution
highNewDriver | Mode: highest number for new driver
highNewMode | Mode: Highest possible value of the new modes.
HorizDir | Text write direction: Horizontal
InterleaveFill | Fill style: Interleaving lines
LCOMFont | Font number: ?
LeftText | Horizontal text alignment: Align text left
lightblue | Color code: Light blue
lightcyan | Color code: Light cyan
lightgray | Color code: Light gray
lightgreen | Color code: Light green
lightmagenta | Color code: Light magenta
lightred | Color code: Light red
LineFill | Fill style: Fill using horizontal lines
lowNewDriver | Mode: lowest number for new driver
lowNewMode | Mode: Lowest possible value of the new modes.
LowRes | Mode: Low resolution.
LtBkSlashFill | Fill style: Light diagonal (backslash) lines
LtSlashFill | Fill style: Light diagonal (slash) lines
m1024x768 | Mode: Resolution 1024x768
m1280x1024 | Mode: Resolution 1280x1024
m1600x1200 | Mode: Resolution 1600x1200
m2048x1536 | Mode: Resolution 2048x1536
m320x200 | Mode: Resolution 320x200
m320x256 | Mode: Resolution 320x256
m320x400 | Mode: Resolution 320x400
m512x384 | Mode: Resolution 512x384
m640x200 | Mode: Resolution 640x200
m640x256 | Mode: Resolution 640x256
m640x350 | Mode: Resolution 640x350
m640x400 | Mode: Resolution 640x400
m640x480 | Mode: Resolution 640x480
m800x600 | Mode: Resolution 800x600
m832x624 | Mode: Resolution 832x624
magenta | Color code: Magenta
MaxColors | Max amount of colors in a palette
maxsmallint | Maximum value for smallint type
MCGA | Graphic driver for MCGA cards
MCGAC0 | MCGA Graphic driver mode C0
MCGAC1 | MCGA Graphic driver mode C1
MCGAC2 | MCGA Graphic driver mode C2
MCGAC3 | MCGA Graphic driver mode C3
MCGAHi | MCGA Graphic driver high resolution mode
MCGAMed | MCGA Graphic driver medium resolution mode
NormalPut | Draw operation: Use Normal (copy) operation
NormWidth | Line width: Normal width
NotPut | Draw operation: use NOT
OrPut | Draw operation: use OR
red | Color code: Red
resolutions | Array with actual resolutions of the new modes
RightText | Horizontal text alignment: Align text right
SansSerifFont | Font number: Sans Serif font
ScriptFont | Font number: Script font
SimpleFont | Font number: Simple font
SlashFill | Fill style: Diagonal (slash) lines
SmallFont | Font number: Small font
SolidFill | Fill style: Solid fill.
SolidLn | Line style: Solid line
ThickWidth | Line width: double width
TopOff | Top off
TopOn | Top on
TopText | Vertical text alignment: Align text to top
TriplexFont | Font number: Triplex font
TSCRFont | Font number: Terminal font
UserBitLn | Line style: User defined
UserCharSize | User character size
UserFill | Fill style: User-defined fill.
VertDir | Text write direction: Vertical
VESA | Mode: VESA graphics adaptor.
VGA | Mode: VGA graphics adaptor.
VGAHi | Mode: VGA high resolution (640x480)
VGALo | Mode: VGA low resolution (640x200)
VGAMed | Mode: VGA medium resolution (640x350)
white | Color code: White
WideDotFill | Fill style: Widely spaced dotted lines
XHatchFill | Fill style: Heavy hatch lines
XORPut | Draw operation: use XOR
yellow | Color code: Yellow


Reference for unit 'Graph': Types

ArcCoordsType | Describe the last arc which was drawn on screen
CircleProc | Standard circle drawing routine prototype.
clrviewproc | Standard clearviewport routine prototype
defpixelproc | Standard pixel drawing routine prototype.
ellipseproc | Standard ellipse drawing routine prototype.
FillPatternType | Bit pattern used when drawing lines. Set bits are drawn.
FillSettingsType | Record describing fill mode
GetBkColorProc | GetBKColor callback prototype
getimageproc | Standard GetImage procedure prototype.
getpixelproc | Standard pixel fetching routine prototype
getrgbpaletteproc | This routine prototype is a hook for GetRGBPalette
getscanlineproc | Standard getscanline routine prototype
graphfreememprc | Procedure prototype, used when heap memory is freed by the graph routines.
graphgetmemprc | Procedure prototype, used when heap memory is needed by the graph routines.
graph_float | The platform's preferred floating point size for fast graph operations
hlineproc | Standard procedure prototype to draw a single horizontal line
imagesizeproc | Standard ImageSize calculation procedure prototype.
initmodeproc | Standard routine prototype to initialize a mode.
lineproc | Standard line drawing routine prototype.
LineSettingsType | Record describing current line drawing mode
OutTextXYProc | This routine prototype is a hook for OutTextXY
PaletteType | Record describing palette.
patternlineproc | Standard procedure prototype to draw a patterned line
PCharsetTransTable | Pointer to TCharsetTransTable array.
PModeInfo | Pointer to TModeInfo record
PointType | Record describing a point in a 2 dimensional plane
putimageproc | Standard PutImage procedure prototype.
putpixelproc | Standard pixel drawing routine prototype
restorestateproc | Standard routine prototype to restore the graphical state at a closegraph call.
RGBRec | Record describing palette RGB color
savestateproc | Standard routine prototype to save the graphical state before a mode is set.
setactivepageproc | Standard SetActivePage procedure prototype.
SetAllPaletteProc | This routine prototype is a hook for SetAllPalette
SetBkColorProc | SetBKColor callback prototype
setrgbpaletteproc | This routine prototype is a hook for SetRGBPalette
setvisualpageproc | Standard SetVisualPage procedure prototype.
TCharsetTransTable | Character transliteration table, with entries for 256 characters
TextSettingsType | Record describing how texts are drawn.
TModeInfo | Record describing a graphical mode.
TResolutionRec | Record describing resolution
ViewPortType | Record describing a viewport
vlineproc | Standard procedure prototype to draw a single vertical line


Reference for unit 'Graph': Procedures and functions

Arc | Draw part of a circle
Bar | Draw filled rectangle
Bar3D | Draw filled 3-dimensional rectangle
ClearDevice | Clear the complete screen
Closegraph | Close graphical system.
DetectGraph | Detect correct graphical driver to use
DrawPoly | Draw a polygone
Ellipse | Draw an ellipse
FillEllipse | Draw and fill an ellipse
FillPoly | Draw, close and fill a polygone
FloodFill | Fill an area with a given color
GetArcCoords | Return coordinates of last drawn arc or ellipse.
GetAspectRatio | Return screen resolution
GetColor | Return current drawing color
GetDefaultPalette | Return default palette
GetDirectVideo | Determine whether direct video mode is active.
GetDriverName | Return current driver name
GetFillPattern | Return current fill pattern
GetFillSettings | Return current fill settings
GetGraphMode | Get current graphical modus
GetLineSettings | Get current line drawing settings
GetMaxColor | return maximum number of colors
GetMaxMode | Return biggest mode for the current driver
GetMaxX | Return maximal X coordinate
GetMaxY | Return maximal Y coordinate
GetModeName | Return description a modus
GetModeRange | Return lowest and highest modus of current driver
GetPalette | Return current palette
GetPaletteSize | Return maximal number of entries in current palette
GetTextSettings | Return current text style
GetViewSettings | Return current viewport
GetX | Return current cursor X position
GetY | Return current cursor Y position
GraphDefaults | Reset graphical mode to defaults
GraphErrorMsg | Return a description of an error
GraphResult | Result of last graphical operation
InitGraph | Initialize grpahical system
InstallUserDriver | Install a user driver
InstallUserFont | Install a user-defined font
LineRel | Draw a line starting from current position in given direction
LineTo | Draw a line starting from current position to a given point
MoveRel | Move cursor relative to current position
MoveTo | Move cursor to absolute position.
OutText | Write text on the screen at the current location.
PieSlice | Draw a pie-slice
queryadapterinfo | Function called to retrieve the current video adapter settings.
Rectangle | Draw a rectangle on the screen.
RegisterBGIDriver | Register a new BGI driver.
RegisterBGIfont | Register a new BGI font
RestoreCrtMode | Restore text screen
Sector | Draw and fill a sector of an ellipse
SetAspectRatio | Set aspect ration of the screen
SetColor | Set foreground drawing color
SetDirectVideo | Attempt to enter direct video mode.
SetFillPattern | Set drawing fill pattern
SetFillStyle | Set drawing fill style
SetGraphMode | Set graphical mode
SetLineStyle | Set line drawing style
SetPalette | Set palette entry using color constant
SetTextJustify | Set text placement style
SetTextStyle | Set text style
SetUserCharSize | Set user character size for vector font
SetViewPort | Set the graphical drawing window
SetWriteMode | Specify binary operation to perform when drawing on screen
TextHeight | Return height (in pixels) of the given string
TextWidth | Return width (in pixels) of the given string


Reference for unit 'Graph': Variables

Circle | Draw a complete circle
ClearViewPort | Clear the current viewport
DirectPutPixel | Hook to directly draw a pixel on the screen.
GetBkColor | Return current background color
GetImage | Return a copy of a screen area
GetPixel | Return color of pixel
GetRGBPalette | Hook to set a RGB palette entries.
GetScanLine | Hook to get a scan line from the screen.
GraphFreeMemPtr | Hook to free heap memory.
GraphGetMemPtr | Hook to get heap memory
HLine | Hook to draw a solid horizontal line
ImageSize | Return size to store image
InternalEllipse | Hook to draw an ellipse
Line | Draw a line between 2 points
OutTextXY | Write text on the screen on given position
PatternLine | Hook to draw a patterned line
PutImage | Draw an in-memory image to the screen
PutPixel | Draw a pixel on the screen
RestoreVideoState | Hook to restore a saved video mode
SaveVideoState | Hook to save the current video state
SetActivePage | Set active graphical page
SetAllPalette | Specify a complete new palette
SetBkColor | Set background drawing color
SetRGBPalette | Set palette entry using RGB value
SetVisualPage | Set video page which is displayed.
VLine | Hook to draw a solid vertical line


Index of all identifiers in unit 'Graph'

A B C D E F G H I L M N O P Q R S T U V W X Y

A

AndPut | Arc
AnsiToASCIITransTable | ArcCoordsType

B

Bar | black | BottomText
Bar3D | blue | brown
BkSlashFill | BoldFont |

C

CenterLn | CGAHi | CloseDotFill
CenterText | Circle | Closegraph
CGA | CircleProc | clrviewproc
CGAC0 | ClearDevice | CopyPut
CGAC1 | ClearViewPort | CurrentDriver
CGAC2 | ClipOff | cyan
CGAC3 | ClipOn |

D

D12bit | D64bit | Detect
D15bit | D6bit | DetectGraph
D16bit | D8bit | detectMode
D1bit | darkgray | DirectPutPixel
D24bit | DashedLn | DottedLn
D2bit | Default | DrawPoly
D32bit | DefaultFont | DrawTextBackground
D4bit | defpixelproc |

E

EGA | EGAHi | EGAMonoHi
EGA64 | EGALightblue | EGARed
EGA64Hi | EGALightcyan | EGAWhite
EGA64Lo | EGALightgray | EGAYellow
EGABlack | EGALightgreen | Ellipse
EGABlue | EGALightmagenta | ellipseproc
EGABrown | EGALightred | EmptyFill
EGACyan | EGALo | EuroFont
EGADarkgray | EGAMagenta |
EGAGreen | EGAMono |

F

FillEllipse | FillPatternType | FillSettingsType
fillpatternTable | FillPoly | FloodFill

G

G1024x768x16 | G640x480x16M | getpixelproc
G1024x768x16M | G640x480x16M32 | GetRGBPalette
G1024x768x16M32 | G640x480x2 | getrgbpaletteproc
G1024x768x256 | G640x480x256 | GetScanLine
G1024x768x32K | G640x480x32K | getscanlineproc
G1024x768x64K | G640x480x64K | GetTextSettings
G1152x864x16 | G720x348x2 | GetViewSettings
G1152x864x16M | G800x600x16 | GetX
G1152x864x16M32 | G800x600x16M | GetY
G1152x864x256 | G800x600x16M32 | GothicFont
G1152x864x32K | G800x600x256 | GraphDefaults
G1152x864x64K | G800x600x32K | GraphErrorMsg
G1280x1024x16 | G800x600x64K | graph_float
G1280x1024x16M | GetArcCoords | graphfreememprc
G1280x1024x16M32 | GetAspectRatio | GraphFreeMemPtr
G1280x1024x256 | GetBkColor | graphgetmemprc
G1280x1024x32K | GetBkColorProc | GraphGetMemPtr
G1280x1024x64K | GetColor | GraphResult
G1600x1200x16 | GetDefaultPalette | GraphStringTransTable
G1600x1200x16M | GetDirectVideo | green
G1600x1200x16M32 | GetDriverName | grError
G1600x1200x256 | GetFillPattern | grFileNotFound
G1600x1200x32K | GetFillSettings | grFontNotFound
G1600x1200x64K | GetGraphMode | grInvalidDriver
G320x200x16 | GetImage | grInvalidFont
G320x200x16M | getimageproc | grInvalidFontNum
G320x200x16M32 | GetLineSettings | grInvalidMode
G320x200x256 | GetMaxColor | grInvalidVersion
G320x200x32K | GetMaxMode | grIOerror
G320x200x64K | GetMaxX | grNoFloodMem
G320x240x256 | GetMaxY | grNoFontMem
G320x400x256 | GetModeName | grNoInitGraph
G360x480x256 | GetModeRange | grNoLoadMem
G640x200x16 | GetPalette | grNoScanMem
G640x350x16 | GetPaletteSize | grNotDetected
G640x480x16 | GetPixel | grOk

H

HatchFill | highNewDriver | hlineproc
HercMono | highNewMode | HorizDir
HercMonoHi | HLine |

I

ImageSize | initmodeproc | InterleaveFill
imagesizeproc | InstallUserDriver | InternalEllipse
InitGraph | InstallUserFont |

L

LCOMFont | lightred | lowNewDriver
LeftText | Line | lowNewMode
lightblue | LineFill | LowRes
lightcyan | lineproc | LtBkSlashFill
lightgray | LineRel | LtSlashFill
lightgreen | LineSettingsType |
lightmagenta | LineTo |

M

m1024x768 | m640x256 | MCGA
m1280x1024 | m640x350 | MCGAC0
m1600x1200 | m640x400 | MCGAC1
m2048x1536 | m640x480 | MCGAC2
m320x200 | m800x600 | MCGAC3
m320x256 | m832x624 | MCGAHi
m320x400 | magenta | MCGAMed
m512x384 | MaxColors | MoveRel
m640x200 | maxsmallint | MoveTo

N

NormalPut NormWidth NotPut

O

OrPut | OutTextXY
OutText | OutTextXYProc

P

PaletteType | PieSlice | putimageproc
PatternLine | PModeInfo | PutPixel
patternlineproc | PointType | putpixelproc
PCharsetTransTable | PutImage |

Q

queryadapterinfo

R

Rectangle | resolutions | RGBRec
red | RestoreCrtMode | RightText
RegisterBGIDriver | restorestateproc |
RegisterBGIfont | RestoreVideoState |

S

SansSerifFont | SetBkColorProc | SetTextStyle
savestateproc | SetColor | SetUserCharSize
SaveVideoState | SetDirectVideo | SetViewPort
ScriptFont | SetFillPattern | SetVisualPage
Sector | SetFillStyle | setvisualpageproc
SetActivePage | SetGraphMode | SetWriteMode
setactivepageproc | SetLineStyle | SimpleFont
SetAllPalette | SetPalette | SlashFill
SetAllPaletteProc | SetRGBPalette | SmallFont
SetAspectRatio | setrgbpaletteproc | SolidFill
SetBkColor | SetTextJustify | SolidLn

T

TCharsetTransTable | ThickWidth | TopText
TextHeight | TModeInfo | TResolutionRec
TextSettingsType | TopOff | TriplexFont
TextWidth | TopOn | TSCRFont

U

UserBitLn UserCharSize UserFill

V

VertDir | VGAHi | ViewPortType
VESA | VGALo | VLine
VGA | VGAMed | vlineproc

W

white WideDotFill

X

XHatchFill XORPut

Y

yellow


initmodeproc

Standard routine prototype to initialize a mode.

Declaration

Source position: graphh.inc line 570

type initmodeproc = procedure;


InterleaveFill

Fill style: Interleaving lines

Declaration

Source position: graphh.inc line 300

const InterleaveFill = 9;


InternalEllipse

Hook to draw an ellipse

Declaration

Source position: graphh.inc line 674

var InternalEllipse: ellipseproc = ;


LCOMFont

Font number: ?

Declaration

Source position: graphh.inc line 274

const LCOMFont = 8;


LeftText

Horizontal text alignment: Align text left

Declaration

Source position: graphh.inc line 314

const LeftText = 0;


lightblue

Color code: Light blue

Declaration

Source position: graphh.inc line 228

const lightblue = 9;


lightcyan

Color code: Light cyan

Declaration

Source position: graphh.inc line 230

const lightcyan = 11;


lightgray

Color code: Light gray

Declaration

Source position: graphh.inc line 226

const lightgray = 7;


lightgreen

Color code: Light green

Declaration

Source position: graphh.inc line 229

const lightgreen = 10;


lightmagenta

Color code: Light magenta

Declaration

Source position: graphh.inc line 232

const lightmagenta = 13;


lightred

Color code: Light red

Declaration

Source position: graphh.inc line 231

const lightred = 12;


Line

Draw a line between 2 points

Declaration

Source position: graphh.inc line 673

var Line: lineproc = ;

Description

Line draws a line starting from (X1,Y1 to (X2,Y2), in the current line style and color. The current position is put to (X2,Y2)

Errors

None.

See also

LineRel | Draw a line starting from current position in given direction
LineTo | Draw a line starting from current position to a given point


LineFill

Fill style: Fill using horizontal lines

Declaration

Source position: graphh.inc line 293

const LineFill = 2;


lineproc

Standard line drawing routine prototype.

Declaration

Source position: graphh.inc line 556

type lineproc = procedure(

  X1: SmallInt;

  Y1: SmallInt;

  X2: SmallInt;

  Y2: SmallInt

);


LineSettingsType

Record describing current line drawing mode

Declaration

Source position: graphh.inc line 448

type LineSettingsType = record
linestyle: Word; | Line style used when drawing.
pattern: Word; | Pattern used when drawing.
thickness: Word; | Thickness of the drawn lines.
end;


lowNewDriver

Mode: lowest number for new driver

Declaration

Source position: graphh.inc line 347

const lowNewDriver = 11;


lowNewMode

Mode: Lowest possible value of the new modes.

Declaration

Source position: graphh.inc line 408

const lowNewMode = m320x200;


LowRes

Mode: Low resolution.

Declaration

Source position: graphh.inc line 329

const LowRes = 6;


LtBkSlashFill

Fill style: Light diagonal (backslash) lines

Declaration

Source position: graphh.inc line 297

const LtBkSlashFill = 6;


LtSlashFill

Fill style: Light diagonal (slash) lines

Declaration

Source position: graphh.inc line 294

const LtSlashFill = 3;


m320x200

Mode: Resolution 320x200

Declaration

Source position: graphh.inc line 392

const m320x200 = detectMode + 1;


m320x256

Mode: Resolution 320x256

Declaration

Source position: graphh.inc line 393

const m320x256 = detectMode + 2;


m320x400

Mode: Resolution 320x400

Declaration

Source position: graphh.inc line 394

const m320x400 = detectMode + 3;


m512x384

Mode: Resolution 512x384

Declaration

Source position: graphh.inc line 395

const m512x384 = detectMode + 4;


m640x200

Mode: Resolution 640x200

Declaration

Source position: graphh.inc line 396

const m640x200 = detectMode + 5;


m640x256

Mode: Resolution 640x256

Declaration

Source position: graphh.inc line 397

const m640x256 = detectMode + 6;


m640x350

Mode: Resolution 640x350

Declaration

Source position: graphh.inc line 398

const m640x350 = detectMode + 7;


m640x400

Mode: Resolution 640x400

Declaration

Source position: graphh.inc line 399

const m640x400 = detectMode + 8;


m640x480

Mode: Resolution 640x480

Declaration

Source position: graphh.inc line 400

const m640x480 = detectMode + 9;


m800x600

Mode: Resolution 800x600

Declaration

Source position: graphh.inc line 401

const m800x600 = detectMode + 10;


m832x624

Mode: Resolution 832x624

Declaration

Source position: graphh.inc line 402

const m832x624 = detectMode + 11;


m1024x768

Mode: Resolution 1024x768

Declaration

Source position: graphh.inc line 403

const m1024x768 = detectMode + 12;


m1280x1024

Mode: Resolution 1280x1024

Declaration

Source position: graphh.inc line 404

const m1280x1024 = detectMode + 13;


m1600x1200

Mode: Resolution 1600x1200

Declaration

Source position: graphh.inc line 405

const m1600x1200 = detectMode + 14;


m2048x1536

Mode: Resolution 2048x1536

Declaration

Source position: graphh.inc line 406

const m2048x1536 = detectMode + 15;


magenta

Color code: Magenta

Declaration

Source position: graphh.inc line 224

const magenta = 5;


MaxColors

Max amount of colors in a palette

Declaration

Source position: graphh.inc line 432

const MaxColors = 255;


maxsmallint

Maximum value for smallint type

Declaration

Source position: graphh.inc line 198

const maxsmallint = high(smallint);


MCGA

Graphic driver for MCGA cards

Declaration

Source position: graphh.inc line 325

const MCGA = 2;


MCGAC0

MCGA Graphic driver mode C0

Declaration

Source position: graphh.inc line 362

const MCGAC0 = 0;


MCGAC1

MCGA Graphic driver mode C1

Declaration

Source position: graphh.inc line 363

const MCGAC1 = 1;


MCGAC2

MCGA Graphic driver mode C2

Declaration

Source position: graphh.inc line 364

const MCGAC2 = 2;


MCGAC3

MCGA Graphic driver mode C3

Declaration

Source position: graphh.inc line 365

const MCGAC3 = 3;


MCGAHi

MCGA Graphic driver high resolution mode

Declaration

Source position: graphh.inc line 367

const MCGAHi = 5;


MCGAMed

MCGA Graphic driver medium resolution mode

Declaration

Source position: graphh.inc line 366

const MCGAMed = 4;


A word about mode selection

The graph unit was implemented for compatibility with the old Turbo Pascal graph unit. For this reason, the mode constants as they were defined in the Turbo Pascal graph unit are retained.

However, since

  1. Video cards have evolved very much
  2. Free Pascal runs on multiple platforms

it was decided to implement new mode and graphic driver constants, which are more independent of the specific platform the program runs on.

In this section we give a short explanation of the new mode system. the following drivers were defined:

D1bit = 11;
D2bit = 12;
D4bit = 13;
D6bit = 14;  { 64 colors Half-brite mode - Amiga }
D8bit = 15;
D12bit = 16; { 4096 color modes HAM mode - Amiga }
D15bit = 17;
D16bit = 18;
D24bit = 19; { not yet supported }
D32bit = 20; { not yet supported }
D64bit = 21; { not yet supported }

lowNewDriver = 11;
highNewDriver = 21;

Each of these drivers specifies a desired color-depth.

The following modes have been defined:

detectMode = 30000;
m320x200 = 30001;
m320x256 = 30002; { amiga resolution (PAL) }
m320x400 = 30003; { amiga/atari resolution }
m512x384 = 30004; { mac resolution }
m640x200 = 30005; { vga resolution }
m640x256 = 30006; { amiga resolution (PAL) }
m640x350 = 30007; { vga resolution }
m640x400 = 30008;
m640x480 = 30009;
m800x600 = 30010;
m832x624 = 30011; { mac resolution }
m1024x768 = 30012;
m1280x1024 = 30013;
m1600x1200 = 30014;
m2048x1536 = 30015;

lowNewMode = 30001;
highNewMode = 30015;

These modes start at 30000 because Borland specified that the mode number should be ascending with increasing X resolution, and the new constants shouldn't interfere with the old ones.

The above constants can be used to set a certain color depth and resultion, as demonstrated in the below example.

If other modes than the ones above are supported by the graphics card, you will not be able to select them with this mechanism.

For this reason, there is also a 'dynamic' mode number, which is assigned at run-time. This number increases with increasing X resolution. It can be queried with the getmoderange call. This call will return the range of modes which are valid for a certain graphics driver. The numbers are guaranteed to be consecutive, and can be used to search for a certain resolution, as in the second example below.

Thus, the getmoderange function can be used to detect all available modes and drivers, as in the third example below:

Example

Program inigraph1;

{ Program to demonstrate static graphics mode selection }

uses graph;

const
  TheLine = 'We are now in 640 x 480 x 256 colors!'+
            ' (press <Return> to continue)';

var
  gd, gm, lo, hi, error,tw,th: integer;
  found: boolean;

begin
  { We want an 8 bit mode }
  gd := D8bit;
  gm := m640x480;
  initgraph(gd,gm,'');
  { Make sure you always check graphresult! }
  error := graphResult;
  if (error <> grOk) Then
    begin
    writeln('640x480x256 is not supported!');
    halt(1)
    end;
  { We are now in 640x480x256 }
  setColor(cyan);
  rectangle(0,0,getmaxx,getmaxy);
  { Write a nice message in the center of the screen }
  setTextStyle(defaultFont,horizDir,1);
  tw:=TextWidth(TheLine);
  th:=TextHeight(TheLine);
  outTextXY((getMaxX - TW) div 2,
            (getMaxY - TH) div 2,TheLine);
  { Wait for return }
  readln;
  { Back to text mode }
  closegraph;
end.

Example

Program inigraph2;

{ Program to demonstrate dynamic graphics mode selection }

uses graph;

const
  TheLine = 'We are now in 640 x 480 x 256 colors!'+
            ' (press <Return> to continue)';

var
  th,tw,gd, gm, lo, hi, error: integer;
  found: boolean;

begin
  { We want an 8 bit mode }
  gd := D8bit;
  { Get all available resolutions for this bitdepth }
  getmoderange(gd,lo,hi);
  { If the highest available mode number is -1,
    no resolutions are supported for this bitdepth  }
  if hi = -1 then
    begin
    writeln('no 8 bit modes supported!');
    halt
    end;
  found := false;
  { Search all resolutions for 640x480 }
  for gm := lo to hi do
    begin
    initgraph(gd,gm,'');
    { Make sure you always check graphresult! }
    error := graphResult;
    if (error = grOk) and
       (getmaxx = 639) and (getmaxy = 479) then
      begin
      found := true;
      break;
      end;
    end;
  if not found then
      CloseGraph();
    begin
    writeln('640x480x256 is not supported!');
    halt(1)
    end;
  { We are now in 640x480x256 }
  setColor(cyan);
  rectangle(0,0,getmaxx,getmaxy);
  { Write a nice message in the center of the screen }
  setTextStyle(defaultFont,horizDir,1);
  TW:=TextWidth(TheLine);
  TH:=TextHeight(TheLine);
  outTextXY((getMaxX - TW) div 2,
            (getMaxY - TH) div 2,TheLine);
  { Wait for return }
  readln;
  { Back to text mode }
  closegraph;
end.

Example

Program GetModeRange_Example;

{ This program demonstrates how to find all available graph modes }

uses graph;

const
  { Currently, only 4, 8, 15 and 16 bit modes are supported
    but this may  change in the future }
  gdnames: array[D4bit..D16bit] of string[6] =
    ('4 bit','6 bit','8 bit','12 bit','15 bit','16 bit');

procedure WriteRes(const depth : integer);
var
  tw, th : integer;
  v, text : String;
begin
  text := 'Current resolution is '; str(getmaxx+1, v);
  text := text + v + 'x'; str(getmaxy+1, v);
  text := text + v + 'x' + gdnames[depth];
  setTextStyle(defaultFont,horizDir,1);
  TW:=TextWidth(text);
  TH:=TextHeight(text);
  outTextXY((getMaxX - TW) div 2,
            (getMaxY - TH) div 2,text);
end;

var
  t: text;
  line : string;
  gd, c, low, high, res: integer;
begin
  assign(t,'modes.txt');
  rewrite(t);
  close(t);
  for gd := D4bit to D16bit do
    begin
    { Get the available mode numbers for this driver }
    getModeRange(gd,low,high);
    append(t);
    write(t,gdnames[gd]);
    Writeln(t,': low modenr = ',low,', high modenr = ',high);
    close(t);
    { If high is -1,
       no resolutions are supported for this bitdepth }
    if high = -1 then
      begin
      append(t);
      writeln(t,'  No modes supported!');
      writeln(t);
      close(t);
      end
    else
      { Enter all supported resolutions for this bitdepth
        and write their characteristics to the file }
      for c := low to high do
        begin
        append(t);
        writeln(t,'  testing mode nr ',c);
        close(t);
        initgraph(gd,c,'');
        res := graphresult;
        append(t);
        { An error occurred when entering the mode? }
        if res <> grok then
          writeln(t,grapherrormsg(res))
        else
          begin
          write(t,'maxx: ',getmaxx,', maxy: ',getmaxy);
          Writeln(t,', maxcolor: ',getmaxcolor);
          closegraph;
          end;
        writeln(t);
          WriteRes(gd);
        close(t);
        end;
    append(t);
    writeln(t);
    close(t);
    end;
  Writeln('All supported modes are listed in modes.txt files');
end.


NormalPut

Draw operation: Use Normal (copy) operation

Declaration

Source position: graphh.inc line 306

const NormalPut = 0;


NormWidth

Line width: Normal width

Declaration

Source position: graphh.inc line 262

const NormWidth = 1;


NotPut

Draw operation: use NOT

Declaration

Source position: graphh.inc line 311

const NotPut = 4;


OrPut

Draw operation: use OR

Declaration

Source position: graphh.inc line 309

const OrPut = 2;


PaletteType

Record describing palette.

Declaration

Source position: graphh.inc line 443

type PaletteType = record
Size: LongInt; | Actual size of palette (number of entries)
Colors: array [0..MaxColors] of RGBRec; | Color entries in palette.
end;


PatternLine

Hook to draw a patterned line

Declaration

Source position: graphh.inc line 675

var PatternLine: patternlineproc = ;


patternlineproc

Standard procedure prototype to draw a patterned line

Declaration

Source position: graphh.inc line 547

type patternlineproc = procedure(

  x1: SmallInt;

  x2: SmallInt;

  y: SmallInt

);


PCharsetTransTable

Pointer to TCharsetTransTable array.

Declaration

Source position: graphh.inc line 686

type PCharsetTransTable = ^TCharsetTransTable;


PModeInfo

Pointer to TModeInfo record

Declaration

Source position: graphh.inc line 608

type PModeInfo = ^TModeInfo;


PointType

Record describing a point in a 2 dimensional plane

Declaration

Source position: graphh.inc line 469

type PointType = record
x: SmallInt; | X coordinate
y: SmallInt; | Y coordinate
end;


PutImage

Draw an in-memory image to the screen

Declaration

Source position: graphh.inc line 656

var PutImage: putimageproc = ;

Description

PutImage Places the bitmap in Bitmap on the screen at (X1,Y1). How determines how the bitmap will be placed on the screen. Possible values are:

  • CopyPut
  • XORPut
  • ORPut
  • AndPut
  • NotPut

Errors

None

See also

ImageSize | Return size to store image
GetImage | Return a copy of a screen area


putimageproc

Standard PutImage procedure prototype.

Declaration

Source position: graphh.inc line 528

type putimageproc = procedure(

  X: SmallInt;

  Y: SmallInt;

  var Bitmap;

  BitBlt: Word

);


PutPixel

Draw a pixel on the screen

Declaration

Source position: graphh.inc line 655

var PutPixel: putpixelproc = ;

Description

Puts a point at (X,Y) using color Color

Errors

None.

See also

GetPixel

Return color of pixel


putpixelproc

Standard pixel drawing routine prototype

Declaration

Source position: graphh.inc line 522

type putpixelproc = procedure(

  X: SmallInt;

  Y: SmallInt;

  Color: Word

);


red

Color code: Red

Declaration

Source position: graphh.inc line 223

const red = 4;


Requirements

The unit Graph exports functions and procedures for graphical output. It requires at least a VGA-compatible Card or a VGA-Card with software-driver (min. 512Kb video memory).


resolutions

Array with actual resolutions of the new modes

Declaration

Source position: graphh.inc line 411

const resolutions: array [lowNewMode..highNewMode] of TResolutionRec = ((x: 320; y: 200), (x: 320; y: 256), (x: 320; y: 400), (x: 512; y: 384), (x: 640; y: 200), (x: 640; y: 256), (x: 640; y: 350), (x: 640; y: 400), (x: 640; y: 480), (x: 800; y: 600), (x: 832; y: 624), (x: 1024; y: 768), (x: 1280; y: 1024), (x: 1600; y: 1200), (x: 2048; y: 1536));


restorestateproc

Standard routine prototype to restore the graphical state at a closegraph call.

Declaration

Source position: graphh.inc line 575

type restorestateproc = procedure;


RestoreVideoState

Hook to restore a saved video mode

Declaration

Source position: graphh.inc line 681

var RestoreVideoState: restorestateproc = ;


RGBRec

Record describing palette RGB color

Declaration

Source position: graphh.inc line 437

type RGBRec = packed record
Red: SmallInt; | Red component of color
Green: SmallInt; | Green component of color
Blue: SmallInt; | Blue component of color
end;


RightText

Horizontal text alignment: Align text right

Declaration

Source position: graphh.inc line 316

const RightText = 2;


SansSerifFont

Font number: Sans Serif font

Declaration

Source position: graphh.inc line 269

const SansSerifFont = 3;


savestateproc

Standard routine prototype to save the graphical state before a mode is set.

Declaration

Source position: graphh.inc line 573

type savestateproc = procedure;


SaveVideoState

Hook to save the current video state

Declaration

Source position: graphh.inc line 680

var SaveVideoState: savestateproc = ;


ScriptFont

Font number: Script font

Declaration

Source position: graphh.inc line 271

const ScriptFont = 5;


SetActivePage

Set active graphical page

Declaration

Source position: graphh.inc line 661

var SetActivePage: setactivepageproc = ;

Description

Sets Page as the active page for all graphical output.

Errors

None.


setactivepageproc

Standard SetActivePage procedure prototype.

Declaration

Source position: graphh.inc line 564

type setactivepageproc = procedure(

  page: Word

);


SetAllPalette

Specify a complete new palette

Declaration

Source position: graphh.inc line 664

var SetAllPalette: SetAllPaletteProc = ;

Description

Sets the current palette to Palette. Palette is an untyped variable, usually pointing to a record of type PaletteType

Errors

None.

See also

GetPalette

Return current palette


SetAllPaletteProc

This routine prototype is a hook for SetAllPalette

Declaration

Source position: graphh.inc line 586

type SetAllPaletteProc = procedure(

  const Palette: PaletteType

);


SetBkColor

Set background drawing color

Declaration

Source position: graphh.inc line 666

var SetBkColor: SetBkColorProc = ;

Description

Sets the background color to Color.

Errors

None.

See also

GetBkColor | Return current background color
SetColor | Set foreground drawing color
SetWriteMode | Specify binary operation to perform when drawing on screen


SetBkColorProc

SetBKColor callback prototype

Declaration

Source position: graphh.inc line 592

type SetBkColorProc = procedure(

  ColorNum: Word

);

Description

SetBkColorProc is the procedure prototype for the SetBkColor method handler in TModeInfo. The procedure gets passed the color code for the color to set as background color.

See also

SetBkColor | Set background drawing color
TModeInfo | Record describing a graphical mode.
GetBkColorProc | GetBKColor callback prototype


SetRGBPalette

Set palette entry using RGB value

Declaration

Source position: graphh.inc line 662

var SetRGBPalette: setrgbpaletteproc = ;

Description

SetRGBPalette sets the ColorNr-th entry in the palette to the color with RGB-values Red, Green Blue.

Errors

None.

See also

SetAllPalette | Specify a complete new palette
SetPalette | Set palette entry using color constant


setrgbpaletteproc

This routine prototype is a hook for SetRGBPalette

Declaration

Source position: graphh.inc line 578

type setrgbpaletteproc = procedure(

  ColorNum: SmallInt;

  RedValue: SmallInt;

  GreenValue: SmallInt;

  BlueValue: SmallInt

);


SetVisualPage

Set video page which is displayed.

Declaration

Source position: graphh.inc line 660

var SetVisualPage: setvisualpageproc = ;

Description

SetVisualPage sets the video page to page number Page.

Errors

None

See also

SetActivePage

Set active graphical page


setvisualpageproc

Standard SetVisualPage procedure prototype.

Declaration

Source position: graphh.inc line 567

type setvisualpageproc = procedure(

  page: Word

);


SimpleFont

Font number: Simple font

Declaration

Source position: graphh.inc line 272

const SimpleFont = 6;


SlashFill

Fill style: Diagonal (slash) lines

Declaration

Source position: graphh.inc line 295

const SlashFill = 4;


SmallFont

Font number: Small font

Declaration

Source position: graphh.inc line 268

const SmallFont = 2;


SolidFill

Fill style: Solid fill.

Declaration

Source position: graphh.inc line 292

const SolidFill = 1;


SolidLn

Line style: Solid line

Declaration

Source position: graphh.inc line 256

const SolidLn = 0;


Target specific issues: DOS

VESA modes (i.e., anything but 320x200x256 and 640x480x16) do not work under most installations of Windows NT, Windows 2000 and Windows XP. They also do not work for some people under Windows 98 and Windows ME, depending on their graphics drivers. However, the graph unit cannot detect this, because no errors are returned from the system. In such cases, the screen simply turns black, or will show garbage.

Nothing can be done about this, the reason is missing or buggy support in the graphics drivers of the operating system.


Target specific issues: Linux

There are several issues on Linux that need to be taken care of:

The Linux version of the Graph unit uses the libvga library. This library works on the console, not under X.

If you get an error similar to

/usr/bin/ld: cannot find -lvga

This can mean one of two things: either libvga and it's development package is not installed properly, or the directory where it is installed is not in the linker path.

To remedy the former, you should install both the libvga package and libvga-devel package (or compile and install from scratch).

To remedy the latter, you should add the path to the compiler command-line using the -Fl option.

Programs using libvga need root privileges to run. You can make them setuid root with the following command:

chown root.root myprogram
chmod u+s myprogram

The libvga library will give up the root privileges after it is initialized.

there is an experimental version of the Graphics library available that uses GGI to do all the drawing, but it is not well tested. It's called ggigraph and is distributed in source form only.

Do not use the CRT unit together with the Graph unit: the console may end up in an unusable state. Instead, the ncurses unit may function fine.


TCharsetTransTable

Character transliteration table, with entries for 256 characters

Declaration

Source position: graphh.inc line 685

type TCharsetTransTable = array [Char] of Char;


TextSettingsType

Record describing how texts are drawn.

Declaration

Source position: graphh.inc line 454

type TextSettingsType = record
font: Word; | Font used.
direction: Word; | Direction in which to write.
charsize: Word; | Font size
horiz: Word; | Horizontal justification
vert: Word; | Vertical justification
end;


ThickWidth

Line width: double width

Declaration

Source position: graphh.inc line 263

const ThickWidth = 3;


TModeInfo

Record describing a graphical mode.

Declaration

Source position: graphh.inc line 609

type TModeInfo = record
DriverNumber: SmallInt; | Number of the driver to be used in InitGraph.
ModeNumber: SmallInt; | Number of the mode to be used in InitGraph.
internModeNumber: SmallInt; | Internal mode number. Do not use.
MaxColor: LongInt; | Max. number of colors in this mode.
PaletteSize: LongInt; | Max number of palette entries in this mode.
XAspect: Word; | X aspect (Aspect ratio correction factor) of mode
YAspect: Word; | Y aspect (Aspect ratio correction factor) of mode
MaxX: Word; | Max number of pixels in horizontal direction (columns).
MaxY: Word; | Max number of pixels in vertical direction (rows).
DirectColor: Boolean; | Direct color mode ? (If False, uses palette)
Hardwarepages: Byte; | Total number of image pages - 1
ModeName: string; | Mode description.
DirectPutPixel: defpixelproc; | Mode Putpixel routine.
GetPixel: getpixelproc; | Mode Getpixel routine.
PutPixel: putpixelproc; | Mode Putpixel routine.
SetRGBPalette: setrgbpaletteproc; | Mode SetRGBPalette routine
GetRGBPalette: getrgbpaletteproc; | Mode GetRGBPalette routine
SetAllPalette: SetAllPaletteProc; | Mode SetAllPalette routine
SetVisualPage: setvisualpageproc; | Mode SetVisualPage routine
SetActivePage: setactivepageproc; | Mode SetActivePage routine
ClearViewPort: clrviewproc; | Mode Clearviewport routine.
PutImage: putimageproc; | Mode PutImage routine.
GetImage: getimageproc; | Mode GetImage routine.
ImageSize: imagesizeproc; | Mode ImageSize routine.
GetScanLine: getscanlineproc; | Mode GetScanLine routine
Line: lineproc; | Mode Line drawing routine
InternalEllipse: ellipseproc; | Mode ellipse drawing routine.
PatternLine: patternlineproc; | Mode PatternLine routine.
HLine: hlineproc; | Mode Horizontal full line drawing routine.
VLine: vlineproc; | Mode vertical full line drawing routine.
Circle: CircleProc; | Mode circle drawing routine.
InitMode: initmodeproc; | Mode initialization routine.
OutTextXY: OutTextXYProc; | Mode OutTextXY routine.
SetBKColor: SetBkColorProc; | Set background color (SetBkColor) callback
GetBKColor: GetBkColorProc; | Get background color (GetBkColor) callback
next: PModeInfo; | Pointer to next mode in linked list.
end;


TopOff

Top off

Declaration

Source position: graphh.inc line 288

const TopOff = False;


TopOn

Top on

Declaration

Source position: graphh.inc line 287

const TopOn = True;


TopText

Vertical text alignment: Align text to top

Declaration

Source position: graphh.inc line 319

const TopText = 2;


TResolutionRec

Record describing resolution

Declaration

Source position: graphh.inc line 193

type TResolutionRec = record
x: LongInt; | Horizontal resolution
y: LongInt; | Vertical resolution
end;


TriplexFont

Font number: Triplex font

Declaration

Source position: graphh.inc line 267

const TriplexFont = 1;


TSCRFont

Font number: Terminal font

Declaration

Source position: graphh.inc line 273

const TSCRFont = 7;


UserBitLn

Line style: User defined

Declaration

Source position: graphh.inc line 260

const UserBitLn = 4;


UserCharSize

User character size

Declaration

Source position: graphh.inc line 281

const UserCharSize = 0;


UserFill

Fill style: User-defined fill.

Declaration

Source position: graphh.inc line 303

const UserFill = 12;


VertDir

Text write direction: Vertical

Declaration

Source position: graphh.inc line 279

const VertDir = 1;


VESA

Mode: VESA graphics adaptor.

Declaration

Source position: graphh.inc line 332

const VESA = 10;


VGA

Mode: VGA graphics adaptor.

Declaration

Source position: graphh.inc line 331

const VGA = 9;


VGAHi

Mode: VGA high resolution (640x480)

Declaration

Source position: graphh.inc line 383

const VGAHi = 2;


VGALo

Mode: VGA low resolution (640x200)

Declaration

Source position: graphh.inc line 381

const VGALo = 0;


VGAMed

Mode: VGA medium resolution (640x350)

Declaration

Source position: graphh.inc line 382

const VGAMed = 1;


ViewPortType

Record describing a viewport

Declaration

Source position: graphh.inc line 473

type ViewPortType = record
x1: SmallInt; | X coordinate of upper-left corner.
y1: SmallInt; | Y coordinate of upper-left corner.
x2: SmallInt; | X coordinate of lower-right corner.
y2: SmallInt; | Y coordinate of lower-right corner.
Clip: Boolean; | Should drawing be clipped to the current rectangle?
end;


VLine

Hook to draw a solid vertical line

Declaration

Source position: graphh.inc line 677

var VLine: vlineproc = ;


vlineproc

Standard procedure prototype to draw a single vertical line

Declaration

Source position: graphh.inc line 542

type vlineproc = procedure(

  x: SmallInt;

  y: SmallInt;

  y2: SmallInt

);


white

Color code: White

Declaration

Source position: graphh.inc line 234

const white = 15;


WideDotFill

Fill style: Widely spaced dotted lines

Declaration

Source position: graphh.inc line 301

const WideDotFill = 10;


XHatchFill

Fill style: Heavy hatch lines

Declaration

Source position: graphh.inc line 299

const XHatchFill = 8;


XORPut

Draw operation: use XOR

Declaration

Source position: graphh.inc line 308

const XORPut = 1;


yellow

Color code: Yellow

Declaration

Source position: graphh.inc line 233

const yellow = 14;


add_tail

Check for memory overwrites

Declaration

Source position: heaptrc.pp line 81

const add_tail: Boolean = True;

Description

If add\_tail is True (the default) then a check is also performed on the memory location just behind the allocated memory.


Controlling HeapTrc with environment variables

The HeapTrc unit can be controlled with the HEAPTRC environment variable. The contents of this variable controls the initial setting of some constants in the unit. HEAPTRC consists of one or more of the following strings, separated by spaces:

keepreleased
If this string occurs, then the KeepReleased variable is set to True
disabled
If this string occurs, then the UseHeapTrace variable is set to False and the heap trace is disabled. It does not make sense to combine this value with other values.
nohalt
If this string occurs, then the HaltOnError variable is set to False, so the program continues executing even in case of a heap error.
log=filename
If this string occurs, then the output of heaptrc is sent to the specified Filename. (see also SetHeapTraceOutput)

The following are valid values for the HEAPTRC variable:

HEAPTRC=disabled
HEAPTRC="keepreleased log=heap.log"
HEAPTRC="log=myheap.log nohalt"

Note that these strings are case sensitive, and the name of the variable too.


GlobalSkipIfNoLeaks

Disable output if no leaks detected

Declaration

Source position: heaptrc.pp line 90

const GlobalSkipIfNoLeaks: Boolean = False;

Description

GlobalSkipIfNoLeaks will, when set to true, disable the output of the heaptrc unit if no memory leaks will detected, i.e. there will only be output if there were actual memory leaks.

See also

SetHeapTraceOutput

Specify filename for heap trace output.


HaltOnError

Halt program on memory fault

Declaration

Source position: heaptrc.pp line 68

const HaltOnError: Boolean = True;

Description

If HaltOnError is set to True then an illegal call to FreeMem will cause the memory manager to execute a halt(1) instruction, causing a memory dump. By Default it is set to True.


HaltOnNotReleased

Halt on exit if any memory was not freed

Declaration

Source position: heaptrc.pp line 70

const HaltOnNotReleased: Boolean = False;

Description

HaltOnNotReleased can be set to True to make the DumpHeap procedure halt (exit code 203) the program if any memory was not released when the dump is made. If it is False (the default) then DumpHeap just returns.

See also

DumpHeap

Dump memory usage report to stderr.


Reference for unit 'heaptrc'

Heap debugging functionality.

uses

  System;

The system unit

Overview

This document describes the HEAPTRC unit for Free Pascal. It was written by Pierre Muller. It is system independent, and works on all supported systems.

The HEAPTRC unit can be used to debug your memory allocation/deallocation. It keeps track of the calls to getmem/freemem, and, implicitly, of New/Dispose statements.

When the program exits, or when you request it explicitly. It displays the total memory used, and then dumps a list of blocks that were allocated but not freed. It also displays where the memory was allocated.

If there are any inconsistencies, such as memory blocks being allocated or freed twice, or a memory block that is released but with wrong size, this will be displayed also.

The information that is stored/displayed can be customized using some constants.

Do not use this unit directly, instead use the -gh switch, to let the compiler insert the unit in the uses clause.

Related topics

environment | Controlling HeapTrc with environment variables
usage | HeapTrc Usage


Reference for unit 'heaptrc': Constants

add_tail | Check for memory overwrites
GlobalSkipIfNoLeaks | Disable output if no leaks detected
HaltOnError | Halt program on memory fault
HaltOnNotReleased | Halt on exit if any memory was not freed
keepreleased | Keep released blocks in memory
maxprintedblocklength | Maximum length of memory block dumps.
printfaultyblock | Print memory dump of faulty blocks ?
printleakedblock | Print memory dump of leaked blocks ?
quicktrace | Do quick trace or extensive trace
tracesize | Specify size of callback trace
usecrc | Use CRC check on allocated memory
useheaptrace | If set to false, the heap trace will be disabled.


Reference for unit 'heaptrc': Types

tdisplayextrainfoProc | The TDisplayExtraInfoProc is a procedural type used in the SetHeapExtraInfo call.
tFillExtraInfoProc | The FillExtraInfoProc is a procedural type used in the SetHeapExtraInfo call.


Reference for unit 'heaptrc': Procedures and functions

CheckPointer | Check if a pointer is in the address range of the application
DumpHeap | Dump memory usage report to stderr.
SetHeapExtraInfo | Store extra information in blocks.
SetHeapTraceOutput | Specify filename for heap trace output.


Index of all identifiers in unit 'heaptrc'

A C D G H K M P Q S T U

A

add_tail

C

CheckPointer

D

DumpHeap

G

GlobalSkipIfNoLeaks

H

HaltOnError HaltOnNotReleased

K

keepreleased

M

maxprintedblocklength

P

printfaultyblock printleakedblock

Q

quicktrace

S

SetHeapExtraInfo SetHeapTraceOutput

T

tdisplayextrainfoProc tFillExtraInfoProc tracesize

U

usecrc useheaptrace


keepreleased

Keep released blocks in memory

Declaration

Source position: heaptrc.pp line 77

const keepreleased: Boolean = False;

Description

If keepreleased is set to true, then a list of freed memory blocks is kept. This is useful if you suspect that the same memory block is released twice. However, this option is very memory intensive, so use it sparingly, and only when it's really necessary.


maxprintedblocklength

Maximum length of memory block dumps.

Declaration

Source position: heaptrc.pp line 88

const maxprintedblocklength: Integer = 128;

Description

maxprintedblocklength determines the maximum number of bytes written by a memory block dump, as produced when printleakedblock or printfaultyblock are true. If the size of the memory block is larger than this size, then only the first maxprintedblocklength will be included in the dump.

See also

printleakedblock | Print memory dump of leaked blocks ?
printfaultyblock | Print memory dump of faulty blocks ?


printfaultyblock

Print memory dump of faulty blocks ?

Declaration

Source position: heaptrc.pp line 87

const printfaultyblock: Boolean = False;

Description

printleakedblock can be set to True to print a memory dump of daulty memory blocks (in case a memory override occurs) The block is printed as a series of hexadecimal numbers, representing the bytes in the memory block. At most maxprintedblocklength bytes of the memory block will be printed.


printleakedblock

Print memory dump of leaked blocks ?

Declaration

Source position: heaptrc.pp line 86

const printleakedblock: Boolean = False;

Description

printleakedblock can be set to True to print a memory dump of unreleased blocks when the heaptrc unit produces a summary of memory leaks. The block is printed as a series of hexadecimal numbers, representing the bytes in the memory block. At most maxprintedblocklength bytes of the memory block will be printed.

See also

maxprintedblocklength | Maximum length of memory block dumps.
printfaultyblock | Print memory dump of faulty blocks ?


quicktrace

Do quick trace or extensive trace

Declaration

Source position: heaptrc.pp line 66

const quicktrace: Boolean = True;

Description

Quicktrace determines whether the memory manager checks whether a block that is about to be released is allocated correctly. This is a rather time consuming search, and slows program execution significantly, so by default it is set to True.


tdisplayextrainfoProc

The TDisplayExtraInfoProc is a procedural type used in the SetHeapExtraInfo call.

Declaration

Source position: heaptrc.pp line 43

type tdisplayextrainfoProc = procedure(

  var ptext: text;

  p: pointer

);

Description

The TDisplayExtraInfoType is a procedural type used in the SetHeapExtraInfo call to display a memory location which was previously filled with TFillExtraInfoProc

See also

SetHeapExtraInfo | Store extra information in blocks.
TFillExtraInfoProc | The FillExtraInfoProc is a procedural type used in the SetHeapExtraInfo call.


tFillExtraInfoProc

The FillExtraInfoProc is a procedural type used in the SetHeapExtraInfo call.

Declaration

Source position: heaptrc.pp line 42

type tFillExtraInfoProc = procedure(

  p: pointer

);

Description

The TFillExtraInfoProc is a procedural type used in the SetHeapExtraInfo call to fill a memory location with extra data for displaying.

See also

SetHeapExtraInfo | Store extra information in blocks.
TDisplayExtraInfoProc | The TDisplayExtraInfoProc is a procedural type used in the SetHeapExtraInfo call.


tracesize

Specify size of callback trace

Declaration

Source position: heaptrc.pp line 61

const tracesize = 8;

Description

Tracesize specifies how many levels of calls are displayed of the call stack during the memory dump. If you specify keepreleased:=True then half the TraceSize is reserved for the GetMem call stack, and the other half is reserved for the FreeMem call stack. For example, the default value of 8 will cause eight levels of call frames to be dumped for the getmem call if keepreleased is False. If KeepReleased is true, then 4 levels of call frames will be dumped for the GetMem call and 4 frames wil be dumped for the FreeMem call. If you want to change this value, you must recode the heaptrc unit.


HeapTrc Usage

You must use the -gh switch, to let the compiler insert the unit by itself, so you don't have to include it in your uses clause. In fact, as of version 3.0.0 you may no longer do so.

The below example shows how to use the heaptrc unit.

This is the memory dump shown when running this program in a standard way:

Marked memory at 0040FA50 invalid
Wrong size : 128 allocated 64 freed
  0x00408708
  0x0040CB49
  0x0040C481
Call trace for block 0x0040FA50 size 128
  0x0040CB3D
  0x0040C481

If you use the lineinfo unit (or use the -gl switch) as well, then heaptrc will also give you the filenames and line-numbers of the procedures in the backtrace:

Marked memory at 00410DA0 invalid
Wrong size : 128 allocated 64 freed
  0x004094B8
  0x0040D8F9  main,  line 25 of heapex.pp
  0x0040D231
Call trace for block 0x00410DA0 size 128
  0x0040D8ED  main,  line 23 of heapex.pp
  0x0040D231

If lines without filename/line-number occur, this means there is a unit which has no debug info included.

Example

Program heapex;

{
  Program used to demonstrate the usage of heaptrc unit
  Compile this program with the -gh command-line option
}

Var P1 : ^Longint;
    P2 : Pointer;
    I : longint;

begin
  {$IF NOT DECLARED(heaptrc)}
  {$ERROR You mmust compile this program with -gh}
  {$ENDIF}
  New(P1);
  // causes previous allocation not to be de-allocated
  New(P1);
  Dispose(P1);
  For I:=1 to 10 do
    begin
    GetMem (P2,128);
    // When I is even, deallocate block. We loose 5 times 128
    // bytes this way.
    If (I mod 2) = 0 Then FreeMem(P2,128);
    end;
  GetMem(P2,128);
  // This will provoke an error and a memory dump
  Freemem (P2,64);
end.


usecrc

Use CRC check on allocated memory

Declaration

Source position: heaptrc.pp line 84

const usecrc: Boolean = True;

Description

If usecrc is True (the default) then a crc check is performed on locations before and after the allocated memory. This is useful to detect memory overwrites.


useheaptrace

If set to false, the heap trace will be disabled.

Declaration

Source position: heaptrc.pp line 64

const useheaptrace: Boolean = True;

Description

This variable must be set at program startup, through the help of an environment variable.

See also

environment

Controlling HeapTrc with environment variables


Reference for unit 'ipc'

Unix Inter Process Communication functionality.

uses
System, | The system unit
BaseUnix, | Basic Unix functionality
unixtype; | Basic unix types

Overview

This document describes the IPC unit for Free Pascal. It was written for Linux by Michael Van Canneyt. It gives all the functionality of System V Inter-Process Communication: shared memory, semaphores and messages. It works only on the Linux operating system.

Many constants here are provided for completeness only, and should under normal circumstances not be used by the programmer.


Reference for unit 'ipc': Constants

IPC_CREAT | Create if key is nonexistent
IPC_EXCL | fail if key exists
IPC_INFO | For ipcs call
IPC_NOWAIT | return error on wait
IPC_PRIVATE
IPC_RMID | Remove resource
IPC_SET | set ipc_perm options
IPC_STAT | get ipc_perm options


Reference for unit 'ipc': Types

key_t | Alias for TKey type
PIPC_Perm | Pointer to TIPC_Perm record.
TKey | Type returned by the ftok key generating function.


Index of all identifiers in unit 'ipc'

I K P T

I

IPC_CREAT | IPC_NOWAIT | IPC_SET
IPC_EXCL | IPC_PRIVATE | IPC_STAT
IPC_INFO | IPC_RMID |

K

key_t

P

PIPC_Perm

T

TKey


IPC_CREAT

Create if key is nonexistent

Declaration

Source position: ipc.pp line 72

const IPC_CREAT = 1 shl 9;


IPC_EXCL

fail if key exists

Declaration

Source position: ipc.pp line 76

const IPC_EXCL = 2 shl 9;


IPC_INFO

For ipcs call

Declaration

Source position: ipc.pp line 100

const IPC_INFO = 3;


IPC_NOWAIT

return error on wait

Declaration

Source position: ipc.pp line 77

const IPC_NOWAIT = 4 shl 9;


IPC_PRIVATE

Declaration

Source position: ipc.pp line 80

const IPC_PRIVATE = TKey(0);


IPC_RMID

Remove resource

Declaration

Source position: ipc.pp line 91

const IPC_RMID = 0;


IPC_SET

set ipc_perm options

Declaration

Source position: ipc.pp line 93

const IPC_SET = 1;


IPC_STAT

get ipc_perm options

Declaration

Source position: ipc.pp line 94

const IPC_STAT = 2;


key_t

Alias for TKey type

Declaration

Source position: ipc.pp line 44

type key_t = TKey;


PIPC_Perm

Pointer to TIPC_Perm record.

Declaration

Source position: ipc.pp line 105

type PIPC_Perm = ^TIPC_Perm;


TKey

Type returned by the ftok key generating function.

Declaration

Source position: ipc.pp line 42

type TKey = cint;


AltPrefix

Keycode for alternate prefix key for Alt key. Unix Only

Declaration

Source position: keyboard.pp line 27

const AltPrefix: Byte = 0;


CtrlPrefix

Keycode for alternate prefix key for Ctrl key. Unix only

Declaration

Source position: keyboard.pp line 29

const CtrlPrefix: Byte = 0;


errKbdBase

Base of keyboard routine error reporting constants.

Declaration

Source position: keybrdh.inc line 16

const errKbdBase = 1010;


errKbdInitError

Failed to initialize keyboard driver

Declaration

Source position: keybrdh.inc line 17

const errKbdInitError = errKbdBase + 0;


errKbdNotImplemented

Keyboard driver not implemented.

Declaration

Source position: keybrdh.inc line 18

const errKbdNotImplemented = errKbdBase + 1;


Reference for unit 'keyboard'

Access to low-level keyboard functions

uses

  System;

The system unit

Overview

The Keyboard unit implements a keyboard access layer which is system independent. It can be used to poll the keyboard state and wait for certain events. Waiting for a keyboard event can be done with the GetKeyEvent function, which will return a driver-dependent key event. This key event can be translated to a interpretable event by the TranslateKeyEvent function. The result of this function can be used in the other event examining functions.

A custom keyboard driver can be installed using the SetKeyboardDriver function. The current keyboard driver can be retrieved using the GetKeyboardDriver function. The last section of this chapter demonstrates how to make a keyboard driver.

Related topics

kbdunix | Unix specific notes
kbddriver | Writing a keyboard driver
kbdscancode | Keyboard scan codes


Reference for unit 'keyboard': Constants

AltPrefix | Keycode for alternate prefix key for Alt key. Unix Only
CtrlPrefix | Keycode for alternate prefix key for Ctrl key. Unix only
errKbdBase | Base of keyboard routine error reporting constants.
errKbdInitError | Failed to initialize keyboard driver
errKbdNotImplemented | Keyboard driver not implemented.
kbAlt | Alt key modifier
kbASCII | Ascii code key event
kbCtrl | Control key modifier
kbdApps | Application key (popup-menu) pressed.
kbdDelete | Delete key pressed
kbdDown | Arrow down key pressed
kbdEnd | End key pressed
kbdF1 | F1 function key pressed.
kbdF10 | F10 function key pressed.
kbdF11 | F12 function key pressed.
kbdF12 | F12 function key pressed.
kbdF13 | F13 function key pressed.
kbdF14 | F14 function key pressed.
kbdF15 | F15 function key pressed.
kbdF16 | F16 function key pressed.
kbdF17 | F17 function key pressed.
kbdF18 | F18 function key pressed.
kbdF19 | F19 function key pressed.
kbdF2 | F2 function key pressed.
kbdF20 | F20 function key pressed.
kbdF3 | F3 function key pressed.
kbdF4 | F4 function key pressed.
kbdF5 | F5 function key pressed.
kbdF6 | F6 function key pressed.
kbdF7 | F7 function key pressed.
kbdF8 | F8 function key pressed.
kbdF9 | F9 function key pressed.
kbdHome | Home key pressed
kbdInsert | Insert key pressed
kbdLeft | Arrow left key pressed
kbdLWin | Left windows key pressed.
kbdMiddle | Middle key pad key pressed (numerical 5)
kbdPgDn | Page down key pressed
kbdPgUp | Page Up key pressed
kbdRight | Arrow right key pressed
kbdRWin | Right windows key pressed.
kbdUp | Arrow up key pressed
kbFnKey | function key pressed.
kbLeftShift | Left shift key modifier
kbPhys | Physical key code event
kbReleased | Key release event (not implemented in FPC)
kbRightShift | Right shift key modifier
kbShift | Shift key modifier
kbUniCode | Unicode code key event
SAnd | 'And' description string
ShiftPrefix | Keycode for alternate prefix key for Shift key. Unix Only
SKeyPad | Names of keypad keys
SLeftRight | Names for left-right keys
SScanCode | Scancode key
SShift | Names of modifier keys
SUnicodeChar | Unicode character string.
SUnknownFunctionKey | Unknown function key


Reference for unit 'keyboard': Types

PTreeElement | Pointer to TTreeElement record
TKeyboardDriver | Keyboard driver structure
TKeyEvent | Base type to describe all key events.
TKeyRecord | Key event decoding type.
Tprocedure | Procedure prototype


Reference for unit 'keyboard': Procedures and functions

DoneKeyboard | Deactivate keyboard driver.
FunctionKeyName | Return string representation of a function key code.
GetKeyboardDriver | Return the current keyboard driver record.
GetKeyEvent | Get the next raw key event, wait if needed.
GetKeyEventChar | Get the character key part of a key event.
GetKeyEventCode | Translate function key part of a key event code.
GetKeyEventFlags | Extract the flags from a key event.
GetKeyEventShiftState | Return the current state of the shift keys.
GetKeyEventUniCode | Return the unicode key event.
InitKeyboard | Initialize the keyboard driver.
IsFunctionKey | Check whether a given event is a function key event.
KeyEventToString | Return a string describing the key event.
KeyPressed | Check event queue for key press
PollKeyEvent | Get next key event, but does not wait.
PollShiftStateEvent | Check current shift state.
PutKeyEvent | Put a key event in the event queue.
SetKeyboardDriver | Set a new keyboard driver.
ShiftStateToString | Return description of key event shift state
TranslateKeyEvent | Translate raw event to ascii key event
TranslateKeyEventUniCode | Translate raw event to UNICode key event


Index of all identifiers in unit 'keyboard'

A C D E F G I K P R S T

A

AddSequence AddSpecialSequence AltPrefix

C

CtrlPrefix

D

DoneKeyboard

E

errKbdBase errKbdInitError errKbdNotImplemented

F

FindSequence FunctionKeyName

G

GetKeyboardDriver | GetKeyEventCode | GetKeyEventUniCode
GetKeyEvent | GetKeyEventFlags |
GetKeyEventChar | GetKeyEventShiftState |

I

InitKeyboard IsFunctionKey

K

kbAlt | kbdF18 | kbdPgDn
kbASCII | kbdF19 | kbdPgUp
kbCtrl | kbdF2 | kbdRight
kbdApps | kbdF20 | kbdRWin
kbdDelete | kbdF3 | kbdUp
kbdDown | kbdF4 | kbFnKey
kbdEnd | kbdF5 | kbLeftShift
kbdF1 | kbdF6 | kbPhys
kbdF10 | kbdF7 | kbReleased
kbdF11 | kbdF8 | kbRightShift
kbdF12 | kbdF9 | kbShift
kbdF13 | kbdHome | kbUniCode
kbdF14 | kbdInsert | KeyEventToString
kbdF15 | kbdLeft | KeyPressed
kbdF16 | kbdLWin |
kbdF17 | kbdMiddle |

P

PollKeyEvent | PTreeElement
PollShiftStateEvent | PutKeyEvent

R

RawReadKey RawReadString RestoreStartMode

S

SAnd | SKeyPad | SUnicodeChar
SetKeyboardDriver | SLeftRight | SUnknownFunctionKey
ShiftPrefix | SScanCode |
ShiftStateToString | SShift |

T

TKeyboardDriver | Tprocedure | TTreeElement
TKeyEvent | TranslateKeyEvent |
TKeyRecord | TranslateKeyEventUniCode |


kbAlt

Alt key modifier

Declaration

Source position: keybrdh.inc line 112

const kbAlt = 8;


kbASCII

Ascii code key event

Declaration

Source position: keybrdh.inc line 100

const kbASCII = $00;


kbCtrl

Control key modifier

Declaration

Source position: keybrdh.inc line 111

const kbCtrl = 4;


kbdApps

Application key (popup-menu) pressed.

Declaration

Source position: keybrdh.inc line 82

const kbdApps = $FF17;


kbdDelete

Delete key pressed

Declaration

Source position: keybrdh.inc line 96

const kbdDelete = $FF2A;


kbdDown

Arrow down key pressed

Declaration

Source position: keybrdh.inc line 92

const kbdDown = $FF27;


Writing a keyboard driver

Writing a keyboard driver means that hooks must be created for most of the keyboard unit functions. The TKeyBoardDriver record contains a field for each of the possible hooks:

TKeyboardDriver = Record
  InitDriver : Procedure;
  DoneDriver : Procedure;
  GetKeyEvent : Function : TKeyEvent;
  PollKeyEvent : Function : TKeyEvent;
  GetShiftState : Function : Byte;
  TranslateKeyEvent : Function (KeyEvent: TKeyEvent): TKeyEvent;
  TranslateKeyEventUniCode: Function (KeyEvent: TKeyEvent): TKeyEvent;
end;

The meaning of these hooks is explained below:

InitDriver
Called to initialize and enable the driver. Guaranteed to be called only once. This should initialize all needed things for the driver.
DoneDriver
Called to disable and clean up the driver. Guaranteed to be called after a call to initDriver. This should clean up all things initialized by InitDriver.
GetKeyEvent
Called by GetKeyEvent. Must wait for and return the next key event. It should NOT store keys.
PollKeyEvent
Called by PollKeyEvent. It must return the next key event if there is one. Should not store keys.
GetShiftState
Called by PollShiftStateEvent. Must return the current shift state.
TranslateKeyEvent
Should translate a raw key event to a cOrrect key event, i.e. should fill in the shiftstate and convert function key scancodes to function key keycodes. If the TranslateKeyEvent is not filled in, a default translation function will be called which converts the known scancodes from the tables in the previous section to a correct keyevent.
TranslateKeyEventUniCode
Should translate a key event to a unicode key representation.

Strictly speaking, only the GetKeyEvent and PollKeyEvent hooks must be implemented for the driver to function correctly.

The example unit demonstrates how a keyboard driver can be installed. It takes the installed driver, and hooks into the GetKeyEvent function to register and log the key events in a file. This driver can work on top of any other driver, as long as it is inserted in the uses clause after the real driver unit, and the real driver unit should set the driver record in its initialization section.

Note that with a simple extension of this unit could be used to make a driver that is capable of recording and storing a set of keyboard strokes, and replaying them at a later time, so a 'keyboard macro' capable driver. This driver could sit on top of any other driver.

Example

unit logkeys;

interface

Procedure StartKeyLogging;
Procedure StopKeyLogging;
Function  IsKeyLogging : Boolean;
Procedure  SetKeyLogFileName(FileName : String);

implementation

uses sysutils,keyboard;

var
  NewKeyBoardDriver,
  OldKeyBoardDriver : TKeyboardDriver;
  Active,Logging : Boolean;
  LogFileName : String;
  KeyLog : Text;

Function TimeStamp : String;

begin
  TimeStamp:=FormatDateTime('hh:nn:ss',Time());
end;

Procedure StartKeyLogging;

begin
  Logging:=True;
  Writeln(KeyLog,'Start logging keystrokes at: ',TimeStamp);
end;

Procedure StopKeyLogging;

begin
  Writeln(KeyLog,'Stop logging keystrokes at: ',TimeStamp);
  Logging:=False;
end;

Function IsKeyLogging : Boolean;

begin
  IsKeyLogging:=Logging;
end;

Function LogGetKeyEvent : TKeyEvent;

Var
  K : TKeyEvent;

begin
  K:=OldkeyboardDriver.GetKeyEvent();
  If Logging then
    begin
    Write(KeyLog,TimeStamp,': Key event: ');
    Writeln(KeyLog,KeyEventToString(TranslateKeyEvent(K)));
    end;
  LogGetKeyEvent:=K;
end;

Procedure LogInitKeyBoard;

begin
  OldKeyBoardDriver.InitDriver();
  Assign(KeyLog,logFileName);
  Rewrite(KeyLog);
  Active:=True;
  StartKeyLogging;
end;

Procedure LogDoneKeyBoard;

begin
  StopKeyLogging;
  Close(KeyLog);
  Active:=False;
  OldKeyBoardDriver.DoneDriver();
end;

Procedure SetKeyLogFileName(FileName : String);

begin
  If Not Active then
    LogFileName:=FileName;
end;

Initialization
  GetKeyBoardDriver(OldKeyBoardDriver);
  NewKeyBoardDriver:=OldKeyBoardDriver;
  NewKeyBoardDriver.GetKeyEvent:=@LogGetKeyEvent;
  NewKeyBoardDriver.InitDriver:=@LogInitKeyboard;
  NewKeyBoardDriver.DoneDriver:=@LogDoneKeyboard;
  LogFileName:='keyboard.log';
  Logging:=False;
  SetKeyboardDriver(NewKeyBoardDriver);
end.

Example

program example9;

{ This program demonstrates the logkeys unit }

uses keyboard,logkeys;

Var
  K : TKeyEvent;

begin
  InitKeyBoard;
  Writeln('Press keys, press "q" to end, "s" toggles logging.');
  Repeat
    K:=GetKeyEvent;
    K:=TranslateKeyEvent(K);
    Writeln('Got key : ',KeyEventToString(K));
    if GetKeyEventChar(K)='s' then
      if IsKeyLogging then
        StopKeyLogging
      else
        StartKeyLogging;
  Until (GetKeyEventChar(K)='q');
  DoneKeyBoard;
end.


kbdEnd

End key pressed

Declaration

Source position: keybrdh.inc line 91

const kbdEnd = $FF26;


kbdF1

F1 function key pressed.

Declaration

Source position: keybrdh.inc line 59

const kbdF1 = $FF01;


kbdF2

F2 function key pressed.

Declaration

Source position: keybrdh.inc line 60

const kbdF2 = $FF02;


kbdF3

F3 function key pressed.

Declaration

Source position: keybrdh.inc line 61

const kbdF3 = $FF03;


kbdF4

F4 function key pressed.

Declaration

Source position: keybrdh.inc line 62

const kbdF4 = $FF04;


kbdF5

F5 function key pressed.

Declaration

Source position: keybrdh.inc line 63

const kbdF5 = $FF05;


kbdF6

F6 function key pressed.

Declaration

Source position: keybrdh.inc line 64

const kbdF6 = $FF06;


kbdF7

F7 function key pressed.

Declaration

Source position: keybrdh.inc line 65

const kbdF7 = $FF07;


kbdF8

F8 function key pressed.

Declaration

Source position: keybrdh.inc line 66

const kbdF8 = $FF08;


kbdF9

F9 function key pressed.

Declaration

Source position: keybrdh.inc line 67

const kbdF9 = $FF09;


kbdF10

F10 function key pressed.

Declaration

Source position: keybrdh.inc line 68

const kbdF10 = $FF0A;


kbdF11

F12 function key pressed.

Declaration

Source position: keybrdh.inc line 69

const kbdF11 = $FF0B;


kbdF12

F12 function key pressed.

Declaration

Source position: keybrdh.inc line 70

const kbdF12 = $FF0C;


kbdF13

F13 function key pressed.

Declaration

Source position: keybrdh.inc line 71

const kbdF13 = $FF0D;


kbdF14

F14 function key pressed.

Declaration

Source position: keybrdh.inc line 72

const kbdF14 = $FF0E;


kbdF15

F15 function key pressed.

Declaration

Source position: keybrdh.inc line 73

const kbdF15 = $FF0F;


kbdF16

F16 function key pressed.

Declaration

Source position: keybrdh.inc line 74

const kbdF16 = $FF10;


kbdF17

F17 function key pressed.

Declaration

Source position: keybrdh.inc line 75

const kbdF17 = $FF11;


kbdF18

F18 function key pressed.

Declaration

Source position: keybrdh.inc line 76

const kbdF18 = $FF12;


kbdF19

F19 function key pressed.

Declaration

Source position: keybrdh.inc line 77

const kbdF19 = $FF13;


kbdF20

F20 function key pressed.

Declaration

Source position: keybrdh.inc line 78

const kbdF20 = $FF14;


kbdHome

Home key pressed

Declaration

Source position: keybrdh.inc line 85

const kbdHome = $FF20;


kbdInsert

Insert key pressed

Declaration

Source position: keybrdh.inc line 95

const kbdInsert = $FF29;


kbdLeft

Arrow left key pressed

Declaration

Source position: keybrdh.inc line 88

const kbdLeft = $FF23;


kbdLWin

Left windows key pressed.

Declaration

Source position: keybrdh.inc line 80

const kbdLWin = $FF15;


kbdMiddle

Middle key pad key pressed (numerical 5)

Declaration

Source position: keybrdh.inc line 89

const kbdMiddle = $FF24;


kbdPgDn

Page down key pressed

Declaration

Source position: keybrdh.inc line 93

const kbdPgDn = $FF28;


kbdPgUp

Page Up key pressed

Declaration

Source position: keybrdh.inc line 87

const kbdPgUp = $FF22;


kbdRight

Arrow right key pressed

Declaration

Source position: keybrdh.inc line 90

const kbdRight = $FF25;


kbdRWin

Right windows key pressed.

Declaration

Source position: keybrdh.inc line 81

const kbdRWin = $FF16;


Keyboard scan codes

Special physical keys are encoded with the DOS scan codes for these keys in the second byte of the TKeyEvent type. A complete list of scan codes can be found in the below table. This is the list of keys that is used by the default key event translation mechanism. When writing a keyboard driver, either these constants should be returned by the various key event functions, or the TranslateKeyEvent hook should be implemented by the driver.

Key Scancodes
Code | Key | Code | Key | Code | Key
00 | NoKey | 3D | F3 | 70 | ALT-F9
01 | ALT-Esc | 3E | F4 | 71 | ALT-F10
02 | ALT-Space | 3F | F5 | 72 | CTRL-PrtSc
04 | CTRL-Ins | 40 | F6 | 73 | CTRL-Left
05 | SHIFT-Ins | 41 | F7 | 74 | CTRL-Right
06 | CTRL-Del | 42 | F8 | 75 | CTRL-end
07 | SHIFT-Del | 43 | F9 | 76 | CTRL-PgDn
08 | ALT-Back | 44 | F10 | 77 | CTRL-Home
09 | ALT-SHIFT-Back | 47 | Home | 78 | ALT-1
0F | SHIFT-Tab | 48 | Up | 79 | ALT-2
10 | ALT-Q | 49 | PgUp | 7A | ALT-3
11 | ALT-W | 4B | Left | 7B | ALT-4
12 | ALT-E | 4C | Center | 7C | ALT-5
13 | ALT-R | 4D | Right | 7D | ALT-6
14 | ALT-T | 4E | ALT-GrayPlus | 7E | ALT-7
15 | ALT-Y | 4F | end | 7F | ALT-8
16 | ALT-U | 50 | Down | 80 | ALT-9
17 | ALT-I | 51 | PgDn | 81 | ALT-0
18 | ALT-O | 52 | Ins | 82 | ALT-Minus
19 | ALT-P | 53 | Del | 83 | ALT-Equal
1A | ALT-LftBrack | 54 | SHIFT-F1 | 84 | CTRL-PgUp
1B | ALT-RgtBrack | 55 | SHIFT-F2 | 85 | F11
1E | ALT-A | 56 | SHIFT-F3 | 86 | F12
1F | ALT-S | 57 | SHIFT-F4 | 87 | SHIFT-F11
20 | ALT-D | 58 | SHIFT-F5 | 88 | SHIFT-F12
21 | ALT-F | 59 | SHIFT-F6 | 89 | CTRL-F11
22 | ALT-G | 5A | SHIFT-F7 | 8A | CTRL-F12
23 | ALT-H | 5B | SHIFT-F8 | 8B | ALT-F11
24 | ALT-J | 5C | SHIFT-F9 | 8C | ALT-F12
25 | ALT-K | 5D | SHIFT-F10 | 8D | CTRL-Up
26 | ALT-L | 5E | CTRL-F1 | 8E | CTRL-Minus
27 | ALT-SemiCol | 5F | CTRL-F2 | 8F | CTRL-Center
28 | ALT-Quote | 60 | CTRL-F3 | 90 | CTRL-GreyPlus
29 | ALT-OpQuote | 61 | CTRL-F4 | 91 | CTRL-Down
2B | ALT-BkSlash | 62 | CTRL-F5 | 94 | CTRL-Tab
2C | ALT-Z | 63 | CTRL-F6 | 97 | ALT-Home
2D | ALT-X | 64 | CTRL-F7 | 98 | ALT-Up
2E | ALT-C | 65 | CTRL-F8 | 99 | ALT-PgUp
2F | ALT-V | 66 | CTRL-F9 | 9B | ALT-Left
30 | ALT-B | 67 | CTRL-F10 | 9D | ALT-Right
31 | ALT-N | 68 | ALT-F1 | 9F | ALT-end
32 | ALT-M | 69 | ALT-F2 | A0 | ALT-Down
33 | ALT-Comma | 6A | ALT-F3 | A1 | ALT-PgDn
34 | ALT-Period | 6B | ALT-F4 | A2 | ALT-Ins
35 | ALT-Slash | 6C | ALT-F5 | A3 | ALT-Del
37 | ALT-GreyAst | 6D | ALT-F6 | A5 | ALT-Tab
3B | F1 | 6E | ALT-F7 |  |
3C | F2 | 6F | ALT-F8 |  |

A list of scan codes for special keys and combinations with the SHIFT, ALT and CTRL keys can be found in the following table: They are for quick reference only.

Special keys scan codes
Key | Code | SHIFT-Key | CTRL-Key | Alt-Key
NoKey | 00 |  |  |
F1 | 3B | 54 | 5E | 68
F2 | 3C | 55 | 5F | 69
F3 | 3D | 56 | 60 | 6A
F4 | 3E | 57 | 61 | 6B
F5 | 3F | 58 | 62 | 6C
F6 | 40 | 59 | 63 | 6D
F7 | 41 | 5A | 64 | 6E
F8 | 42 | 5B | 65 | 6F
F9 | 43 | 5C | 66 | 70
F10 | 44 | 5D | 67 | 71
F11 | 85 | 87 | 89 | 8B
F12 | 86 | 88 | 8A | 8C
Home | 47 |  | 77 | 97
Up | 48 |  | 8D | 98
PgUp | 49 |  | 84 | 99
Left | 4B |  | 73 | 9B
Center | 4C |  | 8F |
Right | 4D |  | 74 | 9D
end | 4F |  | 75 | 9F
Down | 50 |  | 91 | A0
PgDn | 51 |  | 76 | A1
Ins | 52 | 05 | 04 | A2
Del | 53 | 07 | 06 | A3
Tab | 8 | 0F | 94 | A5
GreyPlus |  |  | 90 | 4E


Unix specific notes

On Unix, applications run on a "terminal", and the application writes to the screen and reads from the keyboard by communicating with the terminal. Unix keyboard handling is mostly backward compatible with the DEC vt100 and vt220 terminals from tens of years ago. The vt100 and vt220 had very different keyboards than todays PC's and this is where the problems start. To make it worse the protocol of both terminals has not been very well designed.

Because of this, the keyboard unit on Unix operating systems does a best effort to provide keyboard functionality. An implementation with full keyboard facilities like on other operating systems is not possible.

The exception is the Linux kernel. The terminal emulation of the Linux kernel is from a PC keyboard viewpoint hopeless as well, but unlike other terminal emulators it is configurable. On the Linux console, the Free Pascal keyboard unit tries to implement full functionality.

Users of applications using the keyboard unit should expect the following:

  • Full functionality on the Linux console. It must be the bare console, SSH into another machine will kill the full functionality.
  • Limited functionality otherwise.

Notes about Linux full functionality:

  • The keyboard is reprogrammed. If the keyboard is for whatever reason not restored in its original state, please load your keymap to reinitialize it.
  • Alt+function keys generate keycodes for those keys. To switch virtual consoles, use ctrl+alt+function key.
  • Unlike what you're used to with other Unix software, escape works as you intuitively expect, it generates the keycode for an escape key without a delay.

The limited functionality does include these quirks:

  • Escape must be pressed two times before it has effect.

  • On the Linux console, when the users runs the program by logging into another machine:

    • Shift+F1 and Shift+F12 will generate keycodes for F11 and F12.
    • Shift+arrow keys, shift+ins, shift+del, shift+home, shift+end do not work. The same is true about the control and alt combinations.
    • Alt+function keys will switch virtual consoles instead of generating the right key sequences.
    • Ctrl+function keys will generate the keycodes for the function keys without ctrl

  • In Xterm:

    • Shift+insert pastes the x clipboard, no keycode will be generated.

  • In Konsole:

    • Shift+insert pastes the x clipboard, no keycode will be generated.
    • Shift+arrow keys doesn't work, nor does ctrl+arrow keys

If you have a non-standard terminal, some keys may not work at all. When in limited functionality mode, the user can work around using an escape prefix:

  • Esc+1 = F1, Esc+2 = F2.
  • Esc before another key is equal to alt+key.

In such cases, if the terminal does output an escape sequence for those keys, please submit a bug report so we can add them.


kbdUp

Arrow up key pressed

Declaration

Source position: keybrdh.inc line 86

const kbdUp = $FF21;


kbFnKey

function key pressed.

Declaration

Source position: keybrdh.inc line 102

const kbFnKey = $02;


kbLeftShift

Left shift key modifier

Declaration

Source position: keybrdh.inc line 108

const kbLeftShift = 1;


kbPhys

Physical key code event

Declaration

Source position: keybrdh.inc line 103

const kbPhys = $03;


kbReleased

Key release event (not implemented in FPC)

Declaration

Source position: keybrdh.inc line 105

const kbReleased = $04;


kbRightShift

Right shift key modifier

Declaration

Source position: keybrdh.inc line 109

const kbRightShift = 2;


kbShift

Shift key modifier

Declaration

Source position: keybrdh.inc line 110

const kbShift = kbLeftShift or kbRightShift;


kbUniCode

Unicode code key event

Declaration

Source position: keybrdh.inc line 101

const kbUniCode = $01;


PTreeElement

Pointer to TTreeElement record

Declaration

Source position: keyboard.pp line 34

type PTreeElement = ^TTreeElement;


SAnd

'And' description string

Declaration

Source position: keybrdh.inc line 122

const SAnd: string = 'AND';

Description

This constant is used as the 'And' word in key descriptions. This constant is used by the key event description routines. It can be changed to localize the key descriptions when needed.

See also

KeyEventToString | Return a string describing the key event.
FunctionKeyName | Return string representation of a function key code.


ShiftPrefix

Keycode for alternate prefix key for Shift key. Unix Only

Declaration

Source position: keyboard.pp line 28

const ShiftPrefix: Byte = 0;


SKeyPad

Names of keypad keys

Declaration

Source position: keybrdh.inc line 123

const SKeyPad: array [0..($FF2F-kbdHome)] of string = ('Home', 'Up', 'PgUp', 'Left', 'Middle', 'Right', 'End', 'Down', 'PgDn', 'Insert', 'Delete', '', '', '', '', '');

Description

This constant describes all keypad keys. This constant is used by the key event description routines. It can be changed to localize the key descriptions when needed.

See also

KeyEventToString | Return a string describing the key event.
FunctionKeyName | Return string representation of a function key code.


SLeftRight

Names for left-right keys

Declaration

Source position: keybrdh.inc line 118

const SLeftRight: array [1..2] of string = ('LEFT', 'RIGHT');

Description

This constant contains strings to describe left and right keys. This constant is used by the key event description routines. It can be changed to localize the key descriptions when needed.

See also

KeyEventToString | Return a string describing the key event.
FunctionKeyName | Return string representation of a function key code.


SScanCode

Scancode key

Declaration

Source position: keybrdh.inc line 120

const SScanCode: string = 'Key with scancode ';

Description

This constant contains a string to denote a scancode key event. This constant is used by the key event description routines. It can be changed to localize the key descriptions when needed.

See also

KeyEventToString | Return a string describing the key event.
FunctionKeyName | Return string representation of a function key code.


SShift

Names of modifier keys

Declaration

Source position: keybrdh.inc line 117

const SShift: array [1..3] of string = ('SHIFT', 'CTRL', 'ALT');

Description

This constant describes the various modifier keys. This constant is used by the key event description routines. It can be changed to localize the key descriptions when needed.

See also

KeyEventToString | Return a string describing the key event.
FunctionKeyName | Return string representation of a function key code.


SUnicodeChar

Unicode character string.

Declaration

Source position: keybrdh.inc line 119

const SUnicodeChar: string = 'Unicode character ';

Description

This constant contains a string to denote a unicode key event. This constant is used by the key event description routines. It can be changed to localize the key descriptions when needed.

See also

KeyEventToString | Return a string describing the key event.
FunctionKeyName | Return string representation of a function key code.


SUnknownFunctionKey

Unknown function key

Declaration

Source position: keybrdh.inc line 121

const SUnknownFunctionKey: string = 'Unknown function key : ';

Description

This constant contains a string to denote that an unknown function key was found. This constant is used by the key event description routines. It can be changed to localize the key descriptions when needed.

See also

KeyEventToString | Return a string describing the key event.
FunctionKeyName | Return string representation of a function key code.


TKeyboardDriver

Keyboard driver structure

Declaration

Source position: keybrdh.inc line 130

type TKeyboardDriver = record
InitDriver: procedure; | Handler called when initializing keyboard driver
DoneDriver: procedure; | Handler called when unloading keyboard driver
GetKeyEvent: function: TKeyEvent; | Blocking handler called when a key event is requested
PollKeyEvent: function: TKeyEvent; | Non blocking handler when checking for presence of a key event
GetShiftState: function: Byte; | Handler called to request the current shift state
TranslateKeyEvent: function( | Translate key event to a suitable ASCII representation
KeyEvent: TKeyEvent
):TKeyEvent;
TranslateKeyEventUniCode: function( | Translate key event to a suitable Unicode representation
KeyEvent: TKeyEvent
):TKeyEvent;
end;

Description

The TKeyboardDriver record can be used to install a custom keyboard driver with the SetKeyboardDriver function.

The various fields correspond to the different functions of the keyboard unit interface. For more information about this record see kbddriver

See also

SetKeyboardDriver | Set a new keyboard driver.
kbddriver | Writing a keyboard driver


TKeyEvent

Base type to describe all key events.

Declaration

Source position: keybrdh.inc line 21

type TKeyEvent = Cardinal;

Description

The TKeyEvent type is the base type for all keyboard events.

The key stroke is encoded in the 4 bytes of the TKeyEvent type. The various fields of the key stroke encoding can be obtained by typecasting the TKeyEvent type to the TKeyRecord type.


TKeyRecord

Key event decoding type.

Declaration

Source position: keybrdh.inc line 22

type TKeyRecord = packed record
Flags: Byte; | Additional flags
ShiftState: Byte; | State of shift keys
KeyCode: Word; | Key code
end;

Description

The structure of a TKeyRecord structure is explained in the following table:

Structure of TKeyRecord
Field | Meaning
KeyCode | Depending on flags either the physical representation of a key (under DOS scancode, ascii code pair), or the translated ASCII/unicode character.
ShiftState | Shift-state when this key was pressed (or shortly after)
Flags | Determine how to interpret KeyCode

The shift-state can be checked using the various shift-state constants, and the flags in the last byte can be checked using one of the kbASCII, kbUniCode, kbFnKey, kbPhys, kbReleased constants.

If there are two keys returning the same char-code, there's no way to find out which one was pressed (Gray+ and Simple+). If it needs to be known which was pressed, the untranslated keycodes must be used, but these are system dependent. System dependent constants may be defined to cover those, with possibily having the same name (but different value).

See also

kbdscancode | Keyboard scan codes
TKeyEvent | Base type to describe all key events.


Tprocedure

Procedure prototype

Declaration

Source position: keyboard.pp line 32

type Tprocedure = procedure;


TTreeElement

Tree element

Declaration

Source position: keyboard.pp line 35

type TTreeElement = record
Next: PTreeElement; | Reference to next scancode in the tree
Parent: PTreeElement; | Reference to parent scancode in the tree
Child: PTreeElement; | Reference to child scancode in the tree
CanBeTerminal: Boolean; | This scancode is possibly the last of a sequence scancode
char: Byte; | Key Character
ScanValue: Byte; | Key scancode
CharValue: Byte; | Character value for scancode
SpecialHandler: Tprocedure; | Procedure to handle this sequence
end;

Description

TTreeELement is used to describe key scancode sequences, and is used to handle special key combinations in AddSpecialSequence on unix platforms. There should be no need to handle records of this type.

See also

AddSpecialSequence

Add a handler for a special key sequence


AllowReuseOfLineInfoData

Speed up LineInfo reading by reusing already-read information

Declaration

Source position: lineinfo.pp line 40

var AllowReuseOfLineInfoData: Boolean = True;

Description

AllowReuseOfLineInfoData can be set to True to keep the last opened file open. When regularly creating backtraces (e.g. in a program log), this will significantly speed up operations.

See also

CloseStabs

Close stabs info file descriptor


CodePointer

Declaration

Source position: lineinfo.pp line 28

type CodePointer = Pointer;


Reference for unit 'lineinfo'

Return adress line information

uses

  System;

The system unit

Overview

The lineinfo provides a routine that reads the debug information of an executable (if any exists) and returns source code information about this address. It works with Stabs debug information. Note that this unit is not thread-safe, and that its behaviour is undefined if multiple threads try to write a backtrace at the same time.

For DWARF debug information, the lnfodwrf unit must be used.


[Overview][Types][Procedures and functions][Variables][Index] Reference for unit 'lineinfo' (#rtl)

Reference for unit 'lineinfo': Types

CodePointer


Reference for unit 'lineinfo': Procedures and functions

CloseStabs | Close stabs info file descriptor
GetLineInfo | Return source line information about an address.
StabBackTraceStr | Get a backtrace from an address


Reference for unit 'lineinfo': Variables

AllowReuseOfLineInfoData

Speed up LineInfo reading by reusing already-read information


Index of all identifiers in unit 'lineinfo'

A C G S

A

AllowReuseOfLineInfoData

C

CloseStabs CodePointer

G

GetLineInfo

S

StabBackTraceStr


CAP_AUDIT_CONTROL

Allow manipulation of kernel auditing features

Declaration

Source position: linux.pp line 330

const CAP_AUDIT_CONTROL = 30;


CAP_AUDIT_WRITE

Allow writing to kernel audit log

Declaration

Source position: linux.pp line 329

const CAP_AUDIT_WRITE = 29;


CAP_CHOWN

Perform chown operation

Declaration

Source position: linux.pp line 299

const CAP_CHOWN = 0;


CAP_DAC_OVERRIDE

Bypass file operation (rwx) checks

Declaration

Source position: linux.pp line 300

const CAP_DAC_OVERRIDE = 1;


CAP_DAC_READ_SEARCH

Bypass file read-only operation checks

Declaration

Source position: linux.pp line 301

const CAP_DAC_READ_SEARCH = 2;


CAP_FOWNER

Bypass owner ID checks

Declaration

Source position: linux.pp line 302

const CAP_FOWNER = 3;


CAP_FS_MASK

?

Declaration

Source position: linux.pp line 304

const CAP_FS_MASK = $1f;


CAP_FSETID

Do not clear SUID/GUID bits on modified files

Declaration

Source position: linux.pp line 303

const CAP_FSETID = 4;


CAP_IPC_LOCK

Allow memory locking calls

Declaration

Source position: linux.pp line 314

const CAP_IPC_LOCK = 14;


CAP_IPC_OWNER

Bypass permission checks on IPC operations

Declaration

Source position: linux.pp line 315

const CAP_IPC_OWNER = 15;


CAP_KILL

Bypass permission checks for sending signals

Declaration

Source position: linux.pp line 305

const CAP_KILL = 5;


CAP_LEASE

Allow file leases

Declaration

Source position: linux.pp line 328

const CAP_LEASE = 28;


CAP_LINUX_IMMUTABLE

Allow setting ext2 file attributes

Declaration

Source position: linux.pp line 309

const CAP_LINUX_IMMUTABLE = 9;


CAP_MKNOD

Allow creation of special files through mknod calls

Declaration

Source position: linux.pp line 327

const CAP_MKNOD = 27;


CAP_NET_ADMIN

Allow network operations (e.g. setting socket options)

Declaration

Source position: linux.pp line 312

const CAP_NET_ADMIN = 12;


CAP_NET_BIND_SERVICE

Allow binding to ports less than 1024

Declaration

Source position: linux.pp line 310

const CAP_NET_BIND_SERVICE = 10;


CAP_NET_BROADCAST

Allow socket broadcast operations

Declaration

Source position: linux.pp line 311

const CAP_NET_BROADCAST = 11;


CAP_NET_RAW

Allow use of RAW and PACKET sockets

Declaration

Source position: linux.pp line 313

const CAP_NET_RAW = 13;


CAP_SETGID

Allow GID manipulations

Declaration

Source position: linux.pp line 306

const CAP_SETGID = 6;


CAP_SETPCAP

Allow to set other process' capabilities

Declaration

Source position: linux.pp line 308

const CAP_SETPCAP = 8;


CAP_SETUID

Allow process ID manipulations

Declaration

Source position: linux.pp line 307

const CAP_SETUID = 7;


CAP_SYS_ADMIN

Allow various system administration calls

Declaration

Source position: linux.pp line 321

const CAP_SYS_ADMIN = 21;


CAP_SYS_BOOT

Allow reboot calls

Declaration

Source position: linux.pp line 322

const CAP_SYS_BOOT = 22;


CAP_SYS_CHROOT

Allow chroot calls.

Declaration

Source position: linux.pp line 318

const CAP_SYS_CHROOT = 18;


CAP_SYS_MODULE

Allow loading/unloading of kernel modules

Declaration

Source position: linux.pp line 316

const CAP_SYS_MODULE = 16;


CAP_SYS_NICE

Allowing raising process and thread priorities

Declaration

Source position: linux.pp line 323

const CAP_SYS_NICE = 23;


CAP_SYS_PACCT

Allow acct calls

Declaration

Source position: linux.pp line 320

const CAP_SYS_PACCT = 20;


CAP_SYS_PTRACE

Allow ptrace calls

Declaration

Source position: linux.pp line 319

const CAP_SYS_PTRACE = 19;


CAP_SYS_RAWIO

Allow raw I/O port operations

Declaration

Source position: linux.pp line 317

const CAP_SYS_RAWIO = 17;


CAP_SYS_RESOURCE

Allow use of special resources or raising of resource limits

Declaration

Source position: linux.pp line 324

const CAP_SYS_RESOURCE = 24;


CAP_SYS_TIME

Allow system or real-time clock modification

Declaration

Source position: linux.pp line 325

const CAP_SYS_TIME = 25;


CAP_SYS_TTY_CONFIG

Allow vhangup calls

Declaration

Source position: linux.pp line 326

const CAP_SYS_TTY_CONFIG = 26;


CLOCK_MONOTONIC

Monotonic system time since some undetermined start point. Can change if time is set.

Declaration

Source position: linux.pp line 442

const CLOCK_MONOTONIC = 1;


CLOCK_MONOTONIC_COARSE

Less precise (but faster) version of CLOCK_MONOTONIC

Declaration

Source position: linux.pp line 447

const CLOCK_MONOTONIC_COARSE = 6;


CLOCK_MONOTONIC_RAW

Like CLOCK_MONOTONIC, not subject to NTP adjustments

Declaration

Source position: linux.pp line 445

const CLOCK_MONOTONIC_RAW = 4;


CLOCK_PROCESS_CPUTIME_ID

Processs-specific high-resolution timer from the CPU.

Declaration

Source position: linux.pp line 443

const CLOCK_PROCESS_CPUTIME_ID = 2;


CLOCK_REALTIME

System wide real-time clock. Can only be set by root.

Declaration

Source position: linux.pp line 441

const CLOCK_REALTIME = 0;


CLOCK_REALTIME_COARSE

Less precise (but faster) version of CLOCK_REALTIME

Declaration

Source position: linux.pp line 446

const CLOCK_REALTIME_COARSE = 5;


CLOCK_SGI_CYCLE

High resolution timer

Declaration

Source position: linux.pp line 449

const CLOCK_SGI_CYCLE = 10;


CLOCK_THREAD_CPUTIME_ID

Thread-specific high-resolution timer from the CPU.

Declaration

Source position: linux.pp line 444

const CLOCK_THREAD_CPUTIME_ID = 3;


clockid_t

Clock id type

Declaration

Source position: linux.pp line 455

type clockid_t = cint;


CLOCKS_MASK

Mask for supported clocks

Declaration

Source position: linux.pp line 451

const CLOCKS_MASK = CLOCK_REALTIME or CLOCK_MONOTONIC;


CLOCKS_MONO

Monotonic clocks mask

Declaration

Source position: linux.pp line 452

const CLOCKS_MONO = CLOCK_MONOTONIC;


CSIGNAL

Clone option: Signal mask to be sent at exit

Declaration

Source position: linux.pp line 55

const CSIGNAL = $000000ff;


EPoll_Data

Epoll data call structure

Declaration

Source position: linux.pp line 256

type EPoll_Data = record
case Integer of
0: (
ptr: pointer; | Pointer to data
);
1: (
fd: cint; | File descriptor
);
2: (
u32: cuint; | Unsigned 32-bit integer
);
3: (
u64: cuint64; | Unsigned 64-bit integer
);
end;

Description

Data structure used in EPOLL IOCTL call.


EPoll_Event

Structure used in epoll_ctl call.

Declaration

Source position: linux.pp line 266

type EPoll_Event = packed record
Events: cuint32; | Events to monitor
Data: TEPoll_Data; | User data
end;


EPOLLERR

event_wait error condition on file descriptor

Declaration

Source position: linux.pp line 134

const EPOLLERR = $08;


EPOLLET

Set event_wait edge trigger behaviour on file descriptor

Declaration

Source position: linux.pp line 137

const EPOLLET = $80000000;


EPOLLHUP

event_wait hang up event

Declaration

Source position: linux.pp line 135

const EPOLLHUP = $10;


EPOLLIN

event_wait input file descriptor ready event

Declaration

Source position: linux.pp line 131

const EPOLLIN = $01;


EPOLLONESHOT

Set single-shot behaviour on epoll_wait.

Declaration

Source position: linux.pp line 136

const EPOLLONESHOT = $40000000;


EPOLLOUT

event_wait output file descriptor ready event

Declaration

Source position: linux.pp line 133

const EPOLLOUT = $04;


EPOLLPRI

event_wait high priority data available on input file descriptor

Declaration

Source position: linux.pp line 132

const EPOLLPRI = $02;


FUTEX_REQUEUE

Futex option: requeue waiting processes on other futex.

Declaration

Source position: linux.pp line 79

const FUTEX_REQUEUE = 3;


FUTEX_TRYLOCK_PI

Futex option: Undocumented

Declaration

Source position: linux.pp line 84

const FUTEX_TRYLOCK_PI = 8;


FUTEX_UNLOCK_PI

Futex option: Undocumented

Declaration

Source position: linux.pp line 83

const FUTEX_UNLOCK_PI = 7;


FUTEX_WAIT

Futex option: Wait on futex till wake call arrives.

Declaration

Source position: linux.pp line 76

const FUTEX_WAIT = 0;


FUTEX_WAKE

Futex option: wakes any waiting processes on this futex

Declaration

Source position: linux.pp line 77

const FUTEX_WAKE = 1;


FUTEX_WAKE_OP

Futex option: Undocumented

Declaration

Source position: linux.pp line 81

const FUTEX_WAKE_OP = 5;


GIO_CMAP

IOCTL: Get colour palette on VGA+

Declaration

Source position: linux.pp line 150

const GIO_CMAP = $4B70;


GIO_FONT

IOCTL: Get font in expanded form.

Declaration

Source position: linux.pp line 145

const GIO_FONT = $4B60;


GIO_FONTX

IOCTL: Get font in consolefontdesc record.

Declaration

Source position: linux.pp line 147

const GIO_FONTX = $4B6B;


GIO_SCRNMAP

IOCTL: get screen mapping from kernel

Declaration

Source position: linux.pp line 165

const GIO_SCRNMAP = $4B40;


GIO_UNIMAP

IOCTL: get unicode-to-font mapping from kernel

Declaration

Source position: linux.pp line 169

const GIO_UNIMAP = $4B66;


GIO_UNISCRNMAP

IOCTL: get full Unicode screen mapping

Declaration

Source position: linux.pp line 167

const GIO_UNISCRNMAP = $4B69;


IN_ACCESS

Data was read from file.

Declaration

Source position: linux.pp line 388

const IN_ACCESS = $00000001;


IN_ALL_EVENTS

All possible events OR-ed together.

Declaration

Source position: linux.pp line 418

const IN_ALL_EVENTS = IN_ACCESS or IN_MODIFY or IN_ATTRIB or IN_CLOSE or IN_OPEN or IN_MOVE or IN_CREATE or IN_DELETE or IN_DELETE_SELF or IN_MOVE_SELF;


IN_ATTRIB

File attributes changed.

Declaration

Source position: linux.pp line 390

const IN_ATTRIB = $00000004;


IN_CLOEXEC

Inotify close on exec flag.

Declaration

Source position: linux.pp line 372

const IN_CLOEXEC = &02000000;

Description

IN_CLOEXEC can be set to indicate that the inotify file handle must be closed on exec.


IN_CLOSE

File was closed (read or write)

Declaration

Source position: linux.pp line 397

const IN_CLOSE = IN_CLOSE_WRITE or IN_CLOSE_NOWRITE;


IN_CLOSE_NOWRITE

File opened for read was closed

Declaration

Source position: linux.pp line 392

const IN_CLOSE_NOWRITE = $00000010;


IN_CLOSE_WRITE

File opened for write was closed

Declaration

Source position: linux.pp line 391

const IN_CLOSE_WRITE = $00000008;


IN_CREATE

A file was created in the directory.

Declaration

Source position: linux.pp line 400

const IN_CREATE = $00000100;


IN_DELETE

A file was deleted from the directory.

Declaration

Source position: linux.pp line 401

const IN_DELETE = $00000200;


IN_DELETE_SELF

Directory or file under observation was deleted.

Declaration

Source position: linux.pp line 402

const IN_DELETE_SELF = $00000400;


IN_DONT_FOLLOW

Do not follow symlinks

Declaration

Source position: linux.pp line 412

const IN_DONT_FOLLOW = $02000000;


IN_IGNORED

Watch was ignored (removed). Only reported.

Declaration

Source position: linux.pp line 408

const IN_IGNORED = $00008000;


IN_ISDIR

Event subject is a directory (reported only)

Declaration

Source position: linux.pp line 414

const IN_ISDIR = $40000000;


IN_MASK_ADD

Add events to existing watch (OR-ing the sets) if one exists.

Declaration

Source position: linux.pp line 413

const IN_MASK_ADD = $20000000;


IN_MODIFY

Data was written to file.

Declaration

Source position: linux.pp line 389

const IN_MODIFY = $00000002;


IN_MOVE

File was moved (in or out of directory)

Declaration

Source position: linux.pp line 398

const IN_MOVE = IN_MOVED_FROM or IN_MOVED_TO;


IN_MOVE_SELF

Directory or file under observation was moved.

Declaration

Source position: linux.pp line 403

const IN_MOVE_SELF = $00000800;


IN_MOVED_FROM

File was moved away from watched directory

Declaration

Source position: linux.pp line 394

const IN_MOVED_FROM = $00000040;


IN_MOVED_TO

File was moved into watched directory

Declaration

Source position: linux.pp line 395

const IN_MOVED_TO = $00000080;


IN_NONBLOCK

Do not block on read

Declaration

Source position: linux.pp line 373

const IN_NONBLOCK = &00004000;

Description

IN_NONBLOCK can be set to indicate that the inotify file handle should not block read operations.


IN_ONESHOT

Only report one event, then remove the watch.

Declaration

Source position: linux.pp line 415

const IN_ONESHOT = $80000000;


IN_ONLYDIR

Only watch filename if it is a directory.

Declaration

Source position: linux.pp line 411

const IN_ONLYDIR = $01000000;


IN_OPEN

File was opened

Declaration

Source position: linux.pp line 393

const IN_OPEN = $00000020;


IN_Q_OVERFLOW

Queue overflowed. Only reported.

Declaration

Source position: linux.pp line 407

const IN_Q_OVERFLOW = $00004000;


IN_UNMOUNT

File system on which file resides was unmounted. Only reported.

Declaration

Source position: linux.pp line 406

const IN_UNMOUNT = $00002000;


Reference for unit 'Linux'

Linux-specific operating system calls.

uses
System, | The system unit
BaseUnix, | Basic Unix functionality
unixtype; | Basic unix types

Overview

The linux unit contains Linux specific operating system calls.

The platform independent functionality of the FPC 1.0.X version of the linux unit has been split out over the unix, baseunix and unixutil units.

The X86-specific parts have been moved to the X86 unit.


Reference for unit 'Linux': Constants

CAP_AUDIT_CONTROL | Allow manipulation of kernel auditing features
CAP_AUDIT_WRITE | Allow writing to kernel audit log
CAP_CHOWN | Perform chown operation
CAP_DAC_OVERRIDE | Bypass file operation (rwx) checks
CAP_DAC_READ_SEARCH | Bypass file read-only operation checks
CAP_FOWNER | Bypass owner ID checks
CAP_FSETID | Do not clear SUID/GUID bits on modified files
CAP_FS_MASK | ?
CAP_IPC_LOCK | Allow memory locking calls
CAP_IPC_OWNER | Bypass permission checks on IPC operations
CAP_KILL | Bypass permission checks for sending signals
CAP_LEASE | Allow file leases
CAP_LINUX_IMMUTABLE | Allow setting ext2 file attributes
CAP_MKNOD | Allow creation of special files through mknod calls
CAP_NET_ADMIN | Allow network operations (e.g. setting socket options)
CAP_NET_BIND_SERVICE | Allow binding to ports less than 1024
CAP_NET_BROADCAST | Allow socket broadcast operations
CAP_NET_RAW | Allow use of RAW and PACKET sockets
CAP_SETGID | Allow GID manipulations
CAP_SETPCAP | Allow to set other process' capabilities
CAP_SETUID | Allow process ID manipulations
CAP_SYS_ADMIN | Allow various system administration calls
CAP_SYS_BOOT | Allow reboot calls
CAP_SYS_CHROOT | Allow chroot calls.
CAP_SYS_MODULE | Allow loading/unloading of kernel modules
CAP_SYS_NICE | Allowing raising process and thread priorities
CAP_SYS_PACCT | Allow acct calls
CAP_SYS_PTRACE | Allow ptrace calls
CAP_SYS_RAWIO | Allow raw I/O port operations
CAP_SYS_RESOURCE | Allow use of special resources or raising of resource limits
CAP_SYS_TIME | Allow system or real-time clock modification
CAP_SYS_TTY_CONFIG | Allow vhangup calls
CLOCKS_MASK | Mask for supported clocks
CLOCKS_MONO | Monotonic clocks mask
CLOCK_MONOTONIC | Monotonic system time since some undetermined start point. Can change if time is set.
CLOCK_MONOTONIC_COARSE | Less precise (but faster) version of CLOCK_MONOTONIC
CLOCK_MONOTONIC_RAW | Like CLOCK_MONOTONIC, not subject to NTP adjustments
CLOCK_PROCESS_CPUTIME_ID | Processs-specific high-resolution timer from the CPU.
CLOCK_REALTIME | System wide real-time clock. Can only be set by root.
CLOCK_REALTIME_COARSE | Less precise (but faster) version of CLOCK_REALTIME
CLOCK_SGI_CYCLE | High resolution timer
CLOCK_THREAD_CPUTIME_ID | Thread-specific high-resolution timer from the CPU.
CLONE_CHILD_CLEARTID | Clone option: Erase child thread ID in child memory space when child exits.
CLONE_CHILD_SETTID | Clone option: Store child thread ID in child memory.
CLONE_DETACHED | Clone option: Start clone detached.
CLONE_FILES | Clone option: open files shared between processes
CLONE_FS | Clone option: fs info shared between processes
CLONE_NEWNS | Clone options: Start child in new (filesystem) namespace.
CLONE_PARENT | Clone options: Set child parent to parent of calling process.
CLONE_PARENT_SETTID | Clone option: Store child thread ID in memory in both parent and child.
CLONE_PID | Clone option: PID shared between processes
CLONE_PTRACE | Clone options: if parent is traced, trace child also
CLONE_SETTLS | Clone option: The newtls parameter is the TLS descriptor of the child
CLONE_SIGHAND | Clone option: signal handlers shared between processes
CLONE_STOPPED | Clone option: Start child in stopped state.
CLONE_SYSVSEM | Clone option: Caller and child share the same semaphore undo values
CLONE_THREAD | Clone options: Set child in thread group of calling process.
CLONE_UNTRACED | Clone option: Do not allow a ptrace call on this clone.
CLONE_VFORK | Clone options: suspend parent till child execs
CLONE_VM | Clone option: VM shared between processes
CSIGNAL | Clone option: Signal mask to be sent at exit
EPOLLERR | event_wait error condition on file descriptor
EPOLLET | Set event_wait edge trigger behaviour on file descriptor
EPOLLHUP | event_wait hang up event
EPOLLIN | event_wait input file descriptor ready event
EPOLLONESHOT | Set single-shot behaviour on epoll_wait.
EPOLLOUT | event_wait output file descriptor ready event
EPOLLPRI | event_wait high priority data available on input file descriptor
EPOLL_CTL_ADD | Add filedescriptor to list of events
EPOLL_CTL_DEL | Delete event for filedescriptor
EPOLL_CTL_MOD | Modify event for filedescriptor
FUTEX_CMP_REQUEUE | Futex option: requeue waiting processes on other futex, but check it's value first
FUTEX_FD | Futex option: Associate file descriptor with futex.
FUTEX_LOCK_PI | Futex option: Undocumented
FUTEX_OP_ADD | Futex operation: Undocumented
FUTEX_OP_ANDN | Futex operation: Undocumented
FUTEX_OP_CMP_EQ | Futex operation: Undocumented
FUTEX_OP_CMP_GE | Futex operation: Undocumented
FUTEX_OP_CMP_GT | Futex operation: Undocumented
FUTEX_OP_CMP_LE | Futex operation: Undocumented
FUTEX_OP_CMP_LT | Futex operation: Undocumented
FUTEX_OP_CMP_NE | Futex operation: Undocumented
FUTEX_OP_OPARG_SHIFT | Futex operation: Undocumented
FUTEX_OP_OR | Futex operation: Undocumented
FUTEX_OP_SET | Futex operation: Undocumented
FUTEX_OP_XOR | Futex operation: Undocumented
FUTEX_REQUEUE | Futex option: requeue waiting processes on other futex.
FUTEX_TRYLOCK_PI | Futex option: Undocumented
FUTEX_UNLOCK_PI | Futex option: Undocumented
FUTEX_WAIT | Futex option: Wait on futex till wake call arrives.
FUTEX_WAKE | Futex option: wakes any waiting processes on this futex
FUTEX_WAKE_OP | Futex option: Undocumented
GIO_CMAP | IOCTL: Get colour palette on VGA+
GIO_FONT | IOCTL: Get font in expanded form.
GIO_FONTX | IOCTL: Get font in consolefontdesc record.
GIO_SCRNMAP | IOCTL: get screen mapping from kernel
GIO_UNIMAP | IOCTL: get unicode-to-font mapping from kernel
GIO_UNISCRNMAP | IOCTL: get full Unicode screen mapping
IN_ACCESS | Data was read from file.
IN_ALL_EVENTS | All possible events OR-ed together.
IN_ATTRIB | File attributes changed.
IN_CLOEXEC | Inotify close on exec flag.
IN_CLOSE | File was closed (read or write)
IN_CLOSE_NOWRITE | File opened for read was closed
IN_CLOSE_WRITE | File opened for write was closed
IN_CREATE | A file was created in the directory.
IN_DELETE | A file was deleted from the directory.
IN_DELETE_SELF | Directory or file under observation was deleted.
IN_DONT_FOLLOW | Do not follow symlinks
IN_IGNORED | Watch was ignored (removed). Only reported.
IN_ISDIR | Event subject is a directory (reported only)
IN_MASK_ADD | Add events to existing watch (OR-ing the sets) if one exists.
IN_MODIFY | Data was written to file.
IN_MOVE | File was moved (in or out of directory)
IN_MOVED_FROM | File was moved away from watched directory
IN_MOVED_TO | File was moved into watched directory
IN_MOVE_SELF | Directory or file under observation was moved.
IN_NONBLOCK | Do not block on read
IN_ONESHOT | Only report one event, then remove the watch.
IN_ONLYDIR | Only watch filename if it is a directory.
IN_OPEN | File was opened
IN_Q_OVERFLOW | Queue overflowed. Only reported.
IN_UNMOUNT | File system on which file resides was unmounted. Only reported.
KB_101 | IOCTL: Keyboard types: 101 keys
KB_84 | IOCTL: Keyboard types: 84 keys
KB_OTHER | IOCTL: Keyboard types: other type
KDADDIO | IOCTL: add i/o port as valid
KDDELIO | IOCTL: delete i/o port as valid
KDDISABIO | IOCTL: disable i/o to video board
KDENABIO | IOCTL: enable i/o to video board
KDFONTOP | IOCTL: font operations
KDGETKEYCODE | IOCTL: read kernel keycode table entry
KDGETLED | IOCTL: return current led state
KDGETMODE | IOCTL: get current mode
KDGKBDIACR | IOCTL: read kernel accent table
KDGKBTYPE | IOCTL: get keyboard type
KDMAPDISP | IOCTL: map display into address space
KDMKTONE | IOCTL: generate tone
KDSETKEYCODE | IOCTL: write kernel keycode table entry
KDSETLED | IOCTL: set led state
KDSETMODE | IOCTL: set text/graphics mode
KDSIGACCEPT | IOCTL: accept kbd generated signals
KDSKBDIACR | IOCTL: write kernel accent table
KDUNMAPDISP | IOCTL: unmap display from address space
KD_GRAPHICS | IOCTL: Tty modes: graphics mode
KD_TEXT | IOCTL: Tty modes: Text mode
KD_TEXT0 | IOCTL: Tty modes: Text mode (obsolete)
KD_TEXT1 | IOCTL: Tty modes: Text mode (obsolete)
KIOCSOUND | IOCTL: start/stop sound generation (0 for off)
LED_CAP | IOCTL: LED_CAP : caps lock led
LED_NUM | IOCTL: LED_SCR : Num lock led
LED_SCR | IOCTL: LED_SCR : scroll lock led
LINUX_CAPABILITY_VERSION | Current capability version in use by kernel
MAP_DENYWRITE | Read-only
MAP_EXECUTABLE | Memory area is marked as executable
MAP_GROWSDOWN | Memory map grows down, like stack
MAP_LOCKED | Memory pages are locked
MAP_NORESERVE | Do not check for reservations
MAX_CLOCKS | Maximum number of clocks in the system
MODIFY_LDT_CONTENTS_CODE | Modify_ldt option: Undocumented
MODIFY_LDT_CONTENTS_DATA | Modify_ldt option: Undocumented
MODIFY_LDT_CONTENTS_STACK | Modify_ldt option: Undocumented
PIO_CMAP | IOCTL: Set colour palette on VGA+
PIO_FONT | IOCTL: Use font in expanded form.
PIO_FONTRESET | IOCTL: Reset to default font
PIO_FONTX | IOCTL: Set font in consolefontdesc record.
PIO_SCRNMAP | IOCTL: put screen mapping table in kernel
PIO_UNIMAP | IOCTL: put unicode-to-font mapping in kernel
PIO_UNIMAPCLR | IOCTL: clear table, possibly advise hash algorithm
PIO_UNISCRNMAP | IOCTL: set full Unicode screen mapping
POLLMSG | Unused in Linux
POLLRDHUP | Peer Shutdown/closed writing half of connection
POLLREMOVE | Undocumented Linux extension of Poll
SPLICE_F_GIFT | Pages spliced in are a gift
SPLICE_F_MORE | Expect more data
SPLICE_F_MOVE | Move pages instead of copying
SPLICE_F_NONBLOCK | Don't block on pipe splicing operations
SYNC_FILE_RANGE_WAIT_AFTER | Wait upon write-out of specified pages in the range after performing any write.
SYNC_FILE_RANGE_WAIT_BEFORE | Wait for write-out of previously-submitted specified pages before writing more data.
SYNC_FILE_RANGE_WRITE | Initiate write of all dirty pages in the specified range.
UD_CONTENTS_CODE | TLS segment descriptor: Undocumented
UD_CONTENTS_DATA | TLS segment descriptor: Undocumented
UD_CONTENTS_STACK | TLS segment descriptor: Undocumented
UD_LIMIT_IN_PAGES | TLS segment descriptor: Undocumented
UD_LM | TLS segment descriptor: Undocumented
UD_READ_EXEC_ONLY | TLS segment descriptor: Undocumented
UD_SEG_32BIT | TLS segment descriptor : Undocumented
UD_SEG_NOT_PRESENT | TLS segment descriptor: Undocumented
UD_USEABLE | TLS segment descriptor: Undocumented


Reference for unit 'Linux': Types

clockid_t | Clock id type
EPoll_Data | Epoll data call structure
EPoll_Event | Structure used in epoll_ctl call.
inotify_event | INotify event structure
PEPoll_Data | Pointer to EPoll_Data record
PEpoll_Event | Pointer to EPoll_Event type
Pinotify_event | Pointer to inotify_event structure.
PSysInfo | Pointer to TSysInfo record.
Puser_cap_data | Pointer to user_cap_data record
Puser_cap_header | Pointer to user_cap_header record
PUser_Desc | Pointer to User_Desc record
TCloneFunc | Clone function prototype.
TEPoll_Data | Alias for EPoll_Data type
TEPoll_Event | Alias for EPoll_Event type
TSysInfo | Record with system information, used by the SysInfo call.
TUser_Desc | Alias for user_desc record
user_cap_data | Capability description record
user_cap_header | Root user capabilities header
user_desc | TLS segment descriptor


Reference for unit 'Linux': Procedures and functions

capget | Return the capabilities for the indicated thread
capset | Set the capabilities for the indicated thread
clock_getres | Get clock resolution
clock_gettime | Get the time of a clock
clock_settime | Set the time of a clock
clone | Clone current process (create new thread)
epoll_create | Create new epoll file descriptor
epoll_ctl | Modify an epoll file descriptor
epoll_wait | Wait for an event on an epoll file descriptor.
fdatasync | Synchronize the data in memory with the data on storage device
futex | Perform a futex operation
futex_op | Futex operation:
inotify_add_watch | Add a watch to a notify file descriptor
inotify_init | Initialize a new inotify file descriptor
inotify_init1 | Initialize a new inotify file descriptor with extra options.
inotify_rm_watch | Remove watch from Inotify file descriptor.
modify_ldt
sched_yield | Yield the processor to another thread.
setregid | Set Real and Effective Group ID
setreuid
sync_file_range | Force committing of data to disk
Sysinfo | Return kernel system information


Index of all identifiers in unit 'Linux'

C E F G I K L M P S T U

C

CAP_AUDIT_CONTROL | CAP_SYS_ADMIN | CLOCKS_MONO
CAP_AUDIT_WRITE | CAP_SYS_BOOT | CLOCK_THREAD_CPUTIME_ID
CAP_CHOWN | CAP_SYS_CHROOT | clone
CAP_DAC_OVERRIDE | CAP_SYS_MODULE | CLONE_CHILD_CLEARTID
CAP_DAC_READ_SEARCH | CAP_SYS_NICE | CLONE_CHILD_SETTID
CAP_FOWNER | CAP_SYS_PACCT | CLONE_DETACHED
CAP_FSETID | CAP_SYS_PTRACE | CLONE_FILES
CAP_FS_MASK | CAP_SYS_RAWIO | CLONE_FS
capget | CAP_SYS_RESOURCE | CLONE_NEWNS
CAP_IPC_LOCK | CAP_SYS_TIME | CLONE_PARENT
CAP_IPC_OWNER | CAP_SYS_TTY_CONFIG | CLONE_PARENT_SETTID
CAP_KILL | clock_getres | CLONE_PID
CAP_LEASE | clock_gettime | CLONE_PTRACE
CAP_LINUX_IMMUTABLE | clockid_t | CLONE_SETTLS
CAP_MKNOD | CLOCK_MONOTONIC | CLONE_SIGHAND
CAP_NET_ADMIN | CLOCK_MONOTONIC_COARSE | CLONE_STOPPED
CAP_NET_BIND_SERVICE | CLOCK_MONOTONIC_RAW | CLONE_SYSVSEM
CAP_NET_BROADCAST | CLOCK_PROCESS_CPUTIME_ID | CLONE_THREAD
CAP_NET_RAW | CLOCK_REALTIME | CLONE_UNTRACED
capset | CLOCK_REALTIME_COARSE | CLONE_VFORK
CAP_SETGID | clock_settime | CLONE_VM
CAP_SETPCAP | CLOCK_SGI_CYCLE | CSIGNAL
CAP_SETUID | CLOCKS_MASK |

E

epoll_create | EPoll_Data | EPOLLIN
epoll_ctl | EPOLLERR | EPOLLONESHOT
EPOLL_CTL_ADD | EPOLLET | EPOLLOUT
EPOLL_CTL_DEL | EPoll_Event | EPOLLPRI
EPOLL_CTL_MOD | EPOLLHUP | epoll_wait

F

fdatasync | FUTEX_OP_CMP_EQ | FUTEX_OP_SET
futex | FUTEX_OP_CMP_GE | FUTEX_OP_XOR
FUTEX_CMP_REQUEUE | FUTEX_OP_CMP_GT | FUTEX_REQUEUE
FUTEX_FD | FUTEX_OP_CMP_LE | FUTEX_TRYLOCK_PI
FUTEX_LOCK_PI | FUTEX_OP_CMP_LT | FUTEX_UNLOCK_PI
futex_op | FUTEX_OP_CMP_NE | FUTEX_WAIT
FUTEX_OP_ADD | FUTEX_OP_OPARG_SHIFT | FUTEX_WAKE
FUTEX_OP_ANDN | FUTEX_OP_OR | FUTEX_WAKE_OP

G

GIO_CMAP | GIO_FONTX | GIO_UNIMAP
GIO_FONT | GIO_SCRNMAP | GIO_UNISCRNMAP

I

IN_ACCESS | IN_DONT_FOLLOW | IN_ONESHOT
IN_ALL_EVENTS | IN_IGNORED | IN_ONLYDIR
IN_ATTRIB | IN_ISDIR | IN_OPEN
IN_CLOEXEC | IN_MASK_ADD | inotify_add_watch
IN_CLOSE | IN_MODIFY | inotify_event
IN_CLOSE_NOWRITE | IN_MOVE | inotify_init
IN_CLOSE_WRITE | IN_MOVED_FROM | inotify_init1
IN_CREATE | IN_MOVED_TO | inotify_rm_watch
IN_DELETE | IN_MOVE_SELF | IN_Q_OVERFLOW
IN_DELETE_SELF | IN_NONBLOCK | IN_UNMOUNT

K

KB_101 | KDGETLED | KDSETMODE
KB_84 | KDGETMODE | KDSIGACCEPT
KB_OTHER | KDGKBDIACR | KDSKBDIACR
KDADDIO | KDGKBTYPE | KD_TEXT
KDDELIO | KD_GRAPHICS | KD_TEXT0
KDDISABIO | KDMAPDISP | KD_TEXT1
KDENABIO | KDMKTONE | KDUNMAPDISP
KDFONTOP | KDSETKEYCODE | KIOCSOUND
KDGETKEYCODE | KDSETLED |

L

LED_CAP | LED_SCR
LED_NUM | LINUX_CAPABILITY_VERSION

M

MAP_DENYWRITE | MAP_NORESERVE | MODIFY_LDT_CONTENTS_DATA
MAP_EXECUTABLE | MAX_CLOCKS | MODIFY_LDT_CONTENTS_STACK
MAP_GROWSDOWN | modify_ldt |
MAP_LOCKED | MODIFY_LDT_CONTENTS_CODE |

P

PEPoll_Data | PIO_FONTX | POLLRDHUP
PEpoll_Event | PIO_SCRNMAP | POLLREMOVE
Pinotify_event | PIO_UNIMAP | PSysInfo
PIO_CMAP | PIO_UNIMAPCLR | Puser_cap_data
PIO_FONT | PIO_UNISCRNMAP | Puser_cap_header
PIO_FONTRESET | POLLMSG | PUser_Desc

S

sched_yield | SPLICE_F_MORE | SYNC_FILE_RANGE_WAIT_AFTER
setregid | SPLICE_F_MOVE | SYNC_FILE_RANGE_WAIT_BEFORE
setreuid | SPLICE_F_NONBLOCK | SYNC_FILE_RANGE_WRITE
SPLICE_F_GIFT | sync_file_range | Sysinfo

T

TCloneFunc | TEPoll_Event | TUser_Desc
TEPoll_Data | TSysInfo |

U

UD_CONTENTS_CODE | UD_LM | UD_USEABLE
UD_CONTENTS_DATA | UD_READ_EXEC_ONLY | user_cap_data
UD_CONTENTS_STACK | UD_SEG_32BIT | user_cap_header
UD_LIMIT_IN_PAGES | UD_SEG_NOT_PRESENT | user_desc


inotify_event

INotify event structure

Declaration

Source position: linux.pp line 376

type inotify_event = record
wd: cint; | Watch descriptor (as returned by inotify_add_watch)
mask: cuint32; | Event mask
cookie: cuint32; | Cookie, used to pair move events
len: cuint32; | Length of name
name: Char; | Filename for which a change is reported
end;

Description

inotify_event is the structure used to report changes in a directory. When reading a inotify file descriptor, one or more inotify_event records can be read from the file descriptor.

See also

baseunix.fpread | Read data from file descriptor
sysutils.FileRead | Read data from a filehandle in a buffer.


KB_84

IOCTL: Keyboard types: 84 keys

Declaration

Source position: linux.pp line 180

const KB_84 = 1;


KB_101

IOCTL: Keyboard types: 101 keys

Declaration

Source position: linux.pp line 181

const KB_101 = 2;


KB_OTHER

IOCTL: Keyboard types: other type

Declaration

Source position: linux.pp line 182

const KB_OTHER = 3;


KD_GRAPHICS

IOCTL: Tty modes: graphics mode

Declaration

Source position: linux.pp line 191

const KD_GRAPHICS = 1;


KD_TEXT

IOCTL: Tty modes: Text mode

Declaration

Source position: linux.pp line 190

const KD_TEXT = 0;


KD_TEXT0

IOCTL: Tty modes: Text mode (obsolete)

Declaration

Source position: linux.pp line 192

const KD_TEXT0 = 2;


KD_TEXT1

IOCTL: Tty modes: Text mode (obsolete)

Declaration

Source position: linux.pp line 193

const KD_TEXT1 = 3;


KDADDIO

IOCTL: add i/o port as valid

Declaration

Source position: linux.pp line 157

const KDADDIO = $4B34;


KDDELIO

IOCTL: delete i/o port as valid

Declaration

Source position: linux.pp line 158

const KDDELIO = $4B35;


KDDISABIO

IOCTL: disable i/o to video board

Declaration

Source position: linux.pp line 160

const KDDISABIO = $4B37;


KDENABIO

IOCTL: enable i/o to video board

Declaration

Source position: linux.pp line 159

const KDENABIO = $4B36;


KDFONTOP

IOCTL: font operations

Declaration

Source position: linux.pp line 177

const KDFONTOP = $4B72;


KDGETKEYCODE

IOCTL: read kernel keycode table entry

Declaration

Source position: linux.pp line 174

const KDGETKEYCODE = $4B4C;


KDGETLED

IOCTL: return current led state

Declaration

Source position: linux.pp line 154

const KDGETLED = $4B31;


KDGETMODE

IOCTL: get current mode

Declaration

Source position: linux.pp line 162

const KDGETMODE = $4B3B;


KDGKBDIACR

IOCTL: read kernel accent table

Declaration

Source position: linux.pp line 172

const KDGKBDIACR = $4B4A;


KDGKBTYPE

IOCTL: get keyboard type

Declaration

Source position: linux.pp line 156

const KDGKBTYPE = $4B33;


KDMAPDISP

IOCTL: map display into address space

Declaration

Source position: linux.pp line 163

const KDMAPDISP = $4B3C;


KDMKTONE

IOCTL: generate tone

Declaration

Source position: linux.pp line 153

const KDMKTONE = $4B30;


KDSETKEYCODE

IOCTL: write kernel keycode table entry

Declaration

Source position: linux.pp line 175

const KDSETKEYCODE = $4B4D;


KDSETLED

IOCTL: set led state

Declaration

Source position: linux.pp line 155

const KDSETLED = $4B32;


KDSETMODE

IOCTL: set text/graphics mode

Declaration

Source position: linux.pp line 161

const KDSETMODE = $4B3A;


KDSIGACCEPT

IOCTL: accept kbd generated signals

Declaration

Source position: linux.pp line 176

const KDSIGACCEPT = $4B4E;


KDSKBDIACR

IOCTL: write kernel accent table

Declaration

Source position: linux.pp line 173

const KDSKBDIACR = $4B4B;


KDUNMAPDISP

IOCTL: unmap display from address space

Declaration

Source position: linux.pp line 164

const KDUNMAPDISP = $4B3D;


KIOCSOUND

IOCTL: start/stop sound generation (0 for off)

Declaration

Source position: linux.pp line 152

const KIOCSOUND = $4B2F;


LED_CAP

IOCTL: LED_CAP : caps lock led

Declaration

Source position: linux.pp line 187

const LED_CAP = 4;


LED_NUM

IOCTL: LED_SCR : Num lock led

Declaration

Source position: linux.pp line 186

const LED_NUM = 2;


LED_SCR

IOCTL: LED_SCR : scroll lock led

Declaration

Source position: linux.pp line 185

const LED_SCR = 1;


LINUX_CAPABILITY_VERSION

Current capability version in use by kernel

Declaration

Source position: linux.pp line 332

const LINUX_CAPABILITY_VERSION = $19980330;


MAP_DENYWRITE

Read-only

Declaration

Source position: linux.pp line 203

const MAP_DENYWRITE = $800;


MAP_EXECUTABLE

Memory area is marked as executable

Declaration

Source position: linux.pp line 204

const MAP_EXECUTABLE = $1000;


MAP_GROWSDOWN

Memory map grows down, like stack

Declaration

Source position: linux.pp line 202

const MAP_GROWSDOWN = $100;


MAP_LOCKED

Memory pages are locked

Declaration

Source position: linux.pp line 205

const MAP_LOCKED = $2000;


MAP_NORESERVE

Do not check for reservations

Declaration

Source position: linux.pp line 206

const MAP_NORESERVE = $4000;


MAX_CLOCKS

Maximum number of clocks in the system

Declaration

Source position: linux.pp line 450

const MAX_CLOCKS = 16;


PEPoll_Data

Pointer to EPoll_Data record

Declaration

Source position: linux.pp line 264

type PEPoll_Data = ^EPoll_Data;


PEpoll_Event

Pointer to EPoll_Event type

Declaration

Source position: linux.pp line 272

type PEpoll_Event = ^EPoll_Event;


Pinotify_event

Pointer to inotify_event structure.

Declaration

Source position: linux.pp line 383

type Pinotify_event = ^inotify_event;


PIO_CMAP

IOCTL: Set colour palette on VGA+

Declaration

Source position: linux.pp line 151

const PIO_CMAP = $4B71;


PIO_FONT

IOCTL: Use font in expanded form.

Declaration

Source position: linux.pp line 146

const PIO_FONT = $4B61;


PIO_FONTRESET

IOCTL: Reset to default font

Declaration

Source position: linux.pp line 149

const PIO_FONTRESET = $4B6D;


PIO_FONTX

IOCTL: Set font in consolefontdesc record.

Declaration

Source position: linux.pp line 148

const PIO_FONTX = $4B6C;


PIO_SCRNMAP

IOCTL: put screen mapping table in kernel

Declaration

Source position: linux.pp line 166

const PIO_SCRNMAP = $4B41;


PIO_UNIMAP

IOCTL: put unicode-to-font mapping in kernel

Declaration

Source position: linux.pp line 170

const PIO_UNIMAP = $4B67;


PIO_UNIMAPCLR

IOCTL: clear table, possibly advise hash algorithm

Declaration

Source position: linux.pp line 171

const PIO_UNIMAPCLR = $4B68;


PIO_UNISCRNMAP

IOCTL: set full Unicode screen mapping

Declaration

Source position: linux.pp line 168

const PIO_UNISCRNMAP = $4B6A;


POLLMSG

Unused in Linux

Declaration

Source position: linux.pp line 127

const POLLMSG = $0400;


POLLRDHUP

Peer Shutdown/closed writing half of connection

Declaration

Source position: linux.pp line 129

const POLLRDHUP = $2000;


POLLREMOVE

Undocumented Linux extension of Poll

Declaration

Source position: linux.pp line 128

const POLLREMOVE = $1000;


PSysInfo

Pointer to TSysInfo record.

Declaration

Source position: linux.pp line 50

type PSysInfo = ^TSysInfo;


Puser_cap_data

Pointer to user_cap_data record

Declaration

Source position: linux.pp line 288

type Puser_cap_data = ^user_cap_data;


Puser_cap_header

Pointer to user_cap_header record

Declaration

Source position: linux.pp line 282

type Puser_cap_header = ^user_cap_header;


PUser_Desc

Pointer to User_Desc record

Declaration

Source position: linux.pp line 247

type PUser_Desc = ^user_desc;

Description

PUser_Desc is a pointer to the user_desc type.


SPLICE_F_GIFT

Pages spliced in are a gift

Declaration

Source position: linux.pp line 344

const SPLICE_F_GIFT = 8;


SPLICE_F_MORE

Expect more data

Declaration

Source position: linux.pp line 343

const SPLICE_F_MORE = 4;


SPLICE_F_MOVE

Move pages instead of copying

Declaration

Source position: linux.pp line 339

const SPLICE_F_MOVE = 1;


SPLICE_F_NONBLOCK

Don't block on pipe splicing operations

Declaration

Source position: linux.pp line 340

const SPLICE_F_NONBLOCK = 2;


TCloneFunc

Clone function prototype.

Declaration

Source position: linux.pp line 210

type TCloneFunc = function(

  args: pointer

):LongInt;


TEPoll_Data

Alias for EPoll_Data type

Declaration

Source position: linux.pp line 263

type TEPoll_Data = EPoll_Data;


TEPoll_Event

Alias for EPoll_Event type

Declaration

Source position: linux.pp line 271

type TEPoll_Event = EPoll_Event;


TSysInfo

Record with system information, used by the SysInfo call.

Declaration

Source position: linux.pp line 31

type TSysInfo = record
uptime: clong; | Number of seconds since boot.
loads: array [0..2] of culong; | 1, 5 and 15 minute load averages.
totalram: culong; | total amount of main memory.
freeram: culong; | amount of free memory.
sharedram: culong; | amount of shared memory.
bufferram: culong; | amount of memory used by buffers.
totalswap: culong; | total amount of swapspace.
freeswap: culong; | amount of free swapspace.
procs: cushort; | number of current processes.
pad: cushort; | Alignment padding
totalhigh: culong; | Total amount of high memory
freehigh: culong; | Total free amount of high memory in bytes
mem_unit: cuint; | Memory unit size in bytes
end;


TUser_Desc

Alias for user_desc record

Declaration

Source position: linux.pp line 246

type TUser_Desc = user_desc;

Description

TUser_Desc is an alias for the user_desc type.


UD_CONTENTS_CODE

TLS segment descriptor: Undocumented

Declaration

Source position: linux.pp line 231

const UD_CONTENTS_CODE = MODIFY_LDT_CONTENTS_CODE shl 1;


UD_CONTENTS_DATA

TLS segment descriptor: Undocumented

Declaration

Source position: linux.pp line 229

const UD_CONTENTS_DATA = MODIFY_LDT_CONTENTS_DATA shl 1;


UD_CONTENTS_STACK

TLS segment descriptor: Undocumented

Declaration

Source position: linux.pp line 230

const UD_CONTENTS_STACK = MODIFY_LDT_CONTENTS_STACK shl 1;


UD_LIMIT_IN_PAGES

TLS segment descriptor: Undocumented

Declaration

Source position: linux.pp line 233

const UD_LIMIT_IN_PAGES = $10;


UD_LM

TLS segment descriptor: Undocumented

Declaration

Source position: linux.pp line 236

const UD_LM = $80;


UD_READ_EXEC_ONLY

TLS segment descriptor: Undocumented

Declaration

Source position: linux.pp line 232

const UD_READ_EXEC_ONLY = $08;


UD_SEG_32BIT

TLS segment descriptor : Undocumented

Declaration

Source position: linux.pp line 228

const UD_SEG_32BIT = $01;


UD_SEG_NOT_PRESENT

TLS segment descriptor: Undocumented

Declaration

Source position: linux.pp line 234

const UD_SEG_NOT_PRESENT = $20;


UD_USEABLE

TLS segment descriptor: Undocumented

Declaration

Source position: linux.pp line 235

const UD_USEABLE = $40;


user_cap_data

Capability description record

Declaration

Source position: linux.pp line 289

type user_cap_data = record
effective: cuint32; | Capabilities effectively used by the kernel
permitted: cuint32; | Limiting set of capabilities
inheritable: cuint32; | Capabilities that will be inherited across exec calls.
end;

Description

user_cap_data describes the set of capabilities for the indicated thread.

See also

user_cap_header | Root user capabilities header
capget | Return the capabilities for the indicated thread
capset | Set the capabilities for the indicated thread


user_cap_header

Root user capabilities header

Declaration

Source position: linux.pp line 283

type user_cap_header = record
version: cuint32; | Version of protocol
pid: cint; | Thread ID to apply/get capabilities from
end;

Description

user_cap_header describes the root user capabilities for the current thread, as set by capget and capset

See also

capget | Return the capabilities for the indicated thread
capset | Set the capabilities for the indicated thread


user_desc

TLS segment descriptor

Declaration

Source position: linux.pp line 239

type user_desc = record
entry_number: cuint; | TLS segment descriptor: Undocumented
base_addr: cuint; | TLS segment descriptor: Undocumented
limit: cuint; | TLS segment descriptor: Undocumented
flags: cuint; | TLS segment descriptor: Undocumented
end;

Description

user_desc is the TLS (Thread Local Storage) segment descriptor used in the Clone call. It should not be used, as it contains highly kernel-specific data.


AllowReuseOfLineInfoData

Speed up LineInfo reading by reusing already-read information

Declaration

Source position: lnfodwrf.pp line 43

var AllowReuseOfLineInfoData: Boolean = True;

Description

AllowReuseOfLineInfoData can be set to True to keep the last opened file open. When regularly creating backtraces (e.g. in a program log), this will significantly speed up operations.

See also

CloseDwarf

Close DWARF info file descriptor


CodePointer

Declaration

Source position: lnfodwrf.pp line 31

type CodePointer = Pointer;


Reference for unit 'lnfodwrf'

Return adress line information

uses

  System;

The system unit

Overview

The lnfodwrf provides a routine that reads the debug information of an executable (if any exists) and returns source code information about this address. It works with DWARF debug information. Note that this unit is not thread-safe, and that its behaviour is undefined if multiple threads try to write a backtrace at the same time.

For stabs debug information, the lineinfo unit must be used.


[Overview][Types][Procedures and functions][Variables][Index] Reference for unit 'lnfodwrf' (#rtl)

Reference for unit 'lnfodwrf': Types

CodePointer


Reference for unit 'lnfodwrf': Procedures and functions

CloseDwarf | Close DWARF info file descriptor
DwarfBackTraceStr | Get a backtrace from an address
GetLineInfo | Return source line information about an address.


Reference for unit 'lnfodwrf': Variables

AllowReuseOfLineInfoData

Speed up LineInfo reading by reusing already-read information


Index of all identifiers in unit 'lnfodwrf'

A C D G

A

AllowReuseOfLineInfoData

C

CloseDwarf CodePointer

D

DwarfBackTraceStr

G

GetLineInfo


Angle unit conversion

Routines to convert angles between different angle units.

Name | Description
cycletorad | convert cycles to radians
degtograd | convert degrees to grads
degtorad | convert degrees to radians
gradtodeg | convert grads to degrees
gradtorad | convert grads to radians
radtocycle | convert radians to cycles
radtodeg | convert radians to degrees
radtograd | convert radians to grads


Cash flow functions

The cash flow functions in the math unit resolve the following equation:

FV + PV * q^n + PMT (q^n - 1) / (q - 1) = 0

In this formula, the following variables are present:

FV
Future value
PV
Present value
PMT
Payment per period
n
Number of payments (number of periods)
q>
Interest Rate (return rate)

The financial functions FutureValue, NumberOfPeriods, Payment, PresentValue and InterestRate solve this equation for one of the variables, when the other variables are known.

See also

FutureValue | Calculate the future value of an investment.
NumberOfPeriods | Calculate the number of periods for an investment
Payment | Calculate the payment for an investment
PresentValue | Calculate the present value given the future value of an investment.
TPaymentTime | Type used in financial (interest) calculations.


Exponential and logarithmic functions

Name | Description
intpower | Raise float to integer power
ldexp | Calculate $2^p x$
lnxp1 | calculate log(x+1)
log10 | calculate 10-base log
log2 | calculate 2-base log
logn | calculate N-base log
power | raise float to arbitrary power


Float

Float type used in all calls

Declaration

Source position: math.pp line 59

type Float = MaxFloatType;

Description

All calculations are done with the Float type which is the largest float type available for the current CPU. This allows to recompile the unit with a different float type to obtain a desired precision. The pointer type PFloat is used in functions that accept an array of values of arbitrary length.


Geometrical functions

Name | Description
hypot | Hypotenuse of triangle
norm | Euclidian norm


Hyperbolic functions

Name | Description
arcosh | caculate reverse hyperbolic cosine
arsinh | caculate reverse hyperbolic sine
artanh | caculate reverse hyperbolic tangent
cosh | calculate hyperbolic cosine
sinh | calculate hyperbolic sine
tanh | calculate hyperbolic tangent


Reference for unit 'math'

Additional mathematical routines.

uses

  System;

The system unit

Overview

This document describes the math unit. The math unit was initially written by Florian Klaempfl. It provides mathematical functions which aren't covered by the system unit.

This chapter starts out with a definition of all types and constants that are defined, after which an overview is presented of the available functions, grouped by category, and the last part contains a complete explanation of each function.

The following things must be taken into account when using this unit:

  1. This unit is compiled in Object Pascal mode so all integers are 32 bit.
  2. Some overloaded functions exist for data arrays of integers and floats. When using the address operator (@) to pass an array of data to such a function, make sure the address is typecasted to the right type, or turn on the 'typed address operator' feature. failing to do so, will cause the compiler not be able to decide which function you want to call.

Related topics

CashFlowFunctions | Cash flow functions
GeometricalRoutines | Geometrical functions
StatisticalRoutines | Statistical functions
NumberConversionRoutines | Number converting
ExpLogRoutines | Exponential and logarithmic functions
HyperbolicRoutines | Hyperbolic functions
TrigoniometricRoutines | Trigoniometric functions
AngleConversionRoutines | Angle unit conversion
MinMaxRoutines | Min/max determination


Reference for unit 'math': Types

Float

Float type used in all calls


Index of all identifiers in unit 'math'

F

F

Float


Min/max determination

Functions to determine the minimum or maximum of numbers:

Name | Description
max | Maximum of 2 values
maxIntValue | Maximum of an array of integer values
maxvalue | Maximum of an array of values
min | Minimum of 2 values
minIntValue | Minimum of an array of integer values
minvalue | Minimum of an array of values


Number converting

Name | Description
ceil | Round to infinity
floor | Round to minus infinity
frexp | Return mantissa and exponent


Statistical functions

Name | Description
mean | Mean of values
meanandstddev | Mean and standard deviation of values
momentskewkurtosis | Moments, skew and kurtosis
popnstddev | Population standarddeviation
popnvariance | Population variance
randg | Gaussian distributed randum value
stddev | Standard deviation
sum | Sum of values
sumofsquares | Sum of squared values
sumsandsquares | Sum of values and squared values
totalvariance | Total variance of values
variance | variance of values


Trigoniometric functions

Name | Description
arccos | calculate reverse cosine
arcsin | calculate reverse sine
arctan2 | calculate reverse tangent
cotan | calculate cotangent
sincos | calculate sine and cosine
tan | calculate tangent


Reference for unit 'matrix'

Two, three, four dimensional matrix unit

uses

  System;

The system unit

Overview

The unit matrix is a unit that provides objects for the common two, three and four dimensional vectors matrixes. These vectors and matrixes are very common in computer graphics and are often implemented from scratch by programmers while every implementation provides exactly the same functionality.

It makes therefore sense to provide this functionality in the runtime library. This eliminates the need for programmers to reinvent the wheel and also allows libraries that use matrix operations to become more compatible.

The matrix unit does not provide n-dimensional matrixes. The functionality needs of a general matrix unit varies from application to application; one can think of reduced memory usage tricks for matrixes that only have data around the diagonal etc., desire for parallelization etc. etc. It is believed that programmers that do use n-dimensional matrices would not necessarily benfit from such a unit in the runtime library.

Design goals:

  • Provide common dimensions, two three and four.
  • Provide multiple floating point precisions, single, double, extended.
  • Simple trivial binary representation; it is possible to typecast vectors into other implementations that use the same trivial representation.
  • No dynamic memory management in the background. It must be possible to write expressions like matrix A * B * C without worrying about memory management.

Design decisions:

  • Class object model is ruled out. The objects object model, without virtual methods, is suitable.
  • Operator overloading is a good way to allow programmers to write matrix expressions.
  • 3 dimensions * 3 precision means 9 vector and 9 matrix objects. Macro's have been used in the source to take care of this.


Reference for unit 'matrix': Types

Tmatrix2_double_data | Internal data of Tmatrix2_double
Tmatrix2_extended_data | Internal data of Tmatrix2_extended
Tmatrix2_single_data | Internal data of Tmatrix2_single
Tmatrix3_double_data | Internal data of Tmatrix3_double
Tmatrix3_extended_data | Internal data of Tmatrix3_extended
Tmatrix3_single_data | Internal data of Tmatrix3_single
Tmatrix4_double_data | Internal data of Tmatrix4_double
Tmatrix4_extended_data | Internal data of Tmatrix4_extended
Tmatrix4_single_data | Internal data of Tmatrix4_single
Tvector2_double_data | Internal data of Tvector2_double
Tvector2_extended_data | Internal data of Tvector2_extended
Tvector2_single_data | Internal data of Tvector2_single
Tvector3_double_data | Internal data of Tvector3_double
Tvector3_extended_data | Internal data of Tvector3_extended
Tvector3_single_data | Internal data of Tvector3_single
Tvector4_double_data | Internal data of Tvector4_double
Tvector4_extended_data | Internal data of Tvector4_extended
Tvector4_single_data | Internal data of Tvector4_single


Reference for unit 'matrix': Classes

Tmatrix2_double | Double precision matrix of two scalars
Tmatrix2_extended | Extended precision matrix of two scalars
Tmatrix2_single | Single precision matrix of two scalars
Tmatrix3_double | Double precision matrix of three scalars
Tmatrix3_extended | Extended precision matrix of three scalars
Tmatrix3_single | Single precision matrix of three scalars
Tmatrix4_double | Double precision matrix of four scalars
Tmatrix4_extended | Extended precision matrix of extended scalars
Tmatrix4_single | Single precision matrix of four scalars
Tvector2_double | Double precision vector of two scalars
Tvector2_extended | Extended precision vector of two scalars
Tvector2_single | Single precision vector of two scalars
Tvector3_double | Double precision vector of three scalars
Tvector3_extended | Extended precision vector of three scalars
Tvector3_single | Single precision vector of three scalars
Tvector4_double | Double precision vector of four scalars
Tvector4_extended | Extended precision vector of extended scalars
Tvector4_single | Single precision vector of four scalars


Reference for unit 'matrix': Procedures and functions

add(Tmatrix2_double,Double):Tmatrix2_double | Add scalar to two-dimensional double precision matrix
add(Tmatrix2_double,Tmatrix2_double):Tmatrix2_double | Add two two-dimensional double precision matrices together.
add(Tmatrix2_extended,extended):Tmatrix2_extended | Add scalar to two-dimensional extended precision matrix
add(Tmatrix2_extended,Tmatrix2_extended):Tmatrix2_extended | Add two two-dimensional extended precision matrices together.
add(Tmatrix2_single,single):Tmatrix2_single | Add scalar to two-dimensional single precision matrix
add(Tmatrix2_single,Tmatrix2_single):Tmatrix2_single | Add two two-dimensional single precision matrices together.
add(Tmatrix3_double,Double):Tmatrix3_double | Add scalar to three-dimensional double precision matrix
add(Tmatrix3_double,Tmatrix3_double):Tmatrix3_double | Add two three-dimensional double precision matrices together.
add(Tmatrix3_extended,extended):Tmatrix3_extended | Add scalar to three-dimensional extended precision matrix
add(Tmatrix3_extended,Tmatrix3_extended):Tmatrix3_extended | Add two three-dimensional extended precision matrices together.
add(Tmatrix3_single,single):Tmatrix3_single | Add scalar to three-dimensional single precision matrix
add(Tmatrix3_single,Tmatrix3_single):Tmatrix3_single | Add two three-dimensional single precision matrices together.
add(Tmatrix4_double,Double):Tmatrix4_double | Add scalar to four-dimensional double precision matrix
add(Tmatrix4_double,Tmatrix4_double):Tmatrix4_double | Add two four-dimensional double precision matrices together.
add(Tmatrix4_extended,extended):Tmatrix4_extended | Add scalar to four-dimensional extended precision matrix
add(Tmatrix4_extended,Tmatrix4_extended):Tmatrix4_extended | Add two four-dimensional extended precision matrices together.
add(Tmatrix4_single,single):Tmatrix4_single | Add scalar to four-dimensional single precision matrix
add(Tmatrix4_single,Tmatrix4_single):Tmatrix4_single | Add two four-dimensional single precision matrices together.
add(Tvector2_double,Double):Tvector2_double | Add scalar to two-dimensional double precision vector
add(Tvector2_double,Tvector2_double):Tvector2_double | Add two-dimensional double precision vectors together
add(Tvector2_extended,extended):Tvector2_extended | Add scalar to two-dimensional extended precision vector
add(Tvector2_extended,Tvector2_extended):Tvector2_extended | Add two-dimensional extended precision vectors together
add(Tvector2_single,single):Tvector2_single | Add scalar to two-dimensional single precision vector
add(Tvector2_single,Tvector2_single):Tvector2_single | Add two-dimensional single precision vectors together
add(Tvector3_double,Double):Tvector3_double | Add scalar to three-dimensional double precision vector
add(Tvector3_double,Tvector3_double):Tvector3_double | Add three-dimensional double precision vectors together
add(Tvector3_extended,extended):Tvector3_extended | Add scalar to three-dimensional extended precision vector
add(Tvector3_extended,Tvector3_extended):Tvector3_extended | Add three-dimensional extended precision vectors together
add(Tvector3_single,single):Tvector3_single | Add scalar to three-dimensional single precision vector
add(Tvector3_single,Tvector3_single):Tvector3_single | Add three-dimensional extended precision vectors together
add(Tvector4_double,Double):Tvector4_double | Add scalar to four-dimensional double precision vector
add(Tvector4_double,Tvector4_double):Tvector4_double | Add four-dimensional double precision vectors together
add(Tvector4_extended,extended):Tvector4_extended | Add scalar to four-dimensional extended precision vector
add(Tvector4_extended,Tvector4_extended):Tvector4_extended | Add four-dimensional extended precision vectors together
add(Tvector4_single,single):Tvector4_single | Add scalar to four-dimensional single precision vector
add(Tvector4_single,Tvector4_single):Tvector4_single | Add four-dimensional single precision vectors together
assign(Tmatrix2_double):Tmatrix2_extended | Allow assignment of two-dimensional double precision matrix to two-dimensional extended precision matrix
assign(Tmatrix2_double):Tmatrix2_single | Allow assignment of two-dimensional double precision matrix to two-dimensional single precision matrix
assign(Tmatrix2_double):Tmatrix3_double | Allow assignment of two-dimensional double precision matrix to three-dimensional double precision matrix
assign(Tmatrix2_double):Tmatrix3_extended | Allow assignment of two-dimensional double precision matrix to three-dimensional extended precision matrix
assign(Tmatrix2_double):Tmatrix3_single | Allow assignment of two-dimensional single precision matrix to three-dimensional single precision matrix
assign(Tmatrix2_double):Tmatrix4_double | Allow assignment of two-dimensional double precision matrix to four-dimensional double precision matrix
assign(Tmatrix2_double):Tmatrix4_extended | Allow assignment of two-dimensional double precision matrix to four-dimensional extended precision matrix
assign(Tmatrix2_double):Tmatrix4_single | Allow assignment of two-dimensional double precision matrix to four-dimensional single precision matrix
assign(Tmatrix2_extended):Tmatrix2_double | Allow assignment of two-dimensional extended precision matrix to two-dimensional double precision matrix
assign(Tmatrix2_extended):Tmatrix2_single | Allow assignment of two-dimensional extended precision matrix to two-dimensional single precision matrix
assign(Tmatrix2_extended):Tmatrix3_double | Allow assignment of two-dimensional extended precision matrix to three-dimensional double precision matrix
assign(Tmatrix2_extended):Tmatrix3_extended | Allow assignment of two-dimensional extended precision matrix to three-dimensional extended precision matrix
assign(Tmatrix2_extended):Tmatrix3_single | Allow assignment of two-dimensional extended precision matrix to three-dimensional single precision matrix
assign(Tmatrix2_extended):Tmatrix4_double | Allow assignment of two-dimensional extended precision matrix to four-dimensional double precision matrix
assign(Tmatrix2_extended):Tmatrix4_extended | Allow assignment of two-dimensional extended precision matrix to four-dimensional extended precision matrix
assign(Tmatrix2_extended):Tmatrix4_single | Allow assignment of two-dimensional extended precision matrix to four-dimensional single precision matrix
assign(Tmatrix2_single):Tmatrix2_double | Allow assignment of two-dimensional single precision matrix to two-dimensional double precision matrix
assign(Tmatrix2_single):Tmatrix2_extended | Allow assignment of two-dimensional single precision matrix to two-dimensional extended precision matrix
assign(Tmatrix2_single):Tmatrix3_double | Allow assignment of two-dimensional single precision matrix to three-dimensional double precision matrix
assign(Tmatrix2_single):Tmatrix3_extended | Allow assignment of two-dimensional single precision matrix to three-dimensional extended precision matrix
assign(Tmatrix2_single):Tmatrix3_single | Allow assignment of two-dimensional single precision matrix to three-dimensional single precision matrix
assign(Tmatrix2_single):Tmatrix4_double | Allow assignment of two-dimensional single precision matrix to four-dimensional double precision matrix
assign(Tmatrix2_single):Tmatrix4_extended | Allow assignment of two-dimensional single precision matrix to four-dimensional extended precision matrix
assign(Tmatrix2_single):Tmatrix4_single | Allow assignment of two-dimensional single precision matrix to four-dimensional single precision matrix
assign(Tmatrix3_double):Tmatrix2_double | Allow assignment of three-dimensional double precision matrix to two-dimensional double precision matrix
assign(Tmatrix3_double):Tmatrix2_extended | Allow assignment of three-dimensional double precision matrix to two-dimensional extended precision matrix
assign(Tmatrix3_double):Tmatrix2_single | Allow assignment of three-dimensional double precision matrix to two-dimensional single precision matrix
assign(Tmatrix3_double):Tmatrix3_extended | Allow assignment of three-dimensional double precision matrix to three-dimensional extended precision matrix
assign(Tmatrix3_double):Tmatrix3_single | Allow assignment of three-dimensional double precision matrix to three-dimensional single precision matrix
assign(Tmatrix3_double):Tmatrix4_double | Allow assignment of three-dimensional double precision matrix to four-dimensional double precision matrix
assign(Tmatrix3_double):Tmatrix4_extended | Allow assignment of three-dimensional double precision matrix to four-dimensional extended precision matrix
assign(Tmatrix3_double):Tmatrix4_single | Allow assignment of three-dimensional double precision matrix to four-dimensional single precision matrix
assign(Tmatrix3_extended):Tmatrix2_double | Allow assignment of three-dimensional extended precision matrix to two-dimensional double precision matrix
assign(Tmatrix3_extended):Tmatrix2_extended | Allow assignment of three-dimensional extended precision matrix to two-dimensional extended precision matrix
assign(Tmatrix3_extended):Tmatrix2_single | Allow assignment of three-dimensional extended precision matrix to two-dimensional single precision matrix
assign(Tmatrix3_extended):Tmatrix3_double | Allow assignment of three-dimensional extended precision matrix to three-dimensional double precision matrix
assign(Tmatrix3_extended):Tmatrix3_single | Allow assignment of three-dimensional extended precision matrix to three-dimensional single precision matrix
assign(Tmatrix3_extended):Tmatrix4_double | Allow assignment of three-dimensional extended precision matrix to four-dimensional double precision matrix
assign(Tmatrix3_extended):Tmatrix4_extended | Allow assignment of three-dimensional extended precision matrix to four-dimensional extended precision matrix
assign(Tmatrix3_extended):Tmatrix4_single | Allow assignment of three-dimensional extended precision matrix to four-dimensional single precision matrix
assign(Tmatrix3_single):Tmatrix2_double | Allow assignment of three-dimensional single precision matrix to two-dimensional double precision matrix
assign(Tmatrix3_single):Tmatrix2_extended | Allow assignment of three-dimensional single precision matrix to two-dimensional extended precision matrix
assign(Tmatrix3_single):Tmatrix2_single | Allow assignment of three-dimensional single precision matrix to two-dimensional single precision matrix
assign(Tmatrix3_single):Tmatrix3_double | Allow assignment of three-dimensional single precision matrix to three-dimensional double precision matrix
assign(Tmatrix3_single):Tmatrix3_extended | Allow assignment of three-dimensional single precision matrix to three-dimensional extended precision matrix
assign(Tmatrix3_single):Tmatrix4_double | Allow assignment of three-dimensional single precision matrix to four-dimensional double precision matrix
assign(Tmatrix3_single):Tmatrix4_extended | Allow assignment of three-dimensional single precision matrix to four-dimensional extended precision matrix
assign(Tmatrix3_single):Tmatrix4_single | Allow assignment of three-dimensional single precision matrix to four-dimensional single precision matrix
assign(Tmatrix4_double):Tmatrix2_double | Allow assignment of four-dimensional double precision matrix to two-dimensional double precision matrix
assign(Tmatrix4_double):Tmatrix2_extended | Allow assignment of four-dimensional double precision matrix to two-dimensional extended precision matrix
assign(Tmatrix4_double):Tmatrix2_single | Allow assignment of four-dimensional double precision matrix to two-dimensional single precision matrix
assign(Tmatrix4_double):Tmatrix3_double | Allow assignment of four-dimensional double precision matrix to three-dimensional double precision matrix
assign(Tmatrix4_double):Tmatrix3_extended | Allow assignment of four-dimensional double precision matrix to three-dimensional extended precision matrix
assign(Tmatrix4_double):Tmatrix3_single | Allow assignment of four-dimensional double precision matrix to three-dimensional single precision matrix
assign(Tmatrix4_double):Tmatrix4_extended | Allow assignment of four-dimensional double precision matrix to four-dimensional extended precision matrix
assign(Tmatrix4_double):Tmatrix4_single | Allow assignment of four-dimensional single precision matrix to four-dimensional single precision matrix
assign(Tmatrix4_extended):Tmatrix2_double | Allow assignment of four-dimensional extended precision matrix to two-dimensional double precision matrix
assign(Tmatrix4_extended):Tmatrix2_extended | Allow assignment of four-dimensional extended precision matrix to two-dimensional extended precision matrix
assign(Tmatrix4_extended):Tmatrix2_single | Allow assignment of four-dimensional extended precision matrix to two-dimensional single precision matrix
assign(Tmatrix4_extended):Tmatrix3_double | Allow assignment of four-dimensional extended precision matrix to three-dimensional double precision matrix
assign(Tmatrix4_extended):Tmatrix3_extended | Allow assignment of four-dimensional extended precision matrix to three-dimensional extended precision matrix
assign(Tmatrix4_extended):Tmatrix3_single | Allow assignment of four-dimensional extended precision matrix to three-dimensional single precision matrix
assign(Tmatrix4_extended):Tmatrix4_double | Allow assignment of four-dimensional extended precision matrix to four-dimensional double precision matrix
assign(Tmatrix4_extended):Tmatrix4_single | Allow assignment of four-dimensional extended precision matrix to four-dimensional single precision matrix
assign(Tmatrix4_single):Tmatrix2_double | Allow assignment of four-dimensional single precision matrix to two-dimensional double precision matrix
assign(Tmatrix4_single):Tmatrix2_extended | Allow assignment of four-dimensional single precision matrix to two-dimensional extended precision matrix
assign(Tmatrix4_single):Tmatrix2_single | Allow assignment of four-dimensional single precision matrix to two-dimensional single precision matrix
assign(Tmatrix4_single):Tmatrix3_double | Allow assignment of four-dimensional single precision matrix to three-dimensional double precision matrix
assign(Tmatrix4_single):Tmatrix3_extended | Allow assignment of four-dimensional single precision matrix to three-dimensional extended precision matrix
assign(Tmatrix4_single):Tmatrix3_single | Allow assignment of four-dimensional single precision matrix to three-dimensional single precision matrix
assign(Tmatrix4_single):Tmatrix4_double | Allow assignment of four-dimensional single precision matrix to four-dimensional double precision matrix
assign(Tmatrix4_single):Tmatrix4_extended | Allow assignment of four-dimensional single precision matrix to four-dimensional extended precision matrix
assign(Tvector2_double):Tvector2_extended | Allow assignment of double precision vector to extended precision vector
assign(Tvector2_double):Tvector2_single | Allow assignment of double precision vector to single precision vector
assign(Tvector2_double):Tvector3_double | Allow assignment of two-dimensional double precision vector to three-dimensional double precision vector
assign(Tvector2_double):Tvector3_extended | Allow assignment of two-dimensional double precision vector to three-dimensional extended precision vector
assign(Tvector2_double):Tvector3_single | Allow assignment of two-dimensional double precision vector to three-dimensional single precision vector
assign(Tvector2_double):Tvector4_double | Allow assignment of two-dimensional double precision vector to four-dimensional double precision vector
assign(Tvector2_double):Tvector4_extended | Allow assignment of two-dimensional double precision vector to four-dimensional extended precision vector
assign(Tvector2_double):Tvector4_single | Allow assignment of two-dimensional double precision vector to four-dimensional single precision vector
assign(Tvector2_extended):Tvector2_double | Allow assignment of extended precision vector to double precision vector
assign(Tvector2_extended):Tvector2_single | Allow assignment of extended precision vector to single precision vector
assign(Tvector2_extended):Tvector3_double | Allow assignment of two-dimensional extended precision vector to three-dimensional double precision vector
assign(Tvector2_extended):Tvector3_extended | Allow assignment of two-dimensional extened precision vector to three-dimensional extended precision vector
assign(Tvector2_extended):Tvector3_single | Allow assignment of two-dimensional extended precision vector to three-dimensional single precision vector
assign(Tvector2_extended):Tvector4_double | Allow assignment of two-dimensional extended precision vector to four-dimensional double precision vector
assign(Tvector2_extended):Tvector4_extended | Allow assignment of two-dimensiona extended precision vector to four-dimensional extended precision vector
assign(Tvector2_extended):Tvector4_single | Allow assignment of two-dimensional extended precision vector to four-dimensional single precision vector
assign(Tvector2_single):Tvector2_double | Allow assignment of single precision vector to double precision vector
assign(Tvector2_single):Tvector2_extended | Allow assignment of single precision vector to extended precision vector
assign(Tvector2_single):Tvector3_double | Allow assignment of two-dimensional single precision vector to three-dimensional double precision vector
assign(Tvector2_single):Tvector3_extended | Allow assignment of two-dimensional single precision vector to three-dimensional extended precision vector
assign(Tvector2_single):Tvector3_single | Allow assignment of two-dimensional single precision vector to three-dimensional single precision vector
assign(Tvector2_single):Tvector4_double | Allow assignment of two-dimensional single precision vector to four-dimensional double precision vector
assign(Tvector2_single):Tvector4_extended | Allow assignment of two-dimensional single precision vector to four-dimensional extended precision vector
assign(Tvector2_single):Tvector4_single | Allow assignment of two-dimensional single precision vector to four-dimensional single precision vector
assign(Tvector3_double):Tvector2_double | Allow assignment of three-dimensional double precision vector to two-dimensional double precision vector
assign(Tvector3_double):Tvector2_extended | Allow assignment of three-dimensional double precision vector to two-dimensional extended precision vector
assign(Tvector3_double):Tvector2_single | Allow assignment of three-dimensional double precision vector to two-dimensional single precision vector
assign(Tvector3_double):Tvector3_extended | Allow assignment of three-dimensional double precision vector to three-dimensional extended precision vector
assign(Tvector3_double):Tvector3_single | Allow assignment of three-dimensional double precision vector to three-dimensional single precision vector
assign(Tvector3_double):Tvector4_double | Allow assignment of three-dimensional double precision vector to four-dimensional double precision vector
assign(Tvector3_double):Tvector4_extended | Allow assignment of three-dimensional double precision vector to four-dimensional extended precision vector
assign(Tvector3_double):Tvector4_single | Allow assignment of three-dimensional double precision vector to four-dimensional single precision vector
assign(Tvector3_extended):Tvector2_double | Allow assignment of three-dimensional extended precision vector to two-dimensional double precision vector
assign(Tvector3_extended):Tvector2_extended | Allow assignment of three-dimensional extended precision vector to two-dimensional extended precision vector
assign(Tvector3_extended):Tvector2_single | Allow assignment of three-dimensional extended precision vector to two-dimensional single precision vector
assign(Tvector3_extended):Tvector3_double | Allow assignment of three-dimensional extended precision vector to three-dimensional double precision vector
assign(Tvector3_extended):Tvector3_single | Allow assignment of three-dimensional single precision vector to three-dimensional double precision vector
assign(Tvector3_extended):Tvector4_double | Allow assignment of three-dimensional extended precision vector to four-dimensional double precision vector
assign(Tvector3_extended):Tvector4_extended | Allow assignment of three-dimensional extended precision vector to four-dimensional extended precision vector
assign(Tvector3_extended):Tvector4_single | Allow assignment of three-dimensional extended precision vector to four-dimensional single precision vector
assign(Tvector3_single):Tvector2_double | Allow assignment of three-dimensional single precision vector to two-dimensional double precision vector
assign(Tvector3_single):Tvector2_extended | Allow assignment of three-dimensional single precision vector to two-dimensional extended precision vector
assign(Tvector3_single):Tvector2_single | Allow assignment of three-dimensional single precision vector to two-dimensional single precision vector
assign(Tvector3_single):Tvector3_double | Allow assignment of three-dimensional single precision vector to three-dimensional double precision vector
assign(Tvector3_single):Tvector3_extended | Allow assignment of three-dimensional single precision vector to three-dimensional extended precision vector
assign(Tvector3_single):Tvector4_double | Allow assignment of three-dimensional single precision vector to four-dimensional double precision vector
assign(Tvector3_single):Tvector4_extended | Allow assignment of three-dimensional single precision vector to four-dimensional extended precision vector
assign(Tvector3_single):Tvector4_single | Allow assignment of three-dimensional single precision vector to four-dimensional single precision vector
assign(Tvector4_double):Tvector2_double | Allow assignment of four-dimensional double precision vector to two-dimensional double precision vector
assign(Tvector4_double):Tvector2_extended | Allow assignment of four-dimensional double precision vector to two-dimensional extended precision vector
assign(Tvector4_double):Tvector2_single | Allow assignment of four-dimensional double precision vector to two-dimensional single precision vector
assign(Tvector4_double):Tvector3_double | Allow assignment of four-dimensional double precision vector to three-dimensional double precision vector
assign(Tvector4_double):Tvector3_extended | Allow assignment of four-dimensional double precision vector to three-dimensional extended precision vector
assign(Tvector4_double):Tvector3_single | Allow assignment of four-dimensional double precision vector to three-dimensional single precision vector
assign(Tvector4_double):Tvector4_extended | Allow assignment of four-dimensional single precision vector to four-dimensional extended precision vector
assign(Tvector4_double):Tvector4_single | Allow assignment of four-dimensional double precision vector to four-dimensional single precision vector
assign(Tvector4_extended):Tvector2_double | Allow assignment of four-dimensional extended precision vector to two-dimensional double precision vector
assign(Tvector4_extended):Tvector2_extended | Allow assignment of four-dimensional extended precision vector to two-dimensional extended precision vector
assign(Tvector4_extended):Tvector2_single | Allow assignment of four-dimensional extended precision vector to two-dimensional single precision vector
assign(Tvector4_extended):Tvector3_double | Allow assignment of four-dimensional extended precision vector to three-dimensional double precision vector
assign(Tvector4_extended):Tvector3_extended | Allow assignment of four-dimensional extended precision vector to three-dimensional extended precision vector
assign(Tvector4_extended):Tvector3_single | Allow assignment of four-dimensional extended precision vector to three-dimensional single precision vector
assign(Tvector4_extended):Tvector4_double | Allow assignment of four-dimensional single precision vector to four-dimensional double precision vector
assign(Tvector4_extended):Tvector4_single | Allow assignment of four-dimensional extended precision vector to four-dimensional single precision vector
assign(Tvector4_single):Tvector2_double | Allow assignment of four-dimensional single precision vector to two-dimensional double precision vector
assign(Tvector4_single):Tvector2_extended | Allow assignment of four-dimensional single precision vector to two-dimensional extended precision vector
assign(Tvector4_single):Tvector2_single | Allow assignment of four-dimensional single precision vector to two-dimensional single precision vector
assign(Tvector4_single):Tvector3_double | Allow assignment of four-dimensional single precision vector to three-dimensional double precision vector
assign(Tvector4_single):Tvector3_extended | Allow assignment of four-dimensional single precision vector to three-dimensional extended precision vector
assign(Tvector4_single):Tvector3_single | Allow assignment of four-dimensional single precision vector to three-dimensional single precision vector
assign(Tvector4_single):Tvector4_double | Allow assignment of four-dimensional single precision vector to four-dimensional double precision vector
assign(Tvector4_single):Tvector4_extended | Allow assignment of four-dimensional single precision vector to four-dimensional extended precision vector
divide(Tmatrix2_double,Double):Tmatrix2_double | Divide a two-dimensional single precision matrix by a scalar
divide(Tmatrix2_extended,extended):Tmatrix2_extended | Divide a two-dimensional single precision matrix by a scalar
divide(Tmatrix2_single,single):Tmatrix2_single | Divide a two-dimensional single precision matrix by a scalar
divide(Tmatrix3_double,Double):Tmatrix3_double | Divide a two-dimensional single precision matrix by a scalar
divide(Tmatrix3_extended,extended):Tmatrix3_extended | Divide a two-dimensional single precision matrix by a scalar
divide(Tmatrix3_single,single):Tmatrix3_single | Divide a two-dimensional single precision matrix by a scalar
divide(Tmatrix4_double,Double):Tmatrix4_double | Divide a two-dimensional single precision matrix by a scalar
divide(Tmatrix4_extended,extended):Tmatrix4_extended | Divide a two-dimensional single precision matrix by a scalar
divide(Tmatrix4_single,single):Tmatrix4_single | Divide a two-dimensional single precision matrix by a scalar
divide(Tvector2_double,Double):Tvector2_double | Divide a two-dimensional double precision vector by a scalar
divide(Tvector2_extended,extended):Tvector2_extended | Divide a two-dimensional extended precision vector by a scalar
divide(Tvector2_single,single):Tvector2_single | Divide a two-dimensional single precision vector by a scalar
divide(Tvector3_double,Double):Tvector3_double | Divide a three-dimensional double precision vector by a scalar
divide(Tvector3_extended,extended):Tvector3_extended | Divide a three-dimensional extended precision vector by a scalar
divide(Tvector3_single,single):Tvector3_single | Divide a three-dimensional single precision vector by a scalar
divide(Tvector4_double,Double):Tvector4_double | Divide a four-dimensional double precision vector by a scalar
divide(Tvector4_extended,extended):Tvector4_extended | Divide a four-dimensional extended precision vector by a scalar
divide(Tvector4_single,single):Tvector4_single | Divide a four-dimensional single precision vector by a scalar
multiply(Tmatrix2_double,Double):Tmatrix2_double | Multiply a two-dimensional double precision matrix by a scalar
multiply(Tmatrix2_double,Tmatrix2_double):Tmatrix2_double | Give product of two two-dimensional double precision matrices
multiply(Tmatrix2_double,Tvector2_double):Tvector2_double | Give product of a two-dimendional double precision matrix and vector
multiply(Tmatrix2_extended,extended):Tmatrix2_extended | Multiply a two-dimensional extended precision matrix by a scalar
multiply(Tmatrix2_extended,Tmatrix2_extended):Tmatrix2_extended | Give product of two two-dimensional extended precision matrices
multiply(Tmatrix2_extended,Tvector2_extended):Tvector2_extended | Give product of a two-dimendional extended precision matrix and vector
multiply(Tmatrix2_single,single):Tmatrix2_single | Multiply a two-dimensional single precision matrix by a scalar
multiply(Tmatrix2_single,Tmatrix2_single):Tmatrix2_single | Give product of two two-dimensional single precision matrices
multiply(Tmatrix2_single,Tvector2_single):Tvector2_single | Give product of a two-dimendional single precision matrix and vector
multiply(Tmatrix3_double,Double):Tmatrix3_double | Multiply a three-dimensional double precision matrix by a scalar
multiply(Tmatrix3_double,Tmatrix3_double):Tmatrix3_double | Give product of two three-dimensional double precision matrices
multiply(Tmatrix3_double,Tvector3_double):Tvector3_double | Give product of a three-dimendional double precision matrix and vector
multiply(Tmatrix3_extended,extended):Tmatrix3_extended | Multiply a three-dimensional extended precision matrix by a scalar
multiply(Tmatrix3_extended,Tmatrix3_extended):Tmatrix3_extended | Give product of two three-dimensional extended precision matrices
multiply(Tmatrix3_extended,Tvector3_extended):Tvector3_extended | Give product of a three-dimendional extended precision matrix and vector
multiply(Tmatrix3_single,single):Tmatrix3_single | Multiply a three-dimensional single precision matrix by a scalar
multiply(Tmatrix3_single,Tmatrix3_single):Tmatrix3_single | Give product of two three-dimensional single precision matrices
multiply(Tmatrix3_single,Tvector3_single):Tvector3_single | Give product of a three-dimendional single precision matrix and vector
multiply(Tmatrix4_double,Double):Tmatrix4_double | Multiply a four-dimensional double precision matrix by a scalar
multiply(Tmatrix4_double,Tmatrix4_double):Tmatrix4_double | Give product of two four-dimensional double precision matrices
multiply(Tmatrix4_double,Tvector4_double):Tvector4_double | Give product of a four-dimendional double precision matrix and vector
multiply(Tmatrix4_extended,extended):Tmatrix4_extended | Multiply a four-dimensional extended precision matrix by a scalar
multiply(Tmatrix4_extended,Tmatrix4_extended):Tmatrix4_extended | Give product of two four-dimensional extended precision matrices
multiply(Tmatrix4_extended,Tvector4_extended):Tvector4_extended | Give product of a four-dimendional extended precision matrix and vector
multiply(Tmatrix4_single,single):Tmatrix4_single | Multiply a four-dimensional single precision matrix by a scalar
multiply(Tmatrix4_single,Tmatrix4_single):Tmatrix4_single | Give product of two four-dimensional single precision matrices
multiply(Tmatrix4_single,Tvector4_single):Tvector4_single | Give product of a four-dimendional single precision matrix and vector
multiply(Tvector2_double,Double):Tvector2_double | Multiply a two-dimensional double precision vector by a scalar
multiply(Tvector2_double,Tvector2_double):Tvector2_double | Multiply two vectors element wise
multiply(Tvector2_extended,extended):Tvector2_extended | Multiply a two-dimensional extended precision vector by a scalar
multiply(Tvector2_extended,Tvector2_extended):Tvector2_extended | Multiply two vectors element wise
multiply(Tvector2_single,single):Tvector2_single | Multiply a two-dimensional single precision vector by a scalar
multiply(Tvector2_single,Tvector2_single):Tvector2_single | Multiply two vectors element wise
multiply(Tvector3_double,Double):Tvector3_double | Multiply a three-dimensional double precision vector by a scalar
multiply(Tvector3_double,Tvector3_double):Tvector3_double | Multiply two vectors element wise
multiply(Tvector3_extended,extended):Tvector3_extended | Multiply a three-dimensional extended precision vector by a scalar
multiply(Tvector3_extended,Tvector3_extended):Tvector3_extended | Multiply two vectors element wise
multiply(Tvector3_single,single):Tvector3_single | Multiply a three-dimensional single precision vector by a scalar
multiply(Tvector3_single,Tvector3_single):Tvector3_single | Multiply two vectors element wise
multiply(Tvector4_double,Double):Tvector4_double | Multiply a four-dimensional double precision vector by a scalar
multiply(Tvector4_double,Tvector4_double):Tvector4_double | Multiply two vectors element wise
multiply(Tvector4_extended,extended):Tvector4_extended | Multiply a four-dimensional extended precision vector by a scalar
multiply(Tvector4_extended,Tvector4_extended):Tvector4_extended | Multiply two vectors element wise
multiply(Tvector4_single,single):Tvector4_single | Multiply a four-dimensional single precision vector by a scalar
multiply(Tvector4_single,Tvector4_single):Tvector4_single | Multiply two vectors element wise
negative(Tmatrix2_double):Tmatrix2_double | Negate two-dimensional double precision matrix.
negative(Tmatrix2_extended):Tmatrix2_extended | Negate two-dimensional extended precision matrix.
negative(Tmatrix2_single):Tmatrix2_single | Negate two-dimensional single precision matrix.
negative(Tmatrix3_double):Tmatrix3_double | Negate three-dimensional double precision matrix.
negative(Tmatrix3_extended):Tmatrix3_extended | Negate three-dimensional extended precision matrix.
negative(Tmatrix3_single):Tmatrix3_single | Negate three-dimensional single precision matrix.
negative(Tmatrix4_double):Tmatrix4_double | Negate four-dimensional double precision matrix.
negative(Tmatrix4_extended):Tmatrix4_extended | Negate four-dimensional extended precision matrix.
negative(Tmatrix4_single):Tmatrix4_single | Negate four-dimensional single precision matrix.
negative(Tvector2_double):Tvector2_double | Negate two-dimensional vector.
negative(Tvector2_extended):Tvector2_extended | Negate two-dimensional vector.
negative(Tvector2_single):Tvector2_single | Negate two-dimensional vector.
negative(Tvector3_double):Tvector3_double | Negate three-dimensional vector.
negative(Tvector3_extended):Tvector3_extended | Negate three-dimensional vector.
negative(Tvector3_single):Tvector3_single | Negate three-dimensional vector.
negative(Tvector4_double):Tvector4_double | Negate four-dimensional vector.
negative(Tvector4_extended):Tvector4_extended | Negate four-dimensional vector.
negative(Tvector4_single):Tvector4_single | Negate four-dimensional vector.
power(Tvector2_double,Tvector2_double):Double | Calculate the internal product of two vectors.
power(Tvector2_extended,Tvector2_extended):extended | Calculate the internal product of two vectors.
power(Tvector2_single,Tvector2_single):single | Calculate the internal product of two vectors.
power(Tvector3_double,Tvector3_double):Double | Calculate the internal product of two vectors.
power(Tvector3_extended,Tvector3_extended):extended | Calculate the internal product of two vectors.
power(Tvector3_single,Tvector3_single):single | Calculate the internal product of two vectors.
power(Tvector4_double,Tvector4_double):Double | Calculate the internal product of two vectors.
power(Tvector4_extended,Tvector4_extended):extended | Calculate the internal product of two vectors.
power(Tvector4_single,Tvector4_single):single | Calculate the internal product of two vectors.
subtract(Tmatrix2_double,Double):Tmatrix2_double | Subtract scalar to two-dimensional double precision matrix
subtract(Tmatrix2_double,Tmatrix2_double):Tmatrix2_double | Subtract a two-dimensional double precision matrix from another.
subtract(Tmatrix2_extended,extended):Tmatrix2_extended | Add scalar to two-dimensional extended precision matrix
subtract(Tmatrix2_extended,Tmatrix2_extended):Tmatrix2_extended | Subtract a two-dimensional extended precision matrix from another.
subtract(Tmatrix2_single,single):Tmatrix2_single | Subtract scalar to two-dimensional single precision matrix
subtract(Tmatrix2_single,Tmatrix2_single):Tmatrix2_single | Subtract a two-dimensional single precision matrix from another.
subtract(Tmatrix3_double,Double):Tmatrix3_double | Add scalar to three-dimensional double precision matrix
subtract(Tmatrix3_double,Tmatrix3_double):Tmatrix3_double | Subtract a three-dimensional double precision matrix from another.
subtract(Tmatrix3_extended,extended):Tmatrix3_extended | Add scalar to three-dimensional extended precision matrix
subtract(Tmatrix3_extended,Tmatrix3_extended):Tmatrix3_extended | Subtract a three-dimensional extended precision matrix from another.
subtract(Tmatrix3_single,single):Tmatrix3_single | Add scalar to three-dimensional single precision matrix
subtract(Tmatrix3_single,Tmatrix3_single):Tmatrix3_single | Subtract a three-dimensional single precision matrix from another.
subtract(Tmatrix4_double,Double):Tmatrix4_double | Add scalar to four-dimensional double precision matrix
subtract(Tmatrix4_double,Tmatrix4_double):Tmatrix4_double | Subtract a four-dimensional double precision matrix from another.
subtract(Tmatrix4_extended,extended):Tmatrix4_extended | Add scalar to four-dimensional extended precision matrix
subtract(Tmatrix4_extended,Tmatrix4_extended):Tmatrix4_extended | Subtract a four-dimensional extended precision matrix from another.
subtract(Tmatrix4_single,single):Tmatrix4_single | Add scalar to four-dimensional single precision matrix
subtract(Tmatrix4_single,Tmatrix4_single):Tmatrix4_single | Subtract a four-dimensional single precision matrix from another.
subtract(Tvector2_double,Double):Tvector2_double | Subtract scalar from two-dimensional double precision vector
subtract(Tvector2_double,Tvector2_double):Tvector2_double | Subtract two-dimensional double precision vectors from each other
subtract(Tvector2_extended,extended):Tvector2_extended | Subtract scalar from two-dimensional extended precision vector
subtract(Tvector2_extended,Tvector2_extended):Tvector2_extended | Subtract two-dimensional extended precision vectors from each other
subtract(Tvector2_single,single):Tvector2_single | Subtract scalar from two-dimensional single precision vector
subtract(Tvector2_single,Tvector2_single):Tvector2_single | Subtract two-dimensional single precision vectors from each other
subtract(Tvector3_double,Double):Tvector3_double | Subtract scalar from three-dimensional double precision vector
subtract(Tvector3_double,Tvector3_double):Tvector3_double | Subtract three-dimensional double precision vectors from each other
subtract(Tvector3_extended,extended):Tvector3_extended | Subtract scalar from three-dimensional extended precision vector
subtract(Tvector3_extended,Tvector3_extended):Tvector3_extended | Subtract three-dimensional extended precision vectors from each other
subtract(Tvector3_single,single):Tvector3_single | Subtract scalar from three-dimensional single precision vector
subtract(Tvector3_single,Tvector3_single):Tvector3_single | Subtract three-dimensional single precision vectors from each other
subtract(Tvector4_double,Double):Tvector4_double | Subtract scalar from four-dimensional double precision vector
subtract(Tvector4_double,Tvector4_double):Tvector4_double | Subtract four-dimensional double precision vectors from each other
subtract(Tvector4_extended,extended):Tvector4_extended | Subtract scalar from four-dimensional extended precision vector
subtract(Tvector4_extended,Tvector4_extended):Tvector4_extended | Subtract four-dimensional extended precision vectors from each other
subtract(Tvector4_single,single):Tvector4_single | Subtract scalar from four-dimensional single precision vector
subtract(Tvector4_single,Tvector4_single):Tvector4_single | Subtract four-dimensional single precision vectors from each other
symmetricaldifference(Tvector3_double,Tvector3_double):Tvector3_double | Calculate the external product of two three-dimensional vectors
symmetricaldifference(Tvector3_extended,Tvector3_extended):Tvector3_extended | Calculate the external product of two three-dimensional vectors
symmetricaldifference(Tvector3_single,Tvector3_single):Tvector3_single | Calculate the external product of two three-dimensional vectors


Index of all identifiers in unit 'matrix'

A D M N P S T

A

add(Tmatrix2_double,Double):Tmatrix2_double | assign(Tmatrix3_double):Tmatrix2_double | assign(Tvector2_extended):Tvector3_single
add(Tmatrix2_double,Tmatrix2_double):Tmatrix2_double | assign(Tmatrix3_double):Tmatrix2_extended | assign(Tvector2_extended):Tvector4_double
add(Tmatrix2_extended,extended):Tmatrix2_extended | assign(Tmatrix3_double):Tmatrix2_single | assign(Tvector2_extended):Tvector4_extended
add(Tmatrix2_extended,Tmatrix2_extended):Tmatrix2_extended | assign(Tmatrix3_double):Tmatrix3_extended | assign(Tvector2_extended):Tvector4_single
add(Tmatrix2_single,single):Tmatrix2_single | assign(Tmatrix3_double):Tmatrix3_single | assign(Tvector2_single):Tvector2_double
add(Tmatrix2_single,Tmatrix2_single):Tmatrix2_single | assign(Tmatrix3_double):Tmatrix4_double | assign(Tvector2_single):Tvector2_extended
add(Tmatrix3_double,Double):Tmatrix3_double | assign(Tmatrix3_double):Tmatrix4_extended | assign(Tvector2_single):Tvector3_double
add(Tmatrix3_double,Tmatrix3_double):Tmatrix3_double | assign(Tmatrix3_double):Tmatrix4_single | assign(Tvector2_single):Tvector3_extended
add(Tmatrix3_extended,extended):Tmatrix3_extended | assign(Tmatrix3_extended):Tmatrix2_double | assign(Tvector2_single):Tvector3_single
add(Tmatrix3_extended,Tmatrix3_extended):Tmatrix3_extended | assign(Tmatrix3_extended):Tmatrix2_extended | assign(Tvector2_single):Tvector4_double
add(Tmatrix3_single,single):Tmatrix3_single | assign(Tmatrix3_extended):Tmatrix2_single | assign(Tvector2_single):Tvector4_extended
add(Tmatrix3_single,Tmatrix3_single):Tmatrix3_single | assign(Tmatrix3_extended):Tmatrix3_double | assign(Tvector2_single):Tvector4_single
add(Tmatrix4_double,Double):Tmatrix4_double | assign(Tmatrix3_extended):Tmatrix3_single | assign(Tvector3_double):Tvector2_double
add(Tmatrix4_double,Tmatrix4_double):Tmatrix4_double | assign(Tmatrix3_extended):Tmatrix4_double | assign(Tvector3_double):Tvector2_extended
add(Tmatrix4_extended,extended):Tmatrix4_extended | assign(Tmatrix3_extended):Tmatrix4_extended | assign(Tvector3_double):Tvector2_single
add(Tmatrix4_extended,Tmatrix4_extended):Tmatrix4_extended | assign(Tmatrix3_extended):Tmatrix4_single | assign(Tvector3_double):Tvector3_extended
add(Tmatrix4_single,single):Tmatrix4_single | assign(Tmatrix3_single):Tmatrix2_double | assign(Tvector3_double):Tvector3_single
add(Tmatrix4_single,Tmatrix4_single):Tmatrix4_single | assign(Tmatrix3_single):Tmatrix2_extended | assign(Tvector3_double):Tvector4_double
add(Tvector2_double,Double):Tvector2_double | assign(Tmatrix3_single):Tmatrix2_single | assign(Tvector3_double):Tvector4_extended
add(Tvector2_double,Tvector2_double):Tvector2_double | assign(Tmatrix3_single):Tmatrix3_double | assign(Tvector3_double):Tvector4_single
add(Tvector2_extended,extended):Tvector2_extended | assign(Tmatrix3_single):Tmatrix3_extended | assign(Tvector3_extended):Tvector2_double
add(Tvector2_extended,Tvector2_extended):Tvector2_extended | assign(Tmatrix3_single):Tmatrix4_double | assign(Tvector3_extended):Tvector2_extended
add(Tvector2_single,single):Tvector2_single | assign(Tmatrix3_single):Tmatrix4_extended | assign(Tvector3_extended):Tvector2_single
add(Tvector2_single,Tvector2_single):Tvector2_single | assign(Tmatrix3_single):Tmatrix4_single | assign(Tvector3_extended):Tvector3_double
add(Tvector3_double,Double):Tvector3_double | assign(Tmatrix4_double):Tmatrix2_double | assign(Tvector3_extended):Tvector3_single
add(Tvector3_double,Tvector3_double):Tvector3_double | assign(Tmatrix4_double):Tmatrix2_extended | assign(Tvector3_extended):Tvector4_double
add(Tvector3_extended,extended):Tvector3_extended | assign(Tmatrix4_double):Tmatrix2_single | assign(Tvector3_extended):Tvector4_extended
add(Tvector3_extended,Tvector3_extended):Tvector3_extended | assign(Tmatrix4_double):Tmatrix3_double | assign(Tvector3_extended):Tvector4_single
add(Tvector3_single,single):Tvector3_single | assign(Tmatrix4_double):Tmatrix3_extended | assign(Tvector3_single):Tvector2_double
add(Tvector3_single,Tvector3_single):Tvector3_single | assign(Tmatrix4_double):Tmatrix3_single | assign(Tvector3_single):Tvector2_extended
add(Tvector4_double,Double):Tvector4_double | assign(Tmatrix4_double):Tmatrix4_extended | assign(Tvector3_single):Tvector2_single
add(Tvector4_double,Tvector4_double):Tvector4_double | assign(Tmatrix4_double):Tmatrix4_single | assign(Tvector3_single):Tvector3_double
add(Tvector4_extended,extended):Tvector4_extended | assign(Tmatrix4_extended):Tmatrix2_double | assign(Tvector3_single):Tvector3_extended
add(Tvector4_extended,Tvector4_extended):Tvector4_extended | assign(Tmatrix4_extended):Tmatrix2_extended | assign(Tvector3_single):Tvector4_double
add(Tvector4_single,single):Tvector4_single | assign(Tmatrix4_extended):Tmatrix2_single | assign(Tvector3_single):Tvector4_extended
add(Tvector4_single,Tvector4_single):Tvector4_single | assign(Tmatrix4_extended):Tmatrix3_double | assign(Tvector3_single):Tvector4_single
assign(Tmatrix2_double):Tmatrix2_extended | assign(Tmatrix4_extended):Tmatrix3_extended | assign(Tvector4_double):Tvector2_double
assign(Tmatrix2_double):Tmatrix2_single | assign(Tmatrix4_extended):Tmatrix3_single | assign(Tvector4_double):Tvector2_extended
assign(Tmatrix2_double):Tmatrix3_double | assign(Tmatrix4_extended):Tmatrix4_double | assign(Tvector4_double):Tvector2_single
assign(Tmatrix2_double):Tmatrix3_extended | assign(Tmatrix4_extended):Tmatrix4_single | assign(Tvector4_double):Tvector3_double
assign(Tmatrix2_double):Tmatrix3_single | assign(Tmatrix4_single):Tmatrix2_double | assign(Tvector4_double):Tvector3_extended
assign(Tmatrix2_double):Tmatrix4_double | assign(Tmatrix4_single):Tmatrix2_extended | assign(Tvector4_double):Tvector3_single
assign(Tmatrix2_double):Tmatrix4_extended | assign(Tmatrix4_single):Tmatrix2_single | assign(Tvector4_double):Tvector4_extended
assign(Tmatrix2_double):Tmatrix4_single | assign(Tmatrix4_single):Tmatrix3_double | assign(Tvector4_double):Tvector4_single
assign(Tmatrix2_extended):Tmatrix2_double | assign(Tmatrix4_single):Tmatrix3_extended | assign(Tvector4_extended):Tvector2_double
assign(Tmatrix2_extended):Tmatrix2_single | assign(Tmatrix4_single):Tmatrix3_single | assign(Tvector4_extended):Tvector2_extended
assign(Tmatrix2_extended):Tmatrix3_double | assign(Tmatrix4_single):Tmatrix4_double | assign(Tvector4_extended):Tvector2_single
assign(Tmatrix2_extended):Tmatrix3_extended | assign(Tmatrix4_single):Tmatrix4_extended | assign(Tvector4_extended):Tvector3_double
assign(Tmatrix2_extended):Tmatrix3_single | assign(Tvector2_double):Tvector2_extended | assign(Tvector4_extended):Tvector3_extended
assign(Tmatrix2_extended):Tmatrix4_double | assign(Tvector2_double):Tvector2_single | assign(Tvector4_extended):Tvector3_single
assign(Tmatrix2_extended):Tmatrix4_extended | assign(Tvector2_double):Tvector3_double | assign(Tvector4_extended):Tvector4_double
assign(Tmatrix2_extended):Tmatrix4_single | assign(Tvector2_double):Tvector3_extended | assign(Tvector4_extended):Tvector4_single
assign(Tmatrix2_single):Tmatrix2_double | assign(Tvector2_double):Tvector3_single | assign(Tvector4_single):Tvector2_double
assign(Tmatrix2_single):Tmatrix2_extended | assign(Tvector2_double):Tvector4_double | assign(Tvector4_single):Tvector2_extended
assign(Tmatrix2_single):Tmatrix3_double | assign(Tvector2_double):Tvector4_extended | assign(Tvector4_single):Tvector2_single
assign(Tmatrix2_single):Tmatrix3_extended | assign(Tvector2_double):Tvector4_single | assign(Tvector4_single):Tvector3_double
assign(Tmatrix2_single):Tmatrix3_single | assign(Tvector2_extended):Tvector2_double | assign(Tvector4_single):Tvector3_extended
assign(Tmatrix2_single):Tmatrix4_double | assign(Tvector2_extended):Tvector2_single | assign(Tvector4_single):Tvector3_single
assign(Tmatrix2_single):Tmatrix4_extended | assign(Tvector2_extended):Tvector3_double | assign(Tvector4_single):Tvector4_double
assign(Tmatrix2_single):Tmatrix4_single | assign(Tvector2_extended):Tvector3_extended | assign(Tvector4_single):Tvector4_extended

D

divide(Tmatrix2_double,Double):Tmatrix2_double | divide(Tmatrix4_double,Double):Tmatrix4_double | divide(Tvector3_double,Double):Tvector3_double
divide(Tmatrix2_extended,extended):Tmatrix2_extended | divide(Tmatrix4_extended,extended):Tmatrix4_extended | divide(Tvector3_extended,extended):Tvector3_extended
divide(Tmatrix2_single,single):Tmatrix2_single | divide(Tmatrix4_single,single):Tmatrix4_single | divide(Tvector3_single,single):Tvector3_single
divide(Tmatrix3_double,Double):Tmatrix3_double | divide(Tvector2_double,Double):Tvector2_double | divide(Tvector4_double,Double):Tvector4_double
divide(Tmatrix3_extended,extended):Tmatrix3_extended | divide(Tvector2_extended,extended):Tvector2_extended | divide(Tvector4_extended,extended):Tvector4_extended
divide(Tmatrix3_single,single):Tmatrix3_single | divide(Tvector2_single,single):Tvector2_single | divide(Tvector4_single,single):Tvector4_single

M

multiply(Tmatrix2_double,Double):Tmatrix2_double | multiply(Tmatrix3_single,single):Tmatrix3_single | multiply(Tvector2_extended,Tvector2_extended):Tvector2_extended
multiply(Tmatrix2_double,Tmatrix2_double):Tmatrix2_double | multiply(Tmatrix3_single,Tmatrix3_single):Tmatrix3_single | multiply(Tvector2_single,single):Tvector2_single
multiply(Tmatrix2_double,Tvector2_double):Tvector2_double | multiply(Tmatrix3_single,Tvector3_single):Tvector3_single | multiply(Tvector2_single,Tvector2_single):Tvector2_single
multiply(Tmatrix2_extended,extended):Tmatrix2_extended | multiply(Tmatrix4_double,Double):Tmatrix4_double | multiply(Tvector3_double,Double):Tvector3_double
multiply(Tmatrix2_extended,Tmatrix2_extended):Tmatrix2_extended | multiply(Tmatrix4_double,Tmatrix4_double):Tmatrix4_double | multiply(Tvector3_double,Tvector3_double):Tvector3_double
multiply(Tmatrix2_extended,Tvector2_extended):Tvector2_extended | multiply(Tmatrix4_double,Tvector4_double):Tvector4_double | multiply(Tvector3_extended,extended):Tvector3_extended
multiply(Tmatrix2_single,single):Tmatrix2_single | multiply(Tmatrix4_extended,extended):Tmatrix4_extended | multiply(Tvector3_extended,Tvector3_extended):Tvector3_extended
multiply(Tmatrix2_single,Tmatrix2_single):Tmatrix2_single | multiply(Tmatrix4_extended,Tmatrix4_extended):Tmatrix4_extended | multiply(Tvector3_single,single):Tvector3_single
multiply(Tmatrix2_single,Tvector2_single):Tvector2_single | multiply(Tmatrix4_extended,Tvector4_extended):Tvector4_extended | multiply(Tvector3_single,Tvector3_single):Tvector3_single
multiply(Tmatrix3_double,Double):Tmatrix3_double | multiply(Tmatrix4_single,single):Tmatrix4_single | multiply(Tvector4_double,Double):Tvector4_double
multiply(Tmatrix3_double,Tmatrix3_double):Tmatrix3_double | multiply(Tmatrix4_single,Tmatrix4_single):Tmatrix4_single | multiply(Tvector4_double,Tvector4_double):Tvector4_double
multiply(Tmatrix3_double,Tvector3_double):Tvector3_double | multiply(Tmatrix4_single,Tvector4_single):Tvector4_single | multiply(Tvector4_extended,extended):Tvector4_extended
multiply(Tmatrix3_extended,extended):Tmatrix3_extended | multiply(Tvector2_double,Double):Tvector2_double | multiply(Tvector4_extended,Tvector4_extended):Tvector4_extended
multiply(Tmatrix3_extended,Tmatrix3_extended):Tmatrix3_extended | multiply(Tvector2_double,Tvector2_double):Tvector2_double | multiply(Tvector4_single,single):Tvector4_single
multiply(Tmatrix3_extended,Tvector3_extended):Tvector3_extended | multiply(Tvector2_extended,extended):Tvector2_extended | multiply(Tvector4_single,Tvector4_single):Tvector4_single

N

negative(Tmatrix2_double):Tmatrix2_double | negative(Tmatrix4_double):Tmatrix4_double | negative(Tvector3_double):Tvector3_double
negative(Tmatrix2_extended):Tmatrix2_extended | negative(Tmatrix4_extended):Tmatrix4_extended | negative(Tvector3_extended):Tvector3_extended
negative(Tmatrix2_single):Tmatrix2_single | negative(Tmatrix4_single):Tmatrix4_single | negative(Tvector3_single):Tvector3_single
negative(Tmatrix3_double):Tmatrix3_double | negative(Tvector2_double):Tvector2_double | negative(Tvector4_double):Tvector4_double
negative(Tmatrix3_extended):Tmatrix3_extended | negative(Tvector2_extended):Tvector2_extended | negative(Tvector4_extended):Tvector4_extended
negative(Tmatrix3_single):Tmatrix3_single | negative(Tvector2_single):Tvector2_single | negative(Tvector4_single):Tvector4_single

P

power(Tvector2_double,Tvector2_double):Double | power(Tvector3_double,Tvector3_double):Double | power(Tvector4_double,Tvector4_double):Double
power(Tvector2_extended,Tvector2_extended):extended | power(Tvector3_extended,Tvector3_extended):extended | power(Tvector4_extended,Tvector4_extended):extended
power(Tvector2_single,Tvector2_single):single | power(Tvector3_single,Tvector3_single):single | power(Tvector4_single,Tvector4_single):single

S

subtract(Tmatrix2_double,Double):Tmatrix2_double | subtract(Tmatrix4_double,Tmatrix4_double):Tmatrix4_double | subtract(Tvector3_extended,extended):Tvector3_extended
subtract(Tmatrix2_double,Tmatrix2_double):Tmatrix2_double | subtract(Tmatrix4_extended,extended):Tmatrix4_extended | subtract(Tvector3_extended,Tvector3_extended):Tvector3_extended
subtract(Tmatrix2_extended,extended):Tmatrix2_extended | subtract(Tmatrix4_extended,Tmatrix4_extended):Tmatrix4_extended | subtract(Tvector3_single,single):Tvector3_single
subtract(Tmatrix2_extended,Tmatrix2_extended):Tmatrix2_extended | subtract(Tmatrix4_single,single):Tmatrix4_single | subtract(Tvector3_single,Tvector3_single):Tvector3_single
subtract(Tmatrix2_single,single):Tmatrix2_single | subtract(Tmatrix4_single,Tmatrix4_single):Tmatrix4_single | subtract(Tvector4_double,Double):Tvector4_double
subtract(Tmatrix2_single,Tmatrix2_single):Tmatrix2_single | subtract(Tvector2_double,Double):Tvector2_double | subtract(Tvector4_double,Tvector4_double):Tvector4_double
subtract(Tmatrix3_double,Double):Tmatrix3_double | subtract(Tvector2_double,Tvector2_double):Tvector2_double | subtract(Tvector4_extended,extended):Tvector4_extended
subtract(Tmatrix3_double,Tmatrix3_double):Tmatrix3_double | subtract(Tvector2_extended,extended):Tvector2_extended | subtract(Tvector4_extended,Tvector4_extended):Tvector4_extended
subtract(Tmatrix3_extended,extended):Tmatrix3_extended | subtract(Tvector2_extended,Tvector2_extended):Tvector2_extended | subtract(Tvector4_single,single):Tvector4_single
subtract(Tmatrix3_extended,Tmatrix3_extended):Tmatrix3_extended | subtract(Tvector2_single,single):Tvector2_single | subtract(Tvector4_single,Tvector4_single):Tvector4_single
subtract(Tmatrix3_single,single):Tmatrix3_single | subtract(Tvector2_single,Tvector2_single):Tvector2_single | symmetricaldifference(Tvector3_double,Tvector3_double):Tvector3_double
subtract(Tmatrix3_single,Tmatrix3_single):Tmatrix3_single | subtract(Tvector3_double,Double):Tvector3_double | symmetricaldifference(Tvector3_extended,Tvector3_extended):Tvector3_extended
subtract(Tmatrix4_double,Double):Tmatrix4_double | subtract(Tvector3_double,Tvector3_double):Tvector3_double | symmetricaldifference(Tvector3_single,Tvector3_single):Tvector3_single

T

Tmatrix2_double | Tmatrix4_double | Tvector3_double
Tmatrix2_double_data | Tmatrix4_double_data | Tvector3_double_data
Tmatrix2_extended | Tmatrix4_extended | Tvector3_extended
Tmatrix2_extended_data | Tmatrix4_extended_data | Tvector3_extended_data
Tmatrix2_single | Tmatrix4_single | Tvector3_single
Tmatrix2_single_data | Tmatrix4_single_data | Tvector3_single_data
Tmatrix3_double | Tvector2_double | Tvector4_double
Tmatrix3_double_data | Tvector2_double_data | Tvector4_double_data
Tmatrix3_extended | Tvector2_extended | Tvector4_extended
Tmatrix3_extended_data | Tvector2_extended_data | Tvector4_extended_data
Tmatrix3_single | Tvector2_single | Tvector4_single
Tmatrix3_single_data | Tvector2_single_data | Tvector4_single_data


Reference for unit 'mmx'

Access to MMX processor functionality

uses

  System;

The system unit

Overview

This document describes the MMX unit. This unit allows you to use the MMX capabilities of the Free Pascal compiler. It was written by Florian Klaempfl for the I386 processor. It should work on all platforms that use the Intel processor.


Reference for unit 'mmx': Constants

is_amd_3d_cpu | Is the current processor equipped with a AMD 3D CPU
is_amd_3d_dsp_cpu | Is the current processor equipped with a AMD 3D DSP CPU
is_amd_3d_mmx_cpu | Is the current processor equipped with a AMD 3D MMX CPU
is_mmx_cpu | Is the current processor equipped with a MMX capable CPU
is_sse2_cpu | Is the current processor equipped with a SSE2 CPU
is_sse_cpu | Is the current processor equipped with a SSE CPU


Reference for unit 'mmx': Types

pmmxbyte | Pointer to tmmxbyte array type
pmmxcardinal | Pointer to tmmxcardinal array type
pmmxinteger | Pointer to tmmxinteger array type
pmmxlongint | Pointer to tmmxlongint array type
pmmxshortint | Pointer to tmmxshortint array type
pmmxsingle | Pointer to tmmxsingle array type
pmmxword | Pointer to tmmxword array type
tmmxbyte | Array of bytes, 64 bits in size
tmmxcardinal | Array of cardinals, 64 bits in size
tmmxinteger | Array of integers, 64 bits in size
tmmxlongint | Array of longint, 64 bits in size
tmmxshortint | Array of shortints, 64 bits in size
tmmxsingle | Array of singles, 64 bits in size
tmmxword | Array of words, 64 bits in size


Reference for unit 'mmx': Procedures and functions

emms | Reset floating point registers
femms | Reset floating point registers - AMD version


Index of all identifiers in unit 'mmx'

E F I P T

E

emms

F

femms

I

is_amd_3d_cpu | is_amd_3d_mmx_cpu | is_sse2_cpu
is_amd_3d_dsp_cpu | is_mmx_cpu | is_sse_cpu

P

pmmxbyte | pmmxlongint | pmmxword
pmmxcardinal | pmmxshortint |
pmmxinteger | pmmxsingle |

T

tmmxbyte | tmmxlongint | tmmxword
tmmxcardinal | tmmxshortint |
tmmxinteger | tmmxsingle |


is_amd_3d_cpu

Is the current processor equipped with a AMD 3D CPU

Declaration

Source position: mmx.pp line 45

const is_amd_3d_cpu: Boolean = False;

Description

The is_amd_3d_cpu initialized constant allows you to determine if the computer has the AMD 3D extensions. It is set correctly in the unit's initialization code.


is_amd_3d_dsp_cpu

Is the current processor equipped with a AMD 3D DSP CPU

Declaration

Source position: mmx.pp line 46

const is_amd_3d_dsp_cpu: Boolean = False;

Description

The is_amd_3d_dsp_cpu initialized constant allows you to determine if the computer has the AMD 3D DSP extensions. It is set correctly in the unit's initialization code.


is_amd_3d_mmx_cpu

Is the current processor equipped with a AMD 3D MMX CPU

Declaration

Source position: mmx.pp line 47

const is_amd_3d_mmx_cpu: Boolean = False;

Description

The is_amd_3d_mmx_cpu initialized constant allows you to determine if the computer has the AMD 3D MMX extensions. It is set correctly in the unit's initialization code.


is_mmx_cpu

Is the current processor equipped with a MMX capable CPU

Declaration

Source position: mmx.pp line 42

const is_mmx_cpu: Boolean = False;

Description

The is_mmx_cpu initialized constant allows you to determine if the computer has MMX extensions. It is set correctly in the unit's initialization code.


is_sse2_cpu

Is the current processor equipped with a SSE2 CPU

Declaration

Source position: mmx.pp line 44

const is_sse2_cpu: Boolean = False;

Description

The is_sse2_cpu initialized constant allows you to determine if the computer has the SSE2 extensions. It is set correctly in the unit's initialization code.


is_sse_cpu

Is the current processor equipped with a SSE CPU

Declaration

Source position: mmx.pp line 43

const is_sse_cpu: Boolean = False;

Description

The is_sse_cpu initialized constant allows you to determine if the computer has the SSE extensions. It is set correctly in the unit's initialization code.


pmmxbyte

Pointer to tmmxbyte array type

Declaration

Source position: mmx.pp line 30

type pmmxbyte = ^tmmxbyte;


pmmxcardinal

Pointer to tmmxcardinal array type

Declaration

Source position: mmx.pp line 37

type pmmxcardinal = ^tmmxcardinal;


pmmxinteger

Pointer to tmmxinteger array type

Declaration

Source position: mmx.pp line 32

type pmmxinteger = ^tmmxinteger;


pmmxlongint

Pointer to tmmxlongint array type

Declaration

Source position: mmx.pp line 36

type pmmxlongint = ^tmmxlongint;


pmmxshortint

Pointer to tmmxshortint array type

Declaration

Source position: mmx.pp line 29

type pmmxshortint = ^tmmxshortint;


pmmxsingle

Pointer to tmmxsingle array type

Declaration

Source position: mmx.pp line 39

type pmmxsingle = ^tmmxsingle;


pmmxword

Pointer to tmmxword array type

Declaration

Source position: mmx.pp line 31

type pmmxword = ^tmmxword;


tmmxbyte

Array of bytes, 64 bits in size

Declaration

Source position: mmx.pp line 21

type tmmxbyte = array [0..7] of Byte;


tmmxcardinal

Array of cardinals, 64 bits in size

Declaration

Source position: mmx.pp line 25

type tmmxcardinal = array [0..1] of Cardinal;


tmmxinteger

Array of integers, 64 bits in size

Declaration

Source position: mmx.pp line 23

type tmmxinteger = array [0..3] of Integer;


tmmxlongint

Array of longint, 64 bits in size

Declaration

Source position: mmx.pp line 24

type tmmxlongint = array [0..1] of LongInt;


tmmxshortint

Array of shortints, 64 bits in size

Declaration

Source position: mmx.pp line 20

type tmmxshortint = array [0..7] of ShortInt;


tmmxsingle

Array of singles, 64 bits in size

Declaration

Source position: mmx.pp line 27

type tmmxsingle = array [0..1] of single;


tmmxword

Array of words, 64 bits in size

Declaration

Source position: mmx.pp line 22

type tmmxword = array [0..3] of Word;


errMouseBase

Base for mouse error codes.

Declaration

Source position: mouseh.inc line 16

const errMouseBase = 1030;


errMouseInitError

Mouse initialization error

Declaration

Source position: mouseh.inc line 17

const errMouseInitError = errMouseBase + 0;


errMouseNotImplemented

Mouse driver not implemented.

Declaration

Source position: mouseh.inc line 18

const errMouseNotImplemented = errMouseBase + 1;


Reference for unit 'Mouse'

Mouse event handling unit

uses

  System;

The system unit

Overview

The Mouse unit implements a platform independent mouse handling interface. It is implemented identically on all platforms supported by Free Pascal and can be enhanced with custom drivers, should this be needed. It is intended to be used only in text-based screens, for instance in conjunction with the keyboard and video unit. No support for graphical screens is implemented, and there are (currently) no plans to implement this.

Related topics

mousedrv

Writing a custom mouse driver


Reference for unit 'Mouse': Constants

errMouseBase | Base for mouse error codes.
errMouseInitError | Mouse initialization error
errMouseNotImplemented | Mouse driver not implemented.
MouseActionDown | Mouse button down event signal.
MouseActionMove | Mouse cursor move event signal.
MouseActionUp | Mouse button up event signal.
MouseButton4 | 4th mouse button event
MouseButton5 | 5th mouse button event
MouseEventBufSize | Mouse event buffer size
MouseLeftButton | Left mouse button event.
MouseMiddleButton | Middle mouse button event.
MouseRightButton | Right mouse button event.


Reference for unit 'Mouse': Types

PMouseEvent | Pointer to TMouseEvent record.
TMouseDriver | Mouse driver structure
TMouseEvent | Mouse event reporting record.


Reference for unit 'Mouse': Procedures and functions

DetectMouse | Detect the presence of a mouse.
DoneMouse | Deinitialize mouse driver.
GetMouseButtons | Get the state of the mouse buttons
GetMouseDriver | Get a copy of the currently active mouse driver.
GetMouseEvent | Get next mouse event from the queue.
GetMouseX | Query the current horizontal position of the mouse cursor.
GetMouseY | Query the current vertical position of the mouse cursor.
HideMouse | Hide the mouse cursor.
InitMouse | Initialize the FPC mouse driver.
PollMouseEvent | Query next mouse event. Do not wait if none available.
PutMouseEvent | Put a mouse event in the venet queue.
SetMouseDriver | Set a new mouse driver.
SetMouseXY | Set the mouse cursor position.
ShowMouse | Show the mouse cursor.


Reference for unit 'Mouse': Variables

MouseButtons | Mouse button state
MouseIntFlag | Internal mouse flag
MouseWhereX | Mouse cursor horizontal position
MouseWhereY | Mouse cursor vertical position


Index of all identifiers in unit 'Mouse'

D E G H I M P S T

D

DetectMouse DoneMouse

E

errMouseBase errMouseInitError errMouseNotImplemented

G

GetMouseButtons | GetMouseEvent | GetMouseY
GetMouseDriver | GetMouseX |

H

HideMouse

I

InitMouse

M

MouseActionDown | MouseButtons | MouseRightButton
MouseActionMove | MouseEventBufSize | MouseWhereX
MouseActionUp | MouseIntFlag | MouseWhereY
MouseButton4 | MouseLeftButton |
MouseButton5 | MouseMiddleButton |

P

PMouseEvent PollMouseEvent PutMouseEvent

S

SetMouseDriver SetMouseXY ShowMouse

T

TMouseDriver TMouseEvent


MouseActionDown

Mouse button down event signal.

Declaration

Source position: mouseh.inc line 29

const MouseActionDown = $0001;


MouseActionMove

Mouse cursor move event signal.

Declaration

Source position: mouseh.inc line 31

const MouseActionMove = $0004;


MouseActionUp

Mouse button up event signal.

Declaration

Source position: mouseh.inc line 30

const MouseActionUp = $0002;


MouseButton4

4th mouse button event

Declaration

Source position: mouseh.inc line 36

const MouseButton4 = $08;


MouseButton5

5th mouse button event

Declaration

Source position: mouseh.inc line 37

const MouseButton5 = $10;


MouseButtons

Mouse button state

Declaration

Source position: mouseh.inc line 43

var MouseButtons: Byte = ;

Description

This variable keeps track of the last known mouse button state. Do not use.


Writing a custom mouse driver

The mouse unit has support for adding a custom mouse driver. This can be used to add support for mouses not supported by the standard Free Pascal driver, but also to enhance an existing driver for instance to log mouse events or to implement a record and playback function.

The following unit shows how a mouse driver can be enhanced by adding some logging capabilities to the driver.

Example

unit logmouse;

interface

Procedure StartMouseLogging;
Procedure StopMouseLogging;
Function  IsMouseLogging : Boolean;
Procedure SetMouseLogFileName(FileName : String);

implementation

uses sysutils,Mouse;

var
  NewMouseDriver,
  OldMouseDriver : TMouseDriver;
  Active,Logging : Boolean;
  LogFileName : String;
  MouseLog : Text;

Function TimeStamp : String;

begin
  TimeStamp:=FormatDateTime('hh:nn:ss',Time());
end;

Procedure StartMouseLogging;

begin
  Logging:=True;
  Writeln(MouseLog,'Start logging mouse events at: ',TimeStamp);
end;

Procedure StopMouseLogging;

begin
  Writeln(MouseLog,'Stop logging mouse events at: ',TimeStamp);
  Logging:=False;
end;

Function IsMouseLogging : Boolean;

begin
  IsMouseLogging:=Logging;
end;

Procedure LogGetMouseEvent(Var Event : TMouseEvent);

Var
  M : TMouseEvent;

begin
  OldMouseDriver.GetMouseEvent(M);
  If Logging then
    begin
    Write(MouseLog,TimeStamp,': Mouse ');
    With M do
      begin
      Case Action of
        MouseActionDown : Write(MouseLog,'down');
        MouseActionUp   : Write(MouseLog,'up');
        MouseActionMove : Write(MouseLog,'move');
      end;
      Write(MouseLog,' event at ',X,',',Y);
      If (Buttons<>0) then
        begin
        Write(MouseLog,' for buttons: ');
        If (Buttons and MouseLeftbutton)<>0 then
          Write(MouseLog,'Left ');
        If (Buttons and MouseRightbutton)<>0 then
          Write(MouseLog,'Right ');
        If (Buttons and MouseMiddlebutton)<>0 then
          Write(MouseLog,'Middle ');
        end;
      Writeln(MouseLog);
      end;
    end;
end;

Procedure LogInitMouse;

begin
  OldMouseDriver.InitDriver();
  Assign(MouseLog,logFileName);
  Rewrite(MouseLog);
  Active:=True;
  StartMouseLogging;
end;

Procedure LogDoneMouse;

begin
  StopMouseLogging;
  Close(MouseLog);
  Active:=False;
  OldMouseDriver.DoneDriver();
end;

Procedure SetMouseLogFileName(FileName : String);

begin
  If Not Active then
    LogFileName:=FileName;
end;

Initialization
  GetMouseDriver(OldMouseDriver);
  NewMouseDriver:=OldMouseDriver;
  NewMouseDriver.GetMouseEvent:=@LogGetMouseEvent;
  NewMouseDriver.InitDriver:=@LogInitMouse;
  NewMouseDriver.DoneDriver:=@LogDoneMouse;
  LogFileName:='Mouse.log';
  Logging:=False;
  SetMouseDriver(NewMouseDriver);
end.


MouseEventBufSize

Mouse event buffer size

Declaration

Source position: mouseh.inc line 39

const MouseEventBufSize = 16;

Description

The mouse unit has a mechanism to buffer mouse events. This constant defines the size of the event buffer.


MouseIntFlag

Internal mouse flag

Declaration

Source position: mouseh.inc line 42

var MouseIntFlag: Byte = ;

Description

This variable keeps track of the last known internal mouse state. Do not use.


MouseLeftButton

Left mouse button event.

Declaration

Source position: mouseh.inc line 33

const MouseLeftButton = $01;


MouseMiddleButton

Middle mouse button event.

Declaration

Source position: mouseh.inc line 35

const MouseMiddleButton = $04;


MouseRightButton

Right mouse button event.

Declaration

Source position: mouseh.inc line 34

const MouseRightButton = $02;


MouseWhereX

Mouse cursor horizontal position

Declaration

Source position: mouseh.inc line 44

var MouseWhereX: Word = ;

Description

This variable keeps track of the last known cursor position. Do not use.


MouseWhereY

Mouse cursor vertical position

Declaration

Source position: mouseh.inc line 45

var MouseWhereY: Word = ;

Description

This variable keeps track of the last known cursor position. Do not use.


PMouseEvent

Pointer to TMouseEvent record.

Declaration

Source position: mouseh.inc line 21

type PMouseEvent = ^TMouseEvent;


TMouseDriver

Mouse driver structure

Declaration

Source position: mouseh.inc line 48

type TMouseDriver = record
UseDefaultQueue: Boolean; | Should the default event queue mechanism be used.
InitDriver: procedure; | Called when the driver must be initialized
DoneDriver: procedure; | Called when the driver will be unloaded.
DetectMouse: function: Byte; | Function called when the mouse must be detected.
ShowMouse: procedure; | Function called when the mouse cursor must be shown.
HideMouse: procedure; | Function called when the mouse cursor must be hidden.
GetMouseX: function: Word; | Called to get the mouse cursors horizontal position.
GetMouseY: function: Word; | Called to get the mouse cursors vertical position.
GetMouseButtons: function: Word; | Called to get the currently pressed mouse buttons.
SetMouseXY: procedure( | Called when the current mouse position must be set.
x: Word;
y: Word
);
GetMouseEvent: procedure( | Called to get the next mouse event. Waits if needed.
var MouseEvent: TMouseEvent
);
PollMouseEvent: function( | Called to get the next mouse event. Does not wait.
var MouseEvent: TMouseEvent
):Boolean;
PutMouseEvent: procedure( | Called to put a mouse event back in the queue.
const MouseEvent: TMouseEvent
);
end;

Description

The TMouseDriver record is used to implement a mouse driver in the SetMouseDriver function. Its fields must be filled in before calling the SetMouseDriver function.

See also

SetMouseDriver

Set a new mouse driver.


TMouseEvent

Mouse event reporting record.

Declaration

Source position: mouseh.inc line 22

type TMouseEvent = packed record
buttons: Word; | Pressed buttons at time of event.
x: Word; | Horizontal position of mouse cursor.
y: Word; | Vertical position of mouse cursor.
Action: Word; | Type of event.
end;

Description

The TMouseEvent is the central type of the mouse unit, it is used to describe all mouse events.

The Buttons field describes which buttons were down when the event occurred. The x,y fields describe where the event occurred on the screen. The Action describes what action was going on when the event occurred. The Buttons and Action field can be examined using the constants defined in the unit interface.

See also

GetMouseEvent | Get next mouse event from the queue.
PollMouseEvent | Query next mouse event. Do not wait if none available.
PutMouseEvent | Put a mouse event in the venet queue.


AsciiZ

Filename - null terminated array of characters.

Declaration

Source position: objects.pp line 170

type AsciiZ = array [0..255] of Char;


coIndexError

Collection list error: Index out of range

Declaration

Source position: objects.pp line 97

const coIndexError = - 1;


coOverflow

Collection list error: Overflow

Declaration

Source position: objects.pp line 98

const coOverflow = - 2;


DefaultTPCompatible

Default value for tstream.tpcompatible

Declaration

Source position: objects.pp line 691

const DefaultTPCompatible: Boolean = False;

Description

DefaultTPCompatible is used to initialize tstream.tpcompatible.


FNameStr

Filename - shortstring version.

Declaration

Source position: objects.pp line 158

type FNameStr = String;


Reference for unit 'Objects'

TP-Compatible basic Objects.

uses

  System;

The system unit

Overview

This document documents the objects unit. The unit was implemented by many people, and was mainly taken from the FreeVision sources. It has been ported to all supported platforms.

The methods and fields that are in a Private part of an object declaration have been left out of this documentation.


Reference for unit 'Objects': Constants

coIndexError | Collection list error: Index out of range
coOverflow | Collection list error: Overflow
DefaultTPCompatible | Default value for tstream.tpcompatible
MaxBytes | Maximum data size (in bytes)
MaxCollectionSize | Maximum collection size (in items)
MaxPtrs | Maximum data size (in pointers)
MaxReadBytes | Maximum data that can be read from a stream (not used)
MaxTPCompatibleCollectionSize | Maximum collection size (in items, same value as in TP)
MaxWords | Maximum data size (in words)
RCollection | Default stream record for the TCollection object.
RStrCollection | Default stream record for the TStrCollection object.
RStringCollection | Default stream record for the TStringCollection object.
RStringList | Default stream record for the TStringList object.
RStrListMaker | Default stream record for the TStrListMaker object.
stCreate | Stream initialization mode: Create new file
stError | Stream error codes: Access error
stGetError | Stream error codes: Get object error
stInitError | Stream error codes: Initialize error
stOk | Stream error codes: No error
stOpen | Stream initialization mode: Read/write access
stOpenError | Stream error codes: Error opening stream
stOpenRead | Stream initialization mode: Read access only
stOpenWrite | Stream initialization mode: Write access only
stPutError | Stream error codes: Put object error
stReadError | Stream error codes: Stream read error
StreamError | Pointer to default stream error handler.
stSeekError | Stream error codes: Seek error in stream
stWriteError | Stream error codes: Stream write error
vmtHeaderSize | Size of the VMT header in an object (not used).


Reference for unit 'Objects': Types

AsciiZ | Filename - null terminated array of characters.
FNameStr | Filename - shortstring version.
LongRec | Record describing a longint (in Words)
PBufStream | Pointer to TBufStream object.
PByteArray | Pointer to TByteArray
PCharSet | Pointer to TCharSet.
PCollection | Pointer to TCollection object.
PDosStream | Pointer to TDosStream object.
PItemList | Pointer to TItemList object.
PMemoryStream | Pointer to TMemoryStream object.
PObject | Pointer to TObject object.
PPoint | Pointer to TPoint record.
PPointerArray | Pointer to TPointerArray
PRect | Pointer to TRect object.
PResourceCollection | Pointer to TResourceCollection object.
PResourceFile | Pointer to TResourceFile object.
PSortedCollection | Pointer to TSortedCollection object.
PStrCollection | Pointer to TStrCollection object.
PStream | Pointer type to TStream
PStreamRec | Pointer to TStreamRec
PStrIndex | Pointer to TStrIndex array.
PString | Pointer to a shortstring.
PStringCollection | Pointer to TStringCollection object.
PStringList | Pointer to TStringList object.
PStrListMaker | Pointer to TStrListMaker object.
PtrRec | Record describing a pointer to a memory location.
PUnSortedStrCollection | Pointer to TUnSortedStrCollection object.
PWordArray | Pointer to TWordArray
Sw_Integer | Alias for longint
Sw_Word | Alias for Cardinal
TByteArray | Array with maxmimum allowed number of bytes.
TCharSet | Generic set of characters type.
TItemList | Pointer array type used in a TCollection
TPointerArray | Array with maxmimum allowed number of pointers
TStreamRec | Record used in streaming mechanism.
TStrIndex | Pointer array type used in a TStringList
TStrIndexRec | Record type used in a TStringList to store the strings
TWordArray | Array with maxmimum allowed number of words.
WordRec | Record describing a Word (in bytes)


Reference for unit 'Objects': Classes

TBufStream | Buffered file stream
TCollection | Manage a collection of pointers of objects
TDosStream | DOS file stream
TMemoryStream | Stream which keeps data in memory.
TObject | Basis of all objects
TPoint | Record describing a point in a 2 dimensional plane.
TRect | Describes a rectangular region in a plane.
TResourceCollection | Collection of resource names
TResourceFile | Resource file
TSortedCollection | Abstract sorted collection.
TStrCollection | Collection of null-terminated strings
TStream | Base stream class
TStringCollection | Collection of pascal strings.
TStringList | Collection of strings
TStrListMaker | Generate a stream with strings, readable by TStringList
TUnSortedStrCollection | Unsorted string collection


Reference for unit 'Objects': Procedures and functions

Abstract | Abstract error handler.
CallPointerConstructor | Call a constructor with a pointer argument.
CallPointerLocal | Call a local nested function with a pointer argument
CallPointerMethod | Call a method with a single pointer argument
CallPointerMethodLocal | Call a local procedure of a method with a pointer argument
CallVoidConstructor | Call a constructor with no arguments
CallVoidLocal | Call a local nested procedure.
CallVoidMethod | Call an object method
CallVoidMethodLocal | Call a local procedure of a method
DisposeStr | Dispose of a shortstring which was allocated on the heap.
LongDiv | Overflow safe divide
LongMul | Overflow safe multiply.
NewStr | Allocate a copy of a shortstring on the heap.
RegisterObjects | Register standard objects.
RegisterType | Register new object for streaming.
SetStr | Allocate a copy of a shortstring on the heap.


Reference for unit 'Objects': Variables

invalidhandle

Value for invalid handle. Initial value for file stream handles or when the stream is closed.


Index of all identifiers in unit 'Objects'

A C D F I L M N P R S T V W

A

Abstract AsciiZ

C

CallPointerConstructor | CallVoidConstructor | coIndexError
CallPointerLocal | CallVoidLocal | coOverflow
CallPointerMethod | CallVoidMethod |
CallPointerMethodLocal | CallVoidMethodLocal |

D

DefaultTPCompatible DisposeStr

F

FNameStr

I

invalidhandle

L

LongDiv LongMul LongRec

M

MaxBytes | MaxPtrs | MaxTPCompatibleCollectionSize
MaxCollectionSize | MaxReadBytes | MaxWords

N

NewStr

P

PBufStream | PPointerArray | PString
PByteArray | PRect | PStringCollection
PCharSet | PResourceCollection | PStringList
PCollection | PResourceFile | PStrListMaker
PDosStream | PSortedCollection | PtrRec
PItemList | PStrCollection | PUnSortedStrCollection
PMemoryStream | PStream | PWordArray
PObject | PStreamRec |
PPoint | PStrIndex |

R

RCollection | RStrCollection | RStrListMaker
RegisterObjects | RStringCollection |
RegisterType | RStringList |

S

SetStr | stOpen | StreamError
stCreate | stOpenError | stSeekError
stError | stOpenRead | stWriteError
stGetError | stOpenWrite | Sw_Integer
stInitError | stPutError | Sw_Word
stOk | stReadError |

T

TBufStream | TPoint | TStreamRec
TByteArray | TPointerArray | TStrIndex
TCharSet | TRect | TStrIndexRec
TCollection | TResourceCollection | TStringCollection
TDosStream | TResourceFile | TStringList
TItemList | TSortedCollection | TStrListMaker
TMemoryStream | TStrCollection | TUnSortedStrCollection
TObject | TStream | TWordArray

V

vmtHeaderSize

W

WordRec


invalidhandle

Value for invalid handle. Initial value for file stream handles or when the stream is closed.

Declaration

Source position: objects.pp line 163

var invalidhandle: THandle = ;


LongRec

Record describing a longint (in Words)

Declaration

Source position: objects.pp line 195

type LongRec = packed record
Hi: Word; | High word of longint
Lo: Word; | Lower word of longint
end;


MaxBytes

Maximum data size (in bytes)

Declaration

Source position: objects.pp line 114

const MaxBytes = 128 * 1024 * 128;


MaxCollectionSize

Maximum collection size (in items)

Declaration

Source position: objects.pp line 121

const MaxCollectionSize = MaxBytes div SizeOf(Pointer);


MaxPtrs

Maximum data size (in pointers)

Declaration

Source position: objects.pp line 120

const MaxPtrs = MaxBytes div SizeOf(Pointer);


MaxReadBytes

Maximum data that can be read from a stream (not used)

Declaration

Source position: objects.pp line 160

const MaxReadBytes = $7fffffff;


MaxTPCompatibleCollectionSize

Maximum collection size (in items, same value as in TP)

Declaration

Source position: objects.pp line 122

const MaxTPCompatibleCollectionSize = 65520 div 4;


MaxWords

Maximum data size (in words)

Declaration

Source position: objects.pp line 119

const MaxWords = MaxBytes div SizeOf(Word);


PBufStream

Pointer to TBufStream object.

Declaration

Source position: objects.pp line 357

type PBufStream = ^TBufStream;


PByteArray

Pointer to TByteArray

Declaration

Source position: objects.pp line 140

type PByteArray = ^TByteArray;


PCharSet

Pointer to TCharSet.

Declaration

Source position: objects.pp line 133

type PCharSet = ^TCharSet;


PCollection

Pointer to TCollection object.

Declaration

Source position: objects.pp line 429

type PCollection = ^TCollection;


PDosStream

Pointer to TDosStream object.

Declaration

Source position: objects.pp line 328

type PDosStream = ^TDosStream;


PItemList

Pointer to TItemList object.

Declaration

Source position: objects.pp line 388

type PItemList = ^TItemList;


PMemoryStream

Pointer to TMemoryStream object.

Declaration

Source position: objects.pp line 383

type PMemoryStream = ^TMemoryStream;


PObject

Pointer to TObject object.

Declaration

Source position: objects.pp line 260

type PObject = ^TObject;


PPoint

Pointer to TPoint record.

Declaration

Source position: objects.pp line 228

type PPoint = ^TPoint;


PPointerArray

Pointer to TPointerArray

Declaration

Source position: objects.pp line 146

type PPointerArray = ^TPointerArray;


PRect

Pointer to TRect object.

Declaration

Source position: objects.pp line 236

type PRect = ^TRect;


PResourceCollection

Pointer to TResourceCollection object.

Declaration

Source position: objects.pp line 497

type PResourceCollection = ^TResourceCollection;


PResourceFile

Pointer to TResourceFile object.

Declaration

Source position: objects.pp line 520

type PResourceFile = ^TResourceFile;


PSortedCollection

Pointer to TSortedCollection object.

Declaration

Source position: objects.pp line 446

type PSortedCollection = ^TSortedCollection;


PStrCollection

Pointer to TStrCollection object.

Declaration

Source position: objects.pp line 470

type PStrCollection = ^TStrCollection;


PStream

Pointer type to TStream

Declaration

Source position: objects.pp line 301

type PStream = ^TStream;


PStreamRec

Pointer to TStreamRec

Declaration

Source position: objects.pp line 211

type PStreamRec = ^TStreamRec;


PStrIndex

Pointer to TStrIndex array.

Declaration

Source position: objects.pp line 529

type PStrIndex = ^TStrIndex;


PString

Pointer to a shortstring.

Declaration

Source position: objects.pp line 152

type PString = PShortString;


PStringCollection

Pointer to TStringCollection object.

Declaration

Source position: objects.pp line 458

type PStringCollection = ^TStringCollection;


PStringList

Pointer to TStringList object.

Declaration

Source position: objects.pp line 545

type PStringList = ^TStringList;


PStrListMaker

Pointer to TStrListMaker object.

Declaration

Source position: objects.pp line 566

type PStrListMaker = ^TStrListMaker;


PtrRec

Record describing a pointer to a memory location.

Declaration

Source position: objects.pp line 203

type PtrRec = packed record
Ofs: Word; | Pointer offset
Seg: Word; | Pointer segment
end;


PUnSortedStrCollection

Pointer to TUnSortedStrCollection object.

Declaration

Source position: objects.pp line 485

type PUnSortedStrCollection = ^TUnSortedStrCollection;


PWordArray

Pointer to TWordArray

Declaration

Source position: objects.pp line 143

type PWordArray = ^TWordArray;


RCollection

Default stream record for the TCollection object.

Declaration

Source position: objects.pp line 698

const RCollection: TStreamRec = (ObjType: 50; VmtLink: Ofs(^ TypeOf(TCollection)); Load: @ TCollection.Load; Store: @ TCollection.Store; Next: Nil);


RStrCollection

Default stream record for the TStrCollection object.

Declaration

Source position: objects.pp line 712

const RStrCollection: TStreamRec = (ObjType: 69; VmtLink: Ofs(^ TypeOf(TStrCollection)); Load: @ TStrCollection.Load; Store: @ TStrCollection.Store; Next: Nil);


RStringCollection

Default stream record for the TStringCollection object.

Declaration

Source position: objects.pp line 705

const RStringCollection: TStreamRec = (ObjType: 51; VmtLink: Ofs(^ TypeOf(TStringCollection)); Load: @ TStringCollection.Load; Store: @ TStringCollection.Store; Next: Nil);


RStringList

Default stream record for the TStringList object.

Declaration

Source position: objects.pp line 719

const RStringList: TStreamRec = (ObjType: 52; VmtLink: Ofs(^ TypeOf(TStringList)); Load: @ TStringList.Load; Store: Nil; Next: Nil);


RStrListMaker

Default stream record for the TStrListMaker object.

Declaration

Source position: objects.pp line 726

const RStrListMaker: TStreamRec = (ObjType: 52; VmtLink: Ofs(^ TypeOf(TStrListMaker)); Load: Nil; Store: @ TStrListMaker.Store; Next: Nil);


stCreate

Stream initialization mode: Create new file

Declaration

Source position: objects.pp line 88

const stCreate = $3C00;


stError

Stream error codes: Access error

Declaration

Source position: objects.pp line 75

const stError = - 1;


stGetError

Stream error codes: Get object error

Declaration

Source position: objects.pp line 79

const stGetError = - 5;


stInitError

Stream error codes: Initialize error

Declaration

Source position: objects.pp line 76

const stInitError = - 2;


stOk

Stream error codes: No error

Declaration

Source position: objects.pp line 74

const stOk = 0;


stOpen

Stream initialization mode: Read/write access

Declaration

Source position: objects.pp line 91

const stOpen = $3D02;


stOpenError

Stream error codes: Error opening stream

Declaration

Source position: objects.pp line 82

const stOpenError = - 8;


stOpenRead

Stream initialization mode: Read access only

Declaration

Source position: objects.pp line 89

const stOpenRead = $3D00;


stOpenWrite

Stream initialization mode: Write access only

Declaration

Source position: objects.pp line 90

const stOpenWrite = $3D01;


stPutError

Stream error codes: Put object error

Declaration

Source position: objects.pp line 80

const stPutError = - 6;


stReadError

Stream error codes: Stream read error

Declaration

Source position: objects.pp line 77

const stReadError = - 3;


StreamError

Pointer to default stream error handler.

Declaration

Source position: objects.pp line 690

const StreamError: CodePointer = Nil;


stSeekError

Stream error codes: Seek error in stream

Declaration

Source position: objects.pp line 81

const stSeekError = - 7;


stWriteError

Stream error codes: Stream write error

Declaration

Source position: objects.pp line 78

const stWriteError = - 4;


Sw_Integer

Alias for longint

Declaration

Source position: objects.pp line 177

type Sw_Integer = LongInt;


Sw_Word

Alias for Cardinal

Declaration

Source position: objects.pp line 176

type Sw_Word = Cardinal;


TByteArray

Array with maxmimum allowed number of bytes.

Declaration

Source position: objects.pp line 139

type TByteArray = array [0..MaxBytes-1] of Byte;


TCharSet

Generic set of characters type.

Declaration

Source position: objects.pp line 132

type TCharSet = set of Char;


TItemList

Pointer array type used in a TCollection

Declaration

Source position: objects.pp line 387

type TItemList = array [0..MaxCollectionSize-1] of Pointer;


TStrIndex

Pointer array type used in a TStringList

Declaration

Source position: objects.pp line 528

type TStrIndex = array [0..9999] of TStrIndexRec;


TStrIndexRec

Record type used in a TStringList to store the strings

Declaration

Source position: objects.pp line 523

type TStrIndexRec = packed record
Key: Sw_Word; | String key value
Count: Word; | String character count
Offset: Word; | String offset in stream
end;


TWordArray

Array with maxmimum allowed number of words.

Declaration

Source position: objects.pp line 142

type TWordArray = array [0..MaxWords-1] of Word;


vmtHeaderSize

Size of the VMT header in an object (not used).

Declaration

Source position: objects.pp line 104

const vmtHeaderSize = 8;


WordRec

Record describing a Word (in bytes)

Declaration

Source position: objects.pp line 187

type WordRec = packed record
Hi: Byte; | High byte of a word
Lo: Byte; | Low byte of a word
end;


Reference for unit 'objpas'

Objpas - Delphi and objfpc mode system overrides

uses

  System;

The system unit

Overview

The objpas unit is meant for compatibility with Object Pascal as implemented by Delphi. The unit is loaded automatically by the Free Pascal compiler whenever the Delphi or objfpc mode is entered, either through the command line switches -Sd or -Sh or with the {$MODE DELPHI} or {$MODE OBJFPC} directives.

It redefines some basic pascal types, introduces some functions for compatibility with Delphi's system unit, and introduces some methods for the management of the resource string tables.


Reference for unit 'objpas': Constants

MaxInt

Maximum value for Integer type.


Reference for unit 'objpas': Types

Integer | Redefinition of integer as 32-bit type.
IntegerArray | Generic array of integer
PInteger | Pointer to Integer type.
PIntegerArray | Pointer to TIntegerArray type.
PointerArray | Generic Array of pointers.
PPointerArray | Pointer to PointerArray
PString | Pointer to ansistring type.
TBoundArray | Array of integer, used in interfaces.
TIntegerArray | Alias for IntegerArray
TPointerArray | Alias for PointerArray


Index of all identifiers in unit 'objpas'

I M P T

I

Integer IntegerArray

M

MaxInt

P

PInteger | PointerArray | PString
PIntegerArray | PPointerArray |

T

TBoundArray TIntegerArray TPointerArray


Integer

Redefinition of integer as 32-bit type.

Declaration

Source position: objpas.pp line 35

type Integer = LongInt;

Description

In OBJPAS mode and in DELPHI mode, an Integer has a size of 32 bit. In TP or regular FPC mode, an integer is 16 bit.


IntegerArray

Generic array of integer

Declaration

Source position: objpas.pp line 46

type IntegerArray = array [0..$effffff] of Integer;


MaxInt

Maximum value for Integer type.

Declaration

Source position: objpas.pp line 33

const MaxInt = MaxLongint;


PInteger

Pointer to Integer type.

Declaration

Source position: objpas.pp line 36

type PInteger = ^Integer;


PIntegerArray

Pointer to TIntegerArray type.

Declaration

Source position: objpas.pp line 49

type PIntegerArray = ^IntegerArray;


PointerArray

Generic Array of pointers.

Declaration

Source position: objpas.pp line 53

type PointerArray = array [0..512*1024*1024-2] of Pointer;


PPointerArray

Pointer to PointerArray

Declaration

Source position: objpas.pp line 56

type PPointerArray = ^PointerArray;


PString

Pointer to ansistring type.

Declaration

Source position: objpas.pp line 40

type PString = PAnsiString;


TBoundArray

Array of integer, used in interfaces.

Declaration

Source position: objpas.pp line 57

type TBoundArray = array of Integer;


TIntegerArray

Alias for IntegerArray

Declaration

Source position: objpas.pp line 48

type TIntegerArray = IntegerArray;


TPointerArray

Alias for PointerArray

Declaration

Source position: objpas.pp line 55

type TPointerArray = PointerArray;


Reference for unit 'ports'

Access to hardware ports

uses

  System;

The system unit

Overview

The ports unit implements the port constructs found in Turbo Pascal. It uses classes and default array properties to do this.

The unit exists on Linux, OS/2 and Dos. It is implemented only for compatibility with Turbo Pascal. Its usage is discouraged, because using ports is not portable programming, and the operating system may not even allow it (for instance Windows).

Under Linux, your program must be run as root, or the IOPerm call must be set in order to set appropriate permissions on the port access.


Reference for unit 'ports': Classes

tport | Type implemented to support integer-sized port access
tportl | Type implemented to support Longint-sized port access
tportw | Type implemented to support word-sized port access


Reference for unit 'ports': Variables

port | Provide port access per integer
portb | Provide port access per byte
portl | Provide port access per longint
portw | Provide port access per word


Index of all identifiers in unit 'ports'

P T

P

port | portl
portb | portw

T

tport tportl tportw


port

Provide port access per integer

Declaration

Source position: ports.pp line 55

var port: tport = ;

Description

Default instance of type TPort. Do not free. This variable is initialized in the unit initialization code, and freed at finalization.

Since there is a default property for a variable of this type, a sentence as

port[221]:=12;

Will result in the integer 12 being written to port 221, if port is defined as a variable of type tport


portb

Provide port access per byte

Declaration

Source position: ports.pp line 56

var portb: tport = ;

Description

Default instance of type TPort. Do not free. This variable is initialized in the unit initialization code, and freed at finalization.

Since there is a default property for a variable of this type, a sentence as

portb[221]:=12;

Will result in the byte 12 being written to port 221, if port is defined as a variable of type tport


portl

Provide port access per longint

Declaration

Source position: ports.pp line 58

var portl: tportl = ;

Description

Default instance of type TPortL. Do not free. This variable is initialized in the unit initialization code, and freed at finalization.

Since there is a default property for a variable of this type, a sentence as

portl[221]:=12;

Will result in the longint 12 being written to port 221, if port is defined as a variable of type tport


portw

Provide port access per word

Declaration

Source position: ports.pp line 57

var portw: tportw = ;

Description

Default instance of type TPortW. Do not free. This variable is initialized in the unit initialization code, and freed at finalization.

Since there is a default property for a variable of this type, a sentence as

portw[221]:=12;

Will result in the word 12 being written to port 221, if port is defined as a variable of type tport


Reference for unit 'printer'

Provide access to the printer.

uses

  System;

The system unit

Overview

This chapter describes the printer unit for Free Pascal. It was written for DOS by Florian Klaempfl, and it was written for Linux by Michael Van Canneyt, and has been ported to Windows and OS/2 as well. Its basic functionality is the same for all supported systems, although there are minor differences on Linux and UNIX.


Reference for unit 'printer': Procedures and functions

AssignLst | Assign text file to printing device
InitPrinter | Initialize the printer
IsLstAvailable | Determine whether printer is available.


Reference for unit 'printer': Variables

Lst

Default printing file.


Index of all identifiers in unit 'printer'

A I L

A

AssignLst

I

InitPrinter IsLstAvailable

L

Lst


Lst

Default printing file.

Declaration

Source position: printerh.inc line 16

var Lst: text = ;

Description

Lst is the standard printing device.
On Linux, Lst is set up using AssignLst('/tmp/PID.lst').

See also

AssignLst

Assign text file to printing device


Reference for unit 'sharemem'

Shared memory memory manager (windows)

uses

  System;

The system unit

Overview

sharemem implements a shared memory manager. Including this unit will replace the standard memory manager with a memory manager which uses shared memory. This means the memory allocated by this unit can be managed by a program and a DLL if they both use the shared memory manager: it allows, amongst other things, to pass ansistrings or unicode strings from a program to a DLL and vice versa.

This unit does not implement any routines: all actions to replace the memory manager are performed in the initialization section of the unit. The unit should be placed as the first unit in a program or DLL's uses section, memory corruption may occur if the unit is not placed first.

This unit requires the fpcmemdll.dll library to be distributed with both program and dll that use this unit. This DLL is distributed with the windows Free Pascal distribution.


Index of all identifiers in unit 'sharemem'

Documentation generated on: May 12 2018


AF_APPLETALK

Address family Appletalk DDP

Declaration

Source position: unxsockh.inc line 24

const AF_APPLETALK = 5;


AF_ASH

Address family: Ash

Declaration

Source position: unxsockh.inc line 38

const AF_ASH = 18;


AF_ATMPVC

Address family: ATM PVCs

Declaration

Source position: unxsockh.inc line 27

const AF_ATMPVC = 8;


AF_ATMSVC

Address family: ATM SVCs

Declaration

Source position: unxsockh.inc line 40

const AF_ATMSVC = 20;


AF_AX25

Address family Amateur Radio AX.25

Declaration

Source position: unxsockh.inc line 22

const AF_AX25 = 3;


AF_BLUETOOTH

Address family: Bluetooth sockets

Declaration

Source position: unxsockh.inc line 47

const AF_BLUETOOTH = 31;


AF_BRIDGE

Address family Multiprotocol bridge

Declaration

Source position: unxsockh.inc line 26

const AF_BRIDGE = 7;


AF_DECnet

Address family: Reserved for DECnet project.

Declaration

Source position: unxsockh.inc line 31

const AF_DECnet = 12;


AF_ECONET

Address family: Acorn Econet

Declaration

Source position: unxsockh.inc line 39

const AF_ECONET = 19;


AF_INET

Address family Internet IP Protocol

Declaration

Source position: unxsockh.inc line 21

const AF_INET = 2;


AF_INET6

Address family IP version 6

Declaration

Source position: unxsockh.inc line 29

const AF_INET6 = 10;


AF_IPX

Address family Novell IPX

Declaration

Source position: unxsockh.inc line 23

const AF_IPX = 4;


AF_IRDA

Address family: IRDA sockets

Declaration

Source position: unxsockh.inc line 42

const AF_IRDA = 23;


AF_KEY

Address family: PF_KEY key management API

Declaration

Source position: unxsockh.inc line 34

const AF_KEY = 15;


AF_LLC

Address family: Linux LLC

Declaration

Source position: unxsockh.inc line 45

const AF_LLC = 26;


AF_LOCAL

Address family: Unix socket

Declaration

Source position: unxsockh.inc line 20

const AF_LOCAL = 1;


AF_MAX

Address family Maximum value

Declaration

Source position: unxsockh.inc line 48

const AF_MAX = 32;


AF_NETBEUI

Address family: Reserved for 802.2LLC project

Declaration

Source position: unxsockh.inc line 32

const AF_NETBEUI = 13;


AF_NETLINK

Address family: ?

Declaration

Source position: unxsockh.inc line 35

const AF_NETLINK = 16;


AF_NETROM

Address family Amateur radio NetROM

Declaration

Source position: unxsockh.inc line 25

const AF_NETROM = 6;


AF_PACKET

Address family: Packet family

Declaration

Source position: unxsockh.inc line 37

const AF_PACKET = 17;


AF_PPPOX

Address family: PPPoX sockets

Declaration

Source position: unxsockh.inc line 43

const AF_PPPOX = 24;


AF_ROSE

Address family: Amateur Radio X.25 PLP

Declaration

Source position: unxsockh.inc line 30

const AF_ROSE = 11;


AF_ROUTE

Address family: Alias to emulate 4.4BSD.

Declaration

Source position: unxsockh.inc line 36

const AF_ROUTE = AF_NETLINK;


AF_SECURITY

Address family: Security callback pseudo AF

Declaration

Source position: unxsockh.inc line 33

const AF_SECURITY = 14;


AF_SNA

Addresss family: Linux SNA project

Declaration

Source position: unxsockh.inc line 41

const AF_SNA = 22;


AF_TIPC

Address family: TIPC sockets

Declaration

Source position: unxsockh.inc line 46

const AF_TIPC = 30;


AF_UNIX

Address family Unix domain sockets

Declaration

Source position: unxsockh.inc line 19

const AF_UNIX = 1;


AF_UNSPEC

Address family Not specified

Declaration

Source position: unxsockh.inc line 18

const AF_UNSPEC = 0;


AF_WANPIPE

Address family: Wanpipe API Sockets

Declaration

Source position: unxsockh.inc line 44

const AF_WANPIPE = 25;


AF_X25

Address family Reserved for X.25 project

Declaration

Source position: unxsockh.inc line 28

const AF_X25 = 9;


EsockADDRINUSE

Error number when socket address is already in use

Declaration

Source position: sockets.pp line 62

const EsockADDRINUSE = ESysEADDRINUSE;

Description

EsockADDRINUSE is the error reported by fpBind when the socket is already in use.

See also

fpBind

Bind a socket to an address.


EsockEACCESS

Access forbidden error

Declaration

Source position: sockets.pp line 50

const EsockEACCESS = ESysEAcces;


EsockEBADF

Alias: bad file descriptor

Declaration

Source position: sockets.pp line 47

const EsockEBADF = EsysEBADF;


EsockEFAULT

Alias: an error occurred

Declaration

Source position: sockets.pp line 48

const EsockEFAULT = EsysEFAULT;


EsockEINTR

Alias : operation interrupted

Declaration

Source position: sockets.pp line 46

const EsockEINTR = EsysEINTR;


EsockEINVAL

Alias: Invalid value specified

Declaration

Source position: sockets.pp line 49

const EsockEINVAL = EsysEINVAL;


EsockEMFILE

Error code ?

Declaration

Source position: sockets.pp line 51

const EsockEMFILE = ESysEmfile;


EsockEMSGSIZE

Wrong message size error

Declaration

Source position: sockets.pp line 53

const EsockEMSGSIZE = ESysEMsgSize;


EsockENOBUFS

No buffer space available error

Declaration

Source position: sockets.pp line 55

const EsockENOBUFS = ESysENoBufs;


EsockENOTCONN

Not connected error

Declaration

Source position: sockets.pp line 56

const EsockENOTCONN = ESysENotConn;


EsockENOTSOCK

File descriptor is not a socket error

Declaration

Source position: sockets.pp line 58

const EsockENOTSOCK = ESysENotSock;


EsockEPROTONOSUPPORT

Protocol not supported error

Declaration

Source position: sockets.pp line 60

const EsockEPROTONOSUPPORT = ESysEProtoNoSupport;


EsockEWOULDBLOCK

Operation would block error

Declaration

Source position: sockets.pp line 61

const EsockEWOULDBLOCK = ESysEWouldBlock;


in6_addr

General purpose IPV6 address

Declaration

Source position: socketsh.inc line 108

type in6_addr = packed record
case Byte of
0: (
u6_addr8: array [0..15] of Byte; | Address field using unsigned 8 bit elements
);
1: (
u6_addr16: array [0..7] of Word; | Address field using unsigned 16 bit elements
);
2: (
u6_addr32: array [0..3] of Cardinal; | Address field using unsigned 32 bit elements
);
3: (
s6_addr8: array [0..15] of ShortInt; | Address field using signed 8 bit elements
);
4: (
s6_addr: array [0..15] of ShortInt; | Address field using signed 8 bit elements
);
5: (
s6_addr16: array [0..7] of SmallInt; | Address field using signed 16 bit elements
);
6: (
s6_addr32: array [0..3] of LongInt; | Address field using signed 32 bit elements
);
end;

Description

Record used to describe a general IPV6 address.

See also

sockaddr_in6

Alias for sockaddr_in6


in_addr

General inet socket address.

Declaration

Source position: socketsh.inc line 55

type in_addr = packed record
case Boolean of
True: (
s_addr: cuint32; | Actual address
);
False: (
s_bytes: array [1..4] of Byte; | Address as bytes
);
end;


INADDR_ANY

A bitmask matching any IP address on the local machine.

Declaration

Source position: socketsh.inc line 45

const INADDR_ANY = CARDINAL(0);


INADDR_NONE

A bitmask matching no valid IP address

Declaration

Source position: socketsh.inc line 46

const INADDR_NONE = CARDINAL($FFFFFFFF);


Reference for unit 'Sockets'

TCP/IP Sockets functionality unit

uses
System, | The system unit
BaseUnix, | Basic Unix functionality
unixtype; | Basic unix types

Overview

This document describes the SOCKETS unit for Free Pascal. it was written for Linux by Michael Van Canneyt, and ported to Windows by Florian Klaempfl.


Reference for unit 'Sockets': Constants

AF_APPLETALK | Address family Appletalk DDP
AF_ASH | Address family: Ash
AF_ATMPVC | Address family: ATM PVCs
AF_ATMSVC | Address family: ATM SVCs
AF_AX25 | Address family Amateur Radio AX.25
AF_BLUETOOTH | Address family: Bluetooth sockets
AF_BRIDGE | Address family Multiprotocol bridge
AF_DECnet | Address family: Reserved for DECnet project.
AF_ECONET | Address family: Acorn Econet
AF_INET | Address family Internet IP Protocol
AF_INET6 | Address family IP version 6
AF_IPX | Address family Novell IPX
AF_IRDA | Address family: IRDA sockets
AF_KEY | Address family: PF_KEY key management API
AF_LLC | Address family: Linux LLC
AF_LOCAL | Address family: Unix socket
AF_MAX | Address family Maximum value
AF_NETBEUI | Address family: Reserved for 802.2LLC project
AF_NETLINK | Address family: ?
AF_NETROM | Address family Amateur radio NetROM
AF_PACKET | Address family: Packet family
AF_PPPOX | Address family: PPPoX sockets
AF_ROSE | Address family: Amateur Radio X.25 PLP
AF_ROUTE | Address family: Alias to emulate 4.4BSD.
AF_SECURITY | Address family: Security callback pseudo AF
AF_SNA | Addresss family: Linux SNA project
AF_TIPC | Address family: TIPC sockets
AF_UNIX | Address family Unix domain sockets
AF_UNSPEC | Address family Not specified
AF_WANPIPE | Address family: Wanpipe API Sockets
AF_X25 | Address family Reserved for X.25 project
EsockADDRINUSE | Error number when socket address is already in use
EsockEACCESS | Access forbidden error
EsockEBADF | Alias: bad file descriptor
EsockEFAULT | Alias: an error occurred
EsockEINTR | Alias : operation interrupted
EsockEINVAL | Alias: Invalid value specified
EsockEMFILE | Error code ?
EsockEMSGSIZE | Wrong message size error
EsockENOBUFS | No buffer space available error
EsockENOTCONN | Not connected error
EsockENOTSOCK | File descriptor is not a socket error
EsockEPROTONOSUPPORT | Protocol not supported error
EsockEWOULDBLOCK | Operation would block error
INADDR_ANY | A bitmask matching any IP address on the local machine.
INADDR_NONE | A bitmask matching no valid IP address
IPPROTO_AH | authentication header.
IPPROTO_COMP | Compression Header Protocol.
IPPROTO_DSTOPTS | IPv6 destination options.
IPPROTO_EGP | Exterior Gateway Protocol.
IPPROTO_ENCAP | Encapsulation Header.
IPPROTO_ESP | encapsulating security payload.
IPPROTO_FRAGMENT | IPv6 fragmentation header.
IPPROTO_GRE | General Routing Encapsulation.
IPPROTO_HOPOPTS | IPv6 Hop-by-Hop options.
IPPROTO_ICMP | Internet Control Message Protocol.
IPPROTO_ICMPV6 | ICMPv6.
IPPROTO_IDP | XNS IDP protocol.
IPPROTO_IGMP | Internet Group Management Protocol.
IPPROTO_IP | Dummy protocol for TCP.
IPPROTO_IPIP | IPIP tunnels (older KA9Q tunnels use 94).
IPPROTO_IPV6 | IPv6 header.
IPPROTO_MAX | Maximum value for IPPROTO options
IPPROTO_MTP | Multicast Transport Protocol.
IPPROTO_NONE | IPv6 no next header.
IPPROTO_PIM | Protocol Independent Multicast.
IPPROTO_PUP | PUP protocol.
IPPROTO_RAW | Raw IP packets.
IPPROTO_ROUTING | IPv6 routing header.
IPPROTO_RSVP | Reservation Protocol.
IPPROTO_SCTP | Stream Control Transmission Protocol.
IPPROTO_TCP | Transmission Control Protocol.
IPPROTO_TP | SO Transport Protocol Class 4.
IPPROTO_UDP | User Datagram Protocol.
IPV6_ADDRFORM | Change the IPV6 address into a different address family. Deprecated
IPV6_ADD_MEMBERSHIP | Undocumented Getsockopt option ?
IPV6_AUTHHDR | GetSockOpt/SetSockopt: Deliver authentication header messages
IPV6_CHECKSUM | Undocumented Getsockopt option ?
IPV6_DROP_MEMBERSHIP | Undocumented Getsockopt option ?
IPV6_DSTOPTS | Deliver destination option control messages
IPV6_HOPLIMIT | Deliver an integer containing the HOP count
IPV6_HOPOPTS | Deliver hop option control messages
IPV6_IPSEC_POLICY | Undocumented Getsockopt option ?
IPV6_JOIN_ANYCAST | Undocumented Getsockopt option ?
IPV6_JOIN_GROUP | GetSockOpt/SetSockopt: Control membership (join group) in multicast groups
IPV6_LEAVE_ANYCAST | Undocumented Getsockopt option ?
IPV6_LEAVE_GROUP | GetSockOpt/SetSockopt: Control membership (leave group)in multicast groups
IPV6_MTU | GetSockOpt/SetSockopt: Get/Set the MTU for the socket
IPV6_MTU_DISCOVER | GetSockOpt/SetSockopt: Get/Set Control path MTU Discovery on the socket
IPV6_MULTICAST_HOPS | GetSockOpt/SetSockopt: Get/Set the multicast hop limit.
IPV6_MULTICAST_IF | GetSockOpt/SetSockopt: Get/Set device for multicast packages on the socket.
IPV6_MULTICAST_LOOP | GetSockOpt/SetSockopt: Control whether socket sees multicast packages that it has sent itself
IPV6_NEXTHOP | sendmsg: set next hop for IPV6 datagram
IPV6_PKTINFO | Change delivery options for incoming IPV6 datagrams
IPV6_PKTOPTIONS | Undocumented Getsockopt option ?
IPV6_PMTUDISC_DO | Always DF.
IPV6_PMTUDISC_DONT | Never send DF frames.
IPV6_PMTUDISC_WANT | Use per route hints.
IPV6_RECVERR | GetSockOpt/SetSockopt: Control receiving of asynchroneous error options
IPV6_ROUTER_ALERT | GetSockOpt/SetSockopt: Get/Set Pass all forwarded packets containing router alert option
IPV6_RTHDR | Deliver routing header control messages
IPV6_RTHDR_LOOSE | Hop doesn't need to be neighbour.
IPV6_RTHDR_STRICT | Hop must be a neighbour.
IPV6_RTHDR_TYPE_0 | IPv6 Routing header type 0.
IPV6_RXDSTOPTS | Undocumented Getsockopt option ?
IPV6_RXHOPOPTS | Undocumented Getsockopt option ?
IPV6_RXSRCRT | Undocumented Getsockopt option ?
IPV6_UNICAST_HOPS | GetSockOpt/SetSockopt: Get/Set unicast hop limit
IPV6_V6ONLY | GetSockOpt/SetSockopt: Handle IPV6 connections only
IPV6_XFRM_POLICY | Undocumented Getsockopt option ?
IP_ADD_MEMBERSHIP | add an IP group membership
IP_ADD_SOURCE_MEMBERSHIP | join source group
IP_BLOCK_SOURCE | block data from source
IP_DEFAULT_MULTICAST_LOOP | Undocumented ?
IP_DEFAULT_MULTICAST_TTL | Undocumented ?
IP_DROP_MEMBERSHIP | drop an IP group membership
IP_DROP_SOURCE_MEMBERSHIP | leave source group
IP_HDRINCL | Header is included with data.
IP_MAX_MEMBERSHIPS | Maximum group memberships for multicast messages
IP_MSFILTER | Undocumented ?
IP_MTU_DISCOVER | Undocumented ?
IP_MULTICAST_IF | set/get IP multicast i/f
IP_MULTICAST_LOOP | set/get IP multicast loopback
IP_MULTICAST_TTL | set/get IP multicast ttl
IP_OPTIONS | IP per-packet options.
IP_PKTINFO | Undocumented ?
IP_PKTOPTIONS | Undocumented ?
IP_PMTUDISC | Undocumented ?
IP_PMTUDISC_DO | Always DF.
IP_PMTUDISC_DONT | Never send DF frames.
IP_PMTUDISC_WANT | Use per route hints.
IP_RECVERR | Undocumented ?
IP_RECVOPTS | Receive all IP options w/datagram.
IP_RECVRETOPTS | Receive IP options for response.
IP_RECVTOS | Undocumented ?
IP_RECVTTL | Undocumented ?
IP_RETOPTS | Set/get IP per-packet options.
IP_ROUTER_ALERT | Undocumented ?
IP_TOS | IP type of service and precedence.
IP_TTL | IP time to live.
IP_UNBLOCK_SOURCE | unblock data from source
MCAST_BLOCK_SOURCE | block from given group
MCAST_EXCLUDE | Undocumented ?
MCAST_INCLUDE | Undocumented ?
MCAST_JOIN_GROUP | join any-source group
MCAST_JOIN_SOURCE_GROUP | join source-spec gruoup
MCAST_LEAVE_GROUP | leave any-source group
MCAST_LEAVE_SOURCE_GROUP | leave source-spec group
MCAST_MSFILTER | Undocumented ?
MCAST_UNBLOCK_SOURCE | unblock from given group
MSG_CONFIRM | Send flags: Conform connection
MSG_CTRUNC | Receive flags: Control Data was discarded (buffer too small)
MSG_DONTROUTE | Send flags: don't use gateway
MSG_DONTWAIT | Receive flags: Non-blocking operation request.
MSG_EOF | Alias for MSG_FIN
MSG_EOR | Receive flags: End of record
MSG_ERRQUERE | Receive flags: ?
MSG_FIN | Receive flags: ?
MSG_MORE | Receive flags: ?
MSG_NOSIGNAL | Receive flags: Suppress SIG_PIPE signal.
MSG_OOB | Receive flags: receive out-of-band data.
MSG_PEEK | Receive flags: peek at data, don't remove from buffer.
MSG_PROXY | Receive flags: ?
MSG_RST | Receive flags: ?
MSG_SYN | Receive flags: ?
MSG_TRUNC | Receive flags: packet Data was discarded (buffer too small)
MSG_TRYHARD | Receive flags: ?
MSG_WAITALL | Receive flags: Wait till operation completed.
NoAddress | Constant indicating invalid (no) network address.
NoAddress6 | Constant indicating invalid (no) IPV6 network address.
NoNet | Constant indicating invalid (no) network address.
NoNet6 | Constant indicating invalid (no) IPV6 network address.
PF_APPLETALK | Protocol family: Appletalk DDP
PF_ASH | Protocol family: Ash
PF_ATMPVC | Protocol family: ATM PVCs
PF_ATMSVC | Protocol family: ATM SVCs
PF_AX25 | Protocol family: Amateur Radio AX.25
PF_BLUETOOTH | Protocol family: Bluetooth sockets
PF_BRIDGE | Protocol family: Multiprotocol bridge
PF_DECnet | Protocol Family: DECNET project
PF_ECONET | Protocol family: Acorn Econet
PF_INET | Protocol family: Internet IP Protocol
PF_INET6 | Protocol family: IP version 6
PF_IPX | Protocol family: Novell IPX
PF_IRDA | Protocol family: IRDA sockets
PF_KEY | Protocol family: Key management API
PF_LLC | Protocol family: Linux LLC
PF_LOCAL | Protocol family: Unix socket
PF_MAX | Protocol family: Maximum value
PF_NETBEUI | Protocol family: Reserved for 802.2LLC project
PF_NETLINK | Protocol family: ?
PF_NETROM | Protocol family:Amateur radio NetROM
PF_PACKET | Protocol family: Packet family
PF_PPPOX | Protocol family: PPPoX sockets
PF_ROSE | Protocol family: Amateur Radio X.25 PLP
PF_ROUTE | Protocol Family: ?
PF_SECURITY | Protocol family: Security callback pseudo PF
PF_SNA | Protocol Family: Linux SNA project
PF_TIPC | Protocol family: TIPC sockets
PF_UNIX | Protocol family: Unix domain sockets
PF_UNSPEC | Protocol family: Unspecified
PF_WANPIPE | Protocol family: Wanpipe API Sockets
PF_X25 | Protocol family: Reserved for X.25 project
SCM_SRCRT | Undocumented Getsockopt option ?
SCM_TIMESTAMP | Socket option: ?
SHUT_RD | Shutdown read part of full duplex socket
SHUT_RDWR | Shutdown read and write part of full duplex socket
SHUT_WR | Shutdown write part of full duplex socket
SOCK_DGRAM | Type of socket: datagram (conn.less) socket (UDP)
SOCK_MAXADDRLEN | Maximum socket address length for Bind call.
SOCK_RAW | Type of socket: raw socket
SOCK_RDM | Type of socket: reliably-delivered message
SOCK_SEQPACKET | Type of socket: sequential packet socket
SOCK_STREAM | Type of socket: stream (connection) type socket (TCP)
SOL_ICMPV6 | Socket level values for IPv6: ICMPV6
SOL_IP | Undocumented ?
SOL_IPV6 | Socket level values for IPv6: IPV6
SOL_SOCKET | Socket option level: Socket level
SOMAXCONN | Maximum queue length specifiable by listen.
SO_ACCEPTCONN | Socket option: ?
SO_ATTACH_FILTER | Socket option: ?
SO_BINDTODEVICE | Socket option: ?
SO_BROADCAST | Socket option: Broadcast
SO_BSDCOMPAT | Socket option: ?
SO_DEBUG | Socket option level: debug
SO_DETACH_FILTER | Socket option: ?
SO_DONTROUTE | Socket option: Don't route
SO_ERROR | Socket option: Error
SO_KEEPALIVE | Socket option: keep alive
SO_LINGER | Socket option: ?
SO_NO_CHECK | Socket option: ?
SO_OOBINLINE | Socket option: ?
SO_PASSCRED | Socket option: ?
SO_PEERCRED | Socket option: ?
SO_PEERNAME | Socket option: ?
SO_PRIORITY | Socket option: ?
SO_RCVBUF | Socket option: receive buffer
SO_RCVLOWAT | Socket option: ?
SO_RCVTIMEO | Socket option: ?
SO_REUSEADDR | Socket option: Reuse address
SO_SECURITY_AUTHENTICATION | Socket option: ?
SO_SECURITY_ENCRYPTION_NETWORK | Socket option: ?
SO_SECURITY_ENCRYPTION_TRANSPORT | Socket option: ?
SO_SNDBUF | Socket option: Send buffer
SO_SNDLOWAT | Socket option: ?
SO_SNDTIMEO | Socket option: ?
SO_TIMESTAMP | Socket option: ?
SO_TYPE | Socket option: Type
S_IN | Input socket in socket pair.
S_OUT | Output socket in socket pair
TCP_CONGESTION | Get/set the congestion-control algorithm for this socket
TCP_CORK | Get/Set CORK algorithm: Send only complete packets
TCP_DEFER_ACCEPT | Get/Set deferred accept on server socket
TCP_INFO | Get TCP connection information (Linux only)
TCP_KEEPCNT | Get/Set retry count for unacknowledged KEEPALIVE transmissions.
TCP_KEEPIDLE | Get/Set inactivity interval between KEEPALIVE transmissions.
TCP_KEEPINTVL | Get/Set retry interval for unacknowledged KEEPALIVE transmissions.
TCP_LINGER2 | Get/Set Linger2 flag
TCP_MAXSEG | Get/Set Maximum segment size
TCP_MD5SIG | Get/Set TCP MD5 signature option
TCP_NODELAY | Get/Set No delay flag: disable Nagle algorithm
TCP_QUICKACK | Get/Set quik ACK packet option.
TCP_SYNCNT | Get/Set number of SYN packets to send before givin up on connection establishment
TCP_WINDOW_CLAMP | Get/Set maximum packet size
UDP_CORK | Get/Set UDP CORK algorithm on datagram sockets
UDP_ENCAP | Get/Set UDP encapsulation flag for IPSec datagram sockets
UDP_ENCAP_ESPINUDP | ? Undocumented datagram option, IPSec related
UDP_ENCAP_ESPINUDP_NON_IKE | ? Undocumented datagram option, IPSec related
UDP_ENCAP_L2TPINUDP | ? Undocumented datagram option, IPSec related


Reference for unit 'Sockets': Types

in6_addr | General purpose IPV6 address
in_addr | General inet socket address.
linger | Record used in setsockopt
PIn6Addr | Pointer to in6_addr type.
pin6_addr | Pointer to Tin6_addr
PInAddr | Alias for pin_addr
PInetSockAddr | Pointer to sockaddr_in
PInetSockAddr6 | Pointer to sockaddr_in6 type
pin_addr | Pointer to in_addr record.
plinger | Pointer to linger type.
psockaddr | Pointer to TSockAddr
PSockAddr6 | Pointer to TSockAddr6
psockaddr_in | Pointer to sockaddr_in
psockaddr_in6 | Pointer to sockaddr_in6
psockaddr_un | Pointer to sockaddr_un type.
sa_family_t | Address family type
sockaddr | Alias for TSockAddr record type.
sockaddr_in | Internet socket address record
sockaddr_in6 | Alias for sockaddr_in6
sockaddr_un | Unix socket address record.
TIn6Addr | Alias for in6_addr type.
Tin6_addr | Alias for sockaddr_in6
TInAddr | Alias for in_addr record type.
TInetSockAddr | Alias for sockaddr_in
TInetSockAddr6 | Alias for sockaddr_in6
TIn_addr | Alias for in_addr record type.
TLinger | Alias for linger
TSockAddr
TSockAddr6 | Alias for sockaddr_in6/>
TSockArray | Type returned by the FPSocketPair call.
Tsocket | Alias for easy kylix porting
TSockLen | Type to specify socket length in fpBind and fpConnect
TSockPairArray | Array of sockets, used in FPSocketPair call.
TUnixSockAddr | Alias for sockaddr_un


Reference for unit 'Sockets': Procedures and functions

Accept | Accept a connection from a socket (deprecated).
Bind | Alias for fpBind.
CloseSocket | Closes a socket handle.
Connect | Open a connection to a server socket (deprecated).
fpaccept | Accept a connection from a socket.
fpbind | Bind a socket to an address.
fpconnect | Open a connection to a server socket.
fpgetpeername | Return the name (address) of the connected peer.
fpgetsockname | Return name of socket.
fpgetsockopt | Get current socket options
fplisten | Listen for connections on a socket.
fprecv | Receive data on socket
fprecvfrom | Receive data from an unconnected socket
fpsend | Send data through socket
fpsendto | Send data through an unconnected socket to an address.
fpsetsockopt | Set socket options.
fpshutdown | Close one end of full duplex connection.
fpsocket | Create new socket
fpsocketpair | Create socket pair.
HostAddrToStr | Convert a host address to a string.
HostAddrToStr6 | Convert a IPV6 host address to a string representation.
HostToNet | Convert a host address to a network address
htonl | Convert long integer from host ordered to network ordered
htons | Convert short integer from host ordered to network ordered
NetAddrToStr | Convert a network address to a string.
NetAddrToStr6 | Convert a IPV6 network address to a string.
NetToHost | Convert a network address to a host address.
NToHl | Convert long integer from network ordered to host ordered
NToHs | Convert short integer from network ordered to host ordered
ShortHostToNet | Convert a host port number to a network port number
ShortNetToHost | Convert a network port number to a host port number
Sock2File | Convert socket to untyped file descriptors
Sock2Text | Convert socket to text file descriptors
socketerror | Contains the error code for the last socket operation.
Str2UnixSockAddr | Convert path to TUnixSockAddr
StrToHostAddr | Convert a string to a host address.
StrToHostAddr6 | Convert a string to a IPV6 host address.
StrToNetAddr | Convert a string to a network address.
StrToNetAddr6 | Convert a string to a IPV6 network address


Index of all identifiers in unit 'Sockets'

A B C E F H I L M N P S T U

A

Accept | AF_INET6 | AF_PPPOX
AF_APPLETALK | AF_IPX | AF_ROSE
AF_ASH | AF_IRDA | AF_ROUTE
AF_ATMPVC | AF_KEY | AF_SECURITY
AF_ATMSVC | AF_LLC | AF_SNA
AF_AX25 | AF_LOCAL | AF_TIPC
AF_BLUETOOTH | AF_MAX | AF_UNIX
AF_BRIDGE | AF_NETBEUI | AF_UNSPEC
AF_DECnet | AF_NETLINK | AF_WANPIPE
AF_ECONET | AF_NETROM | AF_X25
AF_INET | AF_PACKET |

B

Bind

C

CloseSocket Connect

E

EsockADDRINUSE | EsockEINVAL | EsockENOTSOCK
EsockEACCESS | EsockEMFILE | EsockEPROTONOSUPPORT
EsockEBADF | EsockEMSGSIZE | EsockEWOULDBLOCK
EsockEFAULT | EsockENOBUFS |
EsockEINTR | EsockENOTCONN |

F

fpaccept | fpgetsockopt | fpsendto
fpbind | fplisten | fpsetsockopt
fpconnect | fprecv | fpshutdown
fpgetpeername | fprecvfrom | fpsocket
fpgetsockname | fpsend | fpsocketpair

H

HostAddrToStr | HostToNet | htons
HostAddrToStr6 | htonl |

I

in6_addr | IPPROTO_HOPOPTS | IPV6_CHECKSUM
in_addr | IPPROTO_ICMP | IPV6_DROP_MEMBERSHIP
INADDR_ANY | IPPROTO_ICMPV6 | IPV6_DSTOPTS
INADDR_NONE | IPPROTO_IDP | IPV6_HOPLIMIT
IP_ADD_MEMBERSHIP | IPPROTO_IGMP | IPV6_HOPOPTS
IP_ADD_SOURCE_MEMBERSHIP | IPPROTO_IP | IPV6_IPSEC_POLICY
IP_BLOCK_SOURCE | IPPROTO_IPIP | IPV6_JOIN_ANYCAST
IP_DEFAULT_MULTICAST_LOOP | IPPROTO_IPV6 | IPV6_JOIN_GROUP
IP_DEFAULT_MULTICAST_TTL | IPPROTO_MAX | IPV6_LEAVE_ANYCAST
IP_DROP_MEMBERSHIP | IPPROTO_MTP | IPV6_LEAVE_GROUP
IP_DROP_SOURCE_MEMBERSHIP | IPPROTO_NONE | IPV6_MTU
IP_HDRINCL | IPPROTO_PIM | IPV6_MTU_DISCOVER
IP_MAX_MEMBERSHIPS | IPPROTO_PUP | IPV6_MULTICAST_HOPS
IP_MSFILTER | IPPROTO_RAW | IPV6_MULTICAST_IF
IP_MTU_DISCOVER | IPPROTO_ROUTING | IPV6_MULTICAST_LOOP
IP_MULTICAST_IF | IPPROTO_RSVP | IPV6_NEXTHOP
IP_MULTICAST_LOOP | IPPROTO_SCTP | IPV6_PKTINFO
IP_MULTICAST_TTL | IPPROTO_TCP | IPV6_PKTOPTIONS
IP_OPTIONS | IPPROTO_TP | IPV6_PMTUDISC_DO
IP_PKTINFO | IPPROTO_UDP | IPV6_PMTUDISC_DONT
IP_PKTOPTIONS | IP_RECVERR | IPV6_PMTUDISC_WANT
IP_PMTUDISC | IP_RECVOPTS | IPV6_RECVERR
IP_PMTUDISC_DO | IP_RECVRETOPTS | IPV6_ROUTER_ALERT
IP_PMTUDISC_DONT | IP_RECVTOS | IPV6_RTHDR
IP_PMTUDISC_WANT | IP_RECVTTL | IPV6_RTHDR_LOOSE
IPPROTO_AH | IP_RETOPTS | IPV6_RTHDR_STRICT
IPPROTO_COMP | IP_ROUTER_ALERT | IPV6_RTHDR_TYPE_0
IPPROTO_DSTOPTS | IP_TOS | IPV6_RXDSTOPTS
IPPROTO_EGP | IP_TTL | IPV6_RXHOPOPTS
IPPROTO_ENCAP | IP_UNBLOCK_SOURCE | IPV6_RXSRCRT
IPPROTO_ESP | IPV6_ADD_MEMBERSHIP | IPV6_UNICAST_HOPS
IPPROTO_FRAGMENT | IPV6_ADDRFORM | IPV6_V6ONLY
IPPROTO_GRE | IPV6_AUTHHDR | IPV6_XFRM_POLICY

L

linger

M

MCAST_BLOCK_SOURCE | MSG_CONFIRM | MSG_NOSIGNAL
MCAST_EXCLUDE | MSG_CTRUNC | MSG_OOB
MCAST_INCLUDE | MSG_DONTROUTE | MSG_PEEK
MCAST_JOIN_GROUP | MSG_DONTWAIT | MSG_PROXY
MCAST_JOIN_SOURCE_GROUP | MSG_EOF | MSG_RST
MCAST_LEAVE_GROUP | MSG_EOR | MSG_SYN
MCAST_LEAVE_SOURCE_GROUP | MSG_ERRQUERE | MSG_TRUNC
MCAST_MSFILTER | MSG_FIN | MSG_TRYHARD
MCAST_UNBLOCK_SOURCE | MSG_MORE | MSG_WAITALL

N

NetAddrToStr | NoAddress | NoNet6
NetAddrToStr6 | NoAddress6 | NToHl
NetToHost | NoNet | NToHs

P

PF_APPLETALK | PF_LOCAL | PF_X25
PF_ASH | PF_MAX | PIn6Addr
PF_ATMPVC | PF_NETBEUI | pin6_addr
PF_ATMSVC | PF_NETLINK | PInAddr
PF_AX25 | PF_NETROM | pin_addr
PF_BLUETOOTH | PF_PACKET | PInetSockAddr
PF_BRIDGE | PF_PPPOX | PInetSockAddr6
PF_DECnet | PF_ROSE | plinger
PF_ECONET | PF_ROUTE | psockaddr
PF_INET | PF_SECURITY | PSockAddr6
PF_INET6 | PF_SNA | psockaddr_in
PF_IPX | PF_TIPC | psockaddr_in6
PF_IRDA | PF_UNIX | psockaddr_un
PF_KEY | PF_UNSPEC |
PF_LLC | PF_WANPIPE |

S

sa_family_t | socketerror | SO_PEERNAME
SCM_SRCRT | SOCK_MAXADDRLEN | SO_PRIORITY
SCM_TIMESTAMP | SOCK_RAW | SO_RCVBUF
ShortHostToNet | SOCK_RDM | SO_RCVLOWAT
ShortNetToHost | SOCK_SEQPACKET | SO_RCVTIMEO
SHUT_RD | SOCK_STREAM | SO_REUSEADDR
SHUT_RDWR | SO_DEBUG | SO_SECURITY_AUTHENTICATION
SHUT_WR | SO_DETACH_FILTER | SO_SECURITY_ENCRYPTION_NETWORK
S_IN | SO_DONTROUTE | SO_SECURITY_ENCRYPTION_TRANSPORT
SO_ACCEPTCONN | SO_ERROR | SO_SNDBUF
SO_ATTACH_FILTER | SO_KEEPALIVE | SO_SNDLOWAT
SO_BINDTODEVICE | SOL_ICMPV6 | SO_SNDTIMEO
SO_BROADCAST | SO_LINGER | SO_TIMESTAMP
SO_BSDCOMPAT | SOL_IP | SO_TYPE
Sock2File | SOL_IPV6 | S_OUT
Sock2Text | SOL_SOCKET | Str2UnixSockAddr
sockaddr | SOMAXCONN | StrToHostAddr
sockaddr_in | SO_NO_CHECK | StrToHostAddr6
sockaddr_in6 | SO_OOBINLINE | StrToNetAddr
sockaddr_un | SO_PASSCRED | StrToNetAddr6
SOCK_DGRAM | SO_PEERCRED |

T

TCP_CONGESTION | TCP_NODELAY | TLinger
TCP_CORK | TCP_QUICKACK | TSockAddr
TCP_DEFER_ACCEPT | TCP_SYNCNT | TSockAddr6
TCP_INFO | TCP_WINDOW_CLAMP | TSockArray
TCP_KEEPCNT | TIn6Addr | Tsocket
TCP_KEEPIDLE | Tin6_addr | TSockLen
TCP_KEEPINTVL | TInAddr | TSockPairArray
TCP_LINGER2 | TIn_addr | TUnixSockAddr
TCP_MAXSEG | TInetSockAddr |
TCP_MD5SIG | TInetSockAddr6 |

U

UDP_CORK | UDP_ENCAP_ESPINUDP | UDP_ENCAP_L2TPINUDP
UDP_ENCAP | UDP_ENCAP_ESPINUDP_NON_IKE |


IP_ADD_MEMBERSHIP

add an IP group membership

Declaration

Source position: unxsockh.inc line 189

const IP_ADD_MEMBERSHIP = 35;


IP_ADD_SOURCE_MEMBERSHIP

join source group

Declaration

Source position: unxsockh.inc line 193

const IP_ADD_SOURCE_MEMBERSHIP = 39;


IP_BLOCK_SOURCE

block data from source

Declaration

Source position: unxsockh.inc line 192

const IP_BLOCK_SOURCE = 38;


IP_DEFAULT_MULTICAST_LOOP

Undocumented ?

Declaration

Source position: unxsockh.inc line 226

const IP_DEFAULT_MULTICAST_LOOP = 1;


IP_DEFAULT_MULTICAST_TTL

Undocumented ?

Declaration

Source position: unxsockh.inc line 225

const IP_DEFAULT_MULTICAST_TTL = 1;


IP_DROP_MEMBERSHIP

drop an IP group membership

Declaration

Source position: unxsockh.inc line 190

const IP_DROP_MEMBERSHIP = 36;


IP_DROP_SOURCE_MEMBERSHIP

leave source group

Declaration

Source position: unxsockh.inc line 194

const IP_DROP_SOURCE_MEMBERSHIP = 40;


IP_HDRINCL

Header is included with data.

Declaration

Source position: unxsockh.inc line 178

const IP_HDRINCL = 3;


IP_MAX_MEMBERSHIPS

Maximum group memberships for multicast messages

Declaration

Source position: unxsockh.inc line 227

const IP_MAX_MEMBERSHIPS = 20;


IP_MSFILTER

Undocumented ?

Declaration

Source position: unxsockh.inc line 195

const IP_MSFILTER = 41;


IP_MTU_DISCOVER

Undocumented ?

Declaration

Source position: unxsockh.inc line 211

const IP_MTU_DISCOVER = 10;


IP_MULTICAST_IF

set/get IP multicast i/f

Declaration

Source position: unxsockh.inc line 186

const IP_MULTICAST_IF = 32;


IP_MULTICAST_LOOP

set/get IP multicast loopback

Declaration

Source position: unxsockh.inc line 188

const IP_MULTICAST_LOOP = 34;


IP_MULTICAST_TTL

set/get IP multicast ttl

Declaration

Source position: unxsockh.inc line 187

const IP_MULTICAST_TTL = 33;


IP_OPTIONS

IP per-packet options.

Declaration

Source position: unxsockh.inc line 177

const IP_OPTIONS = 4;


IP_PKTINFO

Undocumented ?

Declaration

Source position: unxsockh.inc line 208

const IP_PKTINFO = 8;


IP_PKTOPTIONS

Undocumented ?

Declaration

Source position: unxsockh.inc line 209

const IP_PKTOPTIONS = 9;


IP_PMTUDISC

Undocumented ?

Declaration

Source position: unxsockh.inc line 210

const IP_PMTUDISC = 10;


IP_PMTUDISC_DO

Always DF.

Declaration

Source position: unxsockh.inc line 220

const IP_PMTUDISC_DO = 2;


IP_PMTUDISC_DONT

Never send DF frames.

Declaration

Source position: unxsockh.inc line 218

const IP_PMTUDISC_DONT = 0;


IP_PMTUDISC_WANT

Use per route hints.

Declaration

Source position: unxsockh.inc line 219

const IP_PMTUDISC_WANT = 1;


IP_RECVERR

Undocumented ?

Declaration

Source position: unxsockh.inc line 212

const IP_RECVERR = 11;


IP_RECVOPTS

Receive all IP options w/datagram.

Declaration

Source position: unxsockh.inc line 181

const IP_RECVOPTS = 6;


IP_RECVRETOPTS

Receive IP options for response.

Declaration

Source position: unxsockh.inc line 184

const IP_RECVRETOPTS = IP_RETOPTS;


IP_RECVTOS

Undocumented ?

Declaration

Source position: unxsockh.inc line 214

const IP_RECVTOS = 13;


IP_RECVTTL

Undocumented ?

Declaration

Source position: unxsockh.inc line 213

const IP_RECVTTL = 12;


IP_RETOPTS

Set/get IP per-packet options.

Declaration

Source position: unxsockh.inc line 183

const IP_RETOPTS = 7;


IP_ROUTER_ALERT

Undocumented ?

Declaration

Source position: unxsockh.inc line 207

const IP_ROUTER_ALERT = 5;


IP_TOS

IP type of service and precedence.

Declaration

Source position: unxsockh.inc line 179

const IP_TOS = 1;


IP_TTL

IP time to live.

Declaration

Source position: unxsockh.inc line 180

const IP_TTL = 2;


IP_UNBLOCK_SOURCE

unblock data from source

Declaration

Source position: unxsockh.inc line 191

const IP_UNBLOCK_SOURCE = 37;


IPPROTO_AH

authentication header.

Declaration

Source position: unxsockh.inc line 161

const IPPROTO_AH = 51;


IPPROTO_COMP

Compression Header Protocol.

Declaration

Source position: unxsockh.inc line 168

const IPPROTO_COMP = 108;


IPPROTO_DSTOPTS

IPv6 destination options.

Declaration

Source position: unxsockh.inc line 164

const IPPROTO_DSTOPTS = 60;


IPPROTO_EGP

Exterior Gateway Protocol.

Declaration

Source position: unxsockh.inc line 148

const IPPROTO_EGP = 8;


IPPROTO_ENCAP

Encapsulation Header.

Declaration

Source position: unxsockh.inc line 166

const IPPROTO_ENCAP = 98;


IPPROTO_ESP

encapsulating security payload.

Declaration

Source position: unxsockh.inc line 160

const IPPROTO_ESP = 50;


IPPROTO_FRAGMENT

IPv6 fragmentation header.

Declaration

Source position: unxsockh.inc line 157

const IPPROTO_FRAGMENT = 44;


IPPROTO_GRE

General Routing Encapsulation.

Declaration

Source position: unxsockh.inc line 159

const IPPROTO_GRE = 47;


IPPROTO_HOPOPTS

IPv6 Hop-by-Hop options.

Declaration

Source position: unxsockh.inc line 142

const IPPROTO_HOPOPTS = 0;


IPPROTO_ICMP

Internet Control Message Protocol.

Declaration

Source position: unxsockh.inc line 144

const IPPROTO_ICMP = 1;


IPPROTO_ICMPV6

ICMPv6.

Declaration

Source position: unxsockh.inc line 162

const IPPROTO_ICMPV6 = 58;


IPPROTO_IDP

XNS IDP protocol.

Declaration

Source position: unxsockh.inc line 152

const IPPROTO_IDP = 22;


IPPROTO_IGMP

Internet Group Management Protocol.

Declaration

Source position: unxsockh.inc line 145

const IPPROTO_IGMP = 2;


IPPROTO_IP

Dummy protocol for TCP.

Declaration

Source position: unxsockh.inc line 141

const IPPROTO_IP = 0;


IPPROTO_IPIP

IPIP tunnels (older KA9Q tunnels use 94).

Declaration

Source position: unxsockh.inc line 146

const IPPROTO_IPIP = 4;


IPPROTO_IPV6

IPv6 header.

Declaration

Source position: unxsockh.inc line 154

const IPPROTO_IPV6 = 41;


IPPROTO_MAX

Maximum value for IPPROTO options

Declaration

Source position: unxsockh.inc line 171

const IPPROTO_MAX = 255;


IPPROTO_MTP

Multicast Transport Protocol.

Declaration

Source position: unxsockh.inc line 165

const IPPROTO_MTP = 92;


IPPROTO_NONE

IPv6 no next header.

Declaration

Source position: unxsockh.inc line 163

const IPPROTO_NONE = 59;


IPPROTO_PIM

Protocol Independent Multicast.

Declaration

Source position: unxsockh.inc line 167

const IPPROTO_PIM = 103;


IPPROTO_PUP

PUP protocol.

Declaration

Source position: unxsockh.inc line 150

const IPPROTO_PUP = 12;


IPPROTO_RAW

Raw IP packets.

Declaration

Source position: unxsockh.inc line 170

const IPPROTO_RAW = 255;


IPPROTO_ROUTING

IPv6 routing header.

Declaration

Source position: unxsockh.inc line 156

const IPPROTO_ROUTING = 43;


IPPROTO_RSVP

Reservation Protocol.

Declaration

Source position: unxsockh.inc line 158

const IPPROTO_RSVP = 46;


IPPROTO_SCTP

Stream Control Transmission Protocol.

Declaration

Source position: unxsockh.inc line 169

const IPPROTO_SCTP = 132;


IPPROTO_TCP

Transmission Control Protocol.

Declaration

Source position: unxsockh.inc line 147

const IPPROTO_TCP = 6;


IPPROTO_TP

SO Transport Protocol Class 4.

Declaration

Source position: unxsockh.inc line 153

const IPPROTO_TP = 29;


IPPROTO_UDP

User Datagram Protocol.

Declaration

Source position: unxsockh.inc line 151

const IPPROTO_UDP = 17;


IPV6_ADD_MEMBERSHIP

Undocumented Getsockopt option ?

Declaration

Source position: unxsockh.inc line 267

const IPV6_ADD_MEMBERSHIP = IPV6_JOIN_GROUP;


IPV6_ADDRFORM

Change the IPV6 address into a different address family. Deprecated

Declaration

Source position: unxsockh.inc line 233

const IPV6_ADDRFORM = 1;


IPV6_AUTHHDR

GetSockOpt/SetSockopt: Deliver authentication header messages

Declaration

Source position: unxsockh.inc line 249

const IPV6_AUTHHDR = 10;


IPV6_CHECKSUM

Undocumented Getsockopt option ?

Declaration

Source position: unxsockh.inc line 243

const IPV6_CHECKSUM = 7;


IPV6_DROP_MEMBERSHIP

Undocumented Getsockopt option ?

Declaration

Source position: unxsockh.inc line 268

const IPV6_DROP_MEMBERSHIP = IPV6_LEAVE_GROUP;


IPV6_DSTOPTS

Deliver destination option control messages

Declaration

Source position: unxsockh.inc line 236

const IPV6_DSTOPTS = 4;


IPV6_HOPLIMIT

Deliver an integer containing the HOP count

Declaration

Source position: unxsockh.inc line 244

const IPV6_HOPLIMIT = 8;


IPV6_HOPOPTS

Deliver hop option control messages

Declaration

Source position: unxsockh.inc line 235

const IPV6_HOPOPTS = 3;


IPV6_IPSEC_POLICY

Undocumented Getsockopt option ?

Declaration

Source position: unxsockh.inc line 263

const IPV6_IPSEC_POLICY = 34;


IPV6_JOIN_ANYCAST

Undocumented Getsockopt option ?

Declaration

Source position: unxsockh.inc line 261

const IPV6_JOIN_ANYCAST = 27;


IPV6_JOIN_GROUP

GetSockOpt/SetSockopt: Control membership (join group) in multicast groups

Declaration

Source position: unxsockh.inc line 254

const IPV6_JOIN_GROUP = 20;


IPV6_LEAVE_ANYCAST

Undocumented Getsockopt option ?

Declaration

Source position: unxsockh.inc line 262

const IPV6_LEAVE_ANYCAST = 28;


IPV6_LEAVE_GROUP

GetSockOpt/SetSockopt: Control membership (leave group)in multicast groups

Declaration

Source position: unxsockh.inc line 255

const IPV6_LEAVE_GROUP = 21;


IPV6_MTU

GetSockOpt/SetSockopt: Get/Set the MTU for the socket

Declaration

Source position: unxsockh.inc line 258

const IPV6_MTU = 24;


IPV6_MTU_DISCOVER

GetSockOpt/SetSockopt: Get/Set Control path MTU Discovery on the socket

Declaration

Source position: unxsockh.inc line 257

const IPV6_MTU_DISCOVER = 23;


IPV6_MULTICAST_HOPS

GetSockOpt/SetSockopt: Get/Set the multicast hop limit.

Declaration

Source position: unxsockh.inc line 252

const IPV6_MULTICAST_HOPS = 18;


IPV6_MULTICAST_IF

GetSockOpt/SetSockopt: Get/Set device for multicast packages on the socket.

Declaration

Source position: unxsockh.inc line 251

const IPV6_MULTICAST_IF = 17;


IPV6_MULTICAST_LOOP

GetSockOpt/SetSockopt: Control whether socket sees multicast packages that it has sent itself

Declaration

Source position: unxsockh.inc line 253

const IPV6_MULTICAST_LOOP = 19;


IPV6_NEXTHOP

sendmsg: set next hop for IPV6 datagram

Declaration

Source position: unxsockh.inc line 248

const IPV6_NEXTHOP = 9;


IPV6_PKTINFO

Change delivery options for incoming IPV6 datagrams

Declaration

Source position: unxsockh.inc line 234

const IPV6_PKTINFO = 2;


IPV6_PKTOPTIONS

Undocumented Getsockopt option ?

Declaration

Source position: unxsockh.inc line 242

const IPV6_PKTOPTIONS = 6;


IPV6_PMTUDISC_DO

Always DF.

Declaration

Source position: unxsockh.inc line 275

const IPV6_PMTUDISC_DO = 2;


IPV6_PMTUDISC_DONT

Never send DF frames.

Declaration

Source position: unxsockh.inc line 273

const IPV6_PMTUDISC_DONT = 0;


IPV6_PMTUDISC_WANT

Use per route hints.

Declaration

Source position: unxsockh.inc line 274

const IPV6_PMTUDISC_WANT = 1;


IPV6_RECVERR

GetSockOpt/SetSockopt: Control receiving of asynchroneous error options

Declaration

Source position: unxsockh.inc line 259

const IPV6_RECVERR = 25;


IPV6_ROUTER_ALERT

GetSockOpt/SetSockopt: Get/Set Pass all forwarded packets containing router alert option

Declaration

Source position: unxsockh.inc line 256

const IPV6_ROUTER_ALERT = 22;


IPV6_RTHDR

Deliver routing header control messages

Declaration

Source position: unxsockh.inc line 237

const IPV6_RTHDR = 5;


IPV6_RTHDR_LOOSE

Hop doesn't need to be neighbour.

Declaration

Source position: unxsockh.inc line 282

const IPV6_RTHDR_LOOSE = 0;


IPV6_RTHDR_STRICT

Hop must be a neighbour.

Declaration

Source position: unxsockh.inc line 283

const IPV6_RTHDR_STRICT = 1;


IPV6_RTHDR_TYPE_0

IPv6 Routing header type 0.

Declaration

Source position: unxsockh.inc line 285

const IPV6_RTHDR_TYPE_0 = 0;


IPV6_RXDSTOPTS

Undocumented Getsockopt option ?

Declaration

Source position: unxsockh.inc line 270

const IPV6_RXDSTOPTS = IPV6_DSTOPTS;


IPV6_RXHOPOPTS

Undocumented Getsockopt option ?

Declaration

Source position: unxsockh.inc line 269

const IPV6_RXHOPOPTS = IPV6_HOPOPTS;


IPV6_RXSRCRT

Undocumented Getsockopt option ?

Declaration

Source position: unxsockh.inc line 238

const IPV6_RXSRCRT = IPV6_RTHDR;


IPV6_UNICAST_HOPS

GetSockOpt/SetSockopt: Get/Set unicast hop limit

Declaration

Source position: unxsockh.inc line 250

const IPV6_UNICAST_HOPS = 16;


IPV6_V6ONLY

GetSockOpt/SetSockopt: Handle IPV6 connections only

Declaration

Source position: unxsockh.inc line 260

const IPV6_V6ONLY = 26;


IPV6_XFRM_POLICY

Undocumented Getsockopt option ?

Declaration

Source position: unxsockh.inc line 264

const IPV6_XFRM_POLICY = 35;


linger

Record used in setsockopt

Declaration

Source position: socketsh.inc line 100

type linger = packed record
l_onoff: cint; | Linger on or off
l_linger: cint; | Time to linger
end;

Description

This record is used in the fpsetsockopt call to specify linger options.

See also

fpsetsockopt

Set socket options.


MCAST_BLOCK_SOURCE

block from given group

Declaration

Source position: unxsockh.inc line 197

const MCAST_BLOCK_SOURCE = 43;


MCAST_EXCLUDE

Undocumented ?

Declaration

Source position: unxsockh.inc line 204

const MCAST_EXCLUDE = 0;


MCAST_INCLUDE

Undocumented ?

Declaration

Source position: unxsockh.inc line 205

const MCAST_INCLUDE = 1;


MCAST_JOIN_GROUP

join any-source group

Declaration

Source position: unxsockh.inc line 196

const MCAST_JOIN_GROUP = 42;


MCAST_JOIN_SOURCE_GROUP

join source-spec gruoup

Declaration

Source position: unxsockh.inc line 200

const MCAST_JOIN_SOURCE_GROUP = 46;


MCAST_LEAVE_GROUP

leave any-source group

Declaration

Source position: unxsockh.inc line 199

const MCAST_LEAVE_GROUP = 45;


MCAST_LEAVE_SOURCE_GROUP

leave source-spec group

Declaration

Source position: unxsockh.inc line 201

const MCAST_LEAVE_SOURCE_GROUP = 47;


MCAST_MSFILTER

Undocumented ?

Declaration

Source position: unxsockh.inc line 202

const MCAST_MSFILTER = 48;


MCAST_UNBLOCK_SOURCE

unblock from given group

Declaration

Source position: unxsockh.inc line 198

const MCAST_UNBLOCK_SOURCE = 44;


MSG_CONFIRM

Send flags: Conform connection

Declaration

Source position: unxsockh.inc line 300

const MSG_CONFIRM = $0800;


MSG_CTRUNC

Receive flags: Control Data was discarded (buffer too small)

Declaration

Source position: unxsockh.inc line 292

const MSG_CTRUNC = $0008;


MSG_DONTROUTE

Send flags: don't use gateway

Declaration

Source position: unxsockh.inc line 290

const MSG_DONTROUTE = $0004;


MSG_DONTWAIT

Receive flags: Non-blocking operation request.

Declaration

Source position: unxsockh.inc line 295

const MSG_DONTWAIT = $0040;


MSG_EOF

Alias for MSG_FIN

Declaration

Source position: unxsockh.inc line 305

const MSG_EOF = MSG_FIN;


MSG_EOR

Receive flags: End of record

Declaration

Source position: unxsockh.inc line 296

const MSG_EOR = $0080;


MSG_ERRQUERE

Receive flags: ?

Declaration

Source position: unxsockh.inc line 302

const MSG_ERRQUERE = $2000;


MSG_FIN

Receive flags: ?

Declaration

Source position: unxsockh.inc line 298

const MSG_FIN = $0200;


MSG_MORE

Receive flags: ?

Declaration

Source position: unxsockh.inc line 304

const MSG_MORE = $8000;


MSG_NOSIGNAL

Receive flags: Suppress SIG_PIPE signal.

Declaration

Source position: unxsockh.inc line 303

const MSG_NOSIGNAL = $4000;


MSG_OOB

Receive flags: receive out-of-band data.

Declaration

Source position: unxsockh.inc line 288

const MSG_OOB = $0001;


MSG_PEEK

Receive flags: peek at data, don't remove from buffer.

Declaration

Source position: unxsockh.inc line 289

const MSG_PEEK = $0002;


MSG_PROXY

Receive flags: ?

Declaration

Source position: unxsockh.inc line 293

const MSG_PROXY = $0010;


MSG_RST

Receive flags: ?

Declaration

Source position: unxsockh.inc line 301

const MSG_RST = $1000;


MSG_SYN

Receive flags: ?

Declaration

Source position: unxsockh.inc line 299

const MSG_SYN = $0400;


MSG_TRUNC

Receive flags: packet Data was discarded (buffer too small)

Declaration

Source position: unxsockh.inc line 294

const MSG_TRUNC = $0020;


MSG_TRYHARD

Receive flags: ?

Declaration

Source position: unxsockh.inc line 291

const MSG_TRYHARD = MSG_DONTROUTE;


MSG_WAITALL

Receive flags: Wait till operation completed.

Declaration

Source position: unxsockh.inc line 297

const MSG_WAITALL = $0100;


NoAddress

Constant indicating invalid (no) network address.

Declaration

Source position: socketsh.inc line 211

const NoAddress: in_addr = (s_addr: 0);


NoAddress6

Constant indicating invalid (no) IPV6 network address.

Declaration

Source position: socketsh.inc line 213

const NoAddress6: in6_addr = (u6_addr16: (0, 0, 0, 0, 0, 0, 0, 0));


NoNet

Constant indicating invalid (no) network address.

Declaration

Source position: socketsh.inc line 212

const NoNet: in_addr = (s_addr: 0);


NoNet6

Constant indicating invalid (no) IPV6 network address.

Declaration

Source position: socketsh.inc line 214

const NoNet6: in6_addr = (u6_addr16: (0, 0, 0, 0, 0, 0, 0, 0));


PF_APPLETALK

Protocol family: Appletalk DDP

Declaration

Source position: unxsockh.inc line 62

const PF_APPLETALK = AF_APPLETALK;


PF_ASH

Protocol family: Ash

Declaration

Source position: unxsockh.inc line 76

const PF_ASH = AF_ASH;


PF_ATMPVC

Protocol family: ATM PVCs

Declaration

Source position: unxsockh.inc line 65

const PF_ATMPVC = AF_ATMPVC;


PF_ATMSVC

Protocol family: ATM SVCs

Declaration

Source position: unxsockh.inc line 78

const PF_ATMSVC = AF_ATMSVC;


PF_AX25

Protocol family: Amateur Radio AX.25

Declaration

Source position: unxsockh.inc line 60

const PF_AX25 = AF_AX25;


PF_BLUETOOTH

Protocol family: Bluetooth sockets

Declaration

Source position: unxsockh.inc line 85

const PF_BLUETOOTH = AF_BLUETOOTH;


PF_BRIDGE

Protocol family: Multiprotocol bridge

Declaration

Source position: unxsockh.inc line 64

const PF_BRIDGE = AF_BRIDGE;


PF_DECnet

Protocol Family: DECNET project

Declaration

Source position: unxsockh.inc line 69

const PF_DECnet = AF_DECnet;


PF_ECONET

Protocol family: Acorn Econet

Declaration

Source position: unxsockh.inc line 77

const PF_ECONET = AF_ECONET;


PF_INET

Protocol family: Internet IP Protocol

Declaration

Source position: unxsockh.inc line 59

const PF_INET = AF_INET;


PF_INET6

Protocol family: IP version 6

Declaration

Source position: unxsockh.inc line 67

const PF_INET6 = AF_INET6;


PF_IPX

Protocol family: Novell IPX

Declaration

Source position: unxsockh.inc line 61

const PF_IPX = AF_IPX;


PF_IRDA

Protocol family: IRDA sockets

Declaration

Source position: unxsockh.inc line 80

const PF_IRDA = AF_IRDA;


PF_KEY

Protocol family: Key management API

Declaration

Source position: unxsockh.inc line 72

const PF_KEY = AF_KEY;


PF_LLC

Protocol family: Linux LLC

Declaration

Source position: unxsockh.inc line 83

const PF_LLC = AF_LLC;


PF_LOCAL

Protocol family: Unix socket

Declaration

Source position: unxsockh.inc line 58

const PF_LOCAL = AF_LOCAL;


PF_MAX

Protocol family: Maximum value

Declaration

Source position: unxsockh.inc line 86

const PF_MAX = AF_MAX;


PF_NETBEUI

Protocol family: Reserved for 802.2LLC project

Declaration

Source position: unxsockh.inc line 70

const PF_NETBEUI = AF_NETBEUI;


PF_NETLINK

Protocol family: ?

Declaration

Source position: unxsockh.inc line 73

const PF_NETLINK = AF_NETLINK;


PF_NETROM

Protocol family:Amateur radio NetROM

Declaration

Source position: unxsockh.inc line 63

const PF_NETROM = AF_NETROM;


PF_PACKET

Protocol family: Packet family

Declaration

Source position: unxsockh.inc line 75

const PF_PACKET = AF_PACKET;


PF_PPPOX

Protocol family: PPPoX sockets

Declaration

Source position: unxsockh.inc line 81

const PF_PPPOX = AF_PPPOX;


PF_ROSE

Protocol family: Amateur Radio X.25 PLP

Declaration

Source position: unxsockh.inc line 68

const PF_ROSE = AF_ROSE;


PF_ROUTE

Protocol Family: ?

Declaration

Source position: unxsockh.inc line 74

const PF_ROUTE = AF_ROUTE;


PF_SECURITY

Protocol family: Security callback pseudo PF

Declaration

Source position: unxsockh.inc line 71

const PF_SECURITY = AF_SECURITY;


PF_SNA

Protocol Family: Linux SNA project

Declaration

Source position: unxsockh.inc line 79

const PF_SNA = AF_SNA;


PF_TIPC

Protocol family: TIPC sockets

Declaration

Source position: unxsockh.inc line 84

const PF_TIPC = AF_TIPC;


PF_UNIX

Protocol family: Unix domain sockets

Declaration

Source position: unxsockh.inc line 57

const PF_UNIX = AF_UNIX;


PF_UNSPEC

Protocol family: Unspecified

Declaration

Source position: unxsockh.inc line 56

const PF_UNSPEC = AF_UNSPEC;


PF_WANPIPE

Protocol family: Wanpipe API Sockets

Declaration

Source position: unxsockh.inc line 82

const PF_WANPIPE = AF_WANPIPE;


PF_X25

Protocol family: Reserved for X.25 project

Declaration

Source position: unxsockh.inc line 66

const PF_X25 = AF_X25;


pin6_addr

Pointer to Tin6_addr

Declaration

Source position: socketsh.inc line 107

type pin6_addr = ^in6_addr;


PIn6Addr

Pointer to in6_addr type.

Declaration

Source position: socketsh.inc line 122

type PIn6Addr = pin6_addr;


pin_addr

Pointer to in_addr record.

Declaration

Source position: socketsh.inc line 54

type pin_addr = ^in_addr;


PInAddr

Alias for pin_addr

Declaration

Source position: socketsh.inc line 64

type PInAddr = pin_addr;


PInetSockAddr

Pointer to sockaddr_in

Declaration

Source position: socketsh.inc line 81

type PInetSockAddr = psockaddr_in;


PInetSockAddr6

Pointer to sockaddr_in6 type

Declaration

Source position: socketsh.inc line 137

type PInetSockAddr6 = psockaddr_in6;


plinger

Pointer to linger type.

Declaration

Source position: socketsh.inc line 99

type plinger = ^linger;


psockaddr

Pointer to TSockAddr

Declaration

Source position: socketsh.inc line 83

type psockaddr = ^sockaddr;


PSockAddr6

Pointer to TSockAddr6

Declaration

Source position: socketsh.inc line 142

type PSockAddr6 = ^TSockAddr6;

Description

PSockAddr6 is a pointer to a record of type TSockAddr6.

See also

TSockAddr6

Alias for sockaddr_in6/>


psockaddr_in

Pointer to sockaddr_in

Declaration

Source position: socketsh.inc line 69

type psockaddr_in = ^sockaddr_in;


psockaddr_in6

Pointer to sockaddr_in6

Declaration

Source position: socketsh.inc line 124

type psockaddr_in6 = ^sockaddr_in6;


psockaddr_un

Pointer to sockaddr_un type.

Declaration

Source position: socketsh.inc line 143

type psockaddr_un = ^sockaddr_un;


S_IN

Input socket in socket pair.

Declaration

Source position: socketsh.inc line 50

const S_IN = 0;


S_OUT

Output socket in socket pair

Declaration

Source position: socketsh.inc line 51

const S_OUT = 1;


sa_family_t

Address family type

Declaration

Source position: socketsh.inc line 20

type sa_family_t = cushort;


SCM_SRCRT

Undocumented Getsockopt option ?

Declaration

Source position: unxsockh.inc line 246

const SCM_SRCRT = IPV6_RXSRCRT;


SCM_TIMESTAMP

Socket option: ?

Declaration

Source position: unxsockh.inc line 130

const SCM_TIMESTAMP = SO_TIMESTAMP;


SHUT_RD

Shutdown read part of full duplex socket

Declaration

Source position: unxsockh.inc line 135

const SHUT_RD = 0;


SHUT_RDWR

Shutdown read and write part of full duplex socket

Declaration

Source position: unxsockh.inc line 137

const SHUT_RDWR = 2;


SHUT_WR

Shutdown write part of full duplex socket

Declaration

Source position: unxsockh.inc line 136

const SHUT_WR = 1;


SO_ACCEPTCONN

Socket option: ?

Declaration

Source position: unxsockh.inc line 131

const SO_ACCEPTCONN = 30;


SO_ATTACH_FILTER

Socket option: ?

Declaration

Source position: unxsockh.inc line 126

const SO_ATTACH_FILTER = 26;


SO_BINDTODEVICE

Socket option: ?

Declaration

Source position: unxsockh.inc line 122

const SO_BINDTODEVICE = 25;


SO_BROADCAST

Socket option: Broadcast

Declaration

Source position: unxsockh.inc line 99

const SO_BROADCAST = 6;


SO_BSDCOMPAT

Socket option: ?

Declaration

Source position: unxsockh.inc line 107

const SO_BSDCOMPAT = 14;


SO_DEBUG

Socket option level: debug

Declaration

Source position: unxsockh.inc line 94

const SO_DEBUG = 1;


SO_DETACH_FILTER

Socket option: ?

Declaration

Source position: unxsockh.inc line 127

const SO_DETACH_FILTER = 27;


SO_DONTROUTE

Socket option: Don't route

Declaration

Source position: unxsockh.inc line 98

const SO_DONTROUTE = 5;


SO_ERROR

Socket option: Error

Declaration

Source position: unxsockh.inc line 97

const SO_ERROR = 4;


SO_KEEPALIVE

Socket option: keep alive

Declaration

Source position: unxsockh.inc line 102

const SO_KEEPALIVE = 9;


SO_LINGER

Socket option: ?

Declaration

Source position: unxsockh.inc line 106

const SO_LINGER = 13;


SO_NO_CHECK

Socket option: ?

Declaration

Source position: unxsockh.inc line 104

const SO_NO_CHECK = 11;


SO_OOBINLINE

Socket option: ?

Declaration

Source position: unxsockh.inc line 103

const SO_OOBINLINE = 10;


SO_PASSCRED

Socket option: ?

Declaration

Source position: unxsockh.inc line 109

const SO_PASSCRED = 16;


SO_PEERCRED

Socket option: ?

Declaration

Source position: unxsockh.inc line 110

const SO_PEERCRED = 17;


SO_PEERNAME

Socket option: ?

Declaration

Source position: unxsockh.inc line 128

const SO_PEERNAME = 28;


SO_PRIORITY

Socket option: ?

Declaration

Source position: unxsockh.inc line 105

const SO_PRIORITY = 12;


SO_RCVBUF

Socket option: receive buffer

Declaration

Source position: unxsockh.inc line 101

const SO_RCVBUF = 8;


SO_RCVLOWAT

Socket option: ?

Declaration

Source position: unxsockh.inc line 111

const SO_RCVLOWAT = 18;


SO_RCVTIMEO

Socket option: ?

Declaration

Source position: unxsockh.inc line 113

const SO_RCVTIMEO = 20;


SO_REUSEADDR

Socket option: Reuse address

Declaration

Source position: unxsockh.inc line 95

const SO_REUSEADDR = 2;


SO_SECURITY_AUTHENTICATION

Socket option: ?

Declaration

Source position: unxsockh.inc line 118

const SO_SECURITY_AUTHENTICATION = 22;


SO_SECURITY_ENCRYPTION_NETWORK

Socket option: ?

Declaration

Source position: unxsockh.inc line 120

const SO_SECURITY_ENCRYPTION_NETWORK = 24;


SO_SECURITY_ENCRYPTION_TRANSPORT

Socket option: ?

Declaration

Source position: unxsockh.inc line 119

const SO_SECURITY_ENCRYPTION_TRANSPORT = 23;


SO_SNDBUF

Socket option: Send buffer

Declaration

Source position: unxsockh.inc line 100

const SO_SNDBUF = 7;


SO_SNDLOWAT

Socket option: ?

Declaration

Source position: unxsockh.inc line 112

const SO_SNDLOWAT = 19;


SO_SNDTIMEO

Socket option: ?

Declaration

Source position: unxsockh.inc line 114

const SO_SNDTIMEO = 21;


SO_TIMESTAMP

Socket option: ?

Declaration

Source position: unxsockh.inc line 129

const SO_TIMESTAMP = 29;


SO_TYPE

Socket option: Type

Declaration

Source position: unxsockh.inc line 96

const SO_TYPE = 3;


SOCK_DGRAM

Type of socket: datagram (conn.less) socket (UDP)

Declaration

Source position: socketsh.inc line 38

const SOCK_DGRAM = 2;


SOCK_MAXADDRLEN

Maximum socket address length for Bind call.

Declaration

Source position: unxsockh.inc line 50

const SOCK_MAXADDRLEN = 255;


SOCK_RAW

Type of socket: raw socket

Declaration

Source position: socketsh.inc line 40

const SOCK_RAW = 3;


SOCK_RDM

Type of socket: reliably-delivered message

Declaration

Source position: socketsh.inc line 41

const SOCK_RDM = 4;


SOCK_SEQPACKET

Type of socket: sequential packet socket

Declaration

Source position: socketsh.inc line 42

const SOCK_SEQPACKET = 5;


SOCK_STREAM

Type of socket: stream (connection) type socket (TCP)

Declaration

Source position: socketsh.inc line 37

const SOCK_STREAM = 1;


sockaddr

Alias for TSockAddr record type.

Declaration

Source position: socketsh.inc line 84

type sockaddr = packed record
case Integer of
0: (
sa_family: sa_family_t; | Address family
sa_data: array [0..13] of cuint8; | Addres data
);
1: (
sin_family: sa_family_t; | Socket family
sin_port: cushort; | Socket port
sin_addr: in_addr; | Socket address
sin_zero: array [0..7] of cuint8; | Padding bytes
);
end;

Description

sockaddr is used to store a general socket addres for the FPBind, FPRecv and FPSend calls.


sockaddr_in

Internet socket address record

Declaration

Source position: socketsh.inc line 70

type sockaddr_in = packed record
sin_family: sa_family_t; | Internet socket family
sin_port: cushort; | Internet socket port
sin_addr: in_addr; | Internet socket host address
xpad: array [0..7] of Char; | Padding bytes
end;

Description

sockaddr_in is used to store a INET socket addres for the FPBind, FPRecv and FPSend calls.


sockaddr_in6

Alias for sockaddr_in6

Declaration

Source position: socketsh.inc line 125

type sockaddr_in6 = packed record
sin6_family: sa_family_t; | Address family
sin6_port: cuint16; | Port
sin6_flowinfo: cuint32; | Flow information.
sin6_addr: in6_addr; | IPV6 address
sin6_scope_id: cuint32; |
end;


sockaddr_un

Unix socket address record.

Declaration

Source position: socketsh.inc line 144

type sockaddr_un = packed record
sun_family: sa_family_t; | Address family
sun_path: array [0..107] of Char; | File name
end;

Description

sockaddr_un is used to store a UNIX socket addres for the FPBind, FPRecv and FPSend calls.


SOL_ICMPV6

Socket level values for IPv6: ICMPV6

Declaration

Source position: unxsockh.inc line 279

const SOL_ICMPV6 = 58;


SOL_IP

Undocumented ?

Declaration

Source position: unxsockh.inc line 223

const SOL_IP = 0;


SOL_IPV6

Socket level values for IPv6: IPV6

Declaration

Source position: unxsockh.inc line 278

const SOL_IPV6 = 41;


SOL_SOCKET

Socket option level: Socket level

Declaration

Source position: unxsockh.inc line 93

const SOL_SOCKET = 1;


SOMAXCONN

Maximum queue length specifiable by listen.

Declaration

Source position: unxsockh.inc line 90

const SOMAXCONN = 128;

See also

FPlisten

Listen for connections on a socket.


TCP_CONGESTION

Get/set the congestion-control algorithm for this socket

Declaration

Source position: unxsockh.inc line 331

const TCP_CONGESTION = 13;


TCP_CORK

Get/Set CORK algorithm: Send only complete packets

Declaration

Source position: unxsockh.inc line 311

const TCP_CORK = 3;


TCP_DEFER_ACCEPT

Get/Set deferred accept on server socket

Declaration

Source position: unxsockh.inc line 323

const TCP_DEFER_ACCEPT = 9;


TCP_INFO

Get TCP connection information (Linux only)

Declaration

Source position: unxsockh.inc line 327

const TCP_INFO = 11;


TCP_KEEPCNT

Get/Set retry count for unacknowledged KEEPALIVE transmissions.

Declaration

Source position: unxsockh.inc line 317

const TCP_KEEPCNT = 6;


TCP_KEEPIDLE

Get/Set inactivity interval between KEEPALIVE transmissions.

Declaration

Source position: unxsockh.inc line 313

const TCP_KEEPIDLE = 4;


TCP_KEEPINTVL

Get/Set retry interval for unacknowledged KEEPALIVE transmissions.

Declaration

Source position: unxsockh.inc line 315

const TCP_KEEPINTVL = 5;


TCP_LINGER2

Get/Set Linger2 flag

Declaration

Source position: unxsockh.inc line 321

const TCP_LINGER2 = 8;


TCP_MAXSEG

Get/Set Maximum segment size

Declaration

Source position: unxsockh.inc line 309

const TCP_MAXSEG = 2;


TCP_MD5SIG

Get/Set TCP MD5 signature option

Declaration

Source position: unxsockh.inc line 333

const TCP_MD5SIG = 14;


TCP_NODELAY

Get/Set No delay flag: disable Nagle algorithm

Declaration

Source position: unxsockh.inc line 307

const TCP_NODELAY = 1;


TCP_QUICKACK

Get/Set quik ACK packet option.

Declaration

Source position: unxsockh.inc line 329

const TCP_QUICKACK = 12;


TCP_SYNCNT

Get/Set number of SYN packets to send before givin up on connection establishment

Declaration

Source position: unxsockh.inc line 319

const TCP_SYNCNT = 7;


TCP_WINDOW_CLAMP

Get/Set maximum packet size

Declaration

Source position: unxsockh.inc line 325

const TCP_WINDOW_CLAMP = 10;


Tin6_addr

Alias for sockaddr_in6

Declaration

Source position: socketsh.inc line 119

type Tin6_addr = in6_addr;


TIn6Addr

Alias for in6_addr type.

Declaration

Source position: socketsh.inc line 121

type TIn6Addr = in6_addr;


TIn_addr

Alias for in_addr record type.

Declaration

Source position: socketsh.inc line 61

type TIn_addr = in_addr;


TInAddr

Alias for in_addr record type.

Declaration

Source position: socketsh.inc line 63

type TInAddr = in_addr;


TInetSockAddr

Alias for sockaddr_in

Declaration

Source position: socketsh.inc line 80

type TInetSockAddr = sockaddr_in;


TInetSockAddr6

Alias for sockaddr_in6

Declaration

Source position: socketsh.inc line 136

type TInetSockAddr6 = sockaddr_in6;


TLinger

Alias for linger

Declaration

Source position: socketsh.inc line 105

type TLinger = linger;


TSockAddr

Declaration

Source position: socketsh.inc line 97

type TSockAddr = sockaddr;


TSockAddr6

Alias for sockaddr_in6/>

Declaration

Source position: socketsh.inc line 141

type TSockAddr6 = sockaddr_in6;

Description

TSockAddr6 is an alias for sockaddr6_in

See also

sockaddr6_in


TSockArray

Type returned by the FPSocketPair call.

Declaration

Source position: socketsh.inc line 140

type TSockArray = array [1..2] of LongInt;


Tsocket

Alias for easy kylix porting

Declaration

Source position: socketsh.inc line 152

type Tsocket = LongInt;


TSockLen

Type to specify socket length in fpBind and fpConnect

Declaration

Source position: sockets.pp line 31

type TSockLen = BaseUnix.TSocklen;

Description

The actual type of TSockLen depends on the platform.

See also

fpBind | Bind a socket to an address.
fpConnect | Open a connection to a server socket.


TSockPairArray

Array of sockets, used in FPSocketPair call.

Declaration

Source position: socketsh.inc line 139

type TSockPairArray = array [0..1] of LongInt;


TUnixSockAddr

Alias for sockaddr_un

Declaration

Source position: sockets.pp line 37

type TUnixSockAddr = packed record
family: sa_family_t; | Protocol family for unix socket
path: array [0..107] of Char; | Filename for unix socket file
end;


UDP_CORK

Get/Set UDP CORK algorithm on datagram sockets

Declaration

Source position: unxsockh.inc line 335

const UDP_CORK = 1;


UDP_ENCAP

Get/Set UDP encapsulation flag for IPSec datagram sockets

Declaration

Source position: unxsockh.inc line 337

const UDP_ENCAP = 100;


UDP_ENCAP_ESPINUDP

? Undocumented datagram option, IPSec related

Declaration

Source position: unxsockh.inc line 342

const UDP_ENCAP_ESPINUDP = 2;


UDP_ENCAP_ESPINUDP_NON_IKE

? Undocumented datagram option, IPSec related

Declaration

Source position: unxsockh.inc line 340

const UDP_ENCAP_ESPINUDP_NON_IKE = 1;


UDP_ENCAP_L2TPINUDP

? Undocumented datagram option, IPSec related

Declaration

Source position: unxsockh.inc line 344

const UDP_ENCAP_L2TPINUDP = 3;


Reference for unit 'strings'

Null-terminated string (PChar) routines.

uses

  System;

The system unit

Overview

This chapter describes the STRINGS unit for Free Pascal. This unit is system independent, and therefore works on all supported platforms.


Reference for unit 'strings': Procedures and functions

stralloc | Allocate memory for a new null-terminated string on the heap
strcat | Concatenate 2 null-terminated strings.
strcomp | Compare 2 null-terminated strings, case sensitive.
strcopy | Copy a null-terminated string
strdispose | disposes of a null-terminated string on the heap
strecopy | Copy a null-terminated string, return a pointer to the end.
strend | Return a pointer to the end of a null-terminated string
stricomp | Compare 2 null-terminated strings, case insensitive.
stripos | Return the position of a substring in a string, case insensitive.
striscan | Scan a string for a character, case-insensitive
strlcat | Concatenate 2 null-terminated strings, with length boundary.
strlcomp | Compare limited number of characters of 2 null-terminated strings
strlcopy | Copy a null-terminated string, limited in length.
strlen | Length of a null-terminated string.
strlicomp | Compare limited number of characters in 2 null-terminated strings, ignoring case.
strlower | Convert null-terminated string to all-lowercase.
strmove | Move a null-terminated string to new location.
strnew | Allocate room for new null-terminated string.
strpas | Convert a null-terminated string to a shortstring.
strpcopy | Copy a pascal string to a null-terminated string
strpos | Search for a null-terminated substring in a null-terminated string
strriscan | Scan a string reversely for a character, case-insensitive
strrscan | Find last occurrence of a character in a null-terminated string.
strscan | Find first occurrence of a character in a null-terminated string.
strupper | Convert null-terminated string to all-uppercase


Index of all identifiers in unit 'strings'

S

S

stralloc | striscan | strpas
strcat | strlcat | strpcopy
strcomp | strlcomp | strpos
strcopy | strlcopy | strriscan
strdispose | strlen | strrscan
strecopy | strlicomp | strscan
strend | strlower | strupper
stricomp | strmove |
stripos | strnew |


AnsiResemblesProc

Procedural variable, called when checking 2 strings for resemblances in AnsiResemblesText

Declaration

Source position: strutils.pp line 141

const AnsiResemblesProc: TCompareTextProc = @ SoundexProc;

Description

This procedural variable is standard set to SoundexProc but can be overriden with a user-defined algorithm. This algorithm should return True if AText resembles AOtherText, or False otherwise. The standard routine compares the soundexes of the two strings and returns True if they are equal.

Errors

None

See also

AnsiResemblesText | Check whether 2 strings resemble each other.
SoundexProc | Default AnsiResemblesText implementation.


Brackets

Set of characters that contain all possible bracket characters

Declaration

Source position: strutils.pp line 207

const Brackets = ['(', ')', '[', ']', '{', '}'];


DigitChars

Set of digit characters

Declaration

Source position: strutils.pp line 206

const DigitChars = ['0'..'9'];


Reference for unit 'strutils'

Various string handling routines

uses
System, | The system unit
sysutils; | Various system utilities.


Reference for unit 'strutils': Resource strings

SErrAmountStrings
'Amount of search and replace strings don''t match'

SInvalidRomanNumeral
'%s is not a valid Roman numeral'


Reference for unit 'strutils': Constants

AnsiResemblesProc | Procedural variable, called when checking 2 strings for resemblances in AnsiResemblesText
Brackets | Set of characters that contain all possible bracket characters
DigitChars | Set of digit characters
StdSwitchChars | Standard characters for the SwitchChars argument of GetCmdLineArg.
StdWordDelims | Standard word delimiter values.
WordDelimiters | Standard word delimiters


Reference for unit 'strutils': Types

SizeIntArray | Array of SizeInt
TCompareTextProc | Function prototype for comparing two string in AnsiResemblesText
TRomanConversionStrictness | How to treat invalid roman numerals in TryRomanToInt.
TSoundexIntLength | Range of allowed integer soundex lengths.
TSoundexLength | Range of allowed soundex lengths.
TStringReplaceAlgorithm | Algorithm to use in StringReplace
TStringSeachOption | Possible options for SearchBuf call.
TStringSearchOption | Possible options for SearchBuf call.
TStringSearchOptions | Set of options for SearchBuf call.


Reference for unit 'strutils': Procedures and functions

AddChar | Add characters to the left of a string till a certain length
AddCharR | Add chars at the end of a string till it reaches a certain length
AnsiContainsStr | Checks whether a string contains a given substring
AnsiContainsText | Check whether a string contains a certain substring, ignoring case.
AnsiEndsStr | Check whether a string ends with a certain substring
AnsiEndsText | Check whether a string ends with a certain substring, ignoring case.
AnsiIndexStr | Searches, observing case, for a string in an array of strings.
AnsiIndexText | Searches, case insensitive, for a string in an array of strings.
AnsiLeftStr | Copies a number of characters starting at the left of a string
AnsiMatchStr | Check whether a string occurs in an array of strings, observing case.
AnsiMatchText | Check whether a string occurs in an array of strings, disregarding case.
AnsiMidStr | Returns a number of characters copied from a given location in a string
AnsiProperCase | Pretty-Print a string: make lowercase and capitalize first letters of words
AnsiReplaceStr | Search and replace all occurrences of a string, case sensitive.
AnsiReplaceText | Search and replace all occurrences of a string, case insensitive.
AnsiResemblesText | Check whether 2 strings resemble each other.
AnsiReverseString | Reverse the letters in a string.
AnsiRightStr | Copies a number of characters starting at the right of a string
AnsiStartsStr | Check whether a string starts with a given substring, observing case
AnsiStartsText | Check whether a string starts with a given substring, ignoring case
BinToHex | Convert a binary buffer to a hexadecimal string
Copy2Space | Returns all characters in a string till the first space character (not included).
Copy2SpaceDel | Deletes and returns all characters in a string till the first space character (not included).
Copy2Symb | Returns all characters in a string till a given character (not included).
Copy2SymbDel | Deletes and returns all characters in a string till a given character (not included).
Dec2Numb | Convert a decimal number to a string representation, using given a base.
DecodeSoundexInt | Decodes the integer representation of a soundex code and returns the original soundex code.
DecodeSoundexWord | Decodes the word-sized representation of a soundex code and returns the original soundex code.
DelChars | Delete all occurrences of a given character from a string.
DelSpace | Delete all occurrences of a space from a string.
DelSpace1 | Reduces sequences of space characters to 1 space character.
DupeString | Creates and concatenates N copies of a string
ExtractDelimited | Extract the N-th delimited part from a string.
ExtractSubstr | Extract a word from a string, starting at a given position in the string.
ExtractWord | Extract the N-th word out of a string.
ExtractWordPos | Extract a word from a string, and return the position where it was located in the string.
FindMatchesBoyerMooreCaseInSensitive | Find case-sensitive matches of a string using a Boyer-Moore algorithm
FindMatchesBoyerMooreCaseSensitive | Find case-sensitive matches of a string using a Boyer-Moore algorithm
FindPart | Search for a substring in a string, using wildcards.
GetCmdLineArg | Returns the command-line argument following the given switch.
Hex2Dec | Converts a hexadecimal string to a decimal value
HexToBin | Convert a hexadecimal string to a binary buffer
IfThen | Returns one of two strings, depending on a boolean expression
IndexStr | Searches, observing case, for a string in an array of strings.
IntToBin | Converts an integer to a binary string representation, inserting spaces at fixed locations.
IntToRoman | Represent an integer with roman numerals
IsEmptyStr | Check whether a string is empty, disregaring whitespace characters
IsWild | Check whether a string matches a wildcard search expression.
IsWordPresent | Check for the presence of a word in a string.
LeftBStr | Copies Count characters starting at the left of a string.
LeftStr | Copies Count characters starting at the left of a string.
MatchStr | Check whether a string occurs in an array of strings, observing case.
MidBStr | Copies a number of characters starting at a given position in a string.
MidStr | Copies a number of characters starting at a given position in a string.
NaturalCompareText | Compare using natural sort
NPos | Returns the position of the N-th occurrence of a substring in a string.
Numb2Dec | Converts a string representation of a number to its numerical value, given a certain base.
Numb2USA | Insert thousand separators.
PadCenter | Pad the string to a certain length, so the string is centered.
PadLeft | Add spaces to the left of a string till a certain length is reached.
PadRight | Add spaces to the right of a string till a certain length is reached.
PosEx | Search for the occurrence of a character in a string, starting at a certain position.
PosSet | Return the position in a string of any character out of a set of characters
PosSetEx | Return the position in a string of any character out of a set of characters, starting at a certain position
RandomFrom | Choose a random string from an array of strings.
Removeleadingchars | Remove any leading characters in a set from a string
RemovePadChars | Remove any trailing or leading characters in a set from a string
RemoveTrailingChars | Remove any trailing characters in a set from a string
ReplaceStr | Replace strings case-sensitively
ReplaceText | Replace strings case-insensitively
ReverseString | Reverse characters in a string
RightBStr | Copy a given number of characters (bytes), counting from the right of a string.
RightStr | Copy a given number of characters, counting from the right of a string.
RomanToInt | Convert a string with a Roman number to it's decimal value.
RomanToIntDef | Convert a roman numeral to an integer value
RPos | Find last occurrence of substring or character in a string
RPosex | Find last occurrence substring or character in a string, starting at a certain position
SearchBuf | Search a buffer for a certain string.
Soundex | Compute the soundex of a string
SoundexCompare | Compare soundex values of 2 strings.
SoundexInt | Soundex value as an integer.
SoundexProc | Default AnsiResemblesText implementation.
SoundexSimilar | Check whether 2 strings have equal soundex values
SoundexWord | Calculate a word-sized soundex value
StringReplace | Optimized search-and-replace algorithm
StringsReplace | Replace occurrences of a set of strings to another set of strings
StuffString | Replace part of a string with another string.
Tab2Space | Convert tab characters to a number of spaces
TrimLeftSet | Remove any leading characters in a set from a string and returns the result
TrimRightSet | Remove any trailing characters in a set from a string and returns the result
TrimSet | Remove any leading or trailing characters in a set from a string and returns the result
TryRomanToInt | Try to convert a roman numeral to an integer value.
WordCount | Count the number of words in a string.
WordPosition | Search position of Nth word in a string.
XorDecode | Decode a string encoded with XorEncode
XorEncode | Encode a string by XOR-ing its characters using characters of a given key, representing the result as hex values.
XorString | Encode a string by XOR-ing its characters using characters of a given key.


Index of all identifiers in unit 'strutils'

A B C D E F G H I L M N P R S T W X

A

AddChar | AnsiIndexText | AnsiReplaceText
AddCharR | AnsiLeftStr | AnsiResemblesProc
AnsiContainsStr | AnsiMatchStr | AnsiResemblesText
AnsiContainsText | AnsiMatchText | AnsiReverseString
AnsiEndsStr | AnsiMidStr | AnsiRightStr
AnsiEndsText | AnsiProperCase | AnsiStartsStr
AnsiIndexStr | AnsiReplaceStr | AnsiStartsText

B

BinToHex Brackets

C

Copy2Space | Copy2Symb
Copy2SpaceDel | Copy2SymbDel

D

Dec2Numb | DelChars | DigitChars
DecodeSoundexInt | DelSpace | DupeString
DecodeSoundexWord | DelSpace1 |

E

ExtractDelimited | ExtractWord
ExtractSubstr | ExtractWordPos

F

FindMatchesBoyerMooreCaseInSensitive FindMatchesBoyerMooreCaseSensitive FindPart

G

GetCmdLineArg

H

Hex2Dec HexToBin

I

IfThen | IntToRoman | IsWordPresent
IndexStr | IsEmptyStr |
IntToBin | IsWild |

L

LeftBStr LeftStr

M

MatchStr MidBStr MidStr

N

NaturalCompareText | Numb2Dec
NPos | Numb2USA

P

PadCenter | PadRight | PosSet
PadLeft | PosEx | PosSetEx

R

RandomFrom | RemoveTrailingChars | RomanToInt
rcsDontCare | ReplaceStr | RomanToIntDef
rcsRelaxed | ReplaceText | RPos
rcsStrict | ReverseString | RPosex
Removeleadingchars | RightBStr |
RemovePadChars | RightStr |

S

SearchBuf | SoundexCompare | sraDefault
SErrAmountStrings | SoundexInt | sraManySmall
SInvalidRomanNumeral | SoundexProc | StdSwitchChars
SizeIntArray | SoundexSimilar | StdWordDelims
soDown | SoundexWord | StringReplace
soMatchCase | soWholeWord | StringsReplace
Soundex | sraBoyerMoore | StuffString

T

Tab2Space | TRomanConversionStrictness | TStringSeachOption
TCompareTextProc | TryRomanToInt | TStringSearchOption
TrimLeftSet | TSoundexIntLength | TStringSearchOptions
TrimRightSet | TSoundexLength |
TrimSet | TStringReplaceAlgorithm |

W

WordCount WordDelimiters WordPosition

X

XorDecode XorEncode XorString


SizeIntArray

Array of SizeInt

Declaration

Source position: strutils.pp line 226

type SizeIntArray = array of SizeInt;

Description

SizeIntArray is an auxiliary type used in StringReplace

See also

StringReplace

Optimized search-and-replace algorithm


StdSwitchChars

Standard characters for the SwitchChars argument of GetCmdLineArg.

Declaration

Source position: strutils.pp line 209

const StdSwitchChars = ['-', '/'];


StdWordDelims

Standard word delimiter values.

Declaration

Source position: strutils.pp line 208

const StdWordDelims = [#0..' ', ',', '.', ';', '/', '\', ':', '''', '"', '`'] + Brackets;


TCompareTextProc

Function prototype for comparing two string in AnsiResemblesText

Declaration

Source position: strutils.pp line 138

type TCompareTextProc = function(

  const AText: string;

  const AOther: string

):Boolean;

Arguments

AText | First string
AOther | Second string.

Function result

True if strings match, false otherwise.


TRomanConversionStrictness

How to treat invalid roman numerals in TryRomanToInt.

Declaration

Source position: strutils.pp line 147

type TRomanConversionStrictness = (
rcsStrict, | Only accept correct roman numerals.
rcsRelaxed, | Like rcsStrict but allow more than 3 consecutive identical letters.
rcsDontCare | Do not check correctness
);

Description

TRomanConversionStrictness is an enumerated type that can be used to decide how to react to invalid roman numerals.

rcsStrict
Strict adherance to roman numerals. Up to 3 consecutive identical letters. No negative numbers. Ordering must be correct.
rcsRelaxed
Same as rcsStrict but allow more than 3 consecutive identical letters.
rcsDontCare
Do not check validity at all

See also

TryRomanToInt | Try to convert a roman numeral to an integer value.
RomanToInt | Convert a string with a Roman number to it's decimal value.
RomanToIntDef | Convert a roman numeral to an integer value


TSoundexIntLength

Range of allowed integer soundex lengths.

Declaration

Source position: strutils.pp line 124

type TSoundexIntLength = 1..8;


TSoundexLength

Range of allowed soundex lengths.

Declaration

Source position: strutils.pp line 118

type TSoundexLength = 1..MaxInt;


TStringReplaceAlgorithm

Algorithm to use in StringReplace

Declaration

Source position: strutils.pp line 235

type TStringReplaceAlgorithm = (
sraDefault, | Use the sysutils algorithm, which does a straightforward linear search and replace
sraManySmall, | Use an approach which is suitable for a string with many occurrences of the same small text
sraBoyerMoore | Use a Boyer-Moore search algorithm
);

Description

TStringReplaceAlgorithm enumerates the available algorithms to StringReplace

sraDefault
Use the sysutils algorithm, which does a straightforward linear search and replace
sraManySmall
Use an approach which is suitable for a string with many occurrences of the same small text
sraBoyerMoore
Use a Boyer-Moore search algorithm

Depending on the kind of data that is being treated, one or the other of these algorithms may produce faster results.

See also

StringReplace

Optimized search-and-replace algorithm


TStringSeachOption

Possible options for SearchBuf call.

Declaration

Source position: strutils.pp line 94

type TStringSeachOption = TStringSearchOption;

Description

There is an typo error in the original Borland StrUtils unit. This type just refers to the correct TStringSearchOption and is provided for compatibility only.


TStringSearchOption

Possible options for SearchBuf call.

Declaration

Source position: strutils.pp line 92

type TStringSearchOption = (
soDown, | Search in down direction.
soMatchCase, | Match case
soWholeWord | Search whole words only.
);


TStringSearchOptions

Set of options for SearchBuf call.

Declaration

Source position: strutils.pp line 93

type TStringSearchOptions = set of (
soDown, | Search in down direction.
soMatchCase, | Match case
soWholeWord | Search whole words only.
);


WordDelimiters

Standard word delimiters

Declaration

Source position: strutils.pp line 86

const WordDelimiters: = [#0..#255] - ['a'..'z', 'A'..'Z', '1'..'9', '0'];

Description

Standard word delimiters, used in the SearchBuf call.


AnsiChar

Alias for 1-byte sized char.

Declaration

Source position: systemh.inc line 413

type AnsiChar = Char;


BackTraceStrFunc

Standard backtrace formatting routine

Declaration

Source position: systemh.inc line 1461

const BackTraceStrFunc: TBackTraceStrFunc = @ SysBackTraceStr;

Description

This handler is called to get a standard format for the backtrace routine.


Byte

An unsigned 8-bits integer

Declaration

Source position: system.fpd line 18

type Byte = 0..255;


Cardinal

An unsigned 32-bits integer.

Declaration

Source position: systemh.inc line 109

type Cardinal = LongWord;


Char

Character type (1 byte)

Declaration

Source position: system.fpd line 19

type Char = #0..#255;

Description

Char is the basic ANSI character type, with a range of [#0..#255].


CodePointer

Code pointer (8/16 bit targets)

Declaration

Source position: systemh.inc line 342

type CodePointer = Pointer;

Description

CodePointer is used in 8/16-bit targets to indicate pointers to code segments. On all other platforms this equals Pointer.


CodePointer

Code pointer (8/16 bit targets)

Declaration

Source position: systemh.inc line 354

type CodePointer = Pointer;

Description

CodePointer is used in 8/16-bit targets to indicate pointers to code segments. On all other platforms this equals Pointer.


CodePtrInt

Signed Integer with same size as CodePointer

Declaration

Source position: systemh.inc line 343

type CodePtrInt = PtrInt;

Description

CodePtrInt is a signed integer with the same size as CodePointer

See also

CodePointer | Code pointer (8/16 bit targets)
CodePtrUInt | Unsigned Integer with same size as CodePointer


CodePtrInt

Signed Integer with same size as CodePointer

Declaration

Source position: systemh.inc line 355

type CodePtrInt = PtrInt;

Description

CodePtrInt is a signed integer with the same size as CodePointer

See also

CodePointer | Code pointer (8/16 bit targets)
CodePtrUInt | Unsigned Integer with same size as CodePointer


CodePtrUInt

Unsigned Integer with same size as CodePointer

Declaration

Source position: systemh.inc line 344

type CodePtrUInt = PtrUInt;

Description

CodePtrUInt is an unsigned integer with the same size as CodePointer

See also

CodePointer | Code pointer (8/16 bit targets)
CodePtrInt | Signed Integer with same size as CodePointer


CodePtrUInt

Unsigned Integer with same size as CodePointer

Declaration

Source position: systemh.inc line 356

type CodePtrUInt = PtrUInt;

Description

CodePtrUInt is an unsigned integer with the same size as CodePointer

See also

CodePointer | Code pointer (8/16 bit targets)
CodePtrInt | Signed Integer with same size as CodePointer


CP_ACP

ANSI code page identifier

Declaration

Source position: systemh.inc line 96

const CP_ACP = 0;

Description

CP_ACP is the default Windows codepage identifier.


CP_ASCII

US-ASCII code page identifier

Declaration

Source position: systemh.inc line 102

const CP_ASCII = 20127;

Description

CP_ASCII is the Windows ASCII encoding codepage identifier.


CP_NONE

No known code page

Declaration

Source position: systemh.inc line 103

const CP_NONE = $FFFF;

Description

CP_NONE is used when no code page information is available.


CP_OEMCP

OEM code page identifier

Declaration

Source position: systemh.inc line 97

const CP_OEMCP = 1;

Description

CP_ACP is the default Windows OEM (MS-DOS) codepage identifier.


CP_UTF7

UTF-7 code page identifier

Declaration

Source position: systemh.inc line 100

const CP_UTF7 = 65000;

Description

CP_UTF7 is the Windows unicode 7-Bit encoding codepage identifier.


CP_UTF8

UTF-8 code page identifier

Declaration

Source position: systemh.inc line 101

const CP_UTF8 = 65001;

Description

CP_UTF8 is the Windows unicode 8-Bit encoding codepage identifier.


CP_UTF16

UTF-16 code page identifier

Declaration

Source position: systemh.inc line 98

const CP_UTF16 = 1200;

Description

CP_UTF16 is the default Windows unicode codepage identifier (little endian).


CP_UTF16BE

Big-endian UTF-16 code page identifier

Declaration

Source position: systemh.inc line 99

const CP_UTF16BE = 1201;

Description

CP_UTF16BE is the Windows unicode codepage identifier (big endian).


Default8087CW

Declaration

Source position: mathh.inc line 19

const Default8087CW: Word = $1332;


DefaultFileSystemCodePage

Codepage to use for filenames

Declaration

Source position: systemh.inc line 689

var DefaultFileSystemCodePage: TSystemCodePage = ;

Description

DefaultFileSystemCodePage determines the code page to which file/path names are translated before they are passed to OS API calls, if the RTL uses a single byte OS API for this purpose on the current platform.

This code page is also used for intermediate operations on file paths inside the RTL before making OS API calls.

This variable does not exist in Delphi, and has been introduced in FPC to make it possible to change the value of DefaultSystemCodePage without breaking RTL interfaces with the OS file system API calls.

The initiali value of this variable depends on the platform:

  • Windows: UTF-8, because the RTL uses UTF-16 OS API calls (so no data is lost in intermediate operations).
  • OS X and iOS: UTF-8 (as defined by Apple)
  • Unix (excluding OS X and iOS): equals DefaultSystemCodePage. This is because the encoding of file names is undefined on Unix platforms: it is an untyped array of bytes that can be interpreted in any way; Specifically, it is not guaranteed to be valid UTF-8.
  • Other platforms: same as DefaultSystemCodePage.

The value of this variable may be changed using the SetMultiByteFileSystemCodePage procedure.

Remark: The Unix/OS X/iOS settings only apply in case the cwstring widestring manager is installed, otherwise DefaultFileSystemCodePage will have the same value as DefaultSystemCodePage after program startup.

See also

DefaultSystemCodePage | Current system codepage.
DefaultRTLFileSystemCodePage | Code page in which to return system-returned filenames
SetMultiByteFileSystemCodePage | Set codepage used when passing strings to OS single-byte filesystem APIs


DefaultMXCSR

Declaration

Source position: mathh.inc line 27

const DefaultMXCSR: DWord = $1900;


DefaultRTLFileSystemCodePage

Code page in which to return system-returned filenames

Declaration

Source position: systemh.inc line 692

var DefaultRTLFileSystemCodePage: TSystemCodePage = ;

Description

DefaultRTLFileSystemCodePage determines the code page to which file/path names are translated before they are returned from RawByteString file/path RTL routines.

Examples include the file/path names returned by the RawbyteString versions of SysUtils.FindFirst and GetDir.

The main reason for its existence is to enable the RTL to provide backward compatibility with earlier versions of FPC, as these always returned strings encoded in whatever the OS' single byte API used (normally DefaultSystemCodePage).

The initial value of this variable depends on the platform:

  • Windows: DefaultSystemCodePage, for backward compatibility.
  • OS X and iOS: UTF-8, for backward compatibility. It was already always UTF-8 in the past, since that's what the OS file APIs returned, and the data was never converted.
  • Other Unixes: DefaultSystemCodePage, for the same reason as DefaultFileSystemCodePage. Setting this to a different value than DefaultFileSystemCodePage is a bad idea on these platforms, since any code page conversion can corrupt these strings as their initial encoding is unknown.
  • Other platforms: same as DefaultSystemCodePage.

The value of this variable can be set using the SetMultiByteRTLFileSystemCodePage call.

See also

DefaultSystemCodePage | Current system codepage.
DefaultFileSystemCodePage | Codepage to use for filenames
SetMultiByteRTLFileSystemCodePage | Set codepage used when interpreting strings from OS single-byte filesystem APIs


DefaultStackSize

Default size for a new thread's stack (4MiB by default).

Declaration

Source position: threadh.inc line 20

const DefaultStackSize = 4 * 1024 * 1024;


DefaultSystemCodePage

Current system codepage.

Declaration

Source position: systemh.inc line 684

var DefaultSystemCodePage: TSystemCodePage = ;

Description

DefaultSystemCodePage is used to determine how CP_ACP is interpreted; it is what the program considers to be the current system codepage.

It is initialized to the default system codepage.

  • On windows, this is the result of the GetACP operating call, which returns the Windows ANSI code page.
  • On iOS, this is UTF-8
  • on other Unixes this will be based on the currently set LANG or LC_CTYPE environment variables. Normally this is UTF-8, but that is not guaranteed to be the case.
  • For all other platforms it is set to CP_ACP, as these platforms currently do not support multiple code pages, and are hardcoded to use their OS-specific code page in all cases.

The DefaultSystemCodePage value may be set using SetMultiByteConversionCodePage. That means that it is not a good idea to use its value to determine the real OS "default system code page".

Note that if you change DefaultSystemCodePage, you should call TEncoding.FreeEncodings to free the encodings that were created. They will be recreated with the correct (new) DefaultSystemCodePage.

See also

DefaultUnicodeCodePage | Code page for new unicode strings
DefaultFileSystemCodePage | Codepage to use for filenames
DefaultRTLFileSystemCodePage | Code page in which to return system-returned filenames
#rtl.sysutils.TEncoding.FreeEncodings | Free all standard encodings


DefaultUnicodeCodePage

Code page for new unicode strings

Declaration

Source position: systemh.inc line 685

var DefaultUnicodeCodePage: TSystemCodePage = ;

Description

DefaultUnicodeCodePage is the unicode code page for a new unicode string. On most platforms, this is CP_UTF16.

See also

CP_UTF16 | UTF-16 code page identifier
DefaultSystemCodePage | Current system codepage.
DefaultFileSystemCodePage | Codepage to use for filenames
DefaultRTLFileSystemCodePage | Code page in which to return system-returned filenames


DispCallByIDProc

Callback to perform dispatch interface procedure call by ID.

Declaration

Source position: objpash.inc line 434

var DispCallByIDProc: CodePointer = ;

Description

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.


DWord

An unsigned 32-bits integer

Declaration

Source position: systemh.inc line 108

type DWord = LongWord;


E_NOINTERFACE

Interface call result: Error: not an interface

Declaration

Source position: objpash.inc line 66

const E_NOINTERFACE = hresult($80004002);


E_NOTIMPL

Interface call result: Interface not implemented

Declaration

Source position: objpash.inc line 68

const E_NOTIMPL = hresult($80004001);


E_UNEXPECTED

Interface call result: Unexpected error

Declaration

Source position: objpash.inc line 67

const E_UNEXPECTED = hresult($8000FFFF);


EnumResLangProc

Callback for language resource enumeration

Declaration

Source position: resh.inc line 49

type EnumResLangProc = function(

  ModuleHandle: TFPResourceHMODULE;

  ResourceType: PChar;

  ResourceName: PChar;

  IDLanguage: Word;

  lParam: PtrInt

):LongBool;

Description

EnumResNameProcs used in the EnumResourceLanguages 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.

See also

EnumResourceLanguages

Enumerate available languages for a resource of given type and name


EnumResNameProc

Callback for resource name enumeration

Declaration

Source position: resh.inc line 48

type EnumResNameProc = function(

  ModuleHandle: TFPResourceHMODULE;

  ResourceType: PChar;

  ResourceName: PChar;

  lParam: PtrInt

):LongBool;

Description

EnumResNameProcs used in the EnumResourceNames 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.

See also

EnumResourceNames

Enumerate available resource names for a specified resource type


EnumResTypeProc

Callback for resource type enumeration

Declaration

Source position: resh.inc line 47

type EnumResTypeProc = function(

  ModuleHandle: TFPResourceHMODULE;

  ResourceType: PChar;

  lParam: PtrInt

):LongBool;

Description

EnumResTypeProc is used in the EnumResourceTypes 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.

See also

EnumResourceTypes | Enumerate available resource types
EnumResNameProc | Callback for resource name enumeration
EnumResLangProc | Callback for language resource enumeration


ErrOutput

Alias for StdErr

Declaration

Source position: systemh.inc line 708

var ErrOutput: Text = ;

Description

ErrOutput is provided for Delphi compatibility.

See also

StdErr

Standard diagnostic output text file.


ExceptClsProc

Callback used to determine the exception class for an OS exception

Declaration

Source position: systemh.inc line 1468

const ExceptClsProc: Pointer = Nil;

Description

ExceptClsProc is used in SEH (Structured Exception Support) to convert OS exception information to FPC exception classes when filtering exceptions. It is set e.g. by the sysutils unit. If it is not set, the exception is not handled.

See also

ExceptObjProc

Callback used to convert OS exceptions to FPC exceptions


ExceptObjProc

Callback used to convert OS exceptions to FPC exceptions

Declaration

Source position: systemh.inc line 1467

const ExceptObjProc: Pointer = Nil;

Description

ExceptObjProc is used in SEH (Structured Exception Support) to convert OS exception information to FPC exceptions. It is set e.g. by the sysutils unit. If it is not set, a run-time error results when OS exceptions are intercepted.

See also

ExceptClsProc

Callback used to determine the exception class for an OS exception


ExceptProc

Current exception handling procedure.

Declaration

Source position: objpash.inc line 345

const ExceptProc: TExceptProc = Nil;

Description

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.


FarPointer

Far pointer (8/16 bit targets)

Declaration

Source position: systemh.inc line 203

type FarPointer = Pointer;

Description

FarPointer is used in 8/16-bit targets to indicate far pointers (over segments). On all other platforms this equals Pointer.

See also

CodePointer

Code pointer (8/16 bit targets)


File handling functions

Functions concerning input and output from and to file.

Name | Description
Append | Open a file in append mode
Assign | Assign a name to a file
Blockread | Read data from a file into memory
Blockwrite | Write data from memory to a file
Close | Close a file
Eof | Check for end of file
Eoln | Check for end of line
Erase | Delete file from disk
Filepos | Position in file
Filesize | Size of file
Flush | Write file buffers to disk
IOresult | Return result of last file IO operation
Read | Read from file into variable
Readln | Read from file into variable and goto next line
Rename | Rename file on disk
Reset | Open file for reading
Rewrite | Open file for writing
Seek | Set file position
SeekEof | Set file position to end of file
SeekEoln | Set file position to end of line
SetTextBuf | Set size of file buffer
Truncate | Truncate the file at position
Write | Write variable to file
WriteLn | Write variable to file and append newline


Filemode

Default file mode for untyped files.

Declaration

Source position: systemh.inc line 651

const Filemode: Byte = 2;


FileRec

Untyped file type

Declaration

Source position: filerec.inc line 32

type FileRec = record
Handle: THandle; | OS file handle
Mode: LongInt; | File open mode
RecSize: SizeInt; | Record size
_private: array [1..3*SizeOf(SizeInt)+5*SizeOf(pointer)] of Byte; | Private field
UserData: array [1..32] of Byte; | User data for use in custom file types
name: array [0..filerecnamelength] of TFileTextRecChar; | File name
end;

Description

FileRec is the underlying type used in untyped files. It should be treated as opaque and never manipulated directly.

See also

TextRec | Text file type
Assign | Assign a name to a file
Reset | Open file for reading
Close | Close a file
Rewrite | Open file for writing


filerecnamelength

Maximum filename size

Declaration

Source position: filerec.inc line 27

const filerecnamelength = 255;

Description

filerecnamelength is the maximum filename size for untyped files.

See also

TextRec | Text file type
FileRec | Untyped file type


FirstDotAtFileNameStartIsExtension

Where does the extension start.

Declaration

Source position: systemh.inc line 682

var FirstDotAtFileNameStartIsExtension: Boolean = False;

Description

FirstDotAtFileNameStartIsExtension determines what happens if a filename starts with a dot (.) character. If True, then the whole file name will be treated as extension. If False, then the extension is empty.


float_flag_denormal

IEC/IEEE floating-point exception flag: ?

Declaration

Source position: mathh.inc line 49

const float_flag_denormal = exDenormalized;


float_flag_divbyzero

IEC/IEEE floating-point exception flag: Division by zero error

Declaration

Source position: mathh.inc line 50

const float_flag_divbyzero = exZeroDivide;


float_flag_inexact

IEC/IEEE floating-point exception flag: ?

Declaration

Source position: mathh.inc line 53

const float_flag_inexact = exPrecision;


float_flag_invalid

IEC/IEEE floating-point exception flag: Invalid operation error

Declaration

Source position: mathh.inc line 48

const float_flag_invalid = exInvalidOp;


float_flag_overflow

IEC/IEEE floating-point exception flag: Overflow error

Declaration

Source position: mathh.inc line 51

const float_flag_overflow = exOverflow;


float_flag_underflow

IEC/IEEE floating-point exception flag: Underflow error

Declaration

Source position: mathh.inc line 52

const float_flag_underflow = exUnderflow;


float_round_down

Round down

Declaration

Source position: mathh.inc line 61

const float_round_down = rmDown;


float_round_nearest_even

Round to nearest even number

Declaration

Source position: mathh.inc line 60

const float_round_nearest_even = rmNearest;


float_round_to_zero

Round in the direction of zero (down for positive, up for negative)

Declaration

Source position: mathh.inc line 63

const float_round_to_zero = rmTruncate;


float_round_up

Round up

Declaration

Source position: mathh.inc line 62

const float_round_up = rmUp;


fmAppend

File mode: File is open for writing, appending to the end.

Declaration

Source position: systemh.inc line 650

const fmAppend = $D7B4;


fmClosed

File mode: File is closed.

Declaration

Source position: systemh.inc line 646

const fmClosed = $D7B0;


fmInOut

File mode: File is open for reading and writing.

Declaration

Source position: systemh.inc line 649

const fmInOut = $D7B3;


fmInput

File mode: File is open for reading.

Declaration

Source position: systemh.inc line 647

const fmInput = $D7B1;


fmOutput

File mode: File is open for writing.

Declaration

Source position: systemh.inc line 648

const fmOutput = $D7B2;


fpc_in_abs_long

Internal ABS function

Declaration

Source position: innr.inc line 75

const fpc_in_abs_long = 64;


fpc_in_abs_real

FPC compiler internal procedure index: abs (real)

Declaration

Source position: innr.inc line 114

const fpc_in_abs_real = 127;


fpc_in_addr_x

FPC compiler internal procedure index: addr

Declaration

Source position: innr.inc line 53

const fpc_in_addr_x = 42;


fpc_in_aligned_x

FPC compiler internal procedure index: aligned

Declaration

Source position: innr.inc line 91

const fpc_in_aligned_x = 80;


fpc_in_arctan_real

FPC compiler internal procedure index: arctan (real)

Declaration

Source position: innr.inc line 117

const fpc_in_arctan_real = 130;


fpc_in_assert_x_y

FPC compiler internal procedure index: assert

Declaration

Source position: innr.inc line 52

const fpc_in_assert_x_y = 41;


fpc_in_assigned_x

FPC compiler internal procedure index: assigned

Declaration

Source position: innr.inc line 30

const fpc_in_assigned_x = 19;


fpc_in_bitsizeof_x

FPC compiler internal procedure index: bitsizeof

Declaration

Source position: innr.inc line 72

const fpc_in_bitsizeof_x = 61;


fpc_in_box_x

FPC compiler internal procedure index: box

Declaration

Source position: innr.inc line 88

const fpc_in_box_x = 77;


fpc_in_break

FPC compiler internal procedure index: break

Declaration

Source position: innr.inc line 50

const fpc_in_break = 39;


fpc_in_bsf_x

FPC compiler internal procedure index: bsf_x

Declaration

Source position: innr.inc line 85

const fpc_in_bsf_x = 74;


fpc_in_bsr_x

FPC compiler internal procedure index: bsr_x

Declaration

Source position: innr.inc line 86

const fpc_in_bsr_x = 75;


fpc_in_chr_byte

FPC compiler internal procedure index: chr

Declaration

Source position: innr.inc line 24

const fpc_in_chr_byte = 7;


fpc_in_concat_x

FPC compiler internal procedure index: concat

Declaration

Source position: innr.inc line 29

const fpc_in_concat_x = 18;


fpc_in_const_abs

FPC compiler internal procedure index: abs

Declaration

Source position: innr.inc line 96

const fpc_in_const_abs = 101;


fpc_in_const_odd

FPC compiler internal procedure index: sqr

Declaration

Source position: innr.inc line 97

const fpc_in_const_odd = 102;


fpc_in_const_ptr

FPC compiler internal procedure index: sqr

Declaration

Source position: innr.inc line 98

const fpc_in_const_ptr = 103;


fpc_in_const_sqr

FPC compiler internal procedure index: sqr

Declaration

Source position: innr.inc line 95

const fpc_in_const_sqr = 100;


fpc_in_const_swap_long

FPC compiler internal procedure index: swap (long)

Declaration

Source position: innr.inc line 100

const fpc_in_const_swap_long = 105;


fpc_in_const_swap_qword

FPC compiler internal procedure index: swap (qword)

Declaration

Source position: innr.inc line 103

const fpc_in_const_swap_qword = 108;


fpc_in_const_swap_word

FPC compiler internal procedure index: swap (word)

Declaration

Source position: innr.inc line 99

const fpc_in_const_swap_word = 104;


fpc_in_continue

FPC compiler internal procedure index: continue

Declaration

Source position: innr.inc line 51

const fpc_in_continue = 40;


fpc_in_copy_x

FPC compiler internal procedure index: copy

Declaration

Source position: innr.inc line 60

const fpc_in_copy_x = 49;


fpc_in_cos_real

FPC compiler internal procedure index: cos (real)

Declaration

Source position: innr.inc line 112

const fpc_in_cos_real = 125;


fpc_in_cycle

FPC compiler internal procedure index: cycle

Declaration

Source position: innr.inc line 63

const fpc_in_cycle = 52;


fpc_in_dec_x

FPC compiler internal procedure index: dec

Declaration

Source position: innr.inc line 47

const fpc_in_dec_x = 36;


fpc_in_default_x

FPC compiler internal procedure index: default

Declaration

Source position: innr.inc line 87

const fpc_in_default_x = 76;


fpc_in_dispose_x

FPC compiler internal procedure index: dispose

Declaration

Source position: innr.inc line 58

const fpc_in_dispose_x = 47;


fpc_in_exclude_x_y

FPC compiler internal procedure index: exclude

Declaration

Source position: innr.inc line 49

const fpc_in_exclude_x_y = 38;


fpc_in_exit

FPC compiler internal procedure index: exit

Declaration

Source position: innr.inc line 59

const fpc_in_exit = 48;


fpc_in_exp_real

FPC internal compiler routine: in_exp_real

Declaration

Source position: innr.inc line 111

const fpc_in_exp_real = 124;


fpc_in_fillchar_x

FPC internal compiler routine: in_fillchar_x

Declaration

Source position: innr.inc line 66

const fpc_in_fillchar_x = 55;


fpc_in_finalize_x

FPC compiler internal procedure index: finalize

Declaration

Source position: innr.inc line 56

const fpc_in_finalize_x = 45;


fpc_in_fma_double

FPC compiler internal procedure index: fma (double)

Declaration

Source position: innr.inc line 121

const fpc_in_fma_double = 134;


fpc_in_fma_extended

FPC compiler internal procedure index: fma (extended)

Declaration

Source position: innr.inc line 122

const fpc_in_fma_extended = 135;


fpc_in_fma_float128

FPC compiler internal procedure index: fma (float 128)

Declaration

Source position: innr.inc line 123

const fpc_in_fma_float128 = 136;


fpc_in_fma_single

FPC compiler internal procedure index: fma (single)

Declaration

Source position: innr.inc line 120

const fpc_in_fma_single = 133;


fpc_in_frac_real

FPC internal compiler routine: in_frac_real

Declaration

Source position: innr.inc line 109

const fpc_in_frac_real = 122;


fpc_in_get_caller_addr

FPC internal compiler routine: in_get_caller_addr

Declaration

Source position: innr.inc line 68

const fpc_in_get_caller_addr = 57;


fpc_in_get_caller_frame

FPC internal compiler routine: in_get_caller_frame

Declaration

Source position: innr.inc line 69

const fpc_in_get_caller_frame = 58;


fpc_in_get_frame

FPC internal compiler routine: in_get_frame

Declaration

Source position: innr.inc line 67

const fpc_in_get_frame = 56;


fpc_in_hi_long

FPC compiler internal procedure index: hi (long)

Declaration

Source position: innr.inc line 21

const fpc_in_hi_long = 4;


fpc_in_hi_qword

FPC compiler internal procedure index: hi (qword)

Declaration

Source position: innr.inc line 102

const fpc_in_hi_qword = 107;


fpc_in_hi_word

FPC compiler internal procedure index: hi (word)

Declaration

Source position: innr.inc line 19

const fpc_in_hi_word = 2;


fpc_in_high_x

FPC compiler internal procedure index: high

Declaration

Source position: innr.inc line 39

const fpc_in_high_x = 28;


fpc_in_inc_x

FPC compiler internal procedure index: inc

Declaration

Source position: innr.inc line 46

const fpc_in_inc_x = 35;


fpc_in_include_x_y

FPC compiler internal procedure index: include

Declaration

Source position: innr.inc line 48

const fpc_in_include_x_y = 37;


fpc_in_initialize_x

FPC compiler internal procedure index: initialize

Declaration

Source position: innr.inc line 61

const fpc_in_initialize_x = 50;


fpc_in_int_real

FPC internal compiler routine: in_int_real

Declaration

Source position: innr.inc line 110

const fpc_in_int_real = 123;


fpc_in_leave

FPC compiler internal procedure index: leave

Declaration

Source position: innr.inc line 62

const fpc_in_leave = 51;


fpc_in_length_string

FPC compiler internal procedure index: length

Declaration

Source position: innr.inc line 23

const fpc_in_length_string = 6;


fpc_in_ln_real

FPC compiler internal procedure index: ln (real)

Declaration

Source position: innr.inc line 118

const fpc_in_ln_real = 131;


fpc_in_lo_long

FPC compiler internal procedure index: lo (long)

Declaration

Source position: innr.inc line 20

const fpc_in_lo_long = 3;


fpc_in_lo_qword

FPC compiler internal procedure index: lo (qword)

Declaration

Source position: innr.inc line 101

const fpc_in_lo_qword = 106;


fpc_in_lo_word

FPC compiler internal procedure index: lo (word)

Declaration

Source position: innr.inc line 18

const fpc_in_lo_word = 1;


fpc_in_low_x

FPC compiler internal procedure index: low

Declaration

Source position: innr.inc line 38

const fpc_in_low_x = 27;


fpc_in_mmx_pcmpeqb

FPC compiler internal procedure index: MMX

Declaration

Source position: innr.inc line 129

const fpc_in_mmx_pcmpeqb = 200;


fpc_in_mmx_pcmpeqd

FPC compiler internal procedure index: MMX

Declaration

Source position: innr.inc line 131

const fpc_in_mmx_pcmpeqd = 202;


fpc_in_mmx_pcmpeqw

FPC compiler internal procedure index: MMX

Declaration

Source position: innr.inc line 130

const fpc_in_mmx_pcmpeqw = 201;


fpc_in_mmx_pcmpgtb

FPC compiler internal procedure index: MMX

Declaration

Source position: innr.inc line 132

const fpc_in_mmx_pcmpgtb = 203;


fpc_in_mmx_pcmpgtd

FPC compiler internal procedure index: MMX

Declaration

Source position: innr.inc line 134

const fpc_in_mmx_pcmpgtd = 205;


fpc_in_mmx_pcmpgtw

FPC compiler internal procedure index: MMX

Declaration

Source position: innr.inc line 133

const fpc_in_mmx_pcmpgtw = 204;


fpc_in_move_x

FPC internal compiler routine: in_move_x

Declaration

Source position: innr.inc line 65

const fpc_in_move_x = 54;


fpc_in_new_x

FPC compiler internal procedure index: new

Declaration

Source position: innr.inc line 57

const fpc_in_new_x = 46;


fpc_in_ofs_x

FPC compiler internal procedure index: ofs

Declaration

Source position: innr.inc line 32

const fpc_in_ofs_x = 21;


fpc_in_ord_x

FPC compiler internal procedure index: ord

Declaration

Source position: innr.inc line 22

const fpc_in_ord_x = 5;


fpc_in_pack_x_y_z

FPC compiler internal procedure index: pack

Declaration

Source position: innr.inc line 70

const fpc_in_pack_x_y_z = 59;


fpc_in_pi_real

FPC internal compiler routine: in_pi_real

Declaration

Source position: innr.inc line 113

const fpc_in_pi_real = 126;


fpc_in_popcnt_x

FPC compiler internal procedure index: popcnt

Declaration

Source position: innr.inc line 90

const fpc_in_popcnt_x = 79;


fpc_in_pred_x

FPC compiler internal procedure index: pred

Declaration

Source position: innr.inc line 41

const fpc_in_pred_x = 30;


fpc_in_prefetch_var

FPC compiler internal procedure index: prefetch

Declaration

Source position: innr.inc line 104

const fpc_in_prefetch_var = 109;


fpc_in_read_x

FPC compiler internal procedure index: read

Declaration

Source position: innr.inc line 27

const fpc_in_read_x = 16;


fpc_in_readln_x

FPC compiler internal procedure index: readln

Declaration

Source position: innr.inc line 28

const fpc_in_readln_x = 17;


fpc_in_readstr_x

Internal read string procedure

Declaration

Source position: innr.inc line 74

const fpc_in_readstr_x = 63;


fpc_in_reset_typedfile

FPC compiler internal procedure index: reset

Declaration

Source position: innr.inc line 43

const fpc_in_reset_typedfile = 32;


fpc_in_reset_x

FPC compiler internal procedure index: reset

Declaration

Source position: innr.inc line 36

const fpc_in_reset_x = 25;


fpc_in_rewrite_typedfile

FPC compiler internal procedure index: rewrite

Declaration

Source position: innr.inc line 44

const fpc_in_rewrite_typedfile = 33;


fpc_in_rewrite_x

FPC compiler internal procedure index: rewrite

Declaration

Source position: innr.inc line 37

const fpc_in_rewrite_x = 26;


fpc_in_rol_x

Declaration

Source position: innr.inc line 78

const fpc_in_rol_x = 67;


fpc_in_rol_x_x

Declaration

Source position: innr.inc line 79

const fpc_in_rol_x_x = 68;


fpc_in_ror_x

Declaration

Source position: innr.inc line 76

const fpc_in_ror_x = 65;


fpc_in_ror_x_x

Declaration

Source position: innr.inc line 77

const fpc_in_ror_x_x = 66;


fpc_in_round_real

FPC internal compiler routine: in_round_real

Declaration

Source position: innr.inc line 108

const fpc_in_round_real = 121;


fpc_in_sar_x

FPC compiler internal procedure index: sar_x

Declaration

Source position: innr.inc line 84

const fpc_in_sar_x = 73;


fpc_in_sar_x_y

FPC compiler internal procedure index: sar_x_y

Declaration

Source position: innr.inc line 83

const fpc_in_sar_x_y = 72;


fpc_in_seg_x

FPC compiler internal procedure index: seg

Declaration

Source position: innr.inc line 40

const fpc_in_seg_x = 29;


fpc_in_setlength_x

FPC compiler internal procedure index: setlength

Declaration

Source position: innr.inc line 55

const fpc_in_setlength_x = 44;


fpc_in_setstring_x_y_z

FPC compiler internal procedure index: setstring

Declaration

Source position: innr.inc line 92

const fpc_in_setstring_x_y_z = 81;


fpc_in_settextbuf_file_x

FPC compiler internal procedure index: settextbuf

Declaration

Source position: innr.inc line 45

const fpc_in_settextbuf_file_x = 34;


fpc_in_sin_real

FPC compiler internal procedure index: sin (real)

Declaration

Source position: innr.inc line 119

const fpc_in_sin_real = 132;


fpc_in_sizeof_x

FPC compiler internal procedure index: sizeof

Declaration

Source position: innr.inc line 33

const fpc_in_sizeof_x = 22;


fpc_in_slice

FPC internal compiler routine: in_slice

Declaration

Source position: innr.inc line 64

const fpc_in_slice = 53;


fpc_in_sqr_real

FPC compiler internal procedure index: sqr (real)

Declaration

Source position: innr.inc line 115

const fpc_in_sqr_real = 128;


fpc_in_sqrt_real

FPC compiler internal procedure index: sqrt (real)

Declaration

Source position: innr.inc line 116

const fpc_in_sqrt_real = 129;


fpc_in_str_x_string

FPC compiler internal procedure index: str

Declaration

Source position: innr.inc line 31

const fpc_in_str_x_string = 20;


fpc_in_succ_x

FPC compiler internal procedure index: succ

Declaration

Source position: innr.inc line 42

const fpc_in_succ_x = 31;


fpc_in_trunc_real

FPC internal compiler routine: in_trunc_real

Declaration

Source position: innr.inc line 107

const fpc_in_trunc_real = 120;


fpc_in_typeinfo_x

FPC compiler internal procedure index: typeinfo

Declaration

Source position: innr.inc line 54

const fpc_in_typeinfo_x = 43;


fpc_in_typeof_x

FPC compiler internal procedure index: typeof

Declaration

Source position: innr.inc line 34

const fpc_in_typeof_x = 23;


fpc_in_unbox_x_y

FPC compiler internal procedure index: unbox

Declaration

Source position: innr.inc line 89

const fpc_in_unbox_x_y = 78;


fpc_in_unpack_x_y_z

FPC compiler internal procedure index: unpack

Declaration

Source position: innr.inc line 71

const fpc_in_unpack_x_y_z = 60;


fpc_in_val_x

FPC compiler internal procedure index: val

Declaration

Source position: innr.inc line 35

const fpc_in_val_x = 24;


fpc_in_write_x

FPC compiler internal procedure index: write

Declaration

Source position: innr.inc line 25

const fpc_in_write_x = 14;


fpc_in_writeln_x

FPC compiler internal procedure index: writeln

Declaration

Source position: innr.inc line 26

const fpc_in_writeln_x = 15;


fpc_in_writestr_x

Internal write string procedure

Declaration

Source position: innr.inc line 73

const fpc_in_writestr_x = 62;


fpc_objc_encode_x

FPC compiler internal procedure index: encode

Declaration

Source position: innr.inc line 82

const fpc_objc_encode_x = 71;


fpc_objc_protocol_x

FPC compiler internal procedure index: protocol

Declaration

Source position: innr.inc line 81

const fpc_objc_protocol_x = 70;


fpc_objc_selector_x

Declaration

Source position: innr.inc line 80

const fpc_objc_selector_x = 69;


growheapsize1

Grow rate for block less than 256 Kb.

Declaration

Source position: heaph.inc line 63

const growheapsize1: PtrUInt = 256 * 1024;


growheapsize2

Grow rate for block larger than 256 Kb.

Declaration

Source position: heaph.inc line 64

const growheapsize2: PtrUInt = 1024 * 1024;


growheapsizesmall

Fixed size small blocks grow rate

Declaration

Source position: heaph.inc line 62

const growheapsizesmall: PtrUInt = 32 * 1024;


HGLOBAL

Windows compatibility type for use in resources

Declaration

Source position: resh.inc line 6

type HGLOBAL = PtrUInt;

Description

This is an opaque type.


HMODULE

Windows compatibility type for use in resources

Declaration

Source position: resh.inc line 5

type HMODULE = PtrUInt;

Description

This is an opaque type.


HRESULT

32-Bit signed integer.

Declaration

Source position: systemh.inc line 441

type HRESULT = type LongInt;


IInterface

Basic interface for all COM based interfaces

Declaration

Source position: objpash.inc line 252

type IInterface = IUnknown;

Description

IInterface is the basic interface from which all COM style interfaces descend.

See also

IDispatch | Dispatch interface
IInvokable | Interface with RTTI associated with it.


Reference for unit 'System'

The system unit

Overview

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.

Related topics

UnicodeSupport | Unicode and codepage support
MiscellaneousFunctions | Miscellaneous functions
OSfunctions | Operating System functions
StringFunctions | String handling
MathematicalFunctions | Mathematical routines
MemoryFunctions | Memory management functions
FileFunctions | File handling functions
RuntimeErrors | Run-Time Error behaviour


Reference for unit 'System': Constants

AbstractErrorProc | Custom abstract error handling procedure
AssertErrorProc | Custom assert error handling procedure
BackTraceStrFunc | Standard backtrace formatting routine
CP_ACP | ANSI code page identifier
CP_ASCII | US-ASCII code page identifier
CP_NONE | No known code page
CP_OEMCP | OEM code page identifier
CP_UTF16 | UTF-16 code page identifier
CP_UTF16BE | Big-endian UTF-16 code page identifier
CP_UTF7 | UTF-7 code page identifier
CP_UTF8 | UTF-8 code page identifier
Default8087CW
DefaultMXCSR
DefaultStackSize | Default size for a new thread's stack (4MiB by default).
Erroraddr | Address where the last error occurred.
Errorcode | Last error code.
ErrorProc | Custom error handling procedure.
ExceptClsProc | Callback used to determine the exception class for an OS exception
ExceptObjProc | Callback used to convert OS exceptions to FPC exceptions
ExceptProc | Current exception handling procedure.
ExitProc | Exit procedure pointer.
E_NOINTERFACE | Interface call result: Error: not an interface
E_NOTIMPL | Interface call result: Interface not implemented
E_UNEXPECTED | Interface call result: Unexpected error
Filemode | Default file mode for untyped files.
filerecnamelength | Maximum filename size
float_flag_denormal | IEC/IEEE floating-point exception flag: ?
float_flag_divbyzero | IEC/IEEE floating-point exception flag: Division by zero error
float_flag_inexact | IEC/IEEE floating-point exception flag: ?
float_flag_invalid | IEC/IEEE floating-point exception flag: Invalid operation error
float_flag_overflow | IEC/IEEE floating-point exception flag: Overflow error
float_flag_underflow | IEC/IEEE floating-point exception flag: Underflow error
float_round_down | Round down
float_round_nearest_even | Round to nearest even number
float_round_to_zero | Round in the direction of zero (down for positive, up for negative)
float_round_up | Round up
fmAppend | File mode: File is open for writing, appending to the end.
fmClosed | File mode: File is closed.
fmInOut | File mode: File is open for reading and writing.
fmInput | File mode: File is open for reading.
fmOutput | File mode: File is open for writing.
fpc_in_abs_long | Internal ABS function
fpc_in_abs_real | FPC compiler internal procedure index: abs (real)
fpc_in_addr_x | FPC compiler internal procedure index: addr
fpc_in_arctan_real | FPC compiler internal procedure index: arctan (real)
fpc_in_assert_x_y | FPC compiler internal procedure index: assert
fpc_in_assigned_x | FPC compiler internal procedure index: assigned
fpc_in_bitsizeof_x | FPC compiler internal procedure index: bitsizeof
fpc_in_break | FPC compiler internal procedure index: break
fpc_in_bsf_x | FPC compiler internal procedure index: bsf_x
fpc_in_bsr_x | FPC compiler internal procedure index: bsr_x
fpc_in_chr_byte | FPC compiler internal procedure index: chr
fpc_in_concat_x | FPC compiler internal procedure index: concat
fpc_in_const_abs | FPC compiler internal procedure index: abs
fpc_in_const_odd | FPC compiler internal procedure index: sqr
fpc_in_const_ptr | FPC compiler internal procedure index: sqr
fpc_in_const_sqr | FPC compiler internal procedure index: sqr
fpc_in_const_swap_long | FPC compiler internal procedure index: swap (long)
fpc_in_const_swap_qword | FPC compiler internal procedure index: swap (qword)
fpc_in_const_swap_word | FPC compiler internal procedure index: swap (word)
fpc_in_continue | FPC compiler internal procedure index: continue
fpc_in_copy_x | FPC compiler internal procedure index: copy
fpc_in_cos_real | FPC compiler internal procedure index: cos (real)
fpc_in_cycle | FPC compiler internal procedure index: cycle
fpc_in_dec_x | FPC compiler internal procedure index: dec
fpc_in_dispose_x | FPC compiler internal procedure index: dispose
fpc_in_exclude_x_y | FPC compiler internal procedure index: exclude
fpc_in_exit | FPC compiler internal procedure index: exit
fpc_in_exp_real | FPC internal compiler routine: in_exp_real
fpc_in_fillchar_x | FPC internal compiler routine: in_fillchar_x
fpc_in_finalize_x | FPC compiler internal procedure index: finalize
fpc_in_frac_real | FPC internal compiler routine: in_frac_real
fpc_in_get_caller_addr | FPC internal compiler routine: in_get_caller_addr
fpc_in_get_caller_frame | FPC internal compiler routine: in_get_caller_frame
fpc_in_get_frame | FPC internal compiler routine: in_get_frame
fpc_in_high_x | FPC compiler internal procedure index: high
fpc_in_hi_long | FPC compiler internal procedure index: hi (long)
fpc_in_hi_qword | FPC compiler internal procedure index: hi (qword)
fpc_in_hi_word | FPC compiler internal procedure index: hi (word)
fpc_in_include_x_y | FPC compiler internal procedure index: include
fpc_in_inc_x | FPC compiler internal procedure index: inc
fpc_in_initialize_x | FPC compiler internal procedure index: initialize
fpc_in_int_real | FPC internal compiler routine: in_int_real
fpc_in_leave | FPC compiler internal procedure index: leave
fpc_in_length_string | FPC compiler internal procedure index: length
fpc_in_ln_real | FPC compiler internal procedure index: ln (real)
fpc_in_low_x | FPC compiler internal procedure index: low
fpc_in_lo_long | FPC compiler internal procedure index: lo (long)
fpc_in_lo_qword | FPC compiler internal procedure index: lo (qword)
fpc_in_lo_word | FPC compiler internal procedure index: lo (word)
fpc_in_mmx_pcmpeqb | FPC compiler internal procedure index: MMX
fpc_in_mmx_pcmpeqd | FPC compiler internal procedure index: MMX
fpc_in_mmx_pcmpeqw | FPC compiler internal procedure index: MMX
fpc_in_mmx_pcmpgtb | FPC compiler internal procedure index: MMX
fpc_in_mmx_pcmpgtd | FPC compiler internal procedure index: MMX
fpc_in_mmx_pcmpgtw | FPC compiler internal procedure index: MMX
fpc_in_move_x | FPC internal compiler routine: in_move_x
fpc_in_new_x | FPC compiler internal procedure index: new
fpc_in_ofs_x | FPC compiler internal procedure index: ofs
fpc_in_ord_x | FPC compiler internal procedure index: ord
fpc_in_pack_x_y_z | FPC compiler internal procedure index: pack
fpc_in_pi_real | FPC internal compiler routine: in_pi_real
fpc_in_pred_x | FPC compiler internal procedure index: pred
fpc_in_prefetch_var | FPC compiler internal procedure index: prefetch
fpc_in_readln_x | FPC compiler internal procedure index: readln
fpc_in_readstr_x | Internal read string procedure
fpc_in_read_x | FPC compiler internal procedure index: read
fpc_in_reset_typedfile | FPC compiler internal procedure index: reset
fpc_in_reset_x | FPC compiler internal procedure index: reset
fpc_in_rewrite_typedfile | FPC compiler internal procedure index: rewrite
fpc_in_rewrite_x | FPC compiler internal procedure index: rewrite
fpc_in_round_real | FPC internal compiler routine: in_round_real
fpc_in_sar_x | FPC compiler internal procedure index: sar_x
fpc_in_sar_x_y | FPC compiler internal procedure index: sar_x_y
fpc_in_seg_x | FPC compiler internal procedure index: seg
fpc_in_setlength_x | FPC compiler internal procedure index: setlength
fpc_in_settextbuf_file_x | FPC compiler internal procedure index: settextbuf
fpc_in_sin_real | FPC compiler internal procedure index: sin (real)
fpc_in_sizeof_x | FPC compiler internal procedure index: sizeof
fpc_in_slice | FPC internal compiler routine: in_slice
fpc_in_sqrt_real | FPC compiler internal procedure index: sqrt (real)
fpc_in_sqr_real | FPC compiler internal procedure index: sqr (real)
fpc_in_str_x_string | FPC compiler internal procedure index: str
fpc_in_succ_x | FPC compiler internal procedure index: succ
fpc_in_trunc_real | FPC internal compiler routine: in_trunc_real
fpc_in_typeinfo_x | FPC compiler internal procedure index: typeinfo
fpc_in_typeof_x | FPC compiler internal procedure index: typeof
fpc_in_unpack_x_y_z | FPC compiler internal procedure index: unpack
fpc_in_val_x | FPC compiler internal procedure index: val
fpc_in_writeln_x | FPC compiler internal procedure index: writeln
fpc_in_writestr_x | Internal write string procedure
fpc_in_write_x | FPC compiler internal procedure index: write
fpc_objc_encode_x | FPC compiler internal procedure index: encode
fpc_objc_protocol_x | FPC compiler internal procedure index: protocol
growheapsize1 | Grow rate for block less than 256 Kb.
growheapsize2 | Grow rate for block larger than 256 Kb.
growheapsizesmall | Fixed size small blocks grow rate
InitProc | Initialization routine
IObjectInstance | GUID for the IObject interface
IsMultiThread | Indicates whether more than one thread is running in the application.
maxint | Maximum integer value.
MaxKeptOSChunks | Maximum number of OS chunks to be kept in memory
maxLongint | Maximum longint value.
MaxSIntValue | Maximum String-size value.
maxSmallint | Maximum smallint value.
MaxUIntValue | Maximum unsigned integer value.
Max_Frame_Dump | Maximum number of frames to show in error frame dump.
ModuleIsCpp | program compiled by CPP ?
ModuleIsLib | Determines whether the current module is a library
ModuleIsPackage | Determines whether the current module is a package
RaiseMaxFrameCount | Maximum number of frames to include in TExceptObject
RaiseProc | Procedure to raise an exception.
RT_ACCELERATOR | Constant identifying an accelerator resouce
RT_ANICURSOR | Resource type: Animated cursor
RT_ANIICON | Resource type: Animated icon
RT_BITMAP | Constant identifying a bitmap resource
RT_CURSOR | Constant identifying a cursor resource
RT_DIALOG | Constant identifying a dialog resource
RT_FONT | Constant identifying a font resource
RT_FONTDIR | Constant identifying a font directory resource
RT_GROUP_CURSOR | Constant identifying a group cursor resource
RT_GROUP_ICON | Constant identifying a group icon resource
RT_HTML | Resource type: HTML data
RT_ICON | Constant identifying an icon resource
RT_MANIFEST | Resource type: manifest
RT_MENU | Constant identifying a menu resource
RT_MESSAGETABLE | Constant identifying a message data resource
RT_RCDATA | Constant identifying a binary data resource
RT_STRING | Constant identifying a string table resource
RT_VERSION | Constant identifying a version info resource
RuntimeErrorExitCodes | Mapping between runtime-error constants and program exit codes
SafeCallErrorProc | Error handler for safecall errors
StackError | Indicate whether there was a stack error.
S_FALSE | Interface call result: Not OK
S_OK | Interface call result: OK
TextRecBufSize | Default buffer size for text files
TextRecNameLength | maximum filename size for text files.
ThreadingAlreadyUsed | Internal constant for the threading system. Don't use.
VarAddRefProc | Callback to increase reference count of a variant.
varany | Variant type: Any
vararray | Variant type: variant Array
varboolean | Variant type: Boolean type
varbyref | Variant type: By reference
varbyte | Variant type: Byte (8 bit)
VarClearProc | Callback to clear a variant.
VarCopyProc | Callback to copy a variant
varcurrency | Variant type: Currency
vardate | Variant type: Date
vardecimal | Variant type: Decimal (BCD)
vardispatch | Variant type: dispatch interface
vardouble | Variant type: Double float
varempty | Variant type: Empty variant
varerror | Variant type: Error type
varint64 | Variant type: Integer (64-Bit)
varinteger | Variant type: Integer (32-bit)
varlongword | Variant type: Word (32 bit)
varnull | Variant type: Null variant
varolestr | Variant type: OLE string (widestring)
varqword | Variant type: Word (64-bit)
varrecord | Record variant type
varshortint | Variant type: Shortint (16 bit)
varsingle | Variant type: Single float
varsmallint | Variant type: smallint (8 bit)
varstrarg | Variant type: String
varstring | Variant type: String
VarToLStrProc | Callback to convert a variant to a ansistring.
VarToWStrProc | Callback to convert a variant to a widestring.
vartypemask | Variant type: Mask to extract type
varuint64 | Unsigned 64-bit value in a variant
varunknown | Variant type: Unknown
varustrarg | Unicode string argument value
varustring | Unicode string value in Variant
varvariant | Variant type: Variant (arrays only)
varword | Variant type: Word (16 bit)
varword64 | Variant type: Word (64-bit)
vmtAfterConstruction | VMT Layout: ?
vmtAutoTable | VMT layout: ?
vmtBeforeDestruction | VMT Layout: ?
vmtClassName | VMT Layout: location of class name.
vmtDefaultHandler | VMT Layout: ?
vmtDefaultHandlerStr | VMT Layout: ?
vmtDestroy | VMT Layout: Location of destructor pointer.
vmtDispatch | Offset to dispatch table
vmtDispatchStr | Offset to string dispatch table
vmtDynamicTable | VMT Layout: location of dynamic methods table.
vmtEquals | Offset to the Equals method pointer
vmtFieldTable | VMT Layout: Location of fields table.
vmtFreeInstance | VMT Layout: location of FreeInstance method.
vmtGetHashCode | Offset to the GetHashCode method pointer
vmtInitTable | VMT Layout: ?
vmtInstanceSize | VMT Layout: Location of class instance size in VMT
vmtIntfTable | VMT layout: Interface table
vmtMethodStart | VMT layout: start of method table.
vmtMethodTable | VMT Layout: Method table start.
vmtMsgStrPtr | VMT layout: message strings table.
vmtNewInstance | VMT Layout: location of NewInstance method.
vmtParent | VMT Layout: location of pointer to parent VMT.
vmtSafeCallException | VMT Layout: ?
vmtToString | Offset to the ToString method pointer
vmtTypeInfo | VMT Layout: Location of class type information.
vtAnsiString | TVarRec type: Ansistring
vtBoolean | TVarRec type: Boolean
vtChar | TVarRec type: Char
vtClass | TVarRec type: Class type
vtCurrency | TVarRec type: Currency
vtExtended | TVarRec type: Extended
vtInt64 | TVarRec type: Int64 (signed 64-bit integer)
vtInteger | TVarRec type: Integer
vtInterface | TVarRec type: Interface
vtObject | TVarRec type: Object instance
vtPChar | TVarRec type: PChar
vtPointer | TVarRec type: pointer
vtPWideChar | TVarRec type: PWideChar
vtQWord | TVarRec type: QWord (unsigned 64-bit integer)
vtString | TVarRec type: String
vtUnicodeString | Unicode string argument
vtVariant | TVarRec type: Variant
vtWideChar | TVarRec type: Widechar
vtWideString | TVarRec type: WideString


Reference for unit 'System': Types

AnsiChar | Alias for 1-byte sized char.
Byte | An unsigned 8-bits integer
Cardinal | An unsigned 32-bits integer.
Char | Character type (1 byte)
CodePointer | Code pointer (8/16 bit targets)
CodePointer | Code pointer (8/16 bit targets)
CodePtrInt | Signed Integer with same size as CodePointer
CodePtrInt | Signed Integer with same size as CodePointer
CodePtrUInt | Unsigned Integer with same size as CodePointer
CodePtrUInt | Unsigned Integer with same size as CodePointer
DWord | An unsigned 32-bits integer
EnumResLangProc | Callback for language resource enumeration
EnumResNameProc | Callback for resource name enumeration
EnumResTypeProc | Callback for resource type enumeration
FarPointer | Far pointer (8/16 bit targets)
FileRec | Untyped file type
HGLOBAL | Windows compatibility type for use in resources
HMODULE | Windows compatibility type for use in resources
HRESULT | 32-Bit signed integer.
IInterface | Basic interface for all COM based interfaces
Int16 | A signed 16-bits integer
Int32 | A signed 32-bits integer
Int64 | 64-bit, signed integer
Int8 | A signed 8-bits integer
Integer | A signed 16-bits integer
IntegerArray | Generic array of integer.
IntPtr | A signed integer with the same size in bytes as pointer
jmp_buf | Record type to store processor information.
Longint | A signed 32-bits integer
Longword | An unsigned 32-bits integer
MAKEINTRESOURCE | Alias for the PChar type.
NativeInt | Alias for PtrInt
NativeUInt | Alias for PtrUInt
PAnsiChar | Alias for PChar type.
PAnsiString | Pointer to an ansistring type.
PBoolean | Pointer to a Boolean type.
PByte | Pointer to byte type
pcalldesc | Pointer to TCallDesc record.
PCardinal | Pointer to Cardinal type
PChar | Pointer to null-terminated string.
PClass | Pointer to TClass
PCodePointer | Pointer to CodePointer
PComp | Pointer to Complex type
PCurrency | Pointer to currency type.
PDate | Pointer to a TDateTime type.
PDateTime | Pointer to TDatetime
PDispatch | Pointer to IDispatch interface type
pdispdesc | Pointer to tdispdesc record
PDouble | Pointer to double-sized float value.
PDWord | Pointer to DWord type
pdynarrayindex | Pointer to tdynarrayindex type.
pdynarraytypeinfo | Pointer to TDynArrayTypeInfo type.
PError | Pointer to an Error type.
PEventState | Pointer to EventState, which is an opaque type.
PExceptObject | Pointer to Exception handler procedural type TExceptProc
PExtended | Pointer to extended-sized float value.
PFileTextRecChar | Pointer to TFileTextRecChar
PGuid | Pointer to TGUID type.
pInt16 | Pointer to Int16 type
pInt32 | Pointer to Int32 type
PInt64 | Pointer to Int64 type
pInt8 | Pointer to Int8 type
PInteger | Pointer to integer type
PIntegerArray | Pointer to IntegerArray type
PInterface | Pointer to IInterface interface
pinterfaceentry | Pointer to tinterfaceentry record.
pinterfacetable | Pointer to tinterfacetable record.
PIntPtr | Pointer to IntPtr type
PJmp_buf | Pointer to jmp_buf record
PLongBool | Pointer to a LongBool type.
PLongint | Pointer to Longint type
PLongWord | Pointer to LongWord type
PMemoryManager | Pointer to TMemoryManager record
PMethod
PMsgStrTable | Pointer to array of TMsgStrTable records.
PNativeInt | Pointer to NativeInt type
PNativeUInt | Pointer to NativeInt type
PointerArray | Generic pointer array.
POleVariant | Pointer to OleVariant type.
PPAnsiChar | Alias for PPChar type.
PPByte | Pointer to PByte type.
PPChar | Pointer to an array of pointers to null-terminated strings.
PPCharArray | Pointer to TPCharArray type.
PPCodePointer | Pointer to PCodePointer
PPDispatch | Pointer to PDispatch pointer type
PPDouble | Pointer to PDouble type.
PPLongint | Pointer to PLongint type.
PPointer | Pointer to a pointer type.
PPointerArray | Pointer to PointerArray type
PPPAnsiChar | Pointer to PPAnsichar
PPPChar | Pointer to PPChar.
PPPointer | Pointer to a PPointer type.
PPPWideChar | Pointer to PPWideChar type.
PPtrInt | Pointer to PtrInt type.
PPtrUInt | Pointer to unsigned integer of pointer size
PPUnknown | Pointer to untyped pointer
PPWideChar | Pointer to link id="PWideChar"> type.
PQWord | Pointer to QWord type
PRTLCriticalSection | Pointer to #rtl.system.TRTLCriticalSection type.
PRTLEvent | Pointer to RTLEvent, which is an opaque type.
PShortInt | Pointer to shortint type
PShortString | Pointer to a shortstring type.
PSingle | Pointer to single-sized float value.
PSizeInt | Pointer to a SizeInt type
PSizeUInt | Pointer to SizeUint
PSmallInt | Pointer to smallint type
pstringmessagetable | Pointer to TStringMessageTable record.
PText | Pointer to text file.
PtrInt | Signed integer type with same size as Pointer.
PtrInt | Signed integer type with same size as Pointer.
PtrUInt | Unsigned integer type with same size as Pointer.
PtrUInt | Unsigned integer type with same size as Pointer.
PUCS2Char | Pointer to UCS2Char character.
PUCS4Char | Pointer to UCS4Char
PUCS4CharArray | Pointer to array of UCS4Char characters.
pUInt16 | Pointer to UInt16 type
pUInt32 | Pointer to UInt32 type
PUInt64 | Pointer to UInt64
pUInt8 | Pointer to UInt8 type
PUintPtr | Pointer to UIntPtr type
PUnicodeChar | Pointer to unicode character
PUnicodeString | Pointer to unicodestring
PUnknown | Untyped pointer
PUTF8String | Pointer to UTF8String
pvararray | Pointer to TVarArray type.
pvararraybound | Pointer to tvararraybound type.
pvararrayboundarray | Pointer to tvararrayboundarray type.
pvararraycoorarray | Pointer to tvararraycoorarray type.
pvardata | Pointer to TVarData record.
PVariant | Pointer to Variant type.
pvariantmanager | Pointer to TVariantManager record.
PVarRec | Pointer to TVarRec type.
PVmt | Pointer to TVMT record
PWideChar | Pointer to WChar.
PWideString | Pointer to widestring type
PWord | Pointer to word type
PWordBool | Pointer to a WordBool type.
QWord | 64-bit unsigned integer
RawByteString | Single-byte character string without specified codepage
Real | Alias for real type
real48 | TP compatible real type (6 bytes) definition
Shortint | A signed 8-bits integer
SizeInt | Signed integer type which fits for sizes
SizeInt | Signed integer type which fits for sizes
SizeUInt | Unsigned Integer type which fits for sizes
SizeUInt | Unsigned Integer type which fits for sizes
Smallint | A signed 16-bits integer
TAbstractErrorProc | Abstract error handler procedural type.
TAllocateThreadVarsHandler | Threadvar allocation callback type for TThreadManager.
TAnsiChar | Alias for 1-byte sized char.
TAssertErrorProc | Assert error handler procedural type.
TBackTraceStrFunc | Type for formatting of backtrace dump.
TBasicEventCreateHandler | callback type for creating eventstate in TThreadManager.
TBasicEventHandler | Generic callback type for handling eventstate in TThreadManager.
TBasicEventWaitForHandler | Wait for basic event callback type for TThreadManager.
TBeginThreadHandler | Callback for thread start in TThreadManager.
TBoundArray | Dynamic array of integer.
tcalldesc | COM/OLE dispatch call argument description.
TClass | Class of TObject.
TCompareOption | How to compare strings
TCompareOptions | Set of TCompareOption
TCriticalSectionHandler | Generic callback type for critical section handling in TThreadManager.
TCriticalSectionHandlerTryEnter | Function prototype for TryEnterCriticalsection
TCtrlBreakHandler | CTRL-C Handler prototype
TDate | Alias for TDateTime type.
TDateTime | Encoded Date-Time type.
tdispdesc | COM/OLE dispatch call description.
TDoubleRec | Extended value record
tdynarrayindex | Type with the correct size for index into a dynamic array.
tdynarraytypeinfo | Type information for a dynamic array.
TEndThreadHandler | Callback for thread end in TThreadManager.
TEntryInformation | Executable entry point information structure
TError | Error type, used in variants.
TErrorProc | Standard error handler procedural type.
TExceptObject | Exception object
TExceptProc | Exception handler procedural type
TextBuf | Text buffer
TExtended80Rec | Extended value record
TextFile | Alias for Text file type.
TextRec | Text file type
TFileTextRecChar | Character type for the filename part in file records
TFloatSpecial | Special floating point values
TFPCHeapStatus | Record describing the state of the default FPC heap manager.
TFPResourceHandle | Handle to resource
TFPResourceHGLOBAL | TFPResourceHGLOBAL
TFPResourceHMODULE | Handle to module containing resource
TFPUException | Type describing Floating Point processor exceptions.
TFPUExceptionMask | Set of TFPUException
TFPUPrecisionMode | Type describing the default precision for Floating Point math.
TFPURoundingMode | How to round floating point values
TGetCurrentThreadIdHandler | Callback type for retrieving thread ID in TThreadManager.
TGuid | Standard GUID representation type.
THandle | Type alias.
THeapStatus | Record describing current heap status.
TInitThreadVarHandler | Threadvar initialization callback type for TThreadManager.
TInterfacedClass | TObject descendent implementing the IInterface interface
tinterfaceentry | Interfaces table entry.
tinterfaceentrytype | Dispatch interface entry type
tinterfacetable | Record to store list of interfaces of a class.
TLineEndStr | Line ending string type
TMemoryManager | Record describing the current memory manager
TMethod | Record describing a method.
TMsgStrTable | Record used in string message handler table.
TPCharArray | Array of PChar
TProcedure | Simple procedural type.
TReleaseThreadVarsHandler | Threadvar release callback type for TThreadManager.
TRelocateThreadVarHandler | Threadvar relocalization callback type for TThreadManager.
TResourceHandle | Handle to a resource, for use in the resource loading routines
TResourceManager | Resource manager definition
TRTLCreateEventHandler | Callback type for creating a TRTLEvent type in TThreadManager.
TRTLCriticalSection | A critical section.
TRTLEventHandler | Generic TRTLEvent handling type for TThreadManager.
TRTLEventHandlerTimeout | TRTLEvent timeout handling type for TThreadManager.
trtlmethod | Callback type for synchronization event.
TRuntimeError | Type of runtime-error for the Error procedure
TSafeCallErrorProc | Prototype for the safecall error handler
TSemaphoreDestroyHandler | Function prototype for destroying a semaphore
TSemaphorePostHandler | Function prototype for posting an event to a semaphore
TSemaphoreWaitHandler | Function prototype to wait on a semaphore
TSempahoreInitHandler | Function prototype for initializing a semaphore
TSingleRec | Extended value record
TStandardCodePageEnum | Description of standard used codepages
TStringMessageTable | String message table container for class.
TSystemCodePage | System code page
TTextBuf | Alias for TextBuf
TTextLineBreakStyle | Text line break style. (end of line character)
TThreadFunc | Thread function prototype
TThreadGetPriorityHandler | Callback type for thread priority getting in TThreadManager.
TThreadHandler | Generic thread handler callback for TThreadManager.
TThreadID | Type for Thread-IDs
TThreadManager | Thread manager record.
TThreadSetPriorityHandler | Callback type for thread priority setting in TThreadManager.
TThreadSwitchHandler | Callback type for thread switch in TThreadManager.
TTime | Alias for TDateTime type.
TUCS4CharArray | Array of UCS4Char characters.
TUnicodeStringManager | Unicode string manager
tvararray | Type describing variant array
tvararraybound | Type describing variant array bounds.
tvararrayboundarray | array of tvararraybound records.
tvararraycoorarray | Array of variant array coordinates
tvardata | Variant record.
tvariantmanager | Record describing the variant manager.
tvarop | Variant operation.
TVarRec | Record describing an element in an array of const
tvartype | Type with size of variant type.
TVmt | Virtual method table layout
TWaitForThreadTerminateHandler | Callback type for thread termination in TThreadManager.
TWideStringManager | Record containing the various callbacks of the widestring manager.
UCS2Char | UCS2 unicode character.
UCS4Char | UCS unicode character (unsigned 32 bit word)
UCS4String | String of UCS4Char characters.
UInt16 | An unsigned 16-bits integer
UInt32 | An unsigned 32-bits integer
UInt64 | Unsigned 64-bit integer
UInt8 | An unsigned 8-bits integer
UIntPtr | An unsigned integer with the same size in bytes as pointer
UnicodeChar | Unicode string character
UnicodeString | A string consisting of widechars.
UTF8String | UTF-8 unicode (ansi) string.
ValReal | Largest available floating point type
ValSInt | Val-Signed integer.
ValSInt | Val-Signed integer.
ValUInt | Val-unsigned integer
ValUInt | Val-unsigned integer
WChar | Wide char (16-bit sized char)
WideChar | The base two byte character type
WideString | UTF-16 widechar encoded unicode string
Word | An unsigned 16-bits integer


Reference for unit 'System': Classes

IDispatch | Dispatch interface
IEnumerable | Interface to retrieve an enumerator from a class.
IEnumerator | Enumerator support interface
IInvokable | Interface with RTTI associated with it.
IUnknown | Basic interface for all COM-based interfaces
TAggregatedObject | Aggregated object
TContainedObject | Base class for contained objects
TInterfacedObject | TObject descendent implementing the IUnknown interface
TObject | Base class of all classes.


Reference for unit 'System': Procedures and functions

abs | Calculate absolute value
AbstractError | Generate an abstract error.
AcquireExceptionObject | Obtain a reference to the current exception object
add(variant,variant):variant | Implement addition (+) operation on variants.
AddExitProc | Add an exit procedure to the exit procedure chain.
Addr | Return address of a variable
Align | Return aligned version of an address
AllocMem | Allocate and clear memory.
AnsiToUtf8 | Convert ansi string to UTF-8 string
Append | Open a file in append mode
arctan | Calculate inverse tangent
ArrayStringToPPchar | Concert an array of string to an array of null-terminated strings
Assert | Check validity of a given condition.
Assign | Assign a name to a file
assign(ansistring):olevariant |
assign(ansistring):variant |
assign(Boolean):olevariant |
assign(Boolean):variant |
assign(Byte):olevariant |
assign(Byte):variant |
assign(Char):olevariant |
assign(Char):variant |
assign(comp):olevariant | Assign a comp-precision float to an ole-variant
assign(comp):variant | Assign a comp-precision float to a variant
assign(currency):olevariant |
assign(currency):variant |
assign(Double):olevariant |
assign(Double):variant |
assign(DWord):olevariant |
assign(DWord):variant |
assign(extended):olevariant | Assign an extended-precision float to an ole-variant
assign(extended):variant | Assign an extended-precision float to a variant
assign(Int64):olevariant |
assign(Int64):variant |
assign(longbool):olevariant |
assign(longbool):variant |
assign(LongInt):olevariant |
assign(LongInt):variant |
assign(olevariant):ansistring |
assign(olevariant):Boolean |
assign(olevariant):Byte |
assign(olevariant):Char |
assign(olevariant):comp | Assign an ole- variant to a comp-precision float
assign(olevariant):currency |
assign(olevariant):Double |
assign(olevariant):DWord |
assign(olevariant):extended | Assign an ole- variant to an extended-precision float
assign(olevariant):Int64 |
assign(olevariant):longbool |
assign(olevariant):LongInt |
assign(olevariant):QWord |
assign(olevariant):Real | Assign an ole- variant to a real-precision float
assign(olevariant):ShortInt |
assign(olevariant):shortstring |
assign(olevariant):single | Assign an ole- variant to a single-precision float
assign(olevariant):SmallInt |
assign(olevariant):TDateTime |
assign(olevariant):TError |
assign(olevariant):UnicodeString | Assign an ole-variant to a unicode string
assign(olevariant):variant |
assign(olevariant):WideChar |
assign(olevariant):widestring |
assign(olevariant):Word |
assign(olevariant):wordbool |
assign(QWord):olevariant |
assign(QWord):variant |
assign(Real):olevariant | Assign a real-precision float to an ole-variant
assign(Real):variant | Assign a real-precision float to a variant
assign(real48):Double |
assign(real48):extended |
assign(ShortInt):olevariant |
assign(ShortInt):variant |
assign(shortstring):olevariant |
assign(shortstring):variant |
assign(single):olevariant | Assign a single-precision float to an ole-variant
assign(single):variant | Assign a single-precision float to a variant
assign(SmallInt):olevariant |
assign(SmallInt):variant |
assign(TDateTime):olevariant |
assign(TDateTime):variant |
assign(TError):olevariant |
assign(TError):variant |
assign(UCS4String):variant | Assign UCS4String to a variant, performing the necessary conversions
assign(UnicodeString):olevariant | Assign a unicodestring to an ole-variant
assign(UnicodeString):variant | Assign UnicodeString to a variant, performing the necessary conversions
assign(UTF8String):variant | Assign an UTF-8 string to a variant, performing the necessary conversions
assign(variant):ansistring |
assign(variant):Boolean |
assign(variant):Byte |
assign(variant):Char |
assign(variant):comp | Assign a variant to a comp-precision float
assign(variant):currency |
assign(variant):Double |
assign(variant):DWord |
assign(variant):extended | Assign a variant to a extended-precision float
assign(variant):Int64 |
assign(variant):longbool |
assign(variant):LongInt |
assign(variant):olevariant |
assign(variant):QWord |
assign(variant):Real | Assign a variant to a real-precision float
assign(variant):ShortInt |
assign(variant):shortstring |
assign(variant):single | Assign a variant to a single-precision float
assign(variant):SmallInt |
assign(variant):TDateTime |
assign(variant):TError |
assign(variant):unicodestring | Assign a variant to a unicodestring
assign(variant):UTF8String | Assign a variant to an UTF8String
assign(variant):WideChar |
assign(variant):widestring |
assign(variant):Word |
assign(variant):wordbool |
assign(WideChar):olevariant |
assign(WideChar):variant |
assign(widestring):olevariant |
assign(widestring):variant |
assign(Word):olevariant |
assign(Word):variant |
assign(wordbool):olevariant |
assign(wordbool):variant |
Assigned | Check if a pointer is valid
BasicEventCreate | Obsolete. Don't use
basiceventdestroy | Obsolete. Don't use
basiceventResetEvent | Obsolete. Don't use
basiceventSetEvent | Obsolete. Don't use
basiceventWaitFor | Obsolete. Don't use
BeginThread | Start a new thread.
BEtoN | Convert Big Endian-ordered integer to Native-ordered integer
binStr | Convert integer to string with binary representation.
BlockRead | Read data from an untyped file into memory
BlockWrite | Write data from memory to an untyped file
Break | Exit current loop construct.
BsfByte | Return the position of the rightmost set bit in an 8-bit value
BsfDWord | Return the position of the rightmost set bit in a 32-bit value
BsfQWord | Return the position of the rightmost set bit in a 64-bit value
BsfWord | Return the position of the rightmost set bit in a 16-bit value
BsrByte | Return the position of the leftmost set bit in an 8-bit value
BsrDWord | Return the position of the leftmost set bit in a 32-bit value
BsrQWord | Return the position of the leftmost set bit in a 64-bit value
BsrWord | Return the position of the leftmost set bit in a 16-bit value
CaptureBacktrace | Return stack trace
chdir | Change current working directory.
chr | Convert byte value to character value
Close | Close a file
CloseThread | Close a thread and free up resources used by the thread
CompareByte | Compare 2 memory buffers byte per byte
CompareChar | ompare 2 memory buffers character per character
CompareChar0 | Compare two buffers character by character till a null-character is reached.
CompareDWord | Compare 2 memory buffers DWord per DWord
CompareWord | Compare 2 memory buffers word per word
Concat | Append one string to another.
Continue | Continue with next loop cycle.
CopyArray | Copy managed-type elements in array
cos | Calculate cosine of angle
Cseg | Return code segment
Dec | Decrease value of variable
DefaultAnsi2UnicodeMove | Standard widestring manager callback
DefaultAnsi2WideMove | Standard implementation of Ansi to Widestring conversion routine
DefaultUnicode2AnsiMove | Standard widestring manager callback
Delete | Delete part of a string.
Dispose | Free dynamically allocated memory
divide(variant,variant):variant | Implement division (/) operation on variants.
DoneCriticalsection | Clean up a critical section.
DoneThread | End the current thread
Dseg | Return data segment
DumpExceptionBackTrace | Create backtrace
Dump_Stack | Dump stack to the given text file.
DynArrayBounds | Return the bounds of the dynamic array
DynArrayClear | Clear dynamical array
DynArrayDim | Return the number of dimensions in a dynamic array
DynArrayIndex | Return pointer to indicated element
DynArraySetLength | Set the length of a dynamic array
DynArraySize | Return length of dynamic array
EmptyMethod | Empty method alias
EndThread | End the current thread.
EnterCriticalsection | Enter a critical section
EnumResourceLanguages | Enumerate available languages for a resource of given type and name
EnumResourceNames | Enumerate available resource names for a specified resource type
EnumResourceTypes | Enumerate available resource types
EOF | Check for end of file
EOLn | Check for end of line
equal(variant,variant):Boolean | Implement = (equality) operation on variants.
Erase | Delete a file from disk
Error | Generate run-time error
Exclude | Exlude element from a set if it is present.
Exit | Exit current subroutine.
exp | Exponentiate
FilePos | Get position in file
FileSize | Size of file
FillByte | Fill memory region with 8-bit pattern
FillChar | Fill memory region with certain character
FillDWord | Fill memory region with 32-bit pattern
FillQWord | Fill memory range with QWord (64-bit) values
FillWord | Fill memory region with 16-bit pattern
FinalizeArray | Finalize managed-type elements in array
FindResource | Locate a resource and return a handle to it.
FindResourceEx | Find a resource based on type, name, language
float_raise | Raise floating point exception
Flush | Write file buffers to disk
FlushThread | Flush all standard files
FMADouble | Internal function, do not use
FMAExtended | Internal function, do not use
FMASingle | Internal function, do not use
fpc_SarInt64 | SAR (int64)
FPower10 | Fast multiply with a power of 10
frac | Return fractional part of floating point value.
Freemem | Release allocated memory
Freememory | Alias for FreeMem
FreeResource | Free a loaded resource
Get8087CW
GetCPUCount | Return the number of cores on the system
GetCurrentThreadId | Return the id of the currently running thread.
getdir | Return the current directory
GetFPCHeapStatus | Return FPC heap manager status information
GetHeapStatus | Return the memory manager heap status.
GetMem | Allocate new memory on the heap
GetMemory | Alias for GetMem
GetMemoryManager | Return current memory manager
GetMXCSR
GetProcessID | Get the current process ID
GetResourceManager | Return the currently active resource manager
GetSSECSR
GetTextCodePage | Get the codepage used in a text file.
GetThreadID | Get the current Thread ID.
GetThreadManager | Return the current thread manager
GetUnicodeStringManager | Return a copy of the currently active unicodetring manager.
GetVariantManager | Return the current variant manager.
GetWideStringManager | Return a copy of the currently active widestring manager.
get_caller_addr | Return the address of the caller.
get_caller_frame | Return the frame pointer of the caller
get_caller_stackinfo | Return caller stack infomation
get_frame | Return the current frame
Get_pc_addr | Get Program Counter address
greaterthan(variant,variant):Boolean | Implement > (greater than) operation on variants.
greaterthanorequal(variant,variant):Boolean | Implement >= (greater than or equal) operation on variants.
halt | Stop program execution.
hexStr | Convert integer value to string with hexadecimal representation.
hi | Return high byte/word/nibble of value.
High | Return highest index of open array or enumerated
HINSTANCE | Windows compatibility type for use in resources
Inc | Increase value of integer variable
Include | Include element in set if it was not yet present.
IndexByte | Search for a byte in a memory range.
IndexChar | Search for a character in a memory range.
IndexChar0 | Return index of a character in null-terminated array of char.
IndexDWord | Search for a DWord value in a memory range.
IndexQWord | Return the position of a QWord in a memory range
Indexword | Search for a WORD value in a memory range.
InitCriticalSection | Initialize a critical section
InitializeArray | Initialize managed-type elements in array
InitThread | Initialize a thread
InitThreadVars | Initialize threadvars
Insert | Insert one string in another.
int | Calculate integer part of floating point value.
intdivide(variant,variant):variant | Implement div (integer division) operation on variants.
InterlockedCompareExchange | Conditional exchange
InterlockedCompareExchange64
InterLockedDecrement | Thread-safe decrement
InterLockedDecrement64
InterLockedExchange | Exchange 2 integers in a thread-safe way
InterLockedExchange64
InterLockedExchangeAdd | Thread-safe add and exchange of 2 values
InterLockedExchangeAdd64
InterLockedIncrement | Thread-safe increment
InterLockedIncrement64
IOResult | Return result of last file IO operation
IsDynArrayRectangular | Check whether all dimensions have the same size
IsMemoryManagerSet | Is the memory manager set
Is_IntResource | Check whether a resource is an internal resource
KillThread | Kill a running thread
LeaveCriticalsection | Leave a critical section
leftshift(variant,variant):variant | Implement binary shl operation on variants.
lessthan(variant,variant):Boolean | Implement < (less than) operation on variants.
lessthanorequal(variant,variant):Boolean | Implement <= (less than or equal) operation on variants.
LEtoN | Convert Little Endian-ordered integer to Native-ordered integer
ln | Calculate logarithm
lo | Return low nibble/byte/word of value.
LoadResource | Load a resource for use
LockResource | Lock a resource
logicaland(variant,variant):variant | Implement logical/binary and operation on variants
logicalnot(variant):variant | Implement logical/binary not operation on variants
logicalor(variant,variant):variant | Implement logical/binary or operation on variants
logicalxor(variant,variant):variant | Implement logical/binary xor operation on variants
longjmp | Jump to address.
Low | Return lowest index of open array or enumerated
lowerCase | Return lowercase version of a string.
MakeLangID | Create a langauge ID
MemSize | Return the size of a memory block.
mkdir | Create a new directory.
modulus(variant,variant):variant | Implement mod (modulo) operation on variants.
Move | Move data from one location in memory to another
MoveChar0 | Move data till first zero character
multiply(variant,variant):variant | Implement multiplication (*) operation on variants.
negative(variant):variant | Implement - (unary minus, negation) operation on variants.
New | Dynamically allocate memory for variable
NtoBE | Convert Native-ordered integer to a Big Endian-ordered integer
NtoLE | Convert Native-ordered integer to a Little Endian-ordered integer
Null | Null variant
OctStr | Convert integer to a string with octal representation.
odd | Is a value odd or even ?
Ofs | Return offset of a variable.
Ord | Return ordinal value of an ordinal type.
ParamCount | Return number of command-line parameters passed to the program.
ParamStr | Return value of a command-line argument.
pi | Return the value of PI.
PopCnt | Count number of set bits
Pos | Search for substring in a string.
power(variant,variant):variant | Implement power (**) operation on variants.
Pred | Return previous element for an ordinal type.
prefetch | Prefetch a memory location
ptr | Combine segment and offset to pointer
RaiseList | List of currently raised exceptions.
Random | Generate random number
Randomize | Initialize random number generator
Read | Read from a text file into variable
ReadBarrier | Memory Read Barrier
ReadDependencyBarrier | Memory Read Dependency Barrier
ReadLn | Read from a text file into variable and goto next line
ReadWriteBarrier | Memory read/write barrier
Real2Double | Convert Turbo Pascal style real to double.
ReAllocMem | Re-allocate memory on the heap
ReAllocMemory | Alias for ReAllocMem
ReleaseExceptionObject | Decrease the reference count of the current exception object.
Rename | Rename file on disk
Reset | Open file for reading
ResumeThread | Resume a suspended thread.
Rewrite | Open file for writing
rightshift(variant,variant):variant | Implement binary shr operation on variants.
rmdir | Remove directory when empty.
RolByte | Rotate bits of a byte value to the left
RolDWord | Rotate bits of a DWord (cardinal) value to the left
RolQWord | Rotate bits of a QWord (64-bit) value to the left
RolWord | Rotate bits of a word value to the left
RorByte | Rotate bits of a byte value to the right
RorDWord | Rotate bits of a DWord (cardinal) value to the right
RorQWord | Rotate bits of a QWord (64-bit) value to the right
RorWord | Rotate bits of a word value to the right
round | Round floating point value to nearest integer number.
RTLEventCreate | Create a new RTL event
RTLeventdestroy | Destroy a RTL Event
RTLeventResetEvent | Reset an event
RTLeventSetEvent | Notify threads of the event.
RTLeventWaitFor | Wait for an event.
RunError | Generate a run-time error.
SarInt64 | 64-bit Shift Arithmetic Right
SarLongint | 32-bit Shift Arithmetic Right
SarShortint | 8-bit Shift Arithmetic Right
SarSmallint | 16-bit Shift Arithmetic Right
Seek | Set file position
SeekEOF | Set file position to end of file
SeekEOLn | Set file position to end of line
Seg | Return segment
SemaphoreDestroy | Destroy a semaphore
SemaphoreInit | Create a new semaphore
SemaphorePost | Make semaphore available
SemaphoreWait | Wait for semaphore to become available
Set8087CW
SetCodePage | Set the codepage of a string
Setjmp | Save current execution point.
SetMemoryManager | Set a memory manager
SetMultiByteConversionCodePage | Set codepage for conversions from multi-byte strings to single-byte strings
SetMultiByteFileSystemCodePage | Set codepage used when passing strings to OS single-byte filesystem APIs
SetMultiByteRTLFileSystemCodePage | Set codepage used when interpreting strings from OS single-byte filesystem APIs
SetMXCSR
SetResourceManager | Set the resource manager
SetSSECSR
SetString | Set length of a string and copy buffer.
SetTextBuf | Set size of text file internal buffer
SetTextCodePage | Set the codepage used in a text file.
SetTextLineEnding | Set the end-of-line character for the given text file.
SetThreadManager | Set the thread manager, optionally return the current thread manager.
SetUnicodeStringManager | Set the unicodestring manager
SetVariantManager | Set the current variant manager.
SetWideStringManager | Set the widestring manager
ShortCompareText | Compare 2 shortstrings
sin | Calculate sine of angle
SizeOf | Return size of a variable or type.
SizeofResource | Return the size of a particular resource
Space | Return a string of spaces
Sptr | Return current stack pointer
sqr | Calculate the square of a value.
sqrt | Calculate the square root of a value
Sseg | Return stack segment register value.
StackTop | Top location of the stack.
Str | Convert a numerical or enumeration value to a string.
StringCodePage | Get the code page of a string
StringElementSize | Get the character size of a string.
StringOfChar | Return a string consisting of 1 character repeated N times.
StringRefCount | Get the reference count of a string
StringToPPChar | Split string in list of null-terminated strings
StringToUnicodeChar | Convert an ansistring to a null-terminated array of unicode characters.
StringToWideChar | Convert a string to an array of widechars.
strlen | Length of a null-terminated string.
strpas | Convert a null-terminated string to a shortstring.
subtract(variant,variant):variant | Implement subtraction (-) operation on variants.
Succ | Return next element of ordinal type.
SuspendThread | Suspend a running thread.
Swap | Swap high and low bytes/words of a variable
SwapEndian | Swap endianness of the argument
SysAllocMem | System memory manager: Allocate memory
SysAssert | Standard Assert failure implementation
SysBackTraceStr | Format an address suitable for inclusion in a backtrace
SysFlushStdIO | Flush all standard IO file descriptors
SysFreemem | System memory manager free routine.
SysFreememSize | System memory manager free routine.
SysGetFPCHeapStatus | Return the status of the FPC heapmanager
SysGetHeapStatus | System implementation of GetHeapStatus
SysGetmem | System memory manager memory allocator.
SysInitExceptions | Initialize exceptions.
SysInitFPU | Initialize the FPU
SysInitStdIO | Initialize standard input and output.
SysMemSize | System memory manager: free size.
SysReAllocMem | System memory manager: Reallocate memory
SysResetFPU | Reset the floating point unit.
SysSetCtrlBreakHandler | System CTRL-C handler
SysTryResizeMem | System memory manager: attempt to resize memory.
ThreadGetPriority | Return the priority of a thread.
ThreadSetPriority | Set the priority of a thread.
ThreadSwitch | Signal possibility of thread switch
ToSingleByteFileSystemEncodedFileName | Convert string to encoding for use in single-byte filesystem API
trunc | Truncate a floating point value.
Truncate | Truncate the file at position
TryEnterCriticalsection | Try entering a critical section
UCS4StringToUnicodeString | Convert a UCS-4 encoded string to a unicode string
UCS4StringToWideString |
Unassigned | Unassigned variant.
UnicodeCharLenToString | Convert a memory buffer with unicode characters to an ansistring
UnicodeCharLenToStrVar | Convert a memory buffer with unicode characters to an ansistring
UnicodeCharToString | Convert unicode character to string
UnicodeCharToStrVar | Convert a null-terminated memory buffer with unicode characters to an ansistring
UnicodeStringToUCS4String | Convert a unicode string to a UCS-4 string.
UnicodeToUtf8 |
UniqueString | Make sure reference count of string is 1
UnlockResource | Unlock a previously locked resource
upCase | Convert a string to all uppercase.
Utf8CodePointLen | Length of an UTF-8 codepoint.
UTF8Decode | Convert an UTF-8 encoded ansistring to a unicodestring
UTF8Encode | Convert a widestring or unicodestring to an UTF-8 encoded ansistring
Utf8ToAnsi | Convert a UTF-8 encoded unicode string to an ansistring
Utf8ToUnicode | Convert a buffer with UTF-8 characters to widestring characters
Val | Calculate numerical/enumerated value of a string.
VarArrayGet |
VarArrayPut | Put a value in a single cell of a variant array
VarArrayRedim | Redimension a variant array
VarCast | Cast a variant to a certain type
WaitForThreadTerminate | Wait for a thread to terminate.
WideCharLenToString | Convert a length-limited array of widechar to an ansistring
WideCharLenToStrVar | Convert a length-limited array of widechar to an ansistring
WideCharToString | Convert a null-terminated array of widechar to an ansistring
WideCharToStrVar | Convert a null-terminated array of widechar to an ansistring
WideStringToUCS4String | Convert a widestring to a UCS-4 encoded string.
WriteBarrier | Memory write barrier


Reference for unit 'System': Variables

DefaultFileSystemCodePage | Codepage to use for filenames
DefaultRTLFileSystemCodePage | Code page in which to return system-returned filenames
DefaultSystemCodePage | Current system codepage.
DefaultUnicodeCodePage | Code page for new unicode strings
DispCallByIDProc | Callback to perform dispatch interface procedure call by ID.
ErrOutput | Alias for StdErr
ExitCode | Exit code for the program, will be communicated to the OS on exit.
FirstDotAtFileNameStartIsExtension | Where does the extension start.
InOutRes | Result of last I/O operation. Read-Only.
Input | Standard input text file.
IsConsole | True for console applications, False for GUI applications.
IsLibrary | True if the current module is a library. Otherwise module is an excutable
NoErrMsg | Unused, for Delphi compatibility
Output | Standard output text file.
RandSeed | Seed for Random function.
ReturnNilIfGrowHeapFails | Describe behaviour if getmem fails.
softfloat_exception_flags | Current soft float exception flags
softfloat_exception_mask | Current soft float exception mask
softfloat_rounding_mode | Rounding mode for softfloat
StackBottom | Current stack bottom.
StackLength | Maximum stack length.
StdErr | Standard diagnostic output text file.
StdOut | Alias for Output.
ThreadID | Current Thread ID.
UTF8CompareLocale | Unused, for Delphi compatibility only
widestringmanager | Current widestring manager.
WriteErrorsToStdErr | Write errors to StdErr


Index of all identifiers in unit 'System'

A B C D E F G H I J K L M N O P Q R S T U V W

A

abs | assign(olevariant):ansistring | assign(TError):olevariant
AbstractError | assign(olevariant):Boolean | assign(TError):variant
AbstractErrorProc | assign(olevariant):Byte | assign(UCS4String):variant
AcquireExceptionObject | assign(olevariant):Char | assign(UnicodeString):olevariant
AddExitProc | assign(olevariant):comp | assign(UnicodeString):variant
Addr | assign(olevariant):currency | assign(UTF8String):variant
add(variant,variant):variant | assign(olevariant):Double | assign(variant):ansistring
Align | assign(olevariant):DWord | assign(variant):Boolean
AllocMem | assign(olevariant):extended | assign(variant):Byte
AnsiChar | assign(olevariant):Int64 | assign(variant):Char
AnsiToUtf8 | assign(olevariant):longbool | assign(variant):comp
Append | assign(olevariant):LongInt | assign(variant):currency
arctan | assign(olevariant):QWord | assign(variant):Double
ArrayStringToPPchar | assign(olevariant):Real | assign(variant):DWord
Assert | assign(olevariant):ShortInt | assign(variant):extended
AssertErrorProc | assign(olevariant):shortstring | assign(variant):Int64
Assign | assign(olevariant):single | assign(variant):longbool
assign(ansistring):olevariant | assign(olevariant):SmallInt | assign(variant):LongInt
assign(ansistring):variant | assign(olevariant):TDateTime | assign(variant):olevariant
assign(Boolean):olevariant | assign(olevariant):TError | assign(variant):QWord
assign(Boolean):variant | assign(olevariant):UnicodeString | assign(variant):Real
assign(Byte):olevariant | assign(olevariant):variant | assign(variant):ShortInt
assign(Byte):variant | assign(olevariant):WideChar | assign(variant):shortstring
assign(Char):olevariant | assign(olevariant):widestring | assign(variant):single
assign(Char):variant | assign(olevariant):Word | assign(variant):SmallInt
assign(comp):olevariant | assign(olevariant):wordbool | assign(variant):TDateTime
assign(comp):variant | assign(QWord):olevariant | assign(variant):TError
assign(currency):olevariant | assign(QWord):variant | assign(variant):unicodestring
assign(currency):variant | assign(real48):Double | assign(variant):UTF8String
assign(Double):olevariant | assign(real48):extended | assign(variant):WideChar
assign(Double):variant | assign(Real):olevariant | assign(variant):widestring
assign(DWord):olevariant | assign(Real):variant | assign(variant):Word
assign(DWord):variant | assign(ShortInt):olevariant | assign(variant):wordbool
Assigned | assign(ShortInt):variant | assign(WideChar):olevariant
assign(extended):olevariant | assign(shortstring):olevariant | assign(WideChar):variant
assign(extended):variant | assign(shortstring):variant | assign(widestring):olevariant
assign(Int64):olevariant | assign(single):olevariant | assign(widestring):variant
assign(Int64):variant | assign(single):variant | assign(wordbool):olevariant
assign(longbool):olevariant | assign(SmallInt):olevariant | assign(wordbool):variant
assign(longbool):variant | assign(SmallInt):variant | assign(Word):olevariant
assign(LongInt):olevariant | assign(TDateTime):olevariant | assign(Word):variant
assign(LongInt):variant | assign(TDateTime):variant |

B

BackTraceStrFunc | BEtoN | BsfQWord
BasicEventCreate | binStr | BsfWord
basiceventdestroy | BlockRead | BsrByte
basiceventResetEvent | BlockWrite | BsrDWord
basiceventSetEvent | Break | BsrQWord
basiceventWaitFor | BsfByte | BsrWord
BeginThread | BsfDWord | Byte

C

CaptureBacktrace | coIgnoreCase | Continue
Cardinal | coIgnoreKanaType | CopyArray
Char | coIgnoreNonSpace | cos
chdir | coIgnoreSymbols | coStringSort
chr | coIgnoreWidth | CP_ACP
Close | coLingCasing | CP_ASCII
CloseThread | coLingIgnoreCase | CP_NONE
CodePointer | coLingIgnoreDiacritic | CP_OEMCP
CodePointer | CompareByte | CP_UTF16
CodePtrInt | CompareChar | CP_UTF16BE
CodePtrInt | CompareChar0 | CP_UTF7
CodePtrUInt | CompareDWord | CP_UTF8
CodePtrUInt | CompareWord | Cseg
coDigitAsNumbers | Concat |

D

Dec | DefaultUnicode2AnsiMove | DumpExceptionBackTrace
Default8087CW | DefaultUnicodeCodePage | Dump_Stack
DefaultAnsi2UnicodeMove | Delete | DWord
DefaultAnsi2WideMove | DispCallByIDProc | DynArrayBounds
DefaultFileSystemCodePage | Dispose | DynArrayClear
DefaultMXCSR | divide(variant,variant):variant | DynArrayDim
DefaultRTLFileSystemCodePage | DoneCriticalsection | DynArrayIndex
DefaultStackSize | DoneThread | DynArraySetLength
DefaultSystemCodePage | Dseg | DynArraySize

E

EmptyMethod | Erase | ExceptClsProc
EndThread | Error | ExceptObjProc
E_NOINTERFACE | Erroraddr | ExceptProc
E_NOTIMPL | Errorcode | Exclude
EnterCriticalsection | ErrorProc | exDenormalized
EnumResLangProc | ErrOutput | exInvalidOp
EnumResNameProc | etFieldValue | Exit
EnumResourceLanguages | etFieldValueClass | ExitCode
EnumResourceNames | etStandard | ExitProc
EnumResourceTypes | etStaticMethodClass | exOverflow
EnumResTypeProc | etStaticMethodResult | exp
EOF | etVirtualMethodClass | exPrecision
EOLn | etVirtualMethodResult | exUnderflow
equal(variant,variant):Boolean | E_UNEXPECTED | exZeroDivide

F

FarPointer | fpc_in_const_sqr | fpc_in_readln_x
Filemode | fpc_in_const_swap_long | fpc_in_readstr_x
FilePos | fpc_in_const_swap_qword | fpc_in_read_x
FileRec | fpc_in_const_swap_word | fpc_in_reset_typedfile
filerecnamelength | fpc_in_continue | fpc_in_reset_x
FileSize | fpc_in_copy_x | fpc_in_rewrite_typedfile
FillByte | fpc_in_cos_real | fpc_in_rewrite_x
FillChar | fpc_in_cycle | fpc_in_rol_x
FillDWord | fpc_in_dec_x | fpc_in_rol_x_x
FillQWord | fpc_in_default_x | fpc_in_ror_x
FillWord | fpc_in_dispose_x | fpc_in_ror_x_x
FinalizeArray | fpc_in_exclude_x_y | fpc_in_round_real
FindResource | fpc_in_exit | fpc_in_sar_x
FindResourceEx | fpc_in_exp_real | fpc_in_sar_x_y
FirstDotAtFileNameStartIsExtension | fpc_in_fillchar_x | fpc_in_seg_x
float_flag_denormal | fpc_in_finalize_x | fpc_in_setlength_x
float_flag_divbyzero | fpc_in_fma_double | fpc_in_setstring_x_y_z
float_flag_inexact | fpc_in_fma_extended | fpc_in_settextbuf_file_x
float_flag_invalid | fpc_in_fma_float128 | fpc_in_sin_real
float_flag_overflow | fpc_in_fma_single | fpc_in_sizeof_x
float_flag_underflow | fpc_in_frac_real | fpc_in_slice
float_raise | fpc_in_get_caller_addr | fpc_in_sqr_real
float_round_down | fpc_in_get_caller_frame | fpc_in_sqrt_real
float_round_nearest_even | fpc_in_get_frame | fpc_in_str_x_string
float_round_to_zero | fpc_in_high_x | fpc_in_succ_x
float_round_up | fpc_in_hi_long | fpc_in_trunc_real
Flush | fpc_in_hi_qword | fpc_in_typeinfo_x
FlushThread | fpc_in_hi_word | fpc_in_typeof_x
FMADouble | fpc_in_include_x_y | fpc_in_unbox_x_y
FMAExtended | fpc_in_inc_x | fpc_in_unpack_x_y_z
fmAppend | fpc_in_initialize_x | fpc_in_val_x
FMASingle | fpc_in_int_real | fpc_in_writeln_x
fmClosed | fpc_in_leave | fpc_in_writestr_x
fmInOut | fpc_in_length_string | fpc_in_write_x
fmInput | fpc_in_ln_real | fpc_objc_encode_x
fmOutput | fpc_in_lo_long | fpc_objc_protocol_x
fpc_dynarray_rangecheck | fpc_in_lo_qword | fpc_objc_selector_x
fpc_in_abs_long | fpc_in_lo_word | fpc_SarInt64
fpc_in_abs_real | fpc_in_low_x | FPower10
fpc_in_addr_x | fpc_in_mmx_pcmpeqb | frac
fpc_in_aligned_x | fpc_in_mmx_pcmpeqd | Freemem
fpc_in_arctan_real | fpc_in_mmx_pcmpeqw | Freememory
fpc_in_assert_x_y | fpc_in_mmx_pcmpgtb | FreeResource
fpc_in_assigned_x | fpc_in_mmx_pcmpgtd | fsDenormal
fpc_in_bitsizeof_x | fpc_in_mmx_pcmpgtw | fsInf
fpc_in_box_x | fpc_in_move_x | fsInvalidOp
fpc_in_break | fpc_in_new_x | fsNaN
fpc_in_bsf_x | fpc_in_ofs_x | fsNDenormal
fpc_in_bsr_x | fpc_in_ord_x | fsNegative
fpc_in_chr_byte | fpc_in_pack_x_y_z | fsNInf
fpc_in_concat_x | fpc_in_pi_real | fsNZero
fpc_in_const_abs | fpc_in_popcnt_x | fsPositive
fpc_in_const_odd | fpc_in_pred_x | fsZero
fpc_in_const_ptr | fpc_in_prefetch_var |

G

Get8087CW | GetMem | GetThreadManager
get_caller_addr | GetMemory | GetUnicodeStringManager
get_caller_frame | GetMemoryManager | GetVariantManager
get_caller_stackinfo | GetMXCSR | GetWideStringManager
GetCPUCount | Get_pc_addr | greaterthanorequal(variant,variant):Boolean
GetCurrentThreadId | GetProcessID | greaterthan(variant,variant):Boolean
getdir | GetResourceManager | growheapsize1
GetFPCHeapStatus | GetSSECSR | growheapsize2
get_frame | GetTextCodePage | growheapsizesmall
GetHeapStatus | GetThreadID |

H

halt | hi | HMODULE
hexStr | High | HRESULT
HGLOBAL | HINSTANCE |

I

IDispatch | InitThreadVars | InterLockedExchange64
IEnumerable | InOutRes | InterLockedExchangeAdd
IEnumerator | Input | InterLockedExchangeAdd64
IInterface | Insert | InterLockedIncrement
IInvokable | int | InterLockedIncrement64
Inc | Int16 | IntPtr
Include | Int32 | IObjectInstance
IndexByte | Int64 | IOResult
IndexChar | Int8 | IsConsole
IndexChar0 | intdivide(variant,variant):variant | IsDynArrayRectangular
IndexDWord | Integer | Is_IntResource
IndexQWord | IntegerArray | IsLibrary
Indexword | InterlockedCompareExchange | IsMemoryManagerSet
InitCriticalSection | InterlockedCompareExchange64 | IsMultiThread
InitializeArray | InterLockedDecrement | IUnknown
InitProc | InterLockedDecrement64 |
InitThread | InterLockedExchange |

J

jmp_buf

K

KillThread

L

LeaveCriticalsection | lo | logicalxor(variant,variant):variant
leftshift(variant,variant):variant | LoadResource | Longint
lessthanorequal(variant,variant):Boolean | LockResource | longjmp
lessthan(variant,variant):Boolean | logicaland(variant,variant):variant | Longword
LEtoN | logicalnot(variant):variant | Low
ln | logicalor(variant,variant):variant | lowerCase

M

MAKEINTRESOURCE | MaxSIntValue | ModuleIsLib
MakeLangID | maxSmallint | ModuleIsPackage
Max_Frame_Dump | MaxUIntValue | modulus(variant,variant):variant
maxint | MemSize | Move
MaxKeptOSChunks | mkdir | MoveChar0
maxLongint | ModuleIsCpp | multiply(variant,variant):variant

N

NativeInt | New | NtoLE
NativeUInt | NoErrMsg | Null
negative(variant):variant | NtoBE |

O

OctStr | opcmplt | opor
odd | opcmpne | oppower
Ofs | opcompare | opshiftleft
opadd | opdivide | opshiftright
opand | opintdivide | opsubtract
opcmpeq | opmodulus | opxor
opcmpge | opmultiply | Ord
opcmpgt | opnegate | Output
opcmple | opnot |

P

PAnsiChar | PLongBool | PRTLEvent
PAnsiString | PLongint | PShortInt
ParamCount | PLongWord | PShortString
ParamStr | pmDouble | PSingle
PBoolean | PMemoryManager | PSizeInt
PByte | PMethod | PSizeUInt
pcalldesc | pmExtended | PSmallInt
PCardinal | pmReserved | pstringmessagetable
PChar | PMsgStrTable | PText
PClass | pmSingle | ptr
PCodePointer | PNativeInt | PtrInt
PComp | PNativeUInt | PtrInt
PCurrency | PointerArray | PtrUInt
PDate | POleVariant | PtrUInt
PDateTime | PopCnt | PUCS2Char
PDispatch | Pos | PUCS4Char
pdispdesc | power(variant,variant):variant | PUCS4CharArray
PDouble | PPAnsiChar | pUInt16
PDWord | PPByte | pUInt32
pdynarrayindex | PPChar | PUInt64
pdynarraytypeinfo | PPCharArray | pUInt8
PError | PPCodePointer | PUintPtr
PEventState | PPDispatch | PUnicodeChar
PExceptObject | PPDouble | PUnicodeString
PExtended | PPLongint | PUnknown
PFileTextRecChar | PPointer | PUTF8String
PGuid | PPointerArray | pvararray
pi | PPPAnsiChar | pvararraybound
pInt16 | PPPChar | pvararrayboundarray
pInt32 | PPPointer | pvararraycoorarray
PInt64 | PPPWideChar | pvardata
pInt8 | PPtrInt | PVariant
PInteger | PPtrUInt | pvariantmanager
PIntegerArray | PPUnknown | PVarRec
PInterface | PPWideChar | PVmt
pinterfaceentry | PQWord | PWideChar
pinterfacetable | Pred | PWideString
PIntPtr | prefetch | PWord
PJmp_buf | PRTLCriticalSection | PWordBool

Q

QWord

R

RaiseList | reNone | RorByte
RaiseMaxFrameCount | reOutOfMemory | RorDWord
RaiseProc | reOverflow | RorQWord
Random | rePrivInstruction | RorWord
Randomize | reQuit | round
RandSeed | reRangeError | RT_ACCELERATOR
RawByteString | reSafeCallError | RT_ANICURSOR
reAccessViolation | Reset | RT_ANIICON
Read | reStackOverflow | RT_BITMAP
ReadBarrier | ResumeThread | RT_CURSOR
ReadDependencyBarrier | ReturnNilIfGrowHeapFails | RT_DIALOG
ReadLn | reUnderflow | RT_FONT
ReadWriteBarrier | reVarArrayBounds | RT_FONTDIR
Real | reVarArrayCreate | RT_GROUP_CURSOR
Real2Double | reVarDispatch | RT_GROUP_ICON
real48 | reVarInvalidOp | RT_HTML
ReAllocMem | reVarNotArray | RT_ICON
ReAllocMemory | reVarTypeCast | RTLEventCreate
reAssertionFailed | Rewrite | RTLeventdestroy
reCodesetConversion | reZeroDivide | RTLeventResetEvent
reControlBreak | rightshift(variant,variant):variant | RTLeventSetEvent
reDivByZero | rmdir | RTLeventWaitFor
reExternalException | rmDown | RT_MANIFEST
reIntfCastError | rmNearest | RT_MENU
reIntOverflow | rmTruncate | RT_MESSAGETABLE
reInvalidCast | rmUp | RT_RCDATA
reInvalidOp | RolByte | RT_STRING
reInvalidPtr | RolDWord | RT_VERSION
ReleaseExceptionObject | RolQWord | RunError
Rename | RolWord | RuntimeErrorExitCodes

S

SafeCallErrorProc | SetThreadManager | StringCodePage
SarInt64 | SetUnicodeStringManager | StringElementSize
SarLongint | SetVariantManager | StringOfChar
SarShortint | SetWideStringManager | StringRefCount
SarSmallint | S_FALSE | StringToPPChar
scpAnsi | ShortCompareText | StringToUnicodeChar
scpConsoleInput | Shortint | StringToWideChar
scpConsoleOutput | sin | strlen
scpFileSystemSingleByte | SizeInt | strpas
Seek | SizeInt | subtract(variant,variant):variant
SeekEOF | SizeOf | Succ
SeekEOLn | SizeofResource | SuspendThread
Seg | SizeUInt | Swap
SemaphoreDestroy | SizeUInt | SwapEndian
SemaphoreInit | Smallint | SysAllocMem
SemaphorePost | softfloat_exception_flags | SysAssert
SemaphoreWait | softfloat_exception_mask | SysBackTraceStr
Set8087CW | softfloat_rounding_mode | SysFlushStdIO
SetCodePage | S_OK | SysFreemem
Setjmp | Space | SysFreememSize
SetMemoryManager | Sptr | SysGetFPCHeapStatus
SetMultiByteConversionCodePage | sqr | SysGetHeapStatus
SetMultiByteFileSystemCodePage | sqrt | SysGetmem
SetMultiByteRTLFileSystemCodePage | Sseg | SysInitExceptions
SetMXCSR | StackBottom | SysInitFPU
SetResourceManager | StackError | SysInitStdIO
SetSSECSR | StackLength | SysMemSize
SetString | StackTop | SysReAllocMem
SetTextBuf | StdErr | SysResetFPU
SetTextCodePage | StdOut | SysSetCtrlBreakHandler
SetTextLineEnding | Str | SysTryResizeMem

T

TAbstractErrorProc | TFPResourceHandle | TRTLEventHandlerTimeout
TAggregatedObject | TFPResourceHGLOBAL | trtlmethod
TAllocateThreadVarsHandler | TFPResourceHMODULE | trunc
TAnsiChar | TFPUException | Truncate
TAssertErrorProc | TFPUExceptionMask | TRuntimeError
TBackTraceStrFunc | TFPUPrecisionMode | TryEnterCriticalsection
TBasicEventCreateHandler | TFPURoundingMode | TSafeCallErrorProc
TBasicEventHandler | TGetCurrentThreadIdHandler | TSemaphoreDestroyHandler
TBasicEventWaitForHandler | TGuid | TSemaphorePostHandler
TBeginThreadHandler | THandle | TSemaphoreWaitHandler
TBoundArray | THeapStatus | TSempahoreInitHandler
tcalldesc | ThreadGetPriority | TSingleRec
TClass | ThreadID | TStandardCodePageEnum
TCompareOption | ThreadingAlreadyUsed | TStringMessageTable
TCompareOptions | ThreadSetPriority | TSystemCodePage
TContainedObject | ThreadSwitch | TTextBuf
TCriticalSectionHandler | TInitThreadVarHandler | TTextLineBreakStyle
TCriticalSectionHandlerTryEnter | TInterfacedClass | TThreadFunc
TCtrlBreakHandler | TInterfacedObject | TThreadGetPriorityHandler
TDate | tinterfaceentry | TThreadHandler
TDateTime | tinterfaceentrytype | TThreadID
tdispdesc | tinterfacetable | TThreadManager
TDoubleRec | tlbsCR | TThreadSetPriorityHandler
tdynarrayindex | tlbsCRLF | TThreadSwitchHandler
tdynarraytypeinfo | tlbsLF | TTime
TEndThreadHandler | TLineEndStr | TUCS4CharArray
TEntryInformation | TMemoryManager | TUnicodeStringManager
TError | TMethod | tvararray
TErrorProc | TMsgStrTable | tvararraybound
TExceptObject | TObject | tvararrayboundarray
TExceptProc | ToSingleByteFileSystemEncodedFileName | tvararraycoorarray
TextBuf | TPCharArray | tvardata
TExtended80Rec | TProcedure | tvariantmanager
TextFile | TReleaseThreadVarsHandler | tvarop
TextRec | TRelocateThreadVarHandler | TVarRec
TextRecBufSize | TResourceHandle | tvartype
TextRecNameLength | TResourceManager | TVmt
TFileTextRecChar | TRTLCreateEventHandler | TWaitForThreadTerminateHandler
TFloatSpecial | TRTLCriticalSection | TWideStringManager
TFPCHeapStatus | TRTLEventHandler |

U

UCS2Char | Unassigned | UnlockResource
UCS4Char | UnicodeChar | upCase
UCS4String | UnicodeCharLenToString | Utf8CodePointLen
UCS4StringToUnicodeString | UnicodeCharLenToStrVar | UTF8CompareLocale
UCS4StringToWideString | UnicodeCharToString | UTF8Decode
UInt16 | UnicodeCharToStrVar | UTF8Encode
UInt32 | UnicodeString | UTF8String
UInt64 | UnicodeStringToUCS4String | Utf8ToAnsi
UInt8 | UnicodeToUtf8 | Utf8ToUnicode
UIntPtr | UniqueString |

V

Val | varrecord | vmtInstanceSize
ValReal | varshortint | vmtIntfTable
ValSInt | varsingle | vmtMethodStart
ValSInt | varsmallint | vmtMethodTable
ValUInt | varstrarg | vmtMsgStrPtr
ValUInt | varstring | vmtNewInstance
VarAddRefProc | VarToLStrProc | vmtParent
varany | VarToWStrProc | vmtSafeCallException
vararray | vartypemask | vmtToString
VarArrayGet | varuint64 | vmtTypeInfo
VarArrayPut | varunknown | vtAnsiString
VarArrayRedim | varustrarg | vtBoolean
varboolean | varustring | vtChar
varbyref | varvariant | vtClass
varbyte | varword | vtCurrency
VarCast | varword64 | vtExtended
VarClearProc | vmtAfterConstruction | vtInt64
VarCopyProc | vmtAutoTable | vtInteger
varcurrency | vmtBeforeDestruction | vtInterface
vardate | vmtClassName | vtObject
vardecimal | vmtDefaultHandler | vtPChar
vardispatch | vmtDefaultHandlerStr | vtPointer
vardouble | vmtDestroy | vtPWideChar
varempty | vmtDispatch | vtQWord
varerror | vmtDispatchStr | vtString
varint64 | vmtDynamicTable | vtUnicodeString
varinteger | vmtEquals | vtVariant
varlongword | vmtFieldTable | vtWideChar
varnull | vmtFreeInstance | vtWideString
varolestr | vmtGetHashCode |
varqword | vmtInitTable |

W

WaitForThreadTerminate | WideCharToString | Word
WChar | WideCharToStrVar | WriteBarrier
WideChar | WideString | WriteErrorsToStdErr
WideCharLenToString | widestringmanager |
WideCharLenToStrVar | WideStringToUCS4String |


InitProc

Initialization routine

Declaration

Source position: systemh.inc line 662

const InitProc: CodePointer = Nil;

Description

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.

Remark: When setting the value of InitProc, the previous value should always be saved, and called when the installed initialization routine has finished executing.

See also

ExitProc

Exit procedure pointer.


InOutRes

Result of last I/O operation. Read-Only.

Declaration

Source position: systemh.inc line 713

var InOutRes: Word = ;


Input

Standard input text file.

Declaration

Source position: systemh.inc line 710

var Input: Text = ;


IntPtr

A signed integer with the same size in bytes as pointer

Declaration

Source position: systemh.inc line 399

type IntPtr = PtrInt;

See also

PtrInt

Signed integer type with same size as Pointer.


IObjectInstance

GUID for the IObject interface

Declaration

Source position: objpash.inc line 438

const IObjectInstance: TGuid = '{D91C9AF4-3C93-420F-A303-BF5BA82BFD23}';

Description

IObjectInstance is an internal GUID, which should not be used in end-user code. It is used in the as operator.


IsConsole

True for console applications, False for GUI applications.

Declaration

Source position: systemh.inc line 680

var IsConsole: Boolean = False;


IsLibrary

True if the current module is a library. Otherwise module is an excutable

Declaration

Source position: systemh.inc line 674

var IsLibrary: Boolean = False;


IsMultiThread

Indicates whether more than one thread is running in the application.

Declaration

Source position: systemh.inc line 656

const IsMultiThread: longbool = False;


jmp_buf

Record type to store processor information.

Declaration

Source position: setjumph.inc line 17

type jmp_buf = packed record
ebx: LongInt; | EBX register.
esi: LongInt; | ESI register
edi: LongInt; | EDI register
bp: Pointer; | BP register
sp: Pointer; | SP register
pc: Pointer; | PC register
end;

See also

setjmp | Save current execution point.
longjmp | Jump to address.


Longint

A signed 32-bits integer

Declaration

Source position: system.fpd line 20

type Longint = - 2147483648..2147483647;


Longword

An unsigned 32-bits integer

Declaration

Source position: system.fpd line 21

type Longword = 0..4294967295;

Description

The base 32-bit unsigned type. See the reference manual for more details

See also

Cardinal | An unsigned 32-bits integer.
DWord | An unsigned 32-bits integer
UInt32 | An unsigned 32-bits integer


MAKEINTRESOURCE

Alias for the PChar type.

Declaration

Source position: resh.inc line 15

type MAKEINTRESOURCE = PChar;


Mathematical routines

Functions connected to calculating and coverting numbers.

Name | Description
Abs | Calculate absolute value
Arctan | Calculate inverse tangent
Cos | Calculate cosine of angle
Dec | Decrease value of variable
Exp | Exponentiate
Frac | Return fractional part of floating point value
Hi | Return high byte/word of value
Inc | Increase value of variable
Int | Calculate integer part of floating point value
Ln | Calculate logarithm
Lo | Return low byte/word of value
Odd | Is a value odd or even ?
Pi | Return the value of pi
Random | Generate random number
Randomize | Initialize random number generator
Round | Round floating point value to nearest integer number
Sin | Calculate sine of angle
Sqr | Calculate the square of a value
Sqrt | Calculate the square root of a value
Swap | Swap high and low bytes/words of a variable
Trunc | Truncate a floating point value


Max_Frame_Dump

Maximum number of frames to show in error frame dump.

Declaration

Source position: systemh.inc line 638

const Max_Frame_Dump: Word = 8;


maxint

Maximum integer value.

Declaration

Source position: systemh.inc line 579

const maxint = maxsmallint;


MaxKeptOSChunks

Maximum number of OS chunks to be kept in memory

Declaration

Source position: heaph.inc line 60

const MaxKeptOSChunks: DWord = 4;

Description

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.

See also

FreeMem

Release allocated memory


maxLongint

Maximum longint value.

Declaration

Source position: systemh.inc line 576

const maxLongint = $7fffffff;


MaxSIntValue

Maximum String-size value.

Declaration

Source position: systemh.inc line 572

const MaxSIntValue = High(ValSInt);


maxSmallint

Maximum smallint value.

Declaration

Source position: systemh.inc line 577

const maxSmallint = 32767;


MaxUIntValue

Maximum unsigned integer value.

Declaration

Source position: systemh.inc line 573

const MaxUIntValue = High(ValUInt);


Memory management functions

Functions concerning memory issues.

Name | Description
Addr | Return address of variable
Assigned | Check if a pointer is valid
CompareByte | Compare 2 memory buffers byte per byte
CompareChar | Compare 2 memory buffers byte per byte
CompareDWord | Compare 2 memory buffers byte per byte
CompareWord | Compare 2 memory buffers byte per byte
CSeg | Return code segment
Dispose | Free dynamically allocated memory
DSeg | Return data segment
FillByte | Fill memory region with 8-bit pattern
FillChar | Fill memory region with certain character
FillDWord | Fill memory region with 32-bit pattern
FillQWord | Fill memory region with 64-bit pattern
FillWord | Fill memory region with 16-bit pattern
Freemem | Release allocated memory
Getmem | Allocate new memory
GetMemoryManager | Return current memory manager
High | Return highest index of open array or enumerated
IndexByte | Find byte-sized value in a memory range
IndexChar | Find char-sized value in a memory range
IndexDWord | Find DWord-sized (32-bit) value in a memory range
IndexQWord | Find QWord-sized value in a memory range
IndexWord | Find word-sized value in a memory range
IsMemoryManagerSet | Is the memory manager set
MemSize | Get size of allocation
Low | Return lowest index of open array or enumerated
Move | Move data from one location in memory to another
MoveChar0 | Move data till first zero character
New | Dynamically allocate memory for variable
Ofs | Return offset of variable
Ptr | Combine segment and offset to pointer
ReAllocMem | Resize a memory block on the heap
Seg | Return segment
SetMemoryManager | Set a memory manager
Sptr | Return current stack pointer
SSeg | Return stack segment register value


Miscellaneous functions

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

Name | Description
Assert | Conditionally abort program with error
Break | Abort current loop
Continue | Next cycle in current loop
Exclude | Exclude an element from a set
Exit | Exit current function or procedure
Include | Include an element into a set
LongJmp | Jump to execution point
Ord | Return ordinal value of enumerated type
Pred | Return previous value of ordinal type
SetJmp | Mark execution point for jump
SizeOf | Return size of variable or type
Succ | Return next value of ordinal type


ModuleIsCpp

program compiled by CPP ?

Declaration

Source position: systemh.inc line 666

const ModuleIsCpp: Boolean = False;

Description

ModuleIsCpp is always false for FPC programs, it is provided for Delphi compatibility only.


ModuleIsLib

Determines whether the current module is a library

Declaration

Source position: systemh.inc line 664

const ModuleIsLib: Boolean = False;

Description

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


ModuleIsPackage

Determines whether the current module is a package

Declaration

Source position: systemh.inc line 665

const ModuleIsPackage: Boolean = False;

Description

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


NativeInt

Alias for PtrInt

Declaration

Source position: systemh.inc line 393

type NativeInt = PtrInt;

Description

NativeInt is defined for Delphi compatibility. It is a signed integer with the size of a pointer, so 32-bit on 32-bit platforms, 64-bit on 64-bit platforms.

See also

PtrInt | Signed integer type with same size as Pointer.
NativeUInt | Alias for PtrUInt


NativeUInt

Alias for PtrUInt

Declaration

Source position: systemh.inc line 394

type NativeUInt = PtrUInt;

Description

NativeUInt is defined for Delphi compatibility. It is an unsigned integer with the size of a pointer, so 32-bit on 32-bit platforms, 64-bit on 64-bit platforms.

See also

PtrInt | Signed integer type with same size as Pointer.
NativeInt | Alias for PtrInt


NoErrMsg

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'System' (#rtl)

NoErrMsg (platform)

Unused, for Delphi compatibility

Declaration

Source position: systemh.inc line 681

var NoErrMsg: Boolean = False;


Operating System functions

Functions that are connected to the operating system.

Name | Description
Chdir | Change working directory
Getdir | Return current working directory
Halt | Halt program execution
Paramcount | Number of parameters with which program was called
Paramstr | Retrieve parameters with which program was called
Mkdir | Make a directory
Rmdir | Remove a directory
Runerror | Abort program execution with error condition


Output

Standard output text file.

Declaration

Source position: systemh.inc line 709

var Output: Text = ;


PAnsiChar

Alias for PChar type.

Declaration

Source position: systemh.inc line 414

type PAnsiChar = PChar;


PAnsiString

Pointer to an ansistring type.

Declaration

Source position: systemh.inc line 503

type PAnsiString = ^AnsiString;


PBoolean

Pointer to a Boolean type.

Declaration

Source position: systemh.inc line 487

type PBoolean = ^Boolean;


PByte

Pointer to byte type

Declaration

Source position: systemh.inc line 464

type PByte = ^Byte;


pcalldesc

Pointer to TCallDesc record.

Declaration

Source position: varianth.inc line 141

type pcalldesc = ^tcalldesc;


PCardinal

Pointer to Cardinal type

Declaration

Source position: systemh.inc line 469

type PCardinal = ^Cardinal;


PChar

Pointer to null-terminated string.

Declaration

Source position: systemh.inc line 406

type PChar = ^Char;

Description

Or the same as a pointer to an array of char. See the reference manual for more information about this type.


PClass

Pointer to TClass

Declaration

Source position: objpash.inc line 80

type PClass = ^TClass;


PCodePointer

Pointer to CodePointer

Declaration

Source position: systemh.inc line 484

type PCodePointer = ^CodePointer;

Description

PCodePointer is a typed pointer to CodePointer.

See also

PPCodePointer | Pointer to PCodePointer
CodePointer | Code pointer (8/16 bit targets)
PPointer | Pointer to a pointer type.


PComp

Pointer to Complex type

Declaration

Source position: systemh.inc line 458

type PComp = ^Comp;

Description

PComp is a pointer to a complex type.


PCurrency

Pointer to currency type.

Declaration

Source position: systemh.inc line 456

type PCurrency = ^Currency;


PDate

Pointer to a TDateTime type.

Declaration

Source position: systemh.inc line 506

type PDate = ^TDateTime;


PDateTime

Pointer to TDatetime

Declaration

Source position: systemh.inc line 507

type PDateTime = ^TDateTime;


PDispatch

Pointer to IDispatch interface type

Declaration

Source position: objpash.inc line 321

type PDispatch = ^IDispatch;


pdispdesc

Pointer to tdispdesc record

Declaration

Source position: varianth.inc line 147

type pdispdesc = ^tdispdesc;


PDouble

Pointer to double-sized float value.

Declaration

Source position: systemh.inc line 451

type PDouble = ^Double;


PDWord

Pointer to DWord type

Declaration

Source position: systemh.inc line 466

type PDWord = ^DWord;


pdynarrayindex

Pointer to tdynarrayindex type.

Declaration

Source position: dynarrh.inc line 20

type pdynarrayindex = ^tdynarrayindex;


pdynarraytypeinfo

Pointer to TDynArrayTypeInfo type.

Declaration

Source position: dynarrh.inc line 22

type pdynarraytypeinfo = ^tdynarraytypeinfo;


PError

Pointer to an Error type.

Declaration

Source position: systemh.inc line 509

type PError = ^TError;


PEventState

Pointer to EventState, which is an opaque type.

Declaration

Source position: threadh.inc line 33

type PEventState = pointer;


PExceptObject

Pointer to Exception handler procedural type TExceptProc

Declaration

Source position: objpash.inc line 329

type PExceptObject = ^TExceptObject;


PExtended

Pointer to extended-sized float value.

Declaration

Source position: systemh.inc line 452

type PExtended = ^Extended;


PFileTextRecChar

Pointer to TFileTextRecChar

Declaration

Source position: systemh.inc line 533

type PFileTextRecChar = ^TFileTextRecChar;

Description

PFileTextRecChar is a typed pointer to TFileTextRecChar.

See also

TFileTextRecChar

Character type for the filename part in file records


PGuid

Pointer to TGUID type.

Declaration

Source position: objpash.inc line 128

type PGuid = ^TGuid;


pInt8

Pointer to Int8 type

Declaration

Source position: systemh.inc line 493

type pInt8 = PShortInt;

See also

Int8

A signed 8-bits integer


pInt16

Pointer to Int16 type

Declaration

Source position: systemh.inc line 494

type pInt16 = PSmallInt;

See also

Int8

A signed 8-bits integer


pInt32

Pointer to Int32 type

Declaration

Source position: systemh.inc line 495

type pInt32 = PLongint;

See also

Int32

A signed 32-bits integer


PInt64

Pointer to Int64 type

Declaration

Source position: systemh.inc line 471

type PInt64 = ^Int64;


PInteger

Pointer to integer type

Declaration

Source position: systemh.inc line 463

type PInteger = ^Integer;


PIntegerArray

Pointer to IntegerArray type

Declaration

Source position: systemh.inc line 587

type PIntegerArray = ^IntegerArray;


PInterface

Pointer to IInterface interface

Declaration

Source position: objpash.inc line 323

type PInterface = PUnknown;


pinterfaceentry

Pointer to tinterfaceentry record.

Declaration

Source position: objpash.inc line 163

type pinterfaceentry = ^tinterfaceentry;


pinterfacetable

Pointer to tinterfacetable record.

Declaration

Source position: objpash.inc line 97

type pinterfacetable = ^tinterfacetable;


PIntPtr

Pointer to IntPtr type

Declaration

Source position: systemh.inc line 496

type PIntPtr = PPtrInt;

See also

IntPtr

A signed integer with the same size in bytes as pointer


PJmp_buf

Pointer to jmp_buf record

Declaration

Source position: setjumph.inc line 24

type PJmp_buf = ^jmp_buf;


PLongBool

Pointer to a LongBool type.

Declaration

Source position: systemh.inc line 489

type PLongBool = ^LongBool;


PLongint

Pointer to Longint type

Declaration

Source position: systemh.inc line 468

type PLongint = ^LongInt;


PLongWord

Pointer to LongWord type

Declaration

Source position: systemh.inc line 467

type PLongWord = ^LongWord;


PMemoryManager

Pointer to TMemoryManager record

Declaration

Source position: heaph.inc line 38

type PMemoryManager = ^TMemoryManager;


PMethod

Declaration

Source position: objpash.inc line 183

type PMethod = ^TMethod;


PMsgStrTable

Pointer to array of TMsgStrTable records.

Declaration

Source position: objpash.inc line 89

type PMsgStrTable = ^TMsgStrTable;


PNativeInt

Pointer to NativeInt type

Declaration

Source position: systemh.inc line 491

type PNativeInt = ^NativeInt;

See also

NativeInt

Alias for PtrInt


PNativeUInt

Pointer to NativeInt type

Declaration

Source position: systemh.inc line 492

type PNativeUInt = ^NativeUInt;

See also

NativeUInt

Alias for PtrUInt


PointerArray

Generic pointer array.

Declaration

Source position: systemh.inc line 591

type PointerArray = array [0..512*1024*1024-2] of Pointer;


POleVariant

Pointer to OleVariant type.

Declaration

Source position: systemh.inc line 511

type POleVariant = ^OleVariant;


PPAnsiChar

Alias for PPChar type.

Declaration

Source position: systemh.inc line 415

type PPAnsiChar = PPChar;


PPByte

Pointer to PByte type.

Declaration

Source position: systemh.inc line 478

type PPByte = ^PByte;

Description

PPByte is a pointer to a PByte type.

See also

PByte

Pointer to byte type


PPChar

Pointer to an array of pointers to null-terminated strings.

Declaration

Source position: systemh.inc line 407

type PPChar = ^PChar;


PPCharArray

Pointer to TPCharArray type.

Declaration

Source position: systemh.inc line 602

type PPCharArray = ^TPCharArray;


PPCodePointer

Pointer to PCodePointer

Declaration

Source position: systemh.inc line 485

type PPCodePointer = ^PCodePointer;

Description

PPCodePointer is a typed pointer to PCodePointer.

See also

CodePointer | Code pointer (8/16 bit targets)
PPointer | Pointer to a pointer type.
PCodePointer | Pointer to CodePointer


PPDispatch

Pointer to PDispatch pointer type

Declaration

Source position: objpash.inc line 322

type PPDispatch = ^PDispatch;


PPDouble

Pointer to PDouble type.

Declaration

Source position: systemh.inc line 454

type PPDouble = ^PDouble;

Description

PPDouble is a pointer to a PDouble type.

See also

PDouble

Pointer to double-sized float value.


PPLongint

Pointer to PLongint type.

Declaration

Source position: systemh.inc line 479

type PPLongint = ^PLongint;

Description

PPLongint is a pointer to a PLongint type.

See also

PLongint

Pointer to Longint type


PPointer

Pointer to a pointer type.

Declaration

Source position: systemh.inc line 481

type PPointer = ^Pointer;


PPointerArray

Pointer to PointerArray type

Declaration

Source position: systemh.inc line 593

type PPointerArray = ^PointerArray;


PPPAnsiChar

Pointer to PPAnsichar

Declaration

Source position: systemh.inc line 416

type PPPAnsiChar = PPPChar;

Description

PPPAnsiChar is a typed pointer to PPAnsichar.

See also

PPAnsichar

Alias for PPChar type.


PPPChar

Pointer to PPChar.

Declaration

Source position: systemh.inc line 408

type PPPChar = ^PPChar;

Description

PPPChar is a pointer to a PPChar

See also

PPChar

Pointer to an array of pointers to null-terminated strings.


PPPointer

Pointer to a PPointer type.

Declaration

Source position: systemh.inc line 482

type PPPointer = ^PPointer;


PPPWideChar

Pointer to PPWideChar type.

Declaration

Source position: systemh.inc line 515

type PPPWideChar = ^PPWideChar;

Description

PPPWideChar is a pointer to a PPWideChar type.

See also

PPWideChar

Pointer to link id="PWideChar"> type.


PPtrInt

Pointer to PtrInt type.

Declaration

Source position: systemh.inc line 473

type PPtrInt = ^PtrInt;


PPtrUInt

Pointer to unsigned integer of pointer size

Declaration

Source position: systemh.inc line 474

type PPtrUInt = ^PtrUInt;


PPUnknown

Pointer to untyped pointer

Declaration

Source position: objpash.inc line 320

type PPUnknown = ^PUnknown;


PPWideChar

Pointer to link id="PWideChar"> type.

Declaration

Source position: systemh.inc line 514

type PPWideChar = ^PWideChar;


PQWord

Pointer to QWord type

Declaration

Source position: systemh.inc line 470

type PQWord = ^QWord;


PRTLCriticalSection

Pointer to #rtl.system.TRTLCriticalSection type.

Declaration

Source position: sysosh.inc line 27

type PRTLCriticalSection = ^TRTLCriticalSection;


PRTLEvent

Pointer to RTLEvent, which is an opaque type.

Declaration

Source position: threadh.inc line 34

type PRTLEvent = type pointer;


PShortInt

Pointer to shortint type

Declaration

Source position: systemh.inc line 462

type PShortInt = ^ShortInt;


PShortString

Pointer to a shortstring type.

Declaration

Source position: systemh.inc line 502

type PShortString = ^ShortString;


PSingle

Pointer to single-sized float value.

Declaration

Source position: systemh.inc line 450

type PSingle = ^Single;


PSizeInt

Pointer to a SizeInt type

Declaration

Source position: systemh.inc line 475

type PSizeInt = ^SizeInt;


PSizeUInt

Pointer to SizeUint

Declaration

Source position: systemh.inc line 476

type PSizeUInt = ^SizeUInt;

Description

PSizeUInt64 is a pointer to a SizeUInt, an unsigned integer of architecture-dependent size.

See also

SizeUInt

Unsigned Integer type which fits for sizes


PSmallInt

Pointer to smallint type

Declaration

Source position: systemh.inc line 461

type PSmallInt = ^SmallInt;


pstringmessagetable

Pointer to TStringMessageTable record.

Declaration

Source position: objpash.inc line 96

type pstringmessagetable = ^TStringMessageTable;


PText

Pointer to text file.

Declaration

Source position: systemh.inc line 559

type PText = ^Text;


PUCS2Char

Pointer to UCS2Char character.

Declaration

Source position: systemh.inc line 518

type PUCS2Char = PWideChar;


PUCS4Char

Pointer to UCS4Char

Declaration

Source position: systemh.inc line 419

type PUCS4Char = ^UCS4Char;


PUCS4CharArray

Pointer to array of UCS4Char characters.

Declaration

Source position: systemh.inc line 425

type PUCS4CharArray = ^TUCS4CharArray;


pUInt8

Pointer to UInt8 type

Declaration

Source position: systemh.inc line 497

type pUInt8 = PByte;

See also

UInt8

An unsigned 8-bits integer


pUInt16

Pointer to UInt16 type

Declaration

Source position: systemh.inc line 498

type pUInt16 = PWord;

See also

UInt16

An unsigned 16-bits integer


pUInt32

Pointer to UInt32 type

Declaration

Source position: systemh.inc line 499

type pUInt32 = PDWord;

See also

UInt32

An unsigned 32-bits integer


PUInt64

Pointer to UInt64

Declaration

Source position: systemh.inc line 472

type PUInt64 = ^UInt64;

Description

PUInt64 is a pointer to a UInt64, an unsigned 64-bit integer.

See also

UInt64

Unsigned 64-bit integer


PUintPtr

Pointer to UIntPtr type

Declaration

Source position: systemh.inc line 500

type PUintPtr = PPtrUInt;

See also

UIntPtr

An unsigned integer with the same size in bytes as pointer


PUnicodeChar

Pointer to unicode character

Declaration

Source position: systemh.inc line 522

type PUnicodeChar = ^UnicodeChar;

Description

PUnicodeChar is a pointer to a unicode character, just like PChar is a pointer to a Char ansistring character.

See also

UnicodeChar | Unicode string character
WideChar | The base two byte character type
UnicodeString | A string consisting of widechars.


PUnicodeString

Pointer to unicodestring

Declaration

Source position: systemh.inc line 523

type PUnicodeString = ^UnicodeString;

Description

PUnicodeString is a pointer to a UnicodeString string.

See also

UnicodeChar | Unicode string character
PUnicodeChar | Pointer to unicode character
WideChar | The base two byte character type


PUnknown

Untyped pointer

Declaration

Source position: objpash.inc line 319

type PUnknown = ^IUnknown;


PUTF8String

Pointer to UTF8String

Declaration

Source position: systemh.inc line 433

type PUTF8String = ^UTF8String;


pvararray

Pointer to TVarArray type.

Declaration

Source position: varianth.inc line 73

type pvararray = ^tvararray;


pvararraybound

Pointer to tvararraybound type.

Declaration

Source position: varianth.inc line 72

type pvararraybound = ^tvararraybound;


pvararrayboundarray

Pointer to tvararrayboundarray type.

Declaration

Source position: varianth.inc line 70

type pvararrayboundarray = ^tvararrayboundarray;


pvararraycoorarray

Pointer to tvararraycoorarray type.

Declaration

Source position: varianth.inc line 71

type pvararraycoorarray = ^tvararraycoorarray;


pvardata

Pointer to TVarData record.

Declaration

Source position: varianth.inc line 139

type pvardata = ^tvardata;


PVariant

Pointer to Variant type.

Declaration

Source position: systemh.inc line 510

type PVariant = ^Variant;


pvariantmanager

Pointer to TVariantManager record.

Declaration

Source position: varianth.inc line 217

type pvariantmanager = ^tvariantmanager;


PVarRec

Pointer to TVarRec type.

Declaration

Source position: objpash.inc line 400

type PVarRec = ^TVarRec;


PVmt

Pointer to TVMT record

Declaration

Source position: objpash.inc line 99

type PVmt = ^TVmt;


PWideChar

Pointer to WChar.

Declaration

Source position: systemh.inc line 513

type PWideChar = ^WideChar;


PWideString

Pointer to widestring type

Declaration

Source position: systemh.inc line 519

type PWideString = ^WideString;


PWord

Pointer to word type

Declaration

Source position: systemh.inc line 465

type PWord = ^Word;


PWordBool

Pointer to a WordBool type.

Declaration

Source position: systemh.inc line 488

type PWordBool = ^WordBool;


QWord

64-bit unsigned integer

Declaration

Source position: system.fpd line 23

type QWord = 0..18446744073709551615;

Description

QWord is a 64-bit, unsigned integer type, with range [0..18446744073709551615].

See also

Int64 | 64-bit, signed integer
Longint | A signed 32-bits integer
Longword | An unsigned 32-bits integer


RaiseMaxFrameCount

Maximum number of frames to include in TExceptObject

Declaration

Source position: objpash.inc line 347

const RaiseMaxFrameCount: LongInt = 16;


RaiseProc

Procedure to raise an exception.

Declaration

Source position: objpash.inc line 346

const RaiseProc: TExceptProc = Nil;


RandSeed

Seed for Random function.

Declaration

Source position: systemh.inc line 670

var RandSeed: Cardinal = ;


RawByteString

Single-byte character string without specified codepage

Declaration

Source position: systemh.inc line 438

type RawByteString = ansistring;

Description

RawByteString is a single-byte character string which does not have any codepage associated with it.

This means that assigning a single-byte character string to this kind of string will not change the codepage of the string.

Inversely, when assigning a RawByteString to a single-byte string, the codepage of the destination is simply set to the codepage of the rawbytestring: no codepage conversion happens, the reference count is simply increased.

See also

TSystemCodePage

System code page


Real

Alias for real type

Declaration

Source position: systemh.inc line 117

type Real = type Double;


real48

TP compatible real type (6 bytes) definition

Declaration

Source position: mathh.inc line 108

type real48 = array [0..5] of Byte;


ReturnNilIfGrowHeapFails

Describe behaviour if getmem fails.

Declaration

Source position: heaph.inc line 66

var ReturnNilIfGrowHeapFails: Boolean = ;

Description

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.


RT_ACCELERATOR

Constant identifying an accelerator resouce

Declaration

Source position: resh.inc line 32

const RT_ACCELERATOR = MAKEINTRESOURCE(9);


RT_ANICURSOR

Resource type: Animated cursor

Declaration

Source position: resh.inc line 38

const RT_ANICURSOR = MAKEINTRESOURCE(21);

Description

This constant can be used to specify a resource of type "animated cursor".

See also

RT_CURSOR

Constant identifying a cursor resource


RT_ANIICON

Resource type: Animated icon

Declaration

Source position: resh.inc line 39

const RT_ANIICON = MAKEINTRESOURCE(22);

Description

This constant can be used to specify a resource of type "animated icon".

See also

RT_ICON

Constant identifying an icon resource


RT_BITMAP

Constant identifying a bitmap resource

Declaration

Source position: resh.inc line 25

const RT_BITMAP = MAKEINTRESOURCE(2);


RT_CURSOR

Constant identifying a cursor resource

Declaration

Source position: resh.inc line 24

const RT_CURSOR = MAKEINTRESOURCE(1);


RT_DIALOG

Constant identifying a dialog resource

Declaration

Source position: resh.inc line 28

const RT_DIALOG = MAKEINTRESOURCE(5);


RT_FONT

Constant identifying a font resource

Declaration

Source position: resh.inc line 31

const RT_FONT = MAKEINTRESOURCE(8);


RT_FONTDIR

Constant identifying a font directory resource

Declaration

Source position: resh.inc line 30

const RT_FONTDIR = MAKEINTRESOURCE(7);


RT_GROUP_CURSOR

Constant identifying a group cursor resource

Declaration

Source position: resh.inc line 35

const RT_GROUP_CURSOR = MAKEINTRESOURCE(12);


RT_GROUP_ICON

Constant identifying a group icon resource

Declaration

Source position: resh.inc line 36

const RT_GROUP_ICON = MAKEINTRESOURCE(14);


RT_HTML

Resource type: HTML data

Declaration

Source position: resh.inc line 40

const RT_HTML = MAKEINTRESOURCE(23);

Description

This constant can be used to specify a resource of type "HTML data".

See also

RT_MANIFEST

Resource type: manifest


RT_ICON

Constant identifying an icon resource

Declaration

Source position: resh.inc line 26

const RT_ICON = MAKEINTRESOURCE(3);


RT_MANIFEST

Resource type: manifest

Declaration

Source position: resh.inc line 41

const RT_MANIFEST = MAKEINTRESOURCE(24);

Description

This constant can be used to specify a resource of type "Manifest".

See also

RT_HTML

Resource type: HTML data


RT_MENU

Constant identifying a menu resource

Declaration

Source position: resh.inc line 27

const RT_MENU = MAKEINTRESOURCE(4);


RT_MESSAGETABLE

Constant identifying a message data resource

Declaration

Source position: resh.inc line 34

const RT_MESSAGETABLE = MAKEINTRESOURCE(11);


RT_RCDATA

Constant identifying a binary data resource

Declaration

Source position: resh.inc line 33

const RT_RCDATA = MAKEINTRESOURCE(10);


RT_STRING

Constant identifying a string table resource

Declaration

Source position: resh.inc line 29

const RT_STRING = MAKEINTRESOURCE(6);


RT_VERSION

Constant identifying a version info resource

Declaration

Source position: resh.inc line 37

const RT_VERSION = MAKEINTRESOURCE(16);


RuntimeErrorExitCodes

Mapping between runtime-error constants and program exit codes

Declaration

Source position: systemh.inc line 1385

const RuntimeErrorExitCodes: array [TRuntimeError] of Byte = (0, 203, 204, 200, 201, 215, 207, 200, 205, 206, 219, 216, 218, 217, 202, 220, 221, 222, 223, 224, 225, 227, 212, 228, 229, 233, 234);

Description

This array is used by the Error routine to convert a TRuntimeError enumeration type to a process exit code.

See also

Error

Generate run-time error


Run-Time Error behaviour

The sytem unit handles errors by default by generating a run-time error, and halting the program with an exit code equal to the run-time error number.

This behaviour changes when the SysUtils unit is used. In that case, all run-time errors are converted to exceptions: most run-time errors have their own exception class.

If these exceptions are caught, the program code decides what to do with it. If the exception is not caught, the program will exit through the default exception handler.

When the system unit documentation refers to run-time errors, the above should be kept in mind.


S_FALSE

Interface call result: Not OK

Declaration

Source position: objpash.inc line 65

const S_FALSE = 1;


S_OK

Interface call result: OK

Declaration

Source position: objpash.inc line 64

const S_OK = 0;


SafeCallErrorProc

Error handler for safecall errors

Declaration

Source position: systemh.inc line 1465

const SafeCallErrorProc: TSafeCallErrorProc = Nil;

Description

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.

See also

TSafeCallErrorProc

Prototype for the safecall error handler


Shortint

A signed 8-bits integer

Declaration

Source position: system.fpd line 24

type Shortint = - 128..127;


SizeInt

Signed integer type which fits for sizes

Declaration

Source position: systemh.inc line 336

type SizeInt = Int64;

Description

SizeInt is used to describe sizes of structures in FPC using a signed integer. The actual type of this type depends on the architecture: its size reflects the maximum addressable memory on the current architecture, thus it is 64-bit on 64-bit platforms, 32-bit on 32-bit platforms, and 16 bit on 16 bit platforms.

See also

SizeUInt

Unsigned Integer type which fits for sizes


SizeInt

Signed integer type which fits for sizes

Declaration

Source position: systemh.inc line 348

type SizeInt = LongInt;

Description

SizeInt is used to describe sizes of structures in FPC using a signed integer. The actual type of this type depends on the architecture: its size reflects the maximum addressable memory on the current architecture, thus it is 64-bit on 64-bit platforms, 32-bit on 32-bit platforms, and 16 bit on 16 bit platforms.

See also

SizeUInt

Unsigned Integer type which fits for sizes


SizeUInt

Unsigned Integer type which fits for sizes

Declaration

Source position: systemh.inc line 337

type SizeUInt = QWord;

Description

SizeUInt is used to describe sizes of structures in FPC using an unsigned integer. The actual type of this type depends on the architecture: its size reflects the maximum addressable memory on the current architecture, thus it is 64-bit on 64-bit platforms, 32-bit on 32-bit platforms, and 16 bit on 16 bit platforms.

See also

SizeInt

Signed integer type which fits for sizes


SizeUInt

Unsigned Integer type which fits for sizes

Declaration

Source position: systemh.inc line 349

type SizeUInt = DWord;

Description

SizeUInt is used to describe sizes of structures in FPC using an unsigned integer. The actual type of this type depends on the architecture: its size reflects the maximum addressable memory on the current architecture, thus it is 64-bit on 64-bit platforms, 32-bit on 32-bit platforms, and 16 bit on 16 bit platforms.

See also

SizeInt

Signed integer type which fits for sizes


Smallint

A signed 16-bits integer

Declaration

Source position: system.fpd line 25

type Smallint = - 32768..32767;


softfloat_exception_flags

Current soft float exception flags

Declaration

Source position: mathh.inc line 71

var softfloat_exception_flags: TFPUExceptionMask = ;


softfloat_exception_mask

Current soft float exception mask

Declaration

Source position: mathh.inc line 70

var softfloat_exception_mask: TFPUExceptionMask = ;


softfloat_rounding_mode

Rounding mode for softfloat

Declaration

Source position: mathh.inc line 72

var softfloat_rounding_mode: TFPURoundingMode = ;

Description

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
Round to nearest even number
float_round_down
Round down
float_round_up
Round up
float_round_to_zero
Round in the direction of zero (down for positive, up for negative)


StackBottom

Current stack bottom.

Declaration

Source position: systemh.inc line 715

var StackBottom: Pointer = ;


StackError

Indicate whether there was a stack error.

Declaration

Source position: systemh.inc line 661

const StackError: Boolean = False;


StackLength

Maximum stack length.

Declaration

Source position: systemh.inc line 716

var StackLength: SizeUInt = ;


StdErr

Standard diagnostic output text file.

Declaration

Source position: systemh.inc line 712

var StdErr: Text = ;


StdOut

Alias for Output.

Declaration

Source position: systemh.inc line 711

var StdOut: Text = ;


String handling

All things connected to string handling.

Name | Description
BinStr | Construct binary representation of integer
Chr | Convert ASCII code to character
Concat | Concatenate two strings
Copy | Copy part of a string
Delete | Delete part of a string
HexStr | Construct hexadecimal representation of integer
Insert | Insert one string in another
Length | Return length of string
Lowercase | Convert string to all-lowercase
OctStr | Construct octal representation of integer
Pos | Calculate position of one string in another
SetLength | Set length of a string
SetString | Set contents and length of a string
Str | Convert number to string representation
StringOfChar | Create string consisting of a number of characters
Upcase | Convert string to all-uppercase
Val | Convert string to number


TAbstractErrorProc

Abstract error handler procedural type.

Declaration

Source position: systemh.inc line 1455

type TAbstractErrorProc = procedure;


TAllocateThreadVarsHandler

Threadvar allocation callback type for TThreadManager.

Declaration

Source position: threadh.inc line 52

type TAllocateThreadVarsHandler = procedure;


TAnsiChar

Alias for 1-byte sized char.

Declaration

Source position: systemh.inc line 412

type TAnsiChar = Char;


TAssertErrorProc

Assert error handler procedural type.

Declaration

Source position: systemh.inc line 1456

type TAssertErrorProc = procedure(

  const msg: ShortString;

  const fname: ShortString;

  lineno: LongInt;

  erroraddr: pointer

);


TBackTraceStrFunc

Type for formatting of backtrace dump.

Declaration

Source position: systemh.inc line 1453

type TBackTraceStrFunc = function(

  Addr: CodePointer

):ShortString;


TBasicEventCreateHandler

callback type for creating eventstate in TThreadManager.

Declaration

Source position: threadh.inc line 56

type TBasicEventCreateHandler = function(

  EventAttributes: Pointer;

  AManualReset: Boolean;

  InitialState: Boolean;

  const Name: ansistring

):PEventState;


TBasicEventHandler

Generic callback type for handling eventstate in TThreadManager.

Declaration

Source position: threadh.inc line 54

type TBasicEventHandler = procedure(

  state: PEventState

);


TBasicEventWaitForHandler

Wait for basic event callback type for TThreadManager.

Declaration

Source position: threadh.inc line 55

type TBasicEventWaitForHandler = function(

  timeout: Cardinal;

  state: PEventState

):LongInt;


TBeginThreadHandler

Callback for thread start in TThreadManager.

Declaration

Source position: threadh.inc line 39

type TBeginThreadHandler = function(

  sa: Pointer;

  stacksize: PtrUInt;

  ThreadFunction: TThreadFunc;

  p: pointer;

  creationFlags: DWord;

  var ThreadId: TThreadID

):TThreadID;


TBoundArray

Dynamic array of integer.

Declaration

Source position: systemh.inc line 595

type TBoundArray = array of SizeInt;


tcalldesc

COM/OLE dispatch call argument description.

Declaration

Source position: varianth.inc line 142

type tcalldesc = packed record
calltype: Byte; | Call type.
argcount: Byte; | Number of arguments to call.
namedargcount: Byte; | Number of named arguments in the call.
argtypes: array [0..255] of Byte; | Types of arguments.
end;

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.


TClass

Class of TObject.

Declaration

Source position: objpash.inc line 79

type TClass = class of TObject;


TCompareOption

How to compare strings

Declaration

Source position: ustringh.inc line 55

type TCompareOption = (
coLingIgnoreCase, | Ignore case linguistically (usually identical to coIgnoreCase)
coLingIgnoreDiacritic, | Ignore diacritic caharacters
coIgnoreCase, | Ignore case (usually identical to coLingIgnoreCase)
coIgnoreKanaType, | Corresponding hiragana and katakana characters compare as equal.
coIgnoreNonSpace, | Ignore nonspace characters (usually identical to coLingIgnoreDiacritic)
coIgnoreSymbols, | Ignore symbols and punctuation characters
coIgnoreWidth, | Ignore half-width and full width characters (used in Chinese and Japanese)
coLingCasing, | Use linguistic rules for casing, instead of file system rules
coDigitAsNumbers, | Treat digits as numbers (20 before 120)
coStringSort | Handle punctuation as symbols
);

Description

TCompareOption indicates how 2 strings should be compared. This option is used in the WideStringManager implementation when comparing 2 strings. The following options exist:

Ignore case linguistically (usually identical to coIgnoreCase)
Ignore diacritic caharacters
Ignore case (usually identical to coLingIgnoreCase)
Corresponding hiragana and katakana characters compare as equal.
Corresponding hiragana and katakana characters compare as equal.
Ignore nonspace characters (usually identical to coLingIgnoreDiacritic)
Ignore symbols and punctuation characters
Ignore half-width and full width characters (used in Chinese and Japanese)
Use linguistic rules for casing, instead of file system rules
Treat digits as numbers (20 before 120)
Handle punctuation as symbols

Not all platforms will support all possibilities.

See also

TWideStringManager

Record containing the various callbacks of the widestring manager.


TCompareOptions

Set of TCompareOption

Declaration

Source position: ustringh.inc line 58

type TCompareOptions = set of (
coLingIgnoreCase, | Ignore case linguistically (usually identical to coIgnoreCase)
coLingIgnoreDiacritic, | Ignore diacritic caharacters
coIgnoreCase, | Ignore case (usually identical to coLingIgnoreCase)
coIgnoreKanaType, | Corresponding hiragana and katakana characters compare as equal.
coIgnoreNonSpace, | Ignore nonspace characters (usually identical to coLingIgnoreDiacritic)
coIgnoreSymbols, | Ignore symbols and punctuation characters
coIgnoreWidth, | Ignore half-width and full width characters (used in Chinese and Japanese)
coLingCasing, | Use linguistic rules for casing, instead of file system rules
coDigitAsNumbers, | Treat digits as numbers (20 before 120)
coStringSort | Handle punctuation as symbols
);

Description

TCompareOptions is simply a set of TCompareOption enumeration values.

See also

TCompareOption

How to compare strings


TCriticalSectionHandler

Generic callback type for critical section handling in TThreadManager.

Declaration

Source position: threadh.inc line 48

type TCriticalSectionHandler = procedure(

  var cs

);


TCriticalSectionHandlerTryEnter

Function prototype for TryEnterCriticalsection

Declaration

Source position: threadh.inc line 49

type TCriticalSectionHandlerTryEnter = function(

  var cs

):LongInt;

Description

TCriticalSectionHandlerTryEnter is the function prototype for the TryEnterCriticalsection function, in the TThreadManager record's TryEnterCriticalSection field.

See also

TryEnterCriticalsection | Try entering a critical section
GetThreadManager | Return the current thread manager
TThreadManager | Thread manager record.


TCtrlBreakHandler

CTRL-C Handler prototype

Declaration

Source position: systemh.inc line 607

type TCtrlBreakHandler = function(

  CtrlBreak: Boolean

):Boolean;

Description

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.


TDate

Alias for TDateTime type.

Declaration

Source position: systemh.inc line 444

type TDate = type TDateTime;

Description

TDate is defined for Delphi compatibility. This type is deprecated, use TDateTime instead.

See also

TDateTime | Encoded Date-Time type.
TTime | Alias for TDateTime type.


TDateTime

Encoded Date-Time type.

Declaration

Source position: systemh.inc line 443

type TDateTime = type Double;


tdispdesc

COM/OLE dispatch call description.

Declaration

Source position: varianth.inc line 148

type tdispdesc = packed record
dispid: LongInt; | Dispatch ID
restype: Byte; | Result type.
calldesc: tcalldesc; | Arguments description.
end;

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.

See also

tcalldesc

COM/OLE dispatch call argument description.


TDoubleRec

Extended value record

Declaration

Source position: mathh.inc line 150

type TDoubleRec = packed record
public
function Mantissa; | Mantissa of the floating point value
function Fraction; | Fraction of the floating point value
function Exponent; | Exponent of the floating point value
property Sign: Boolean; [rw] | Sign of the floating point value
property Exp: QWord; [rw] | Exponent bitpattern representation
property Frac: QWord; [rw] | Fractional part of double
function SpecialType; | Is the floating point value special ?
case Byte of
0: (
Bytes: array [0..7] of Byte; | Value as bytes
);
1: (
Words: array [0..3] of Word; | Value as words
);
2: (
Data: QWord; | Value as QWord
);
3: (
Value: Double; | Value as Double
);
end;

Description

TDoubleRec models the memory layout of a double value when using software floating point math.

See also

TDoubleRec | Extended value record
TSingleRec | Extended value record


TDoubleRec.Exp

Exponent bitpattern representation

Declaration

Source position: mathh.inc line 163

public property TDoubleRec.Exp : QWord
  read GetExp
  write SetExp;

Description

Exp returns the internal bit representation of the exponent of the floating point value.

See also

TDoubleRec.Sign | Sign of the floating point value
TDoubleRec.Exponent | Exponent of the floating point value


Exponent

Exponent of the floating point value

Declaration

Source position: mathh.inc line 161

function TDoubleRec.Exponent: LongInt;

Description

Exponent returns the exponent (X in m*2^X representation) of the floating point value.

See also

TDoubleRec.Fraction | Fraction of the floating point value
TDoubleRec.Mantissa | Mantissa of the floating point value
TDoubleRec.SpecialType | Is the floating point value special ?


TDoubleRec.Frac

Fractional part of double

Declaration

Source position: mathh.inc line 164

public property TDoubleRec.Frac : QWord
  read Getfrac
  write SetFrac;

Description

Frac is the fractional part of the Double. This is the bit pattern representing the fractional part including the preceding 1. (The mantissa is that bit pattern without the preceding 1)

See also

Frac

Return fractional part of floating point value.


Fraction

Fraction of the floating point value

Declaration

Source position: mathh.inc line 160

function TDoubleRec.Fraction: ValReal;

Description

Fraction returns the fraction (value after decimal) of the floating point value.

See also

TDoubleRec.Mantissa | Mantissa of the floating point value
TDoubleRec.Exponent | Exponent of the floating point value
TDoubleRec.SpecialType | Is the floating point value special ?


Mantissa

Mantissa of the floating point value

Declaration

Source position: mathh.inc line 159

function TDoubleRec.Mantissa: QWord;

Description

Mantissa returns the Mantissa part (significand bitpattern without hidden bit) of the floating point value.

See also

TDoubleRec.Fraction | Fraction of the floating point value
TDoubleRec.Exponent | Exponent of the floating point value
TDoubleRec.SpecialType | Is the floating point value special ?


TDoubleRec.Sign

Sign of the floating point value

Declaration

Source position: mathh.inc line 162

public property TDoubleRec.Sign : Boolean
  read GetSign
  write SetSign;


SpecialType

Is the floating point value special ?

Declaration

Source position: mathh.inc line 165

function TDoubleRec.SpecialType: TFloatSpecial;

Description

SpecialType returns special characteristics of the floating point value, if any. See TFLoatSpecial for an explanation of the various special values.

See also

TDoubleRec.Fraction | Fraction of the floating point value
TDoubleRec.Mantissa | Mantissa of the floating point value
TDoubleRec.Exponent | Exponent of the floating point value
TFLoatSpecial | Special floating point values


tdynarrayindex

Type with the correct size for index into a dynamic array.

Declaration

Source position: dynarrh.inc line 19

type tdynarrayindex = SizeInt;

Description

A variable of type tdynarrayindex will always have the correct size, suitable for serving as an index in a dynamic array.


tdynarraytypeinfo

Type information for a dynamic array.

Declaration

Source position: dynarrh.inc line 23

type tdynarraytypeinfo = packed record
kind: Byte; | Kind of array.
namelen: Byte; | Length of the Name of the array type. Name follows as Namelen characters.
elesize: SizeInt; | Size of a single element in the array
eletype: pdynarraytypeinfo; | Pointer to next dimension structure in case of a multidimensional array
vartype: LongInt; | Type (variant type) of element in the array
end;

Description

tdynarraytypeinfo describes the structure of a multi-dimensional dynamical array. It is used in the DynArraySetLength call.

See also

DynArraySetLength

Set the length of a dynamic array


TEndThreadHandler

Callback for thread end in TThreadManager.

Declaration

Source position: threadh.inc line 40

type TEndThreadHandler = procedure(

  ExitCode: DWord

);


TEntryInformation

Executable entry point information structure

Declaration

Source position: systemh.inc line 561

type TEntryInformation = record
InitFinalTable: Pointer; | List of units to initialize/finalize
ThreadvarTablesTable: Pointer; | List of threadvar locations
asm_exit: procedure; | Exit procedure
PascalMain: procedure; | Main pascal code routine
valgrind_used: Boolean; | Determine if valgrind is used or not
end;

Description

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.


TError

Error type, used in variants.

Declaration

Source position: systemh.inc line 447

type TError = type LongInt;


TErrorProc

Standard error handler procedural type.

Declaration

Source position: systemh.inc line 1454

type TErrorProc = procedure(

  ErrNo: LongInt;

  Address: CodePointer;

  Frame: Pointer

);


TExceptObject

Exception object

Declaration

Source position: objpash.inc line 330

type TExceptObject = record
FObject: TObject; | Exception instance.
Addr: CodePointer; | Address where exception occurred
Next: PExceptObject; | Next exception object on the stack.
refcount: LongInt; | Reference count for this exception object
Framecount: LongInt; | Number of frames in the exception object
Frames: PCodePointer; | Pointer to array of frame pointers
end;

Description

TExceptObject is the exception description record which is found on the exception stack.


TExceptProc

Exception handler procedural type

Declaration

Source position: objpash.inc line 326

type TExceptProc = procedure(

  Obj: TObject;

  Addr: CodePointer;

  FrameCount: LongInt;

  Frame: PCodePointer

);


TextBuf

Text buffer

Declaration

Source position: textrec.inc line 32

type TextBuf = array [0..TextRecBufSize-1] of AnsiChar;

Description

TextBuf is a type for the default buffer used in TextRec.

See also

TextRec

Text file type


TExtended80Rec

Extended value record

Declaration

Source position: mathh.inc line 123

type TExtended80Rec = packed record
public
function Mantissa; | Mantissa of the floating point value
function Fraction; | Fraction of the floating point value
function Exponent; | Exponent of the floating point value
property Sign: Boolean; [rw] | Sign of the floating point value
property Exp: QWord; [rw] | Exponent representation
function SpecialType; | Is the floating point value special ?
case Byte of
0: (
Bytes: array [0..9] of Byte; | Value as bytes
);
1: (
Words: array [0..4] of Word; | Value as words
);
2: (
_Exp: Word; | Encoded exponent of value
Frac: QWord; | Encoded fraction of value
);
3: (
Value: Extended; | Value as Extended
);
end;

Description

TExtended80Rec models the memory layout of an extended value when using software floating point math.

See also

TDoubleRec | Extended value record
TSingleRec | Extended value record


TExtended80Rec.Exp

Exponent representation

Declaration

Source position: mathh.inc line 134

public property TExtended80Rec.Exp : QWord
  read GetExp
  write SetExp;

Description

Exponent returns the internal bit representation of the exponent of the floating point value.

See also

TExtended80Rec.Sign | Sign of the floating point value
TExtended80Rec.Exponent | Exponent of the floating point value


Exponent

Exponent of the floating point value

Declaration

Source position: mathh.inc line 132

function TExtended80Rec.Exponent: LongInt;

Description

Exponent returns the exponent (the X in the m*2^X representation) of the floating point value.

See also

TExtended80Rec.Fraction | Fraction of the floating point value
TExtended80Rec.Mantissa | Mantissa of the floating point value
TExtended80Rec.SpecialType | Is the floating point value special ?


Fraction

Fraction of the floating point value

Declaration

Source position: mathh.inc line 131

function TExtended80Rec.Fraction: Extended;

Description

Fraction returns the fraction (value after decimal) of the floating point value.

See also

TExtended80Rec.Mantissa | Mantissa of the floating point value
TExtended80Rec.Exponent | Exponent of the floating point value
TExtended80Rec.SpecialType | Is the floating point value special ?


Mantissa

Mantissa of the floating point value

Declaration

Source position: mathh.inc line 130

function TExtended80Rec.Mantissa: QWord;

Description

Mantissa returns the Mantissa part (bit pattern of the significand, skipping the hidden bit) of the floating point value.

See also

TExtended80Rec.Fraction | Fraction of the floating point value
TExtended80Rec.Exponent | Exponent of the floating point value
TExtended80Rec.SpecialType | Is the floating point value special ?


TExtended80Rec.Sign

Sign of the floating point value

Declaration

Source position: mathh.inc line 133

public property TExtended80Rec.Sign : Boolean
  read GetSign
  write SetSign;


SpecialType

Is the floating point value special ?

Declaration

Source position: mathh.inc line 135

function TExtended80Rec.SpecialType: TFloatSpecial;

Description

SpecialType returns special characteristics of the floating point value, if any. See TFLoatSpecial for an explanation of the various special values.

See also

TExtended80Rec.Fraction | Fraction of the floating point value
TExtended80Rec.Mantissa | Mantissa of the floating point value
TExtended80Rec.Exponent | Exponent of the floating point value
TFLoatSpecial | Special floating point values


TextFile

Alias for Text file type.

Declaration

Source position: objpash.inc line 71

type TextFile = Text;


TextRec

Text file type

Declaration

Source position: textrec.inc line 37

type TextRec = record
Handle: THandle; | Low-level OS file handle
Mode: LongInt; | Open mode
bufsize: SizeInt; | Actual buffer size
_private: SizeInt; | Private data
bufpos: SizeInt; | Current buffer position
bufend: SizeInt; | Current buffer end position
bufptr: ; | Pointer to current buffer
openfunc: CodePointer; | File open function
inoutfunc: CodePointer; | File I/O function
flushfunc: CodePointer; | I/O flush function
closefunc: CodePointer; | File close function
UserData: array [1..32] of Byte; | User data
name: array [0..textrecnamelength-1] of TFileTextRecChar; | File name
LineEnd: TLineEndStr; | Line ending to use
buffer: TextBuf; | Default buffer
end;

Description

TextRec is the underlying type used in text files. It should be treated as opaque and never manipulated directly.

See also

FileRec | Untyped file type
Assign | Assign a name to a file
Reset | Open file for reading
Close | Close a file
Rewrite | Open file for writing


TextRecBufSize

Default buffer size for text files

Declaration

Source position: textrec.inc line 28

const TextRecBufSize = 256;

Description

TextRecBufSize is the default buffer size for text files. The actual buffer can be set to another size using SetTextBuf.

See also

SetTextBuf

Set size of text file internal buffer


TextRecNameLength

maximum filename size for text files.

Declaration

Source position: textrec.inc line 27

const TextRecNameLength = 256;

Description

TextRecNameLength is the maximum filename size for text files.


TFileTextRecChar

Character type for the filename part in file records

Declaration

Source position: systemh.inc line 532

type TFileTextRecChar = UnicodeChar;

Description

TFileTextRecChar is the type of character used in TextRec or FileRec file types. It is an alias type, depending on platform and RTL compilation flags. No assumptions should be made on the actual character type.

See also

TextRec | Text file type
FileRec | Untyped file type


TFloatSpecial

Special floating point values

Declaration

Source position: mathh.inc line 119

type TFloatSpecial = (
fsZero, | Zero
fsNZero, | Negative zero
fsDenormal, | Denormal value
fsNDenormal, | Negative enormal value
fsPositive, | Positive value
fsNegative, | Negative value
fsInf, | Infinity
fsNInf, | Negative infinity
fsNaN, | Not a number
fsInvalidOp | Invalid operation
);

Description

TFloatSpecial enumerates a series of floating point value properties.


TFPCHeapStatus

Record describing the state of the default FPC heap manager.

Declaration

Source position: heaph.inc line 18

type TFPCHeapStatus = record
MaxHeapSize: PtrUInt; | Maximum allowed size for the heap, in bytes
MaxHeapUsed: PtrUInt; | Maximum used size for the heap, in bytes
CurrHeapSize: PtrUInt; | Current heap size, in bytes
CurrHeapUsed: PtrUInt; | Currently used heap size, in bytes
CurrHeapFree: PtrUInt; | Currently free memory on heap, in bytes
end;

Description

TFPCHeapStatus describes the state of the FPC heap manager. This is not equivalent to the THeapStatus record defined by Delphi, which contains information not meaningful for the FPC heap manager. The heap status can be retrieved by the GetFPCHeapStatus call.

See also

GetFPCHeapStatus | Return FPC heap manager status information
GetHeapStatus | Return the memory manager heap status.
THeapStatus | Record describing current heap status.


TFPResourceHandle

Handle to resource

Declaration

Source position: resh.inc line 8

type TFPResourceHandle = PtrUInt;

Description

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.

See also

TFPResourceHMODULE | Handle to module containing resource
TFPResourceHGLOBAL | TFPResourceHGLOBAL


TFPResourceHGLOBAL

TFPResourceHGLOBAL

Declaration

Source position: resh.inc line 10

type TFPResourceHGLOBAL = PtrUInt;

Description

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.

See also

TFPResourceHandle | Handle to resource
TFPResourceHMODULE | Handle to module containing resource


TFPResourceHMODULE

Handle to module containing resource

Declaration

Source position: resh.inc line 9

type TFPResourceHMODULE = PtrUInt;

Description

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.

See also

TFPResourceHandle | Handle to resource
TFPResourceHGLOBAL | TFPResourceHGLOBAL


TFPUException

Type describing Floating Point processor exceptions.

Declaration

Source position: mathh.inc line 38

type TFPUException = (
exInvalidOp, | Invalid operation error
exDenormalized, |
exZeroDivide, | Division by zero error.
exOverflow, | Float overflow error
exUnderflow, | Float underflow error
exPrecision | Precision error
);

Description

TFPUException describes what floating point errors raise exceptions. It has been moved here from the Math unit.

See also

TFPUExceptionMask

Set of TFPUException


TFPUExceptionMask

Set of TFPUException

Declaration

Source position: mathh.inc line 40

type TFPUExceptionMask = set of (
exInvalidOp, | Invalid operation error
exDenormalized, |
exZeroDivide, | Division by zero error.
exOverflow, | Float overflow error
exUnderflow, | Float underflow error
exPrecision | Precision error
);

Description

TFPUExceptionMask is a set of TFPUException constants

See also

softfloat_exception_mask | Current soft float exception mask
softfloat_exception_flags | Current soft float exception flags


TFPUPrecisionMode

Type describing the default precision for Floating Point math.

Declaration

Source position: mathh.inc line 37

type TFPUPrecisionMode = (
pmSingle, | Single-type precision
pmReserved, | ?
pmDouble, | Double-type precision
pmExtended | Extended-type precision
);

Description

TFPUPrecisionMode describes the possible default precisions for the software Floating Point math routines. It has been moved here from the math unit.

See also

TFPURoundingMode

How to round floating point values


TFPURoundingMode

How to round floating point values

Declaration

Source position: mathh.inc line 36

type TFPURoundingMode = (
rmNearest, | Round to nearest integer
rmDown, | Round to biggest integer smaller than value.
rmUp, | Round to smallest integer larger than value
rmTruncate | Cut off fractional part
);

Description

TFPURoundingMode enumerates the possible values for software floating point math rounding. It has been moved here from the math unit.

See also

TFPUPrecisionMode | Type describing the default precision for Floating Point math.
softfloat_rounding_mode | Rounding mode for softfloat


TGetCurrentThreadIdHandler

Callback type for retrieving thread ID in TThreadManager.

Declaration

Source position: threadh.inc line 47

type TGetCurrentThreadIdHandler = function: TThreadID;


TGuid

Standard GUID representation type.

Declaration

Source position: objpash.inc line 129

type TGuid = packed record
case Integer of
1: (
Data1: DWord; | First 4 bytes of GUID
Data2: Word; | Bytes 5 and 6 of GUID
Data3: Word; | Bytes 7 and 8 of GUID
Data4: array [0..7] of Byte; | Bytes 9-17 of GUID
);
2: (
D1: DWord; | First 4 bytes of GUID
D2: Word; | Bytes 5 and 6 of GUID
D3: Word; | Bytes 7 and 8 of GUID
D4: array [0..7] of Byte; | Bytes 9-17 of GUID
);
3: (
time_low: DWord; | low part of GUID timestamp
time_mid: Word; | Middle part of GUID timestamp
time_hi_and_version: Word; | High part of GUID timestamp and version
clock_seq_hi_and_reserved: Byte; | High part of clock sequence of GUID
clock_seq_low: Byte; | Low part of clock sequence of GUID
node: array [0..5] of Byte; | Node part of GUID
);
end;


THandle

Type alias.

Declaration

Source position: sysosh.inc line 21

type THandle = LongInt;

Description

This type should be considered opaque. It is used to describe file and other handles.


THeapStatus

Record describing current heap status.

Declaration

Source position: heaph.inc line 25

type THeapStatus = record
TotalAddrSpace: Cardinal; | Total amount of available addressable memory
TotalUncommitted: Cardinal; | Total amount of uncommitted memory
TotalCommitted: Cardinal; | Total amount of committed memory
TotalAllocated: Cardinal; | Total amount of allocated memory
TotalFree: Cardinal; | Total amount of free memory
FreeSmall: Cardinal; | Total amount of free small memory blocks
FreeBig: Cardinal; | Total amount of free large memory blocks
Unused: Cardinal; | Total amount of free process memory
Overhead: Cardinal; | Total bytes of overhead by memory manager
HeapErrorCode: Cardinal; | Last error code
end;

Description

THeapStatus is the record describing the current heap status. It is returned by the GetHeapStatus call.

See also

GetHeapStatus

Return the memory manager heap status.


ThreadID

Current Thread ID.

Declaration

Source position: systemh.inc line 706

var ThreadID: TThreadID = ;


ThreadingAlreadyUsed

Internal constant for the threading system. Don't use.

Declaration

Source position: systemh.inc line 659

const ThreadingAlreadyUsed: Boolean = False;


TInitThreadVarHandler

Threadvar initialization callback type for TThreadManager.

Declaration

Source position: threadh.inc line 50

type TInitThreadVarHandler = procedure(

  var offset: DWord;

  size: DWord

);


TInterfacedClass

TObject descendent implementing the IInterface interface

Declaration

Source position: objpash.inc line 297

type TInterfacedClass = class of TInterfacedObject;

Description

TInterfacedClass is a descendent of


tinterfaceentry

Interfaces table entry.

Declaration

Source position: objpash.inc line 164

type tinterfaceentry = record
IID: PGuid; | Unique GUID for this interface.
VTable: Pointer; | Pointer to interface VTable.
IOffset: SizeUInt; | Offset
IIDStr: PShortString; | Pointer to GUID string. Always assigned for COM.
case Boolean of
True: (
IType: tinterfaceentrytype; | Interface entry interface type
);
False: (
__pad_dummy: SizeInt; | Padding bytes
);
end;

Description

tinterfaceentry is used to store the list of Interfaces of a class. This list is stored as an array of tinterfaceentry records.


tinterfaceentrytype

Dispatch interface entry type

Declaration

Source position: objpash.inc line 154

type tinterfaceentrytype = (
etStandard, | Standard entry
etVirtualMethodResult, | Virtual method
etStaticMethodResult, | Statis method
etFieldValue, | Field value
etVirtualMethodClass, | Interface provided by a virtual class method
etStaticMethodClass, | Interface provided by a static class method
etFieldValueClass | Interface provided by a class field
);

Description

This is an internal type for the compiler to encode calls to dispatch interfaces.


tinterfacetable

Record to store list of interfaces of a class.

Declaration

Source position: objpash.inc line 178

type tinterfacetable = record
EntryCount: SizeUInt; | Number of interfaces.
Entries: array [0..0] of tinterfaceentry; | Array of tinterfaceentry records.
end;


TLineEndStr

Line ending string type

Declaration

Source position: textrec.inc line 31

type TLineEndStr = string;

Description

TLineEndStr is an alias for the actual line ending string type, used in TextRec. It should be treated as opaque.


TMemoryManager

Record describing the current memory manager

Declaration

Source position: heaph.inc line 39

type TMemoryManager = record
NeedLock: Boolean; | Does the memory manager require a lock
Getmem: function( | Function called when memory must be allocated on the heap.
Size: PtrUInt
):Pointer;
Freemem: function( | Function called when previously allocated memory can be freed again.
p: pointer
):PtrUInt;
FreememSize: function( | Function called when previously allocated memory with a known size can be freed again.
p: pointer;
Size: PtrUInt
):PtrUInt;
AllocMem: function( | Same as getmem, but additionally clear the allocated memory (filled with 0 bytes).
Size: PtrUInt
):Pointer;
ReAllocMem: function( | Handler called when an allocated memory block should be resized
var p: pointer;
Size: PtrUInt
):Pointer;
MemSize: function( | Return the size of a memory block.
p: pointer
):PtrUInt;
InitThread: procedure; | Called when a thread is initialized
DoneThread: procedure; | Called when a thread ends
RelocateHeap: procedure; | Relocate the heap to a different location
GetHeapStatus: function: THeapStatus; | Handler called when the heap status must be reported.
GetFPCHeapStatus: function: TFPCHeapStatus; | Handler to get FPC heap status information.
end;

Description

TMemoryManager describes the memory manager. For more information about the memory manager, see the programmer's reference.


TMethod

Record describing a method.

Declaration

Source position: objpash.inc line 184

type TMethod = record
Code: CodePointer; | Pointer to method code.
Data: Pointer; | Pointer to object instance.
end;

Description

TMethod describes a general method pointer, and is used in Run-Time Type Information handling.


TMsgStrTable

Record used in string message handler table.

Declaration

Source position: objpash.inc line 84

type TMsgStrTable = record
name: PShortString; | Message name
method: CodePointer; | Method to call
end;


TPCharArray

Array of PChar

Declaration

Source position: systemh.inc line 600

type TPCharArray = array [0..(MaxLongintdivSizeOf(PChar))-1] of PChar;


TProcedure

Simple procedural type.

Declaration

Source position: systemh.inc line 538

type TProcedure = procedure;


TReleaseThreadVarsHandler

Threadvar release callback type for TThreadManager.

Declaration

Source position: threadh.inc line 53

type TReleaseThreadVarsHandler = procedure;


TRelocateThreadVarHandler

Threadvar relocalization callback type for TThreadManager.

Declaration

Source position: threadh.inc line 51

type TRelocateThreadVarHandler = function(

  offset: DWord

):pointer;


TResourceHandle

Handle to a resource, for use in the resource loading routines

Declaration

Source position: resh.inc line 4

type TResourceHandle = PtrUInt;

Description

This is an opaque type.

See also

LoadResource

Load a resource for use


TResourceManager

Resource manager definition

Declaration

Source position: resh.inc line 73

type TResourceManager = record
HINSTANCEFunc: function: TFPResourceHMODULE; | Return the programs instance handle.
EnumResourceTypesFunc: function( | Handler for EnumResourceTypes.
ModuleHandle: TFPResourceHMODULE;
EnumFunc: EnumResTypeProc;
lParam: PtrInt
):LongBool;
EnumResourceNamesFunc: function( | Handler for EnumResourceNames.
ModuleHandle: TFPResourceHMODULE;
ResourceType: PChar;
EnumFunc: EnumResNameProc;
lParam: PtrInt
):LongBool;
EnumResourceLanguagesFunc: function( | Handler for EnumResourceLanguages.
ModuleHandle: TFPResourceHMODULE;
ResourceType: PChar;
ResourceName: PChar;
EnumFunc: EnumResLangProc;
lParam: PtrInt
):LongBool;
FindResourceFunc: function( | Handler for FindResource
ModuleHandle: TFPResourceHMODULE;
ResourceName: PChar;
ResourceType: PChar
):TFPResourceHandle;
FindResourceExFunc: function( | Handler for FindResourceEx
ModuleHandle: TFPResourceHMODULE;
ResourceType: PChar;
ResourceName: PChar;
Language: Word
):TFPResourceHandle;
LoadResourceFunc: function( | Handler for LoadResource
ModuleHandle: TFPResourceHMODULE;
ResHandle: TFPResourceHandle
):TFPResourceHGLOBAL;
SizeofResourceFunc: function( | Handler for SizeOfResource
ModuleHandle: TFPResourceHMODULE;
ResHandle: TFPResourceHandle
):LongWord;
LockResourceFunc: function( | Handler for LockResource
ResData: TFPResourceHGLOBAL
):Pointer;
UnlockResourceFunc: function( | Handler for UnLockResource
ResData: TFPResourceHGLOBAL
):LongBool;
FreeResourceFunc: function( | Handler for FreeResource
ResData: TFPResourceHGLOBAL
):LongBool;
end;

Description

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.

See also

GetResourceManager | Return the currently active resource manager
SetResourceManager | Set the resource manager


TRTLCreateEventHandler

Callback type for creating a TRTLEvent type in TThreadManager.

Declaration

Source position: threadh.inc line 59

type TRTLCreateEventHandler = function: PRTLEvent;


TRTLCriticalSection

A critical section.

Declaration

Source position: sysosh.inc line 28

type TRTLCriticalSection = Opaque type

Description

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.

See also

InitCriticalSection | Initialize a critical section
DoneCriticalSection | Clean up a critical section.
EnterCriticalSection | Enter a critical section
LeaveCriticalSection | Leave a critical section


TRTLEventHandler

Generic TRTLEvent handling type for TThreadManager.

Declaration

Source position: threadh.inc line 57

type TRTLEventHandler = procedure(

  AEvent: PRTLEvent

);


TRTLEventHandlerTimeout

TRTLEvent timeout handling type for TThreadManager.

Declaration

Source position: threadh.inc line 58

type TRTLEventHandlerTimeout = procedure(

  AEvent: PRTLEvent;

  timeout: LongInt

);


trtlmethod

Callback type for synchronization event.

Declaration

Source position: threadh.inc line 36

type trtlmethod = procedure of object;


TRuntimeError

Type of runtime-error for the Error procedure

Declaration

Source position: systemh.inc line 1374

type TRuntimeError = (
reNone, | No error
reOutOfMemory, | Out of memory error
reInvalidPtr, | Invalid pointer error
reDivByZero, | Division by zero error
reRangeError, | Range check error
reIntOverflow, | Integer overflow error
reInvalidOp, | Invalid operation error
reZeroDivide, | Division by zero error
reOverflow, | Overflow error
reUnderflow, | Underflow error
reInvalidCast, | Invalid (class) typecast error
reAccessViolation, | Access Violation
rePrivInstruction, | Privileged instruction error
reControlBreak, | User pressed CTRL-C
reStackOverflow, | Stack overflow error
reVarTypeCast, | Invalid typecase from variant
reVarInvalidOp, | Invalid variant operation error
reVarDispatch, | Variant Dispatch error.
reVarArrayCreate, | Variant array creation error
reVarNotArray, | Variant is not an array error.
reVarArrayBounds, | Variant array bounds error
reAssertionFailed, | Assertion failed error
reExternalException, | An external exception occurred
reIntfCastError, | Interface typecast error
reSafeCallError, | Safecall (IDispInterface) error
reQuit, | Quit signal error
reCodesetConversion | Code set conversion error
);

Description

TRuntimeError is used in the Error procedure to indicate what kind of error should be reported.

See also

Error

Generate run-time error


TSafeCallErrorProc

Prototype for the safecall error handler

Declaration

Source position: systemh.inc line 1457

type TSafeCallErrorProc = procedure(

  error: HRESULT;

  addr: pointer

);

Arguments

error | Error number
addr | Address where error occurred

Description

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.

See also

SafeCallErrorProc

Error handler for safecall errors


TSemaphoreDestroyHandler

Function prototype for destroying a semaphore

Declaration

Source position: threadh.inc line 62

type TSemaphoreDestroyHandler = procedure(

  const sem: Pointer

);

Description

TSemaphoreDestroyHandler is the function prototype to destroy an existing semaphore, as returned by (ThreadManager.SemaphoreInit). It is used by the thread manager (ThreadManager.SemaphoreDestroy)


TSemaphorePostHandler

Function prototype for posting an event to a semaphore

Declaration

Source position: threadh.inc line 63

type TSemaphorePostHandler = procedure(

  const sem: Pointer

);

Description

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.


TSemaphoreWaitHandler

Function prototype to wait on a semaphore

Declaration

Source position: threadh.inc line 64

type TSemaphoreWaitHandler = procedure(

  const sem: Pointer

);

Description

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.


TSempahoreInitHandler

Function prototype for initializing a semaphore

Declaration

Source position: threadh.inc line 61

type TSempahoreInitHandler = function: Pointer;

Description

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.


TSingleRec

Extended value record

Declaration

Source position: mathh.inc line 175

type TSingleRec = packed record
public
function Mantissa; | Mantissa of the floating point value
function Fraction; | Fraction of the floating point value
function Exponent; | Exponent of the floating point value
property Sign: Boolean; [rw] | Sign of the floating point value
property Exp: QWord; [rw] | Exponent bitpattern representation
property Frac: QWord; [rw] | Fractional part of single
function SpecialType; | Is the floating point value special ?
case Byte of
0: (
Bytes: array [0..3] of Byte; | Value as bytes
);
1: (
Words: array [0..1] of Word; | Value as words
);
2: (
Data: DWord; | Value as QWord
);
3: (
Value: Single; | Value as single
);
end;

Description

TsingleRec models the memory layout of a double value when using software floating point math.

See also

TsingleRec | Extended value record
TSingleRec | Extended value record


TSingleRec.Exp

Exponent bitpattern representation

Declaration

Source position: mathh.inc line 188

public property TSingleRec.Exp : QWord
  read GetExp
  write SetExp;

Description

Exp returns the internal bit representation of the exponent of the floating point value.

See also

TsingleRec.Sign | Sign of the floating point value
TsingleRec.Exponent | Exponent of the floating point value


Exponent

Exponent of the floating point value

Declaration

Source position: mathh.inc line 186

function TSingleRec.Exponent: LongInt;

Description

Exponent returns the exponent (X in m*2^X representation) of the floating point value.

See also

TsingleRec.Fraction | Fraction of the floating point value
TsingleRec.Mantissa | Mantissa of the floating point value
TsingleRec.SpecialType | Is the floating point value special ?


TSingleRec.Frac

Fractional part of single

Declaration

Source position: mathh.inc line 189

public property TSingleRec.Frac : QWord
  read Getfrac
  write SetFrac;

Description

Frac is the fractional part of the Single. his is the bit pattern representing the fractional part including the preceding 1. (The mantissa is that bit pattern without the preceding 1)

See also

Frac

Return fractional part of floating point value.


Fraction

Fraction of the floating point value

Declaration

Source position: mathh.inc line 185

function TSingleRec.Fraction: ValReal;

Description

Fraction returns the fraction (after decimal) of the floating point value.

See also

TsingleRec.Mantissa | Mantissa of the floating point value
TsingleRec.Exponent | Exponent of the floating point value
TsingleRec.SpecialType | Is the floating point value special ?


Mantissa

Mantissa of the floating point value

Declaration

Source position: mathh.inc line 184

function TSingleRec.Mantissa: QWord;

Description

Mantissa returns the Mantissa part (significand bitpattern without hidden bit) of the floating point value.

See also

TsingleRec.Fraction | Fraction of the floating point value
TsingleRec.Exponent | Exponent of the floating point value
TsingleRec.SpecialType | Is the floating point value special ?


TSingleRec.Sign

Sign of the floating point value

Declaration

Source position: mathh.inc line 187

public property TSingleRec.Sign : Boolean
  read GetSign
  write SetSign;


SpecialType

Is the floating point value special ?

Declaration

Source position: mathh.inc line 190

function TSingleRec.SpecialType: TFloatSpecial;

Description

SpecialType returns special characteristics of the floating point value, if any. See TFLoatSpecial for an explanation of the various special values.

See also

TsingleRec.Fraction | Fraction of the floating point value
TsingleRec.Mantissa | Mantissa of the floating point value
TsingleRec.Exponent | Exponent of the floating point value
TFLoatSpecial | Special floating point values


TStandardCodePageEnum

Description of standard used codepages

Declaration

Source position: ustringh.inc line 59

type TStandardCodePageEnum = (
scpAnsi, | Ansi codepage (CP_ACP)
scpConsoleInput, | Console input codepage
scpConsoleOutput, | Console output codepage
scpFileSystemSingleByte | File system single byte codepage.
);

Description

TStandardCodePageEnum describes several types of standard used codepages, which can be queried by the unicode string manager TUnicodeStringManager.

See also

TUnicodeStringManager

Unicode string manager


TStringMessageTable

String message table container for class.

Declaration

Source position: objpash.inc line 91

type TStringMessageTable = record
count: LongInt; | Number of messages in the string table.
msgstrtable: array [0..0] of TMsgStrTable; | First TMsgStrTable record.
end;

Description

Record used to describe the string messages handled by a class. It consists of a count, followed by an array of TMsgStrTable records.

See also

TMsgStrTable

Record used in string message handler table.


TSystemCodePage

System code page

Declaration

Source position: systemh.inc line 525

type TSystemCodePage = Word;

Description

TSystemCodePage is a type used to indicate code pages. It should be treated as an opaque type.

See also

RawByteString

Single-byte character string without specified codepage


TTextBuf

Alias for TextBuf

Declaration

Source position: textrec.inc line 33

type TTextBuf = TextBuf;

Description

TTextBuf is an alias for TextBuf

See also

TextBuf

Text buffer


TTextLineBreakStyle

Text line break style. (end of line character)

Declaration

Source position: systemh.inc line 535

type TTextLineBreakStyle = (
tlbsLF, | Line-feed only (#10, Unix style)
tlbsCRLF, | Carriage-return, line-feed (#13#30, Windows style)
tlbsCR | Carriage-return (#13, Mac-OS style)
);


TThreadFunc

Thread function prototype

Declaration

Source position: threadh.inc line 35

type TThreadFunc = function(

  parameter: pointer

):PtrInt;


TThreadGetPriorityHandler

Callback type for thread priority getting in TThreadManager.

Declaration

Source position: threadh.inc line 46

type TThreadGetPriorityHandler = function(

  threadHandle: TThreadID

):LongInt;


TThreadHandler

Generic thread handler callback for TThreadManager.

Declaration

Source position: threadh.inc line 42

type TThreadHandler = function(

  threadHandle: TThreadID

):DWord;


TThreadID

Type for Thread-IDs

Declaration

Source position: sysosh.inc line 24

type TThreadID = PtrUInt;

Description

This is an opaque type, it can differ from operating system to operating system.


TThreadManager

Thread manager record.

Declaration

Source position: threadh.inc line 67

type TThreadManager = record
InitManager: function: Boolean; | Initialize the thread manager.
DoneManager: function: Boolean; | Clean up the thread manager.
BeginThread: TBeginThreadHandler; | Start a new thread.
EndThread: TEndThreadHandler; | End the current thread.
SuspendThread: TThreadHandler; | Suspend a running thread.
ResumeThread: TThreadHandler; | Resumt a suspended thread.
KillThread: TThreadHandler; | Kill a running thread.
CloseThread: TThreadHandler; | Implements CloseThread.
ThreadSwitch: TThreadSwitchHandler; | Cause a threadswitch.
WaitForThreadTerminate: TWaitForThreadTerminateHandler; | Wait for a thread to stop.
ThreadSetPriority: TThreadSetPriorityHandler; | Set thread priority
ThreadGetPriority: TThreadGetPriorityHandler; | Get thread priority.
GetCurrentThreadId: TGetCurrentThreadIdHandler; | Get current thread ID
InitCriticalSection: TCriticalSectionHandler; | Initialize a critical section.
DoneCriticalSection: TCriticalSectionHandler; | Free a critical section
EnterCriticalSection: TCriticalSectionHandler; | Enter a critical section
TryEnterCriticalSection: TCriticalSectionHandlerTryEnter; | Implements TryEnterCriticalsection.
LeaveCriticalSection: TCriticalSectionHandler; | leave a critical section.
InitThreadVar: TInitThreadVarHandler; | Initialize a thread variable.
RelocateThreadVar: TRelocateThreadVarHandler; | Relocate a thread variable.
AllocateThreadVars: TAllocateThreadVarsHandler; | Allocate thread variables.
ReleaseThreadVars: TReleaseThreadVarsHandler; | Release thread variables.
BasicEventCreate: TBasicEventCreateHandler; | Create a basic event.
BasicEventDestroy: TBasicEventHandler; | Destroy a basic event.
BasicEventResetEvent: TBasicEventHandler; | Reset a basic event.
BasicEventSetEvent: TBasicEventHandler; | Set a basic event
BasiceventWaitFOr: TBasicEventWaitForHandler; | Wait for a basic event
RTLEventCreate: TRTLCreateEventHandler; | Create an RTL event
RTLEventDestroy: TRTLEventHandler; | Free an RTL event
RTLEventSetEvent: TRTLEventHandler; | Set an RTL event
RTLEventResetEvent: TRTLEventHandler; | Reset an RTL event
RTLEventWaitFor: TRTLEventHandler; | Wait for an RTL event.
RTLEventWaitForTimeout: TRTLEventHandlerTimeout; | Wait for RTL event, with timeout.
SemaphoreInit: TSempahoreInitHandler; | Initialize (create) a new semaphore
SemaphoreDestroy: TSemaphoreDestroyHandler; | Destroy (free) a semaphore created using SemaphoreInit.
SemaphorePost: TSemaphorePostHandler; | Post an event on a semaphore created using SemaphoreInit.
SemaphoreWait: TSemaphoreWaitHandler; | Wait on a semaphore event posted by SemaphorePost.
end;

Description

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 SetThreadManager procedure, and the current thread manager can be retrieved with the GetThreadManager 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.

See also

GetThreadManager | Return the current thread manager
SetThreadManager | Set the thread manager, optionally return the current thread manager.


TThreadSetPriorityHandler

Callback type for thread priority setting in TThreadManager.

Declaration

Source position: threadh.inc line 45

type TThreadSetPriorityHandler = function(

  threadHandle: TThreadID;

  Prio: LongInt

):Boolean;


TThreadSwitchHandler

Callback type for thread switch in TThreadManager.

Declaration

Source position: threadh.inc line 43

type TThreadSwitchHandler = procedure;


TTime

Alias for TDateTime type.

Declaration

Source position: systemh.inc line 445

type TTime = type TDateTime;

Description

TTime is defined for Delphi compatibility. This type is deprecated, use TDateTime instead.

See also

TDateTime | Encoded Date-Time type.
TDate | Alias for TDateTime type.


TUCS4CharArray

Array of UCS4Char characters.

Declaration

Source position: systemh.inc line 423

type TUCS4CharArray = array [0..$effffff] of UCS4Char;


TUnicodeStringManager

Unicode string manager

Declaration

Source position: ustringh.inc line 69

type TUnicodeStringManager = record
Wide2AnsiMoveProc: procedure( | Callback used when a unicode/wide string must be converted to an ansistring
source: PWideChar;
var dest: RawByteString;
cp: TSystemCodePage;
len: SizeInt
);
Ansi2WideMoveProc: procedure( | Callback used when an ansistring must be converted to a unicodestring/widestring.
source: PChar;
cp: TSystemCodePage;
var dest: widestring;
len: SizeInt
);
UpperWideStringProc: function( | Callback used when a unicode/wide string must be uppercased.
const S: WideString
):WideString;
LowerWideStringProc: function( | Callback used when a unicode/wide string must be lowercased.
const S: WideString
):WideString;
CompareWideStringProc: function( | Callback used when 2 unicode/wide strings must be compared
const s1: WideString;
const s2: WideString;
Options: TCompareOptions
):PtrInt;
CharLengthPCharProc: function( | Callback used when the character length of a unicode/wide string must be calculated
const Str: PChar
):PtrInt;
CodePointLengthProc: function( | Return the length of a code point
const Str: PChar;
MaxLookAead: PtrInt
):PtrInt;
UpperAnsiStringProc: function( | Callback used when an ansistring must be uppercased.
const s: ansistring
):ansistring;
LowerAnsiStringProc: function( | Callback used when an ansistring must be lowercased.
const s: ansistring
):ansistring;
CompareStrAnsiStringProc: function( | Callback used when 2 ansistrings must be compared.
const S1: ansistring;
const S2: ansistring
):PtrInt;
CompareTextAnsiStringProc: function( | Callback used when 2 ansistrings must be compared case insensitively.
const S1: ansistring;
const S2: ansistring
):PtrInt;
StrCompAnsiStringProc: function( | Callback used when 2 ansistrings must be compared case insensitively
S1: PChar;
S2: PChar
):PtrInt;
StrICompAnsiStringProc: function( | Callback used when 2 null-terminated ansistring arrays must be compared case insensitively
S1: PChar;
S2: PChar
):PtrInt;
StrLCompAnsiStringProc: function( | Callback used when 2 ansistring arrays must be compared up to a given length
S1: PChar;
S2: PChar;
MaxLen: PtrUInt
):PtrInt;
StrLICompAnsiStringProc: function( | Callback used when 2 ansistring arrays must be compared case insensitively up to agiven length
S1: PChar;
S2: PChar;
MaxLen: PtrUInt
):PtrInt;
StrLowerAnsiStringProc: function( | Callback used when a null-terminated ansistring array must be lowercased.
Str: PChar
):PChar;
StrUpperAnsiStringProc: function( | Callback used when a null-terminated ansistring array must be uppercased.
Str: PChar
):PChar;
ThreadInitProc: procedure; | Called whenever a new thread is started.
ThreadFiniProc: procedure; | Called whenever a thread ends.
Unicode2AnsiMoveProc: procedure( | Callback used whenever a unicode string must be converted to an ansistring.
source: PUnicodeChar;
var dest: RawByteString;
cp: TSystemCodePage;
len: SizeInt
);
Ansi2UnicodeMoveProc: procedure( | Callback used whenever a ansistring must be converted to a unicode string.
source: PChar;
cp: TSystemCodePage;
var dest: unicodestring;
len: SizeInt
);
UpperUnicodeStringProc: function( | Callback used to convert a unicode string to uppercase.
const S: UnicodeString
):UnicodeString;
LowerUnicodeStringProc: function( | Callback used to convert a unicode string to lowercase.
const S: UnicodeString
):UnicodeString;
CompareUnicodeStringProc: function( | Callback used to compare 2 unicode strings.
const s1: UnicodeString;
const s2: UnicodeString;
Options: TCompareOptions
):PtrInt;
GetStandardCodePageProc: function( | Callback to query for standard used codepages
const stdcp: TStandardCodePageEnum
):TSystemCodePage;
end;

Description

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

See also

TWideStringManager

Record containing the various callbacks of the widestring manager.


tvararray

Type describing variant array

Declaration

Source position: varianth.inc line 82

type tvararray = record
dimcount: Word; | Number of dimensions
flags: Word; | Array flags.
elementsize: LongInt; | Size of one element in the array.
lockcount: LongInt; | Lock (reference) count of the array.
data: pointer; | Pointer to the array data.
bounds: tvararrayboundarray; | Array describing the bounds in the array.
end;

Description

tvararray is a record describing a variant array. It contains some general data, followed by a number of TVarArrayBound records equal to the number of dimensions in the array (dimcoun).

See also

TVarArrayBound

Type describing variant array bounds.


tvararraybound

Type describing variant array bounds.

Declaration

Source position: varianth.inc line 75

type tvararraybound = record
elementcount: LongInt; | Number of elements in this array dimension.
lowbound: LongInt; | Lower bound of this array dimension (index of first element).
end;

Description

tvararraybound is used to describe one dimension in a variant array.

See also

tvararray

Type describing variant array


tvararrayboundarray

array of tvararraybound records.

Declaration

Source position: varianth.inc line 79

type tvararrayboundarray = array [0..0] of tvararraybound;


tvararraycoorarray

Array of variant array coordinates

Declaration

Source position: varianth.inc line 80

type tvararraycoorarray = array [0..0] of LongInt;


tvardata

Variant record.

Declaration

Source position: varianth.inc line 95

type tvardata = packed record
vtype: tvartype; | Type of variant.
case Integer of
0: (
res1: Word; | Reserved byte
case Integer of
0: (
res2: Word; | Reserved byte
res3: Word; | Reserved byte
case Word of
varsmallint: (
vsmallint: SmallInt; | Smallint value
);
varinteger: (
vinteger: LongInt; | Integer value
);
varsingle: (
vsingle: single; | Single value
);
vardouble: (
vdouble: Double; | Double value
);
vardate: (
vdate: TDateTime; | TDateTime value
);
varcurrency: (
vcurrency: currency; | Currency value
);
varolestr: (
volestr: PWideChar; | OLE string value (specially allocated widestring)
);
vardispatch: (
vdispatch: pointer; | Dispatch interface value
);
varerror: (
verror: HRESULT; | Error value
);
varboolean: (
vboolean: wordbool; | Boolean value
);
varunknown: (
vunknown: pointer; | IUnknown interface value
);
varshortint: (
vshortint: ShortInt; | Shortint value
);
varbyte: (
vbyte: Byte; | Byte value
);
varword: (
vword: Word; | Word value
);
varlongword: (
vlongword: DWord; | Longword value
);
varint64: (
vint64: Int64; | Int64 value
);
varqword: (
vqword: QWord; | QWord value
);
varword64: (
vword64: QWord; | QWord value (?)
);
varstring: (
vstring: pointer; | Ansistring value
);
varany: (
vany: pointer; | Any valyue
);
vararray: (
varray: pvararray; | Variant array value
);
varbyref: (
vpointer: pointer; | Pointer value
);
);
1: (
vlongs: array [0..2] of LongInt; | Value as an array of longints
);
);
1: (
vwords: array [0..6] of Word; | Value as an array of words
);
2: (
vbytes: array [0..13] of Byte; | Value as an array of bytes
);
end;

Description

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.


tvariantmanager

Record describing the variant manager.

Declaration

Source position: varianth.inc line 155

type tvariantmanager = record
vartoint: function( | Called to convert a variant to an integer value
const v: variant
):LongInt;
vartoint64: function( | Called to convert a variant to an int64 value
const v: variant
):Int64;
vartoword64: function( | Called to convert a variant to a word64 value
const v: variant
):QWord;
vartobool: function( | Called to convert a variant to a boolean value
const v: variant
):Boolean;
vartoreal: function( | Called to convert a variant to a value
const v: variant
):extended;
vartotdatetime: function( | Callback to convert a variant to a TDatetime value.
const v: variant
):TDateTime;
vartocurr: function( | Called to convert a variant to a value
const v: variant
):currency;
vartopstr: procedure( | Called to convert a variant to a value
var s;
const v: variant
);
vartolstr: procedure( | Called to convert a variant to a value
var s: ansistring;
const v: variant
);
vartowstr: procedure( | Called to convert a variant to a value
var s: widestring;
const v: variant
);
vartointf: procedure( | Called to convert a variant to a value
var intf: IInterface;
const v: variant
);
vartodisp: procedure( | Called to convert a variant to a value
var disp: IDispatch;
const v: variant
);
vartodynarray: procedure( | Called to convert a variant to a value
var dynarr: pointer;
const v: variant;
typeinfo: pointer
);
varfrombool: procedure( | Called to convert a value to a variant
var dest: variant;
const source: Boolean
);
varfromint: procedure( | Called to convert a value to a variant
var dest: variant;
const source: LongInt;
const Range: LongInt
);
varfromint64: procedure( | Called to convert a value to a variant
var dest: variant;
const source: Int64
);
varfromword64: procedure( | Called to convert a value to a variant
var dest: variant;
const source: QWord
);
varfromreal: procedure( | Called to convert a value to a variant
var dest: variant;
const source: extended
);
varfromtdatetime: procedure( | Callback to convert a TDateTime value to a variant.
var dest: Variant;
const source: TDateTime
);
varfromcurr: procedure( | Callback to convert a variant to a currency value.
var dest: Variant;
const source: Currency
);
varfrompstr: procedure( | Called to convert a value to a variant
var dest: variant;
const source: ShortString
);
varfromlstr: procedure( | Called to convert a value to a variant
var dest: variant;
const source: ansistring
);
varfromwstr: procedure( | Called to convert a value to a variant
var dest: variant;
const source: WideString
);
varfromintf: procedure( | Called to convert a value to a variant
var dest: variant;
const source: IInterface
);
varfromdisp: procedure( | Called to convert a value to a variant
var dest: variant;
const source: IDispatch
);
varfromdynarray: procedure( | Called to convert a value to a variant
var dest: variant;
const source: pointer;
typeinfo: pointer
);
olevarfrompstr: procedure( | Called to convert a value to a variant
var dest: olevariant;
const source: shortstring
);
olevarfromlstr: procedure( | Called to convert a value to a variant
var dest: olevariant;
const source: ansistring
);
olevarfromvar: procedure( | Called to convert a value to a variant
var dest: olevariant;
const source: variant
);
olevarfromint: procedure( | Called to convert a value to a variant
var dest: olevariant;
const source: LongInt;
const range: ShortInt
);
varop: procedure( | Called to perform a variant operation:
var left: variant;
const right: variant;
opcode: tvarop
);
cmpop: function( | Called to perform a variant operation:
const left: variant;
const right: variant;
const opcode: tvarop
):Boolean;
varneg: procedure( | Called to perform a variant operation:
var v: variant
);
varnot: procedure( | Called to perform a variant operation:
var v: variant
);
varinit: procedure( | Called to perform a variant operation:
var v: variant
);
varclear: procedure( | Called to perform a variant operation:
var v: variant
);
varaddref: procedure( | Called to perform a variant operation:
var v: variant
);
varcopy: procedure( | Called to perform a variant operation:
var dest: variant;
const source: variant
);
varcast: procedure( | Called to perform a variant operation:
var dest: variant;
const source: variant;
vartype: LongInt
);
varcastole: procedure( | Called to perform a variant operation:
var dest: variant;
const source: variant;
vartype: LongInt
);
dispinvoke: procedure( | Called to perform a variant operation:
dest: pvardata;
var source: tvardata;
calldesc: pcalldesc;
params: pointer
);
vararrayredim: procedure( | Called to perform a variant operation:
var a: variant;
highbound: SizeInt
);
vararrayget: function( | Called to perform a variant operation:
const a: variant;
indexcount: SizeInt;
indices: PLongint
):variant;
vararrayput: procedure( | Called to perform a variant operation:
var a: variant;
const value: variant;
indexcount: SizeInt;
indices: PLongint
);
writevariant: function( | Called to perform a variant operation:
var t: text;
const v: variant;
width: LongInt
):Pointer;
write0Variant: function( | Called to perform a variant operation:
var t: text;
const v: Variant
):Pointer;
end;

Description

TVariantManager describes the variant manager as expected by the SetVariantManager call.

See also

SetVariantManager

Set the current variant manager.


tvarop

Variant operation.

Declaration

Source position: varianth.inc line 91

type tvarop = (
opadd, | Variant operation: Addition.
opsubtract, | Variant operation: Substraction
opmultiply, | Variant operation: multiplication
opdivide, | Variant operation: division
opintdivide, | Variant operation: integer divide
opmodulus, | Variant operation: Modulus
opshiftleft, | Variant operation: Shift left
opshiftright, | Variant operation: Shift right
opand, | Variant operation: Binary AND operation
opor, | Variant operation: Binary OR operation
opxor, | Variant operation: binary XOR operation.
opcompare, | Variant operation: Compare
opnegate, | Variant operation: negation.
opnot, | Variant operation: Binary NOT operation.
opcmpeq, | Variant operation: Compare equal.
opcmpne, | Variant operation: Compare not equal
opcmplt, | Variant operation: Compare less than.
opcmple, | Variant operation: Compare less than or equal to
opcmpgt, | Variant operation: Compare larger than
opcmpge, | Variant operation: Compare larger than or equal
oppower | Variant operation: Power
);

Description

tvarop describes a variant operation. It is mainly used for the variant manager to implement the various conversions and mathematical operations on a variant.

See also

TVariantManager

Record describing the variant manager.


TVarRec

Record describing an element in an array of const

Declaration

Source position: objpash.inc line 401

type TVarRec = record
case VType: SizeInt of
vtInteger: (
VInteger: LongInt; | Integer value
);
vtBoolean: (
VBoolean: Boolean; | Boolean value
);
vtChar: (
VChar: Char; | Character value
);
vtWideChar: (
VWideChar: WideChar; | Widechar value
);
vtExtended: (
VExtended: PExtended; | Extended value
);
vtString: (
VString: PShortString; | String value
);
vtPointer: (
VPointer: Pointer; | Pointer value
);
vtPChar: (
VPChar: PAnsiChar; | PChar value (null-terminated string)
);
vtObject: (
VObject: TObject; | Object value (instance pointer)
);
vtClass: (
VClass: TClass; | Class pointer value (VMT pointer)
);
vtPWideChar: (
VPWideChar: PWideChar; | Widechar value
);
vtAnsiString: (
VAnsiString: Pointer; | Ansistring value
);
vtCurrency: (
VCurrency: PCurrency; | Currency value
);
vtVariant: (
VVariant: PVariant; | Variant value
);
vtInterface: (
VInterface: Pointer; | Interface value
);
vtWideString: (
VWideString: Pointer; | Widestring value
);
vtInt64: (
VInt64: PInt64; | Int64 value
);
vtUnicodeString: (
VUnicodeString: Pointer; | Unicode string value
);
vtQWord: (
VQWord: PQWord; | QWord value
);
end;

Description

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


tvartype

Type with size of variant type.

Declaration

Source position: varianth.inc line 68

type tvartype = Word;


TVmt

Virtual method table layout

Declaration

Source position: objpash.inc line 100

type TVmt = record
vInstanceSize: SizeInt; | Class instance size
vInstanceSize2: SizeInt; | Duplicate of class instance size (should equal -vInstanceSize)
vParent: PVmt; | Pointer to parent VMT
vClassName: PShortString; | Pointer to shortstring with classname
vDynamicTable: Pointer; | Pointer to table with dynamic methods.
vMethodTable: Pointer; | Pointer to table with virtual methods.
vFieldTable: Pointer; | Pointer to table with field information
vTypeInfo: Pointer; | Pointer to class type info record.
vInitTable: Pointer; | Pointer to initialization information
vAutoTable: Pointer; | Pointer to Automation interfaces table
vIntfTable: pinterfacetable; | Pointer to interfaces table
vMsgStrPtr: pstringmessagetable; | Pointer to string message dispatch table
vDestroy: CodePointer; | Pointer to destructor
vNewInstance: CodePointer; | Pointer to NewInstance method
vFreeInstance: CodePointer; | Pointer to FreeInstance method
vSafeCallException: CodePointer; | ?
vDefaultHandler: CodePointer; | Pointer to default message handler
vAfterConstruction: CodePointer; | Pointer to afterconstruction method.
vBeforeDestruction: CodePointer; | Pointer to beforeconstruction method.
vDefaultHandlerStr: CodePointer; | Pointer to default string message handler
vDispatch: CodePointer; | Dispatch method pointer
vDispatchStr: CodePointer; | DispatchStr method pointer
vEquals: CodePointer; | Equals method pointer
vGetHashCode: CodePointer; | GetHashCode method pointer
vToString: CodePointer; | ToString method pointer
end;

Description

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.

See also

PVmt

Pointer to TVMT record


TWaitForThreadTerminateHandler

Callback type for thread termination in TThreadManager.

Declaration

Source position: threadh.inc line 44

type TWaitForThreadTerminateHandler = function(

  threadHandle: TThreadID;

  TimeoutMs: LongInt

):DWord;


TWideStringManager

Record containing the various callbacks of the widestring manager.

Declaration

Source position: wstringh.inc line 37

type TWideStringManager = TUnicodeStringManager;

Description

TWideStringManager contains the definition of the widestring manager.


UCS2Char

UCS2 unicode character.

Declaration

Source position: systemh.inc line 517

type UCS2Char = WideChar;


UCS4Char

UCS unicode character (unsigned 32 bit word)

Declaration

Source position: systemh.inc line 418

type UCS4Char = type ;


UCS4String

String of UCS4Char characters.

Declaration

Source position: systemh.inc line 426

type UCS4String = array of UCS4Char;


UInt8

An unsigned 8-bits integer

Declaration

Source position: systemh.inc line 400

type UInt8 = Byte;

See also

Byte

An unsigned 8-bits integer


UInt16

An unsigned 16-bits integer

Declaration

Source position: systemh.inc line 401

type UInt16 = Word;

See also

Word

An unsigned 16-bits integer


UInt32

An unsigned 32-bits integer

Declaration

Source position: systemh.inc line 402

type UInt32 = Cardinal;

See also

LongWord | An unsigned 32-bits integer
Cardinal | An unsigned 32-bits integer.
DWord | An unsigned 32-bits integer


UInt64

Unsigned 64-bit integer

Declaration

Source position: systemh.inc line 111

type UInt64 = QWord;


UIntPtr

An unsigned integer with the same size in bytes as pointer

Declaration

Source position: systemh.inc line 403

type UIntPtr = PtrUInt;

Description

Alias for PtrUInt type for compatibility with later Delphi versions.

See also

PtrUInt

Unsigned integer type with same size as Pointer.


UnicodeChar

Unicode string character

Declaration

Source position: systemh.inc line 521

type UnicodeChar = WideChar;

Description

UnicodeChar is a single character from a UnicodeString. It equals WideChar in all respects.

See also

WideChar | The base two byte character type
UnicodeString | A string consisting of widechars.


UnicodeString

A string consisting of widechars.

Declaration

Source position: system.fpd line 28

type UnicodeString = UnicodeString;

Description

UnicodeString is a string of WideChars. The main difference with WideString is that unicodestring is reference counted, and WideString is not reference counted on Windows.


Unicode and codepage support

The system unit works with Short-, Ansi-, and UnicodeString routines for all string related operations.

Ansistrings are code-page aware, which means that code page information is associated with them. For most routines, the support for converting these code pages is natural. For some routines, care must be taken when converting from codepage-aware strings to widestring.

The codepage conversion support is influenced by the following variables:

Name | Description
DefaultSystemCodePage | Actual code page to use when CP_ACP is encountered
DefaultUnicodeCodePage | Code page for new unicode strings
DefaultFileSystemCodePage | Codepage to use when sending strings to single-byte OS filesystem routines.
DefaultRTLFileSystemCodePage | Codepage to use when receiving strings from single-byte OS filesystem routines.

The windows code page identifiers are used. There are 3 special codepage identifiers:

Name | Description
CP_ACP | Currently set default syststem cpdepage
CP_OEMCP | OEM (console) code page (only on windows)
CP_NONE | Indicates absence of code page information for a string
DefaultRTLFileSystemCodePage |

The following routines may perform code page conversions:

Name | Description
LowerCase | Return lowercase version of a string.
UpCase | Convert a string to all uppercase.
GetDir | Return the current directory
MkDir | Create a new directory.
ChDir | Change current working directory.
RmDir | Remove directory when empty.
Assign | Assign a name to a file
Erase | Delete a file from disk
Rename | Rename file on disk
Read | Read from a text file into variable
ReadLn | Read from a text file into variable and goto next line
Write | Write variable to a text file
WriteLn | Write variable to a text file and append newline
ReadStr | Read variables from a string
WriteStr | Write variables to a string
Insert | Insert one string in another.
Copy | Copy part of a string.
Delete | Delete part of a string.
SetString | Set length of a string and copy buffer.

All these routines exist also in Unicode versions.

Note that for conversion of codepages and unicode strings, a unicode manager must be present. On windows, the system is used for this. On Unix, one of the fpwidestring or cwstring units must be used.


UTF8CompareLocale

Unused, for Delphi compatibility only

Declaration

Source position: systemh.inc line 693

var UTF8CompareLocale: TSystemCodePage = ;

Description

UTF8CompareLocale is currently present for Delphi compatibility only, it is not used in FPC code.

See also

DefaultSystemCodePage | Current system codepage.
DefaultFileSystemCodePage | Codepage to use for filenames
DefaultRTLFileSystemCodePage | Code page in which to return system-returned filenames


UTF8String

UTF-8 unicode (ansi) string.

Declaration

Source position: systemh.inc line 431

type UTF8String = type ansistring;


VarAddRefProc

Callback to increase reference count of a variant.

Declaration

Source position: varianth.inc line 229

const VarAddRefProc: procedure( = Nil;

  var v: tvardata

)


varany

Variant type: Any

Declaration

Source position: varianth.inc line 58

const varany = $101;


vararray

Variant type: variant Array

Declaration

Source position: varianth.inc line 61

const vararray = $2000;


varboolean

Variant type: Boolean type

Declaration

Source position: varianth.inc line 33

const varboolean = 11;


varbyref

Variant type: By reference

Declaration

Source position: varianth.inc line 62

const varbyref = $4000;


varbyte

Variant type: Byte (8 bit)

Declaration

Source position: varianth.inc line 38

const varbyte = 17;


VarClearProc

Callback to clear a variant.

Declaration

Source position: varianth.inc line 228

const VarClearProc: procedure( = Nil;

  var v: tvardata

)


VarCopyProc

Callback to copy a variant

Declaration

Source position: varianth.inc line 230

const VarCopyProc: procedure( = Nil;

  var d: tvardata;

  const s: tvardata

)


varcurrency

Variant type: Currency

Declaration

Source position: varianth.inc line 29

const varcurrency = 6;


vardate

Variant type: Date

Declaration

Source position: varianth.inc line 27

const vardate = 7;


vardecimal

Variant type: Decimal (BCD)

Declaration

Source position: varianth.inc line 36

const vardecimal = 14;


vardispatch

Variant type: dispatch interface

Declaration

Source position: varianth.inc line 31

const vardispatch = 9;


vardouble

Variant type: Double float

Declaration

Source position: varianth.inc line 26

const vardouble = 5;


varempty

Variant type: Empty variant

Declaration

Source position: varianth.inc line 20

const varempty = 0;


varerror

Variant type: Error type

Declaration

Source position: varianth.inc line 32

const varerror = 10;


varint64

Variant type: Integer (64-Bit)

Declaration

Source position: varianth.inc line 41

const varint64 = 20;


varinteger

Variant type: Integer (32-bit)

Declaration

Source position: varianth.inc line 23

const varinteger = 3;


varlongword

Variant type: Word (32 bit)

Declaration

Source position: varianth.inc line 40

const varlongword = 19;


varnull

Variant type: Null variant

Declaration

Source position: varianth.inc line 21

const varnull = 1;


varolestr

Variant type: OLE string (widestring)

Declaration

Source position: varianth.inc line 30

const varolestr = 8;


varqword

Variant type: Word (64-bit)

Declaration

Source position: varianth.inc line 42

const varqword = 21;


varrecord

Record variant type

Declaration

Source position: varianth.inc line 44

const varrecord = 36;


varshortint

Variant type: Shortint (16 bit)

Declaration

Source position: varianth.inc line 37

const varshortint = 16;


varsingle

Variant type: Single float

Declaration

Source position: varianth.inc line 25

const varsingle = 4;


varsmallint

Variant type: smallint (8 bit)

Declaration

Source position: varianth.inc line 22

const varsmallint = 2;


varstrarg

Variant type: String

Declaration

Source position: varianth.inc line 51

const varstrarg = $48;


varstring

Variant type: String

Declaration

Source position: varianth.inc line 57

const varstring = $100;


VarToLStrProc

Callback to convert a variant to a ansistring.

Declaration

Source position: varianth.inc line 231

const VarToLStrProc: procedure( = Nil;

  var d: AnsiString;

  const s: tvardata

)


VarToWStrProc

Callback to convert a variant to a widestring.

Declaration

Source position: varianth.inc line 232

const VarToWStrProc: procedure( = Nil;

  var d: WideString;

  const s: tvardata

)


vartypemask

Variant type: Mask to extract type

Declaration

Source position: varianth.inc line 60

const vartypemask = $fff;


varuint64

Unsigned 64-bit value in a variant

Declaration

Source position: varianth.inc line 65

const varuint64 = varqword;

Description

varuint64 denotes an unsigned 64-bit value in a variant. It is one of the values found in the VType field of the variant record tvardata.

See also

tvardata

Variant record.


varunknown

Variant type: Unknown

Declaration

Source position: varianth.inc line 35

const varunknown = 13;


varustrarg

Unicode string argument value

Declaration

Source position: varianth.inc line 52

const varustrarg = $49;

Description

varustrarg denotes a unicode string argument in DispInvoke call. It will be converted to varustring in a variant.

See also

varustring

Unicode string value in Variant


varustring

Unicode string value in Variant

Declaration

Source position: varianth.inc line 59

const varustring = $102;

Description

varustring denotes a unicode string value in a variant. It is one of the values found in the VType field of the variant record tvardata.

See also

tvardata

Variant record.


varvariant

Variant type: Variant (arrays only)

Declaration

Source position: varianth.inc line 34

const varvariant = 12;


varword

Variant type: Word (16 bit)

Declaration

Source position: varianth.inc line 39

const varword = 18;


varword64

Variant type: Word (64-bit)

Declaration

Source position: varianth.inc line 64

const varword64 = varqword;


vmtAfterConstruction

VMT Layout: ?

Declaration

Source position: objpash.inc line 54

const vmtAfterConstruction = vmtMethodStart + sizeof(codepointer) * 5;


vmtAutoTable

VMT layout: ?

Declaration

Source position: objpash.inc line 44

const vmtAutoTable = vmtParent + sizeof(pointer) * 7;


vmtBeforeDestruction

VMT Layout: ?

Declaration

Source position: objpash.inc line 55

const vmtBeforeDestruction = vmtMethodStart + sizeof(codepointer) * 6;


vmtClassName

VMT Layout: location of class name.

Declaration

Source position: objpash.inc line 38

const vmtClassName = vmtParent + sizeof(pointer);


vmtDefaultHandler

VMT Layout: ?

Declaration

Source position: objpash.inc line 53

const vmtDefaultHandler = vmtMethodStart + sizeof(codepointer) * 4;


vmtDefaultHandlerStr

VMT Layout: ?

Declaration

Source position: objpash.inc line 56

const vmtDefaultHandlerStr = vmtMethodStart + sizeof(codepointer) * 7;


vmtDestroy

VMT Layout: Location of destructor pointer.

Declaration

Source position: objpash.inc line 49

const vmtDestroy = vmtMethodStart;


vmtDispatch

Offset to dispatch table

Declaration

Source position: objpash.inc line 57

const vmtDispatch = vmtMethodStart + sizeof(codepointer) * 8;

Description

vmtDispatch is the offset from the VMT start, in bytes to the dispatch table for a class.The dispatch table is used when dispatching messages in TObject.Dispatch

See also

vmtDispatchStr

Offset to string dispatch table


vmtDispatchStr

Offset to string dispatch table

Declaration

Source position: objpash.inc line 58

const vmtDispatchStr = vmtMethodStart + sizeof(codepointer) * 9;

Description

vmtDispatchStr is the offset from the VMT start, in bytes to the dispatch table for a class.The dispatch table is used when dispatching messages in TObject.DispatchStr


vmtDynamicTable

VMT Layout: location of dynamic methods table.

Declaration

Source position: objpash.inc line 39

const vmtDynamicTable = vmtParent + sizeof(pointer) * 2;


vmtEquals

Offset to the Equals method pointer

Declaration

Source position: objpash.inc line 59

const vmtEquals = vmtMethodStart + sizeof(codepointer) * 10;

Description

vmtEquals contains the offset from the VMT start, of the location of the TObject.Equals method pointer.

See also

vmtGetHashCode | Offset to the GetHashCode method pointer
vmtToString | Offset to the ToString method pointer


vmtFieldTable

VMT Layout: Location of fields table.

Declaration

Source position: objpash.inc line 41

const vmtFieldTable = vmtParent + sizeof(pointer) * 4;


vmtFreeInstance

VMT Layout: location of FreeInstance method.

Declaration

Source position: objpash.inc line 51

const vmtFreeInstance = vmtMethodStart + sizeof(codepointer) * 2;


vmtGetHashCode

Offset to the GetHashCode method pointer

Declaration

Source position: objpash.inc line 60

const vmtGetHashCode = vmtMethodStart + sizeof(codepointer) * 11;

Description

vmtGetHashCode contains the offset from the VMT start, of the location of the TObject.GetHashCode method pointer.

See also

vmtEquals | Offset to the Equals method pointer
vmtToString | Offset to the ToString method pointer


vmtInitTable

VMT Layout: ?

Declaration

Source position: objpash.inc line 43

const vmtInitTable = vmtParent + sizeof(pointer) * 6;


vmtInstanceSize

VMT Layout: Location of class instance size in VMT

Declaration

Source position: objpash.inc line 33

const vmtInstanceSize = 0;


vmtIntfTable

VMT layout: Interface table

Declaration

Source position: objpash.inc line 45

const vmtIntfTable = vmtParent + sizeof(pointer) * 8;


vmtMethodStart

VMT layout: start of method table.

Declaration

Source position: objpash.inc line 48

const vmtMethodStart = vmtParent + sizeof(pointer) * 10;


vmtMethodTable

VMT Layout: Method table start.

Declaration

Source position: objpash.inc line 40

const vmtMethodTable = vmtParent + sizeof(pointer) * 3;


vmtMsgStrPtr

VMT layout: message strings table.

Declaration

Source position: objpash.inc line 46

const vmtMsgStrPtr = vmtParent + sizeof(pointer) * 9;


vmtNewInstance

VMT Layout: location of NewInstance method.

Declaration

Source position: objpash.inc line 50

const vmtNewInstance = vmtMethodStart + sizeof(codepointer);


vmtParent

VMT Layout: location of pointer to parent VMT.

Declaration

Source position: objpash.inc line 34

const vmtParent = sizeof(SizeInt) * 2;


vmtSafeCallException

VMT Layout: ?

Declaration

Source position: objpash.inc line 52

const vmtSafeCallException = vmtMethodStart + sizeof(codepointer) * 3;


vmtToString

Offset to the ToString method pointer

Declaration

Source position: objpash.inc line 61

const vmtToString = vmtMethodStart + sizeof(codepointer) * 12;

Description

vmtToString contains the offset from the VMT start, of the location of the TObject.ToString method pointer.

See also

vmtGetHashCode | Offset to the GetHashCode method pointer
vmtEquals | Offset to the Equals method pointer


vmtTypeInfo

VMT Layout: Location of class type information.

Declaration

Source position: objpash.inc line 42

const vmtTypeInfo = vmtParent + sizeof(pointer) * 5;


vtAnsiString

TVarRec type: Ansistring

Declaration

Source position: objpash.inc line 390

const vtAnsiString = 11;


vtBoolean

TVarRec type: Boolean

Declaration

Source position: objpash.inc line 378

const vtBoolean = 1;


vtChar

TVarRec type: Char

Declaration

Source position: objpash.inc line 379

const vtChar = 2;


vtClass

TVarRec type: Class type

Declaration

Source position: objpash.inc line 387

const vtClass = 8;


vtCurrency

TVarRec type: Currency

Declaration

Source position: objpash.inc line 391

const vtCurrency = 12;


vtExtended

TVarRec type: Extended

Declaration

Source position: objpash.inc line 381

const vtExtended = 3;


vtInt64

TVarRec type: Int64 (signed 64-bit integer)

Declaration

Source position: objpash.inc line 395

const vtInt64 = 16;


vtInteger

TVarRec type: Integer

Declaration

Source position: objpash.inc line 377

const vtInteger = 0;


vtInterface

TVarRec type: Interface

Declaration

Source position: objpash.inc line 393

const vtInterface = 14;


vtObject

TVarRec type: Object instance

Declaration

Source position: objpash.inc line 386

const vtObject = 7;


vtPChar

TVarRec type: PChar

Declaration

Source position: objpash.inc line 385

const vtPChar = 6;


vtPointer

TVarRec type: pointer

Declaration

Source position: objpash.inc line 384

const vtPointer = 5;


vtPWideChar

TVarRec type: PWideChar

Declaration

Source position: objpash.inc line 389

const vtPWideChar = 10;


vtQWord

TVarRec type: QWord (unsigned 64-bit integer)

Declaration

Source position: objpash.inc line 396

const vtQWord = 17;


vtString

TVarRec type: String

Declaration

Source position: objpash.inc line 383

const vtString = 4;


vtUnicodeString

Unicode string argument

Declaration

Source position: objpash.inc line 397

const vtUnicodeString = 18;

Description

vtUnicodeString denotes a unicode string argument in the array of const. The TVarRec.VUnicodeString field will contain the actual value.


vtVariant

TVarRec type: Variant

Declaration

Source position: objpash.inc line 392

const vtVariant = 13;


vtWideChar

TVarRec type: Widechar

Declaration

Source position: objpash.inc line 388

const vtWideChar = 9;


vtWideString

TVarRec type: WideString

Declaration

Source position: objpash.inc line 394

const vtWideString = 15;


WChar

Wide char (16-bit sized char)

Declaration

Source position: systemh.inc line 516

type WChar = WideChar;


WideChar

The base two byte character type

Declaration

Source position: system.fpd line 27

type WideChar = #$0000..#$FFFF;

Description

This type is the base unit for all two byte character types, like UnicodeString and WideString

See also

UnicodeChar

Unicode string character


WideString

UTF-16 widechar encoded unicode string

Declaration

Source position: system.fpd line 29

type WideString = WideString;

Description

WideString is an alias for UnicodeString on unix. On windows, it is a different type wich has no reference counting.


widestringmanager

Current widestring manager.

Declaration

Source position: ustringh.inc line 127

var widestringmanager: TUnicodeStringManager = ;

Description

Contains the current widestring manager. Do not use directly.

See also

GetWideStringManager | Return a copy of the currently active widestring manager.
SetWideStringManager | Set the widestring manager


Word

An unsigned 16-bits integer

Declaration

Source position: system.fpd line 26

type Word = 0..65535;


WriteErrorsToStdErr

Write errors to StdErr

Declaration

Source position: systemh.inc line 719

var WriteErrorsToStdErr: Boolean = True;

Description

WriteErrorsToStdErr can be set to True to write error messages (run-time errors, exceptions) to StdErr instead of to standard output. This is the default behaviour. When set to False, error message will be written to standar output.

See also

Halt | Stop program execution.
RunError | Generate a run-time error.


ConfigExtension

Default application configuration file extension.

Declaration

Source position: osutilsh.inc line 49

const ConfigExtension: string = '.cfg';

Description

ConfigExtension is the default extension used by the GetAppConfigFile call. It can be set to any valid extension for the current OS.


Miscellaneous conversion routines

Functions for various conversions.

Name | Description
BCDToInt | Convert BCD number to integer
CompareMem | Compare two memory regions
FloatToStrF | Convert float to formatted string
FloatToStr | Convert float to string
FloatToText | Convert float to string
FormatFloat | Format a floating point value
GetDirs | Split string in list of directories
IntToHex | return hexadecimal representation of integer
IntToStr | return decumal representation of integer
StrToIntDef | Convert string to integer with default value
StrToInt | Convert string to integer
StrToFloat | Convert string to float
TextToFloat | Convert null-terminated string to float


CPUEndian

Current CPU endianness

Declaration

Source position: syshelph.inc line 12

const CPUEndian = TEndian.Big;

Description

CPUEndian describes whether the current CPU is little or big endian.

See also

TEndian

Endianness of a CPU


CurrencyDecimals

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

CurrencyDecimals (deprecated)

Number of decimals in currency amounts.

Declaration

Source position: sysinth.inc line 140

var CurrencyDecimals: Byte = ;

Description

CurrencyDecimals is the number of decimals to be used when formatting a currency. It is used by the float formatting routines. The initialization routines of the SysUtils unit initialize this string with a value conforming to the regional preferences of the user or system regional default.

This constant is deprecated. You should use DefaultFormatSettings.CurrencyFormat instead.

See also

Format | Format a string with given arguments.
DecimalSeparator | Decimal point separator.
DefaultFormatSettings | Storage for default settings


CurrencyFormat

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

CurrencyFormat (deprecated)

Format string for currencies.

Declaration

Source position: sysinth.inc line 149

var CurrencyFormat: Byte = ;

Description

CurrencyFormat is the default format string for positive currencies. It is used by the float formatting routines. The initialization routines of the SysUtils unit initialize this string with a value conforming to the regional preferences of the user or system regional default.

This constant is deprecated. You should use DefaultFormatSettings.CurrencyFormat instead.

See also

CurrencyDecimals | Number of decimals in currency amounts.
NegCurrFormat | Format string for negative currencies.
CurrencyString | Name of currency.
Format | Format a string with given arguments.
FloatToText | Return a string representation of a float, with a given format.
DefaultFormatSettings | Storage for default settings


CurrencyString

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

CurrencyString (deprecated)

Name of currency.

Declaration

Source position: sysinth.inc line 167

var CurrencyString: string = ;

Description

CurrencyString is the currency symbol for the current locale. It is used by the float formatting routines. The initialization routines of the SysUtils unit initialize this string with a value conforming to the regional preferences of the user or system regional default.

This constant is deprecated. You should use DefaultFormatSettings.CurrencyString instead.

See also

CurrencyDecimals | Number of decimals in currency amounts.
NegCurrFormat | Format string for negative currencies.
CurrencyFormat | Format string for currencies.
Format | Format a string with given arguments.
FloatToText | Return a string representation of a float, with a given format.
DefaultFormatSettings | Storage for default settings


DecimalSeparator

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

DecimalSeparator (deprecated)

Decimal point separator.

Declaration

Source position: sysinth.inc line 134

var DecimalSeparator: Char = ;

Description

DecimalSeparator is used to display the decimal symbol in floating point numbers or currencies. It is used by the float formatting routines. The initialization routines of the SysUtils unit initialize this string with a value conforming to the regional preferences of the user or system regional default.

This constant is deprecated. You should use DefaultFormatSettings.DecimalSeparator instead.

See also

ThousandSeparator | Thousand grouping character.
Format | Format a string with given arguments.
FormatFloat | Format a float according to a certain mask.
FloatToStr | Convert a float value to a string using a fixed format.
DefaultFormatSettings | Storage for default settings


DefaultFormatSettings

Storage for default settings

Declaration

Source position: sysinth.inc line 57

var DefaultFormatSettings: TFormatSettings = (CurrencyFormat: 1; NegCurrFormat: 5; ThousandSeparator: ','; DecimalSeparator: '.'; CurrencyDecimals: 2; DateSeparator: '-'; TimeSeparator: ':'; ListSeparator: ','; CurrencyString: '$'; ShortDateFormat: 'd/m/y'; LongDateFormat: 'dd" "mmmm" "yyyy'; TimeAMString: 'AM'; TimePMString: 'PM'; ShortTimeFormat: 'hh:nn'; LongTimeFormat: 'hh:nn:ss'; ShortMonthNames: ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); LongMonthNames: ('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); ShortDayNames: ('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'); LongDayNames: ('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'); TwoDigitYearCenturyWindow: 50);

Description

DefaultFormatSettings contains the default settings for all type of formatting constants. If no thread-specific values are specified when a formatting function is called, this record is used as a default.

All other formatting constants refer to the fields of this variable using absolute addressing.

See also

ShortMonthNames | Names of months, abbreviated form.
LongMonthNames | Full names of months.
ShortDayNames | Names of days, abbreviated form.
LongDayNames | Full names of days.


DriveDelim

Drive letter delimiter

Declaration

Source position: sysutilh.inc line 271

const DriveDelim = DriveSeparator;

Description

DriveDelim refers to the system unit's DriveSeparator constant, it is for Delphi compatibility only.

See also

PathDelim | Path (directory) delimiter.
PathSep | Path separator. (Separates paths in search path lists)


EHeapException

Heap exception

Declaration

Source position: sysutilh.inc line 169

type EHeapException = EHeapMemoryError;

Description

EHeapMemoryError is raised when an error occurs in the heap management routines.

See also

EHeapMemoryError | Heap memory error
EoutOfMemory | Out of memory error.
EInvalidPointer | Invalid pointer operation


EmptyStr

Empty String Constant

Declaration

Source position: sysstrh.inc line 55

const EmptyStr: string = '';


EmptyWideStr

Empty wide string.

Declaration

Source position: sysstrh.inc line 58

const EmptyWideStr: WideString = '';


ExceptClass

Exception Class reference

Declaration

Source position: sysutilh.inc line 129

type ExceptClass = class of Exception;

Description

ExceptClass is a Exception class reference.

See also

Exception

Base class of all exceptions.


faAnyFile

Match any file

Declaration

Source position: filutilh.inc line 97

const faAnyFile = $000001FF;

Description

Use this attribute in the FindFirst call to find all matching files.

See also

FindFirst

Start a file search and return a findhandle


faArchive

Archive bit is set

Declaration

Source position: filutilh.inc line 90

const faArchive = $00000020;

Description

Attribute of a file, meaning the file has the archive bit set. Used in TSearchRec and FindFirst

See also

TSearchRec | Record describing a search handle or result
FindFirst | Start a file search and return a findhandle


faCompressed

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

faCompressed (platform)

Compressed file attribute

Declaration

Source position: filutilh.inc line 94

const faCompressed = $00000800;

Description

faTemporary can be returned by FindFirst or FindNext to indicate that a returned file is compressed (on filesystems that support this).

See also

faDirectory | File is a directory
faArchive | Archive bit is set
faHidden | Hidden file.
faEncrypted | Encrypted file attribute
faNormal | Normal file attribute
FindFirst | Start a file search and return a findhandle
FindNext | Find the next entry in a findhandle.


faDirectory

File is a directory

Declaration

Source position: filutilh.inc line 89

const faDirectory = $00000010;

Description

Attribute of a file, meaning the file is a directory. Used in TSearchRec and FindFirst

See also

TSearchRec | Record describing a search handle or result
FindFirst | Start a file search and return a findhandle


faEncrypted

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

faEncrypted (platform)

Encrypted file attribute

Declaration

Source position: filutilh.inc line 95

const faEncrypted = $00004000;

Description

faEncrypted can be returned by FindFirst or FindNext to indicate that a returned file is encrypted (on filesystems that support this).

See also

faDirectory | File is a directory
faArchive | Archive bit is set
faHidden | Hidden file.
faCompressed | Compressed file attribute
faNormal | Normal file attribute
FindFirst | Start a file search and return a findhandle
FindNext | Find the next entry in a findhandle.


faHidden

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

faHidden (platform)

Hidden file.

Declaration

Source position: filutilh.inc line 86

const faHidden = $00000002;

Description

Attribute of a file, meaning the file is read-only. Used in TSearchRec and FindFirst

See also

TSearchRec | Record describing a search handle or result
FindFirst | Start a file search and return a findhandle


FalseBoolStrs

False Strings used in StrToBool conversion

Declaration

Source position: sysstrh.inc line 62

var FalseBoolStrs: array of string = ;

Description

FalseBoolStrs contains the strings that will result in a False return value by StrToBool.

See also

FalseBoolStrs | False Strings used in StrToBool conversion
StrToBool | Convert a string to a boolean value


faNormal

Normal file attribute

Declaration

Source position: filutilh.inc line 91

const faNormal = $00000080;

Description

faNormal can be used in FindFirst to indicate that normal files must be included in the result.

See also

faTemporary | Temporary file attribute
faDirectory | File is a directory
faArchive | Archive bit is set
faHidden | Hidden file.
FindFirst | Start a file search and return a findhandle
faCompressed | Compressed file attribute
faEncrypted | Encrypted file attribute


faReadOnly

Read-Only file.

Declaration

Source position: filutilh.inc line 85

const faReadOnly = $00000001;

Description

Attribute of a file, meaning the file is read-only. Used in TSearchRec and FindFirst

See also

TSearchRec | Record describing a search handle or result
FindFirst | Start a file search and return a findhandle


faSymLink

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

faSymLink (platform)

File is a symlink

Declaration

Source position: filutilh.inc line 93

const faSymLink = $00000400;

Description

faSymLink means the file (as returned e.g. by FindFirst/FindNext), is a symlink. It's ignored under Windows.

See also

FindFirst | Start a file search and return a findhandle
FindNext | Find the next entry in a findhandle.
TSearchRec | Record describing a search handle or result


faSysFile

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

faSysFile (platform)

System file (Dos/Windows only)

Declaration

Source position: filutilh.inc line 87

const faSysFile = $00000004;

Description

Attribute of a file, meaning the file is a system file. Used in TSearchRec and FindFirst

See also

TSearchRec | Record describing a search handle or result
FindFirst | Start a file search and return a findhandle


faTemporary

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

faTemporary (platform)

Temporary file attribute

Declaration

Source position: filutilh.inc line 92

const faTemporary = $00000100;

Description

faTemporary can be returned by FindFirst or FindNext to indicate that a returned file is a temporary file.

See also

faDirectory | File is a directory
faArchive | Archive bit is set
faHidden | Hidden file.
faCompressed | Compressed file attribute
faEncrypted | Encrypted file attribute
faNormal | Normal file attribute
FindFirst | Start a file search and return a findhandle
FindNext | Find the next entry in a findhandle.


faVirtual

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

faVirtual (platform)

Virtual file attribute

Declaration

Source position: filutilh.inc line 96

const faVirtual = $00010000;

Description

faVirtual can be returned by FindFirst or FindNext to indicate that a returned file is virtual (on filesystems that support this).

See also

faDirectory | File is a directory
faArchive | Archive bit is set
faHidden | Hidden file.
faCompressed | Compressed file attribute
faVirtual | Virtual file attribute
faEncrypted | Encrypted file attribute
faNormal | Normal file attribute
FindFirst | Start a file search and return a findhandle
FindNext | Find the next entry in a findhandle.


faVolumeId

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

faVolumeId (deprecated, platform)

Volume id (Fat filesystem, Dos/Windows only)

Declaration

Source position: filutilh.inc line 88

const faVolumeId = $00000008;

Description

Attribute of a file, meaning the entry contains the volume ID. Used in TSearchRec and FindFirst

See also

TSearchRec | Record describing a search handle or result
FindFirst | Start a file search and return a findhandle


feInvalidHandle

FileOpen error value

Declaration

Source position: filutilh.inc line 117

const feInvalidHandle: THandle = THandle(- 1);

Description

feInvalidHandle is the return value of FileOpen in case of an error.

See also

FileOpen

Open an existing file and return a filehandle


FileName handling routines

Functions for file manipulation.

Name | Description
AnsiCompareFileName | Compare 2 filenames
AnsiLowerCaseFileName | Create lowercase filename
AnsiUpperCaseFileName | Create uppercase filename
AddDisk | Add disk to list of disk drives
ChangeFileExt | Change extension of file name
CreateDir | Create a directory
DeleteFile | Delete a file
DiskFree | Free space on disk
DiskSize | Total size of disk
ExpandFileName | Create full file name
ExpandFileNameCase | Create full file name case insensitively
ExpandUNCFileName | Create full UNC file name
ExtractFileDir | Extract drive and directory part of filename
ExtractFileDrive | Extract drive part of filename
ExtractFileExt | Extract extension part of filename
ExtractFileName | Extract name part of filename
ExtractFilePath | Extrct path part of filename
ExtractRelativePath | Construct relative path between two files
FileAge | Return file age
FileDateToDateTime | Convert file date to system date
FileExists | Determine whether a file exists on disk
FileGetAttr | Get attributes of file
FileGetDate | Get date of last file modification
FileSearch | Search for file in path
FileSetAttr | Get file attributes
FileSetDate | Get file dates
FindFirst | Start finding a file
FindNext | Find next file
GetCurrentDir | Return current working directory
RemoveDir | Remove a directory from disk
RenameFile | Rename a file on disk
SameFileName | Check whether 2 filenames are the same
SetCurrentDir | Set current working directory
SetDirSeparators | Set directory separator characters
FindClose | Stop searching a file
DoDirSeparators | Replace directory separator characters


fmOpenRead

Open file in read-only mode

Declaration

Source position: filutilh.inc line 101

const fmOpenRead = $0000;

Description

fmOpenRead is used in the FileOpen call to open a file in read-only mode.

See also

FileOpen

Open an existing file and return a filehandle


fmOpenReadWrite

Open file in read/write mode.

Declaration

Source position: filutilh.inc line 103

const fmOpenReadWrite = $0002;

Description

fmOpenReadWrite is used in the FileOpen call to open a file in read-write mode.

See also

FileOpen

Open an existing file and return a filehandle


fmOpenWrite

Open file in write-only mode

Declaration

Source position: filutilh.inc line 102

const fmOpenWrite = $0001;

Description

fmOpenWrite is used in the FileOpen call to open a file in write-only mode.

See also

FileOpen

Open an existing file and return a filehandle


fmShareCompat

Open file in DOS share-compatibility mode

Declaration

Source position: filutilh.inc line 105

const fmShareCompat = $0000;

Description

fmOpenShareCompat is used in the FileOpen call OR-ed together with one of fmOpenReadWrite, fmOpenRead or fmOpenWrite,to open a file in a sharing modus that is equivalent to sharing implemented in MS-DOS.

See also

FileOpen

Open an existing file and return a filehandle


fmShareDenyNone

Do not lock file.

Declaration

Source position: filutilh.inc line 109

const fmShareDenyNone = $0040;

Description

fmShareDenyNone is used in the FileOpen call OR-ed together with one of fmOpenReadWrite, fmOpenRead or fmOpenWrite, to open a file so other processes can read/write the file as well.

See also

FileOpen

Open an existing file and return a filehandle


fmShareDenyRead

Lock file so other processes cannot read.

Declaration

Source position: filutilh.inc line 108

const fmShareDenyRead = $0030;

Description

fmOpenShareRead is used in the FileOpen call OR-ed together with one of fmOpenReadWrite, fmOpenRead or fmOpenWrite, to open a file so other processes cannot read from it.

This constant only works on Windows, because other operating systems do not support this constants.

See also

FileOpen

Open an existing file and return a filehandle


fmShareDenyWrite

Lock file so other processes can only read.

Declaration

Source position: filutilh.inc line 107

const fmShareDenyWrite = $0020;

Description

fmOpenShareDenyWrite is used in the FileOpen call OR-ed together with one of fmOpenReadWrite, fmOpenRead or fmOpenWrite, to open a file so other processes cannot write to it, they can only read.

See also

FileOpen

Open an existing file and return a filehandle


fmShareExclusive

Lock file for exclusive use

Declaration

Source position: filutilh.inc line 106

const fmShareExclusive = $0010;

Description

fmOpenShareExclusive is used in the FileOpen call OR-ed together with one of fmOpenReadWrite, fmOpenRead or fmOpenWrite, to open a file exclusively.

See also

FileOpen

Open an existing file and return a filehandle


Date and time formatting characters

Various date and time formatting routines accept a format string to format the date and or time. The following characters can be used to control the date and time formatting:

c
Formats date using shortdateformat and formats time using longtimeformat if the time is not zero.
f
Same as c, but adds the time even if it is zero.
d
day of month
dd
day of month (leading zero)
ddd
day of week (abbreviation)
dddd
day of week (full)
ddddd
shortdateformat
dddddd
longdateformat
m
month or minutes if preceded by h or hh specifiers.
mm
month or minutes if preceded by h or hh specifiers, with leading zero.
mmm
month (abbreviation)
mmmm
month (full)
y
year (2 digits)
yy
year (two digits)
yyyy
year (with century)
h
hour
hh
hour (leading zero)
n
minute
nn
minute (leading zero)
s
second
ss
second (leading zero)
t
shorttimeformat
tt
longtimeformat
am/pm
use 12 hour clock and display am and pm accordingly
a/p
use 12 hour clock and display a and p accordingly
/
insert date seperator
:
insert time seperator
"xx"
literal text
'xx'
literal text
z
milliseconds
zzz
milliseconds(leading zero)
[h]
hours including the hours of the full days (i.e. can be > 24).
[hh]
hours with leading zero, including the hours of the full days (i.e. can be > 24)
[n]
minutes including the minutes of the full hours and days
[nn]
minutes with leading zero, including the minutes of the full hours and days
[s]
seconds including the seconds of the full minutes, hours and days.
[ss]
seconds with leading zero, including the seconds of the full minutes, hours and days.

The forms in square brackets are only allowed if the fdPeriod option is included in the Options argument of FormatDateTime.

The date and time separators are taken from the DefaultFormatSettings record, unless a TFormatSettings record is passed to the FormatDateTime function.

Note that to include any of the above characters literally in the result string, they must be enclosed in double quotes.

See also

DefaultFormatSettings | Storage for default settings
TFormatSettings | Record with all the strings that determine formatting
FormatDateTime | Return a string representation of a TDateTime value with a given format.


FormatSettings

Alias for DefaultFormatSettings

Declaration

Source position: sysinth.inc line 82

var FormatSettings: TFormatSettings = ;

Description

FormatSettings is provided for Delphi compatibility, and refers to the DefaultFormatSettings variable.

See also

DefaultFormatSettings

Storage for default settings


Formatting strings

Functions for formatting strings.

Name | Description
AdjustLineBreaks | Convert line breaks to line breaks for system
FormatBuf | Format a buffer
Format | Format arguments in string
FmtStr | Format buffer
QuotedStr | Quote a string
StrFmt | Format arguments in a string
StrLFmt | Format maximum L characters in a string
TrimLeft | Remove whitespace at the left of a string
TrimRight | Remove whitespace at the right of a string
Trim | Remove whitespace at both ends of a string


fsFromBeginning

Start seek operation from beginning of file.

Declaration

Source position: filutilh.inc line 112

const fsFromBeginning = 0;

Description

fsFromBeginning is used to indicate in the FileSeek call that a seek operation should be started at the start of the file.

See also

FileSeek

Set the current file position on a file handle.


fsFromCurrent

Start seek operation from current position in file.

Declaration

Source position: filutilh.inc line 113

const fsFromCurrent = 1;

Description

fsFromBeginning is used to indicate in the FileSeek call that a seek operation should be started at the current position in the file.

See also

FileSeek

Set the current file position on a file handle.


fsFromEnd

Start seek operation from end of file.

Declaration

Source position: filutilh.inc line 114

const fsFromEnd = 2;

Description

fsFromBeginning is used to indicate in the FileSeek call that a seek operation should be started at the last position in the file.

See also

FileSeek

Set the current file position on a file handle.


GUID_NULL

NULL GUID constant

Declaration

Source position: intfh.inc line 16

const GUID_NULL: TGuid = '{00000000-0000-0000-0000-000000000000}';


HexDisplayPrefix

String to prepend to hexadecimal values

Declaration

Source position: sysutilh.inc line 266

const HexDisplayPrefix: string = '$';

Description

HexDisplayPrefix is used by the formatting routines to indicate that the number which follows the prefix is in Hexadecimal notation.

Errors

Currently unused in Free Pascal.


HoursPerDay

Number of hours in a day.

Declaration

Source position: datih.inc line 25

const HoursPerDay = 24;


Reference for unit 'sysutils'

Various system utilities.

uses
System, | The system unit
Linux, | Linux-specific operating system calls.
Unix, | Extended Unix functionality.
errors, | Convert unix error codes to string message
sysconst, | Resource strings
unixtype; | Basic unix types

Overview

This documentation describes the sysutils unit. The sysutils unit was started by Gertjan Schouten, and completed by Michael Van Canneyt. It aims to be compatible to the Delphi sysutils unit, but in contrast with the latter, it is designed to work on multiple platforms. It is implemented on all supported platforms.

Related topics

TypeHelpers | Type Helpers for basic types
Localization | Localization support
UnicodeAndCodePages | Unicode and codepage awareness
ConversionRoutines | Miscellaneous conversion routines
DateTimeRoutines | Date/time routines
FileNameRoutines | FileName handling routines
IORoutines | File input/output routines
PCharFunctions | PChar related functions
FormatChars | Date and time formatting characters
FormatStrings | Formatting strings
StringFunctions | String functions


Reference for unit 'sysutils': Constants

ConfigExtension | Default application configuration file extension.
CPUEndian | Current CPU endianness
DateDelta | Days between 1/1/0001 and 12/31/1899
DriveDelim | Drive letter delimiter
EmptyStr | Empty String Constant
EmptyWideStr | Empty wide string.
faAnyFile | Match any file
faArchive | Archive bit is set
faCompressed | Compressed file attribute
faDirectory | File is a directory
faEncrypted | Encrypted file attribute
faHidden | Hidden file.
faNormal | Normal file attribute
faReadOnly | Read-Only file.
faSymLink | File is a symlink
faSysFile | System file (Dos/Windows only)
faTemporary | Temporary file attribute
faVirtual | Virtual file attribute
faVolumeId | Volume id (Fat filesystem, Dos/Windows only)
feInvalidHandle | FileOpen error value
fmOpenRead | Open file in read-only mode
fmOpenReadWrite | Open file in read/write mode.
fmOpenWrite | Open file in write-only mode
fmShareCompat | Open file in DOS share-compatibility mode
fmShareDenyNone | Do not lock file.
fmShareDenyRead | Lock file so other processes cannot read.
fmShareDenyWrite | Lock file so other processes can only read.
fmShareExclusive | Lock file for exclusive use
fsFromBeginning | Start seek operation from beginning of file.
fsFromCurrent | Start seek operation from current position in file.
fsFromEnd | Start seek operation from end of file.
GUID_NULL | NULL GUID constant
HexDisplayPrefix | String to prepend to hexadecimal values
HoursPerDay | Number of hours in a day.
JulianEpoch | Starting point of the Julian calendar
LeadBytes | Lead bytes in Multi-Byte character sets
MaxCurrency | Maximum currency value
MaxDateTime | Maximum TDateTime value.
MAX_PATH | Maximum length of a fully qualified filename (including path)
MinCurrency | Minimum Currency value
MinDateTime | Minimum TDateTime value.
MinsPerDay | Number of minutes per day.
MinsPerHour | Number of minutes per hour.
MonthDays | Array with number of days in the months for leap and non-leap years.
MSecsPerDay | Number of milliseconds per day
MSecsPerSec | Number of milliseconds per second
NullStr | Pointer to an empty string
PathDelim | Path (directory) delimiter.
PathSep | Path separator. (Separates paths in search path lists)
pfBCB4Produced | Not used in Free Pascal.
pfDelphi4Produced | Not used in Free Pascal.
pfDesignOnly | Package is a design-time only package
pfExeModule | Package is an executable
pfIgnoreDupUnits | Ignore duplicate units in package
pfLibraryModule | Package is a library
pfModuleTypeMask | Mask for module type flags
pfNeverBuild | Never-build flag was specified when compiling package
pfPackageModule | Package is a real package (not exe)
pfProducerMask | Mask for producer flags
pfProducerUndefined | Not used in Free Pascal.
pfRunOnly | Package is a run-time only package
pfV3Produced | Not used in Free Pascal.
RTL_SIGBUS | Bus error signal number (Unix only)
RTL_SIGDEFAULT | Default signal handler (Unix only)
RTL_SIGFPE | Floating Point Error signal number (Unix only)
RTL_SIGILL | Illegal instruction signal number (Unix only)
RTL_SIGINT | INTERRUPT signal number (Unix only)
RTL_SIGLAST | Last signal number (Unix only)
RTL_SIGQUIT | QUIT signal number (Unix only)
RTL_SIGSEGV | Segmentation fault signal number (Unix only)
SecsPerDay | Number of seconds per day
SecsPerMin | Number of seconds per minute
SwitchChars | Characters which start a command-line switch
SysConfigDir | System configuration directory.
ufImplicitUnit | Unit was implicitly imported into package (did not appear in package contains list)
ufMainUnit | Unit is the main unit of the package
ufOrgWeakUnit | Unit is the original weak packaged unit
ufPackageUnit | Unit is a packaged unit (appeared in package contains list)
ufWeakPackageUnit | Weak (original or not) packaged unit
ufWeakUnit | Unit is a weak packaged unit
UnixDateDelta | Number of days between 1.1.1900 and 1.1.1970
UnixEpoch | Starting point of the unix calendar (1/1/1970)


Reference for unit 'sysutils': Types

EHeapException | Heap exception
ExceptClass | Exception Class reference
Int128Rec | Record representing a 128-bit unsigned integer.
Int64Rec | Record describing an Int64 value
LongRec | Record describing a longint value
OWordRec | Identical to the Int128Rec record.
PByteArray | Pointer to an array of byte.
PDayTable | Pointer to TDayTable type.
PString | Pointer to a ansistring
PSysCharSet | Pointer to TSysCharSet type.
PWordarray | Pointer to an array of word.
TArray | Generic array definition
TBeepHandler | Beep handler prototype
TByteArray | Array of bytes
TBytes | Array of byte
TCharArray | Array of characters
TCompareOption | String compare options
TCompareOptions | Set of string compare options
TCreateGUIDFunc | Callback prototype to create GUIDs
TDayTable | Array of day names.
TEndian | Endianness of a CPU
TEventType | Log event type
TEventTypes | Set of TEventType
TExecuteFlags | Flags for ExecuteProcess
TFilename | Filename type
TFilenameCaseMatch | Type describing how ExpandFileNameCase found the resulting filename
TFilenameCaseMatch | Type describing how ExpandFileNameCase found the resulting filename
TFileRec | Record describing an untyped file.
TFileSearchOption | Options for the FileSearch call.
TFileSearchOptions | Set of TFileSearchOption
TFloatFormat | Formats for the FloatToText function.
TFloatRec | Record descriing a float value
TFloatValue | Type of float to return in the buffer for TextToFloat.
TFormatDateTimeOption | Additional options for FormatDateTime
TFormatDateTimeOptions | Set of TFormatDateTimeOption
TFormatSettings | Record with all the strings that determine formatting
TGetAppNameEvent | Callback type to get customized application name.
TGetTempDirEvent | Function prototype for OnGetTempDir handler.
TGetTempFileEvent | Function prototype for OnGetTempFile handler.
TGetVendorNameEvent | Prototype for OnGetVendorName event.
THandle | File Handle type.
TIntegerSet | Set with size of integer.
TMbcsByteType | Type of multi-byte character set.
TMonthNameArray | Array type for array of month variables
TProcedure | Procedural type
TRawbyteSearchRec | Record describing a search handle or result (single-byte string version)
TReplaceFlags | Flags for StringReplace function
TSearchRec | Record describing a search handle or result
TSignalState | State of the signal handler (unix only)
TStringArray | Dynamic array of strings
TStringSplitOptions | String split options used in TSTringHelper.Split
TSysCharSet | Set of characters.
TSysLocale | Type describing the current locale
TSystemTime | System time structure
TTerminateProc | Terminate procedure procedural variable.
TTextRec | Record describing a text file.
TTimeStamp | TimeStamp structure
TUnicodeCharArray | Array of UnicodeChar
TUnicodeSearchRec | Unicode searchrec record
TUseBoolStrs | Use boolean strings
TWeekNameArray | Array of 7 Strings for week day names
TWordArray | Array of word (Unsigned 16 bit integer)
WordRec | Record describing a word value.


Reference for unit 'sysutils': Classes

EAbort | Abort error.
EAbstractError | Abstract error.
EAccessViolation | Access Violation error
EArgumentException | Invalid argument passed to a function
EArgumentNilException | Exception raised when a required argument is Nil.
EArgumentOutOfRangeException | Argument out of valid range passed to a function
EAssertionFailed | Assertion failed error.
EBusError | Bus error exception
EControlC | Control-C (abort) was pressed on the console.
EConvertError | Conversion error.
EDirectoryNotFoundException | Exception raised when a directory is not found.
EDivByZero | Division by zero error.
EEncodingError | Exception raised by the TEncoding class.
EExternal | External Exception.
EExternalException | External exception
EFileNotFoundException | Exception raised when a file is not found.
EFormatError | Formatting error exception
EHeapMemoryError | Heap memory error
EInOutError | Input/Output error
EInterror | Integer operation error.
EIntfCastError | Invalid interface cast error.
EIntOverflow | Integer overflow error.
EInvalidCast | Invalid typecast error.
EInvalidContainer | Invalid container error.
EInvalidInsert | Invalid insert error.
EInvalidOp | Invalid operation.
EInvalidPointer | Invalid pointer operation
EMathError | Mathematical error
ENoConstructException | Error raised when instantiating a TCharacter class
ENoThreadSupport | No Thread support error.
ENotImplemented | Exception raised in case of a not implemented feature.
ENotSupportedException | Exception raised when a feature is not supported.
ENoWideStringSupport | Exception raised if no widestring support is available in the executable
EObjectCheck | A Nil object reference was encountered
EOSError | Operating system error.
EOutOfMemory | Out of memory error.
EOverflow | Float overflow error.
EPackageError | Package error.
EPathNotFoundException | Exception raised when a path is not found.
EPathTooLongException | Exception raised when a path name is too long.
EPrivilege | Privileged instruction error.
EPropReadOnly | Read-only property error.
EPropWriteOnly | Write-only property error.
ERangeError | Range check error.
ESafecallException | SafeCall exception.
EStackOverflow | Stack overflow error.
EUnderflow | Float underflow error
EVariantError | Variant error.
Exception | Base class of all exceptions.
EZeroDivide | Division by zero error.
IReadWriteSync | Read/Write synchronizer
TBigEndianUnicodeEncoding | Big-endian UTF-16 unicode encoding
TBooleanHelper | Helper for the Boolean type.
TByteBoolHelper | Helper for the ByteBool type.
TByteHelper | Helper for a byte-typed ordinal value
TCardinalHelper | Helper for a Cardinal-typed ordinal value
TDoubleHelper | Helper for Double floating point type
TEncoding | Encoding support
TExtendedHelper | Helper for Extended floating point type
TGuidHelper | Helper type for TGUID
TInt64Helper | Helper for a Int64-typed ordinal value
TIntegerHelper | Helper for a Integer-typed ordinal value
TLongBoolHelper | Helper for the LongBool type.
TMBCSEncoding | Multi-Byte character set encoding
TMultiReadExclusiveWriteSynchronizer | Standard implementation of a IReadWriteSync interface
TNativeIntHelper | Helper for a NativeInt-typed ordinal value
TNativeUIntHelper | Helper for a NativeUInt-typed ordinal value
TQWordHelper | Helper for a QWord-typed ordinal value
TShortIntHelper | Helper for a ShortInt-typed ordinal value
TSimpleRWSync | Read/Write synchronizing object.
TSingleHelper | Helper for Single floating point type
TSmallIntHelper | Helper for a SmallInt-typed ordinal value
TStringHelper | Helper type for strings.
TUnicodeEncoding | UTF-16 unicode encoding
TUTF7Encoding | UTF-7 unicode encoding
TUTF8Encoding | UTF-8 unicode encoding
TWordBoolHelper | Helper for the WordBool type.
TWordHelper | Helper for a Word-typed ordinal value


Reference for unit 'sysutils': Procedures and functions

AbandonSignalHandler | Abandon the signal handler
Abort | Abort program execution.
AddDisk | Add a disk to the list of known disks (Unix only)
AddTerminateProc | Add a procedure to the exit chain.
AdjustLineBreaks | Convert possible line-endings to the currently valid line ending.
AnsiCompareFileName | Compare 2 filenames.
AnsiCompareStr | Compare 2 ansistrings, case sensitive, ignoring accents characters.
AnsiCompareText | Compare 2 ansistrings, case insensitive, ignoring accents characters.
AnsiDequotedStr | Extract string without quotes
AnsiExtractQuotedStr | Removes the first quoted string from a string.
AnsiLastChar | Return a pointer to the last character of a string.
AnsiLowerCase | Return a lowercase version of a string.
AnsiLowerCaseFileName | Convert filename to lowercase.
AnsiPos | Return Position of one ansistring in another.
AnsiQuotedStr | Return a quoted version of a string.
AnsiSameStr | Checks whether 2 strings are the same (case sensitive)
AnsiSameText | Checks whether 2 strings are the same (case insensitive)
AnsiStrComp | Compare two null-terminated strings. Case sensitive.
AnsiStrIComp | Compare two null-terminated strings. Case insensitive.
AnsiStrLastChar | Return a pointer to the last character of a string.
AnsiStrLComp | Compare a limited number of characters of 2 strings
AnsiStrLIComp | Compares a given number of characters of a string, case insensitive.
AnsiStrLower | Convert a null-terminated string to all-lowercase characters.
AnsiStrPos | Return position of one null-terminated substring in another
AnsiStrRScan | Find last occurrence of a character in a null-terminated string.
AnsiStrScan | Find first occurrence of a character in a null-terminated string.
AnsiStrUpper | Convert a null-terminated string to all-uppercase characters.
AnsiUpperCase | Return an uppercase version of a string, taking into account special characters.
AnsiUpperCaseFileName | Convert filename to uppercase.
AppendStr | Append one ansistring to another.
ApplicationName | Return a default application name
AssignStr | Assigns an ansistring to a null-terminated string.
BCDToInt | Convert a BCD coded integer to a normal integer.
Beep | Sound the system bell.
BoolToStr | Convert a boolean value to a string.
ByteLength | Length (in bytes) of a unicodestring
BytesOf | Return the bytes in a string
ByteToCharIndex | Convert a character index in Bytes to an Index in characters
ByteToCharLen | Convert a length in bytes to a length in characters.
ByteType | Return the type of byte in an ansistring for a multi-byte character set
CallTerminateProcs | Call the exit chain procedures.
ChangeFileExt | Change the extension of a filename.
CharInSet | Check whether a char is in a set of characters
CharToByteLen | Convert a length in characters to a length in bytes.
CodePageNameToCodePage | Return a numeric identifier for the codepage.
CodePageToCodePageName | Convert a numeric codepage identifier to a codepage name
CompareMem | Compare two memory areas.
CompareMemRange | Compare 2 memory locations
CompareStr | Compare 2 ansistrings case-sensitively, ignoring special characters.
CompareText | Compare 2 ansistrings case insensitive.
ComposeDateTime | Add a date and time
ConcatPaths | Concatenate an array of paths to form a single path
CreateDir | Create a new directory
CreateGUID | Create a new GUID
CurrentYear | Return the current year
CurrToStr | Convert a currency value to a string.
CurrToStrF | Format a currency to a string
Date | Return the current date.
DateTimeToFileDate | Convert a TDateTime value to a file age (integer)
DateTimeToStr | Converts a TDateTime value to a string using a predefined format.
DateTimeToString | Converts a TDateTime value to a string with a given format.
DateTimeToSystemTime | Converts a TDateTime value to a systemtime structure.
DateTimeToTimeStamp | Converts a TDateTime value to a TimeStamp structure.
DateToStr | Converts a TDateTime value to a date string with a predefined format.
DayOfWeek | Returns the day of the week.
DecodeDate | Decode a TDateTime to a year,month,day triplet
DecodeDateFully | Decode a date with additional date of the week.
DecodeTime | Decode a TDateTime to a hour,minute,second,millisec quartet
DeleteFile | Delete a file from the filesystem.
DirectoryExists | Check whether a directory exists in the file system.
DiskFree | Return the amount of free diskspace
DiskSize | Return the total amount of diskspace.
DisposeStr | Dispose an ansistring from the heap.
DoDirSeparators | Convert known directory separators to the current directory separator.
EncodeDate | Encode a Year,Month,Day to a TDateTime value.
EncodeTime | Encode a Hour,Min,Sec,millisec to a TDateTime value.
ExceptAddr | Current exception address.
ExceptFrameCount | Number of frames included in an exception backtrace
ExceptFrames | Return the current exception stack frames
ExceptionErrorMessage | Return a message describing the exception.
ExceptObject | Current Exception object.
ExcludeLeadingPathDelimiter | Strip the leading path delimiter of a path
ExcludeTrailingBackslash | Strip trailing directory separator from a pathname, if needed.
ExcludeTrailingPathDelimiter | Strip trailing directory separator from a pathname, if needed.
ExecuteProcess | Execute another process (program).
ExeSearch | Search for an executable
ExpandFileName | Expand a relative filename to an absolute filename.
ExpandFileNameCase | Expand a filename entered as case insensitive to the full path as stored on the disk.
ExpandUNCFileName | Expand a relative filename to an absolute UNC filename.
ExtractFileDir | Extract the drive and directory part of a filename.
ExtractFileDrive | Extract the drive part from a filename.
ExtractFileExt | Return the extension from a filename.
ExtractFileName | Extract the filename part from a full path filename.
ExtractFilePath | Extract the path from a filename.
ExtractRelativepath | Extract a relative path from a filename, given a base directory.
ExtractShortPathName | Returns a 8.3 path name
FileAge | Return the timestamp of a file.
FileClose | Close a file handle.
FileCreate | Create a new file and return a handle to it.
FileDateToDateTime | Convert a FileDate value to a TDateTime value.
FileExists | Check whether a particular file exists in the filesystem.
FileFlush
FileGetAttr | Return attributes of a file.
FileGetDate | Return the file time of an opened file.
FileIsReadOnly | Check whether a file is read-only.
FileOpen | Open an existing file and return a filehandle
FileRead | Read data from a filehandle in a buffer.
FileSearch | Search for a file in a path.
FileSeek | Set the current file position on a file handle.
FileSetAttr | Set the attributes of a file.
FileSetDate | Set the date of a file.
FileTruncate | Truncate an open file to a given size.
FileWrite | Write data from a buffer to a given filehandle.
FindClose | Close a find handle
FindCmdLineSwitch | Check whether a certain switch is present on the command-line.
FindFirst | Start a file search and return a findhandle
FindNext | Find the next entry in a findhandle.
FloattoCurr | Convert a float to a Currency value.
FloatToDateTime | Convert a float to a TDateTime value.
FloatToDecimal | Convert a float value to a TFloatRec value.
FloatToStr | Convert a float value to a string using a fixed format.
FloatToStrF | Convert a float value to a string using a given format.
FloatToText | Return a string representation of a float, with a given format.
FloatToTextFmt | Convert a float value to a string using a given mask.
FmtStr | Format a string with given arguments.
ForceDirectories | Create a chain of directories
Format | Format a string with given arguments.
FormatBuf | Format a string with given arguments and store the result in a buffer.
FormatCurr | Format a currency
FormatDateTime | Return a string representation of a TDateTime value with a given format.
FormatFloat | Format a float according to a certain mask.
FreeAndNil | Free object if needed, and set object reference to Nil
FreeMemAndNil | Free the heap memory pointed to by a pointer and set pointer to nil.
GetAppConfigDir | Return the appropriate directory for the application's configuration files.
GetAppConfigFile | Return an appropriate name for an application configuration file.
GetCurrentDir | Return the current working directory of the application.
GetDirs | Return a list of directory names from a path.
GetDriveIDFromLetter | Return the drive ID based on a drive letter
GetEnvironmentString | Return an environment variable by index.
GetEnvironmentVariable | Return the value of an environment variable.
GetEnvironmentVariableCount | Return the number of variables in the environment.
GetFileHandle | Extract OS handle from an untyped file or text file.
GetLastOSError | Return the last code from the OS.
GetLocalTime | Get the local time.
GetLocalTimeOffset | Return local timezone offset
GetModuleName | Return the name of the current module
GetTempDir | Return name of system's temporary directory
GetTempFileName | Return the name of a temporary file.
GetTickCount | Get tick count (32-bit, deprecated)
GetTickCount64 | Get tick count (64-bit)
GetUserDir | Returns the current user's home directory.
GuidCase | Return the index of a GUID in an array of GUID values
GUIDToString | Convert a TGUID to a string representation.
HashName | Calculate a hash from a null-terminated string
HookSignal | Hook a specified signal
IncAMonth | Increase a date with a certain amount of months
IncludeLeadingPathDelimiter | Prepend a path delimiter if there is not already one.
IncludeTrailingBackslash | Add trailing directory separator to a pathname, if needed.
IncludeTrailingPathDelimiter | Add trailing directory separator to a pathname, if needed.
IncMonth | Increases the month in a TDateTime value with a given amount.
InquireSignal | Check whether a signal handler is set (unix only)
IntToHex | Convert an integer value to a hexadecimal string.
IntToStr | Convert an integer value to a decimal string.
IsDelimiter | Check whether a given string is a delimiter character.
IsEqualGUID | Check whether two TGUID variables are equal.
IsLeapYear | Determine whether a year is a leap year.
IsPathDelimiter | Is the character at the given position a pathdelimiter ?
IsValidIdent | Check whether a string is a valid identifier name.
LastDelimiter | Return the last occurrence of a set of delimiters in a string.
LeftStr | Return a number of characters starting at the left of a string.
LoadStr | Load a string from the resource tables.
LowerCase | Return a lowercase version of a string.
MSecsToTimeStamp | Convert a number of milliseconds to a TDateTime value.
NewStr | Allocate a new ansistring on the heap.
Now | Returns the current date and time.
OutOfMemoryError | Raise an EOutOfMemory exception
QuotedStr | Return a quotes version of a string.
RaiseLastOSError | Raise an exception with the last Operating System error code.
RemoveDir | Remove a directory from the filesystem.
RenameFile | Rename a file.
ReplaceDate | Replace the date part of a date/time stamp
ReplaceTime | Replace the time part
RightStr | Return a number of characters from a string, starting at the end.
SafeLoadLibrary | Load a library safely
SameFileName | Are two filenames referring to the same file ?
SameStr | Check whether 2 strings are the same, case insensitive
SameText | Checks whether 2 strings are the same (case insensitive)
SetCurrentDir | Set the current directory of the application.
SetDirSeparators | Set the directory separators to the known directory separators.
ShowException | Show the current exception to the user.
Sleep | Suspend execution of a program for a certain time.
SScanf | Scan a string for substrings and return the substrings
StrAlloc | Allocate a null-terminated string on the heap.
StrBufSize | Return the size of a null-terminated string allocated on the heap.
StrByteType | Return the type of byte in a null-terminated string for a multi-byte character set
strcat | Concatenate 2 null-terminated strings.
StrCharLength | Return the length of a null-terminated string in characters.
strcomp | Compare 2 null-terminated strings, case sensitive.
StrCopy | Copy a null-terminated string
StrDispose | Dispose of a null-terminated string on the heap.
strecopy | Copy a null-terminated string, return a pointer to the end.
strend | Return a pointer to the end of a null-terminated string
StrFmt | Format a string with given arguments, store the result in a buffer.
stricomp | Compare 2 null-terminated strings, case insensitive.
StringOf | Create a unicode string from an array of bytes
StringReplace | Replace occurrences of one substring with another in a string.
StringToGUID | Convert a string to a native TGUID type.
strlcat | Concatenate 2 null-terminated strings, with length boundary.
strlcomp | Compare limited number of characters of 2 null-terminated strings
StrLCopy | Copy a null-terminated string, limited in length.
StrLen | Length of a null-terminated string.
StrLFmt | Format a string with given arguments, but with limited length.
strlicomp | Compare limited number of characters in 2 null-terminated strings, ignoring case.
strlower | Convert null-terminated string to all-lowercase.
StrMove | Move a null-terminated string to new location.
strnew | Allocate room for new null-terminated string.
StrNextChar | Returns a pointer to the location of the next empty character in a null-terminated string
StrPas | Convert a null-terminated string to an ansistring.
StrPCopy | Copy an ansistring to a null-terminated string.
StrPLCopy | Copy a limited number of characters from an ansistring to a null-terminated string.
strpos | Find position of one null-terminated substring in another.
strrscan | Find last occurrence of a character in a null-terminated string.
StrScan | Find first occurrence of a character in a null-terminated string.
StrToBool | Convert a string to a boolean value
StrToBoolDef | Convert string to boolean value, returning default in case of error
StrToCurr | Convert a string to a currency value
StrToCurrDef | Convert a string to a currency value, using a default value
StrToDate | Convert a date string to a TDateTime value.
StrToDateDef | Convert string to date, returning a default value
StrToDateTime | Convert a date/time string to a TDateTime value.
StrToDateTimeDef | Convert string to date/time, returning a default value
StrToDWord | Convert string to DWord (cardinal)
StrToDWordDef | Convert string to DWord (cardinal), using default
StrToFloat | Convert a string to a floating-point value.
StrToFloatDef | Convert a string to a float, with a default value.
StrToInt | Convert a string to an integer value.
StrToInt64 | Convert a string to an Int64 value.
StrToInt64Def | Convert a string to an Int64 value, with a default value
StrToIntDef | Convert a string to an integer value, with a default value.
StrToQWord | Convert a string to a QWord.
StrToQWordDef | Try to convert a string to a QWord, returning a default value in case of failure.
StrToTime | Convert a time string to a TDateTime value.
StrToTimeDef | Convert string to time, returning a default value
strupper | Convert null-terminated string to all-uppercase
Supports | Check whether a class or given interface supports an interface
SysErrorMessage | Format a system error message.
SystemTimeToDateTime | Convert a system time to a TDateTime value.
TextToFloat | Convert a buffer to a float value.
Time | Returns the current time.
TimeStampToDateTime | Convert a TimeStamp value to a TDateTime value.
TimeStampToMSecs | Converts a timestamp to a number of milliseconds.
TimeToStr | Convert a TDateTime time to a string using a predefined format.
Trim | Trim whitespace from the ends of a string.
TrimLeft | Trim whitespace from the beginning of a string.
TrimRight | Trim whitespace from the end of a string.
TryEncodeDate | Try to encode a date, and indicate success.
TryEncodeTime | Try to encode a time, and indicate success.
TryFloatToCurr | Try to convert a float value to a currency value and report on success.
TryStringToGUID | Try to transform a string to a GUID
TryStrToBool | Try to convert a string to a boolean value
TryStrToCurr | Try to convert a string to a currency
TryStrToDate | Try to convert a string with a date indication to a TDateTime value
TryStrToDateTime | Try to convert a string with date/time indication to a TDateTime value
TryStrToDWord | Try to convert a string to DWord (cardinal)
TryStrToFloat | Try to convert a string to a float.
TryStrToInt | Try to convert a string to an integer, and report on success.
TryStrToInt64 | Try to convert a string to an int64 value, and report on success.
TryStrToQWord | Try to convert a string to a QWord value, and report on success
TryStrToTime | Try to convert a string with a time indication to a TDateTime value
UnhookSignal | UnHook a specified signal
UnicodeCompareStr | Compare 2 unicode strings
UnicodeCompareText | Compare 2 strings case insentivively
UnicodeFmtStr | Format a string with given arguments, procedural version.
UnicodeFormat | Format unicode string
UnicodeFormatBuf | Format a unicode string with given arguments and store the result in a unicodebuffer.
UnicodeLowerCase | Return lowercase version of a string
UnicodeSameStr | Check whether 2 strings are equal
UnicodeSameText | Check whether 2 strings are the same, ignoring case
UnicodeStringReplace | Replace one occurrence of a string with another
UnicodeUpperCase | Return uppercase version of a string
UpperCase | Return an uppercase version of a string.
VendorName | Return Application vendor Name
WideBytesOf | Returns the contents of a widestring as an array of bytes
WideCompareStr | Compare two widestrings (case sensitive)
WideCompareText | Compare two widestrings (ignoring case).
WideFmtStr | Widestring format
WideFormat | Format a wide string.
WideFormatBuf | Format widestring in a buffer.
WideLowerCase | Change a widestring to all-lowercase.
WideSameStr | Check whether two widestrings are the same (case sensitive)
WideSameText | Check whether two widestrings are the same (ignoring case)
WideStrAlloc | Allocate a null-terminated widestring on the heap.
WideStringOf | Create unicode string from array of bytes
WideStringReplace | Replace occurrences of one substring with another in a widestring.
WideUpperCase | Change a widestring to all-uppercase.
WrapText | Word-wrap a text.


Reference for unit 'sysutils': Variables

CurrencyDecimals | Number of decimals in currency amounts.
CurrencyFormat | Format string for currencies.
CurrencyString | Name of currency.
DateSeparator | Date separator character (subject to locale).
DecimalSeparator | Decimal point separator.
DefaultFormatSettings | Storage for default settings
FalseBoolStrs | False Strings used in StrToBool conversion
FormatSettings | Alias for DefaultFormatSettings
ListSeparator | Separator character for lists
LongDateFormat | Long date format string (subject to locale).
LongDayNames | Full names of days.
LongMonthNames | Full names of months.
LongTimeFormat | Long time format string (subject to locale)
NegCurrFormat | Format string for negative currencies.
OnBeep | Event called by Beep to actually implement beep
OnCreateGUID | Callback to create GUID values
OnGetApplicationName | Callback to get a customized application name.
OnGetTempDir | Handler for GetTempDir function.
OnGetTempFile | Handler for GetTempFileName function.
OnGetVendorName | Vendor name callback
OnShowException | Callback to show unhandled exceptions.
ShortDateFormat | Short Date Format string (subject to locale).
ShortDayNames | Names of days, abbreviated form.
ShortMonthNames | Names of months, abbreviated form.
ShortTimeFormat | Short time format string (subject to locale).
SysLocale | Variable with locale information
ThousandSeparator | Thousand grouping character.
TimeAMString | AM indicator string.
TimePMString | PM indicator string.
TimeSeparator | Time separator character.
TrueBoolStrs | True Strings used in StrToBool conversion
TwoDigitYearCenturyWindow | Window to determine what century 2 digit years are in.


Index of all identifiers in unit 'sysutils'

A B C D E F G H I J L M N O P Q R S T U V W

A

AbandonSignalHandler | AnsiLowerCase | AnsiStrLower
Abort | AnsiLowerCaseFileName | AnsiStrPos
AddDisk | AnsiPos | AnsiStrRScan
AddTerminateProc | AnsiQuotedStr | AnsiStrScan
AdjustLineBreaks | AnsiSameStr | AnsiStrUpper
AnsiCompareFileName | AnsiSameText | AnsiUpperCase
AnsiCompareStr | AnsiStrComp | AnsiUpperCaseFileName
AnsiCompareText | AnsiStrIComp | AppendStr
AnsiDequotedStr | AnsiStrLastChar | ApplicationName
AnsiExtractQuotedStr | AnsiStrLComp | AssignStr
AnsiLastChar | AnsiStrLIComp |

B

BCDToInt | BoolToStr | ByteToCharIndex
Beep | ByteLength | ByteToCharLen
Big | BytesOf | ByteType

C

CallTerminateProcs | CompareStr | CurrencyDecimals
ChangeFileExt | CompareText | CurrencyFormat
CharInSet | ComposeDateTime | CurrencyString
CharToByteLen | ConcatPaths | CurrentYear
CodePageNameToCodePage | ConfigExtension | CurrToStr
CodePageToCodePageName | CPUEndian | CurrToStrF
CompareMem | CreateDir |
CompareMemRange | CreateGUID |

D

Date | DateToStr | DirectoryExists
DateDelta | DayOfWeek | DiskFree
DateSeparator | DecimalSeparator | DiskSize
DateTimeToFileDate | DecodeDate | DisposeStr
DateTimeToStr | DecodeDateFully | DoDirSeparators
DateTimeToString | DecodeTime | DriveDelim
DateTimeToSystemTime | DefaultFormatSettings |
DateTimeToTimeStamp | DeleteFile |

E

EAbort | EMathError | EUnderflow
EAbstractError | EmptyStr | EVariantError
EAccessViolation | EmptyWideStr | ExceptAddr
EArgumentException | EncodeDate | ExceptClass
EArgumentNilException | EncodeTime | ExceptFrameCount
EArgumentOutOfRangeException | ENoConstructException | ExceptFrames
EAssertionFailed | ENoThreadSupport | Exception
EBusError | ENotImplemented | ExceptionErrorMessage
EControlC | ENotSupportedException | ExceptObject
EConvertError | ENoWideStringSupport | ExcludeEmpty
EDirectoryNotFoundException | EObjectCheck | ExcludeLeadingPathDelimiter
EDivByZero | EOSError | ExcludeTrailingBackslash
EEncodingError | EOutOfMemory | ExcludeTrailingPathDelimiter
EExternal | EOverflow | ExecuteProcess
EExternalException | EPackageError | ExeSearch
EFileNotFoundException | EPathNotFoundException | ExpandFileName
EFormatError | EPathTooLongException | ExpandFileNameCase
EHeapException | EPrivilege | ExpandUNCFileName
EHeapMemoryError | EPropReadOnly | ExtractFileDir
EInOutError | EPropWriteOnly | ExtractFileDrive
EInterror | ERangeError | ExtractFileExt
EIntfCastError | ESafecallException | ExtractFileName
EIntOverflow | EStackOverflow | ExtractFilePath
EInvalidCast | etCustom | ExtractRelativepath
EInvalidContainer | etDebug | ExtractShortPathName
EInvalidInsert | etError | EZeroDivide
EInvalidOp | etInfo |
EInvalidPointer | etWarning |

F

faAnyFile | FileExists | fmOpenWrite
faArchive | FileFlush | fmShareCompat
faCompressed | FileGetAttr | fmShareDenyNone
faDirectory | FileGetDate | fmShareDenyRead
faEncrypted | FileIsReadOnly | fmShareDenyWrite
faHidden | FileOpen | fmShareExclusive
False | FileRead | FmtStr
FalseBoolStrs | FileSearch | ForceDirectories
faNormal | FileSeek | Format
faReadOnly | FileSetAttr | FormatBuf
faSymLink | FileSetDate | FormatCurr
faSysFile | FileTruncate | FormatDateTime
faTemporary | FileWrite | FormatFloat
faVirtual | FindClose | FormatSettings
faVolumeId | FindCmdLineSwitch | FreeAndNil
fdoInterval | FindFirst | FreeMemAndNil
feInvalidHandle | FindNext | fsFromBeginning
ffCurrency | FloattoCurr | fsFromCurrent
ffExponent | FloatToDateTime | fsFromEnd
ffFixed | FloatToDecimal | fvComp
ffGeneral | FloatToStr | fvCurrency
ffNumber | FloatToStrF | fvDouble
FileAge | FloatToText | fvExtended
FileClose | FloatToTextFmt | fvReal
FileCreate | fmOpenRead | fvSingle
FileDateToDateTime | fmOpenReadWrite |

G

GetAppConfigDir | GetEnvironmentVariableCount | GetTempFileName
GetAppConfigFile | GetFileHandle | GetTickCount
GetCurrentDir | GetLastOSError | GetTickCount64
GetDirs | GetLocalTime | GetUserDir
GetDriveIDFromLetter | GetLocalTimeOffset | GuidCase
GetEnvironmentString | GetModuleName | GUID_NULL
GetEnvironmentVariable | GetTempDir | GUIDToString

H

HashName | HookSignal
HexDisplayPrefix | HoursPerDay

I

IncAMonth | Int128Rec | IsEqualGUID
IncludeLeadingPathDelimiter | Int64Rec | IsLeapYear
IncludeTrailingBackslash | IntToHex | IsPathDelimiter
IncludeTrailingPathDelimiter | IntToStr | IsValidIdent
IncMonth | IReadWriteSync |
InquireSignal | IsDelimiter |

J

JulianEpoch

L

LastDelimiter | Little | LongMonthNames
LeadBytes | LoadStr | LongRec
LeftStr | LongDateFormat | LongTimeFormat
ListSeparator | LongDayNames | LowerCase

M

MaxCurrency | MinsPerDay | mkSingleMatch
MaxDateTime | MinsPerHour | mkSingleMatch
MAX_PATH | mkAmbiguous | MonthDays
mbLeadByte | mkAmbiguous | MSecsPerDay
mbSingleByte | mkExactMatch | MSecsPerSec
mbTrailByte | mkExactMatch | MSecsToTimeStamp
MinCurrency | mkNone |
MinDateTime | mkNone |

N

NegCurrFormat | None | NullStr
NewStr | Now |

O

OnBeep | OnGetTempDir | OnShowException
OnCreateGUID | OnGetTempFile | OutOfMemoryError
OnGetApplicationName | OnGetVendorName | OWordRec

P

PathDelim | pfExeModule | pfProducerUndefined
PathSep | pfIgnoreDupUnits | pfRunOnly
PByteArray | pfLibraryModule | pfV3Produced
PDayTable | pfModuleTypeMask | PString
pfBCB4Produced | pfNeverBuild | PSysCharSet
pfDelphi4Produced | pfPackageModule | PWordarray
pfDesignOnly | pfProducerMask |

Q

QuotedStr

R

RaiseLastOSError | RightStr | RTL_SIGINT
RemoveDir | RTL_SIGBUS | RTL_SIGLAST
RenameFile | RTL_SIGDEFAULT | RTL_SIGQUIT
ReplaceDate | RTL_SIGFPE | RTL_SIGSEGV
ReplaceTime | RTL_SIGILL |

S

SafeLoadLibrary | StrCopy | StrToBoolDef
SameFileName | StrDispose | StrToCurr
SameStr | strecopy | StrToCurrDef
SameText | strend | StrToDate
SecsPerDay | StrFmt | StrToDateDef
SecsPerMin | stricomp | StrToDateTime
SetCurrentDir | StringOf | StrToDateTimeDef
SetDirSeparators | StringReplace | StrToDWord
sfoImplicitCurrentDir | StringToGUID | StrToDWordDef
sfoStripQuotes | strlcat | StrToFloat
ShortDateFormat | strlcomp | StrToFloatDef
ShortDayNames | StrLCopy | StrToInt
ShortMonthNames | StrLen | StrToInt64
ShortTimeFormat | StrLFmt | StrToInt64Def
ShowException | strlicomp | StrToIntDef
Sleep | strlower | StrToQWord
SScanf | StrMove | StrToQWordDef
ssHooked | strnew | StrToTime
ssNotHooked | StrNextChar | StrToTimeDef
ssOverridden | StrPas | strupper
StrAlloc | StrPCopy | Supports
StrBufSize | StrPLCopy | SwitchChars
StrByteType | strpos | SysConfigDir
strcat | strrscan | SysErrorMessage
StrCharLength | StrScan | SysLocale
strcomp | StrToBool | SystemTimeToDateTime

T

TArray | TGetTempFileEvent | TryStrToCurr
TBeepHandler | TGetVendorNameEvent | TryStrToDate
TBigEndianUnicodeEncoding | TGuidHelper | TryStrToDateTime
TBooleanHelper | THandle | TryStrToDWord
TByteArray | ThousandSeparator | TryStrToFloat
TByteBoolHelper | Time | TryStrToInt
TByteHelper | TimeAMString | TryStrToInt64
TBytes | TimePMString | TryStrToQWord
TCardinalHelper | TimeSeparator | TryStrToTime
TCharArray | TimeStampToDateTime | TSearchRec
TCompareOption | TimeStampToMSecs | TShortIntHelper
TCompareOptions | TimeToStr | TSignalState
TCreateGUIDFunc | TInt64Helper | TSimpleRWSync
TDayTable | TIntegerHelper | TSingleHelper
TDoubleHelper | TIntegerSet | TSmallIntHelper
TEncoding | TLongBoolHelper | TStringArray
TEndian | TMbcsByteType | TStringHelper
TEventType | TMBCSEncoding | TStringSplitOptions
TEventTypes | TMonthNameArray | TSysCharSet
TExecuteFlags | TMultiReadExclusiveWriteSynchronizer | TSysLocale
TExtendedHelper | TNativeIntHelper | TSystemTime
TextToFloat | TNativeUIntHelper | TTerminateProc
TFilename | TProcedure | TTextRec
TFilenameCaseMatch | TQWordHelper | TTimeStamp
TFilenameCaseMatch | TRawbyteSearchRec | TUnicodeCharArray
TFileRec | TReplaceFlags | TUnicodeEncoding
TFileSearchOption | Trim | TUnicodeSearchRec
TFileSearchOptions | TrimLeft | TUseBoolStrs
TFloatFormat | TrimRight | TUTF7Encoding
TFloatRec | True | TUTF8Encoding
TFloatValue | TrueBoolStrs | TWeekNameArray
TFormatDateTimeOption | TryEncodeDate | TwoDigitYearCenturyWindow
TFormatDateTimeOptions | TryEncodeTime | TWordArray
TFormatSettings | TryFloatToCurr | TWordBoolHelper
TGetAppNameEvent | TryStringToGUID | TWordHelper
TGetTempDirEvent | TryStrToBool |

U

ufImplicitUnit | UnicodeCompareStr | UnicodeSameText
ufMainUnit | UnicodeCompareText | UnicodeStringReplace
ufOrgWeakUnit | UnicodeFmtStr | UnicodeUpperCase
ufPackageUnit | UnicodeFormat | UnixDateDelta
ufWeakPackageUnit | UnicodeFormatBuf | UnixEpoch
ufWeakUnit | UnicodeLowerCase | UpperCase
UnhookSignal | UnicodeSameStr |

V

VendorName

W

WideBytesOf | WideFormatBuf | WideStringOf
WideCompareStr | WideLowerCase | WideStringReplace
WideCompareText | WideSameStr | WideUpperCase
WideFmtStr | WideSameText | WordRec
WideFormat | WideStrAlloc | WrapText


Int64Rec

Record describing an Int64 value

Declaration

Source position: sysutilh.inc line 63

type Int64Rec = packed record
case Integer of
0: (
Hi: Cardinal; | High integer
Lo: Cardinal; | Lower integer
);
1: (
Words: array [0..3] of Word; | Array of 4 words
);
2: (
Bytes: array [0..7] of Byte; | Array of 8 bytes
);
end;

Description

Int64Rec can be used to extract the parts of a Int64: the high and low cardinal, or a zero-based array of 4 words, or a zero based array of 8 bytes. Note that the meaning of the High and Low parts are different on various CPUs.

See also

LongRec | Record describing a longint value
WordRec | Record describing a word value.


Int128Rec

Record representing a 128-bit unsigned integer.

Declaration

Source position: sysutilh.inc line 74

type Int128Rec = packed record
case Integer of
0: (
Hi: QWord; | High QWord of the 128-bit integer
Lo: QWord; | Low QWord of the 128-bit integer
);
1: (
DWords: array [0..3] of DWord; | The 128-bit integer as an array of 4 DWords
);
2: (
Words: array [0..7] of Word; | The 128-bit integer as an array of 8 words
);
3: (
Bytes: array [0..15] of Byte; | The 128-bit integer as an array of 16 bytes
);
end;

Description

Int128Rec is a record defining a 128-bit integer. It is made up of 2 QWords or 4 DWords or 8 words or 16 bytes.

See also

LongRec | Record describing a longint value
WordRec | Record describing a word value.
OWordRec | Identical to the Int128Rec record.


File input/output routines

Functions for reading/writing to file.

Name | Description
FileCreate | Create a file and return handle
FileOpen | Open file end return handle
FileRead | Read from file
FileSeek | Set file position
FileTruncate | Truncate file length
FileWrite | Write to file
FileClose | Close file handle


JulianEpoch

Starting point of the Julian calendar

Declaration

Source position: datih.inc line 35

const JulianEpoch = TDateTime(- 2415018.5);


LeadBytes

Lead bytes in Multi-Byte character sets

Declaration

Source position: sysstrh.inc line 54

const LeadBytes: = [];

Description

LeadBytes contains the set of bytes that serve as lead byte in a MBCS string.


ListSeparator

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

ListSeparator (deprecated)

Separator character for lists

Declaration

Source position: sysinth.inc line 169

var ListSeparator: Char = ;

Description

ListSeparator is the character used in lists of values. It is locale dependent.

See also

DecimalSeparator

Decimal point separator.


Localization support

Localization support depends on various constants and structures being initialized correctly. On Windows and OS/2 this is done automatically: a widestring manager is installed by default which helps taking care of the current locale when performing various operations on strings. The various internationalization settings (date/time format, currency, language etc) are also initialized correctly on these platforms.

On unixes, the widestring support is in a separate unit: cwstring, which loads the various needed functions from the C library. It should be added manually to the uses clause of your program. No internationalization (or localisation) settings are applied by this unit, these must be initialized separately by including the clocale unit in the uses clause of your program.


LongDateFormat

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

LongDateFormat (deprecated)

Long date format string (subject to locale).

Declaration

Source position: sysinth.inc line 96

var LongDateFormat: string = ;

Description

LongDateFormat contains a template to format a date in a long format. It is used by the date formatting routines. The initialization routines of the SysUtils unit initialize this string with a value conforming to the regional preferences of the user or system regional default.

This constant is deprecated. You should use DefaultFormatSettings.LongDateFormat instead.

See also

ShortDateFormat | Short Date Format string (subject to locale).
FormatDateTime | Return a string representation of a TDateTime value with a given format.
DateSeparator | Date separator character (subject to locale).
DefaultFormatSettings | Storage for default settings


LongDayNames

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

LongDayNames (deprecated)

Full names of days.

Declaration

Source position: sysinth.inc line 109

var LongDayNames: TWeekNameArray = ;

Description

LongDayNames is an array with the full names of days. It is used by the date formatting routines. The initialization routines of the SysUtils unit initialize this string with a value conforming to the regional preferences of the user or system regional default.

The array is indexed by values as returned by the DayOfWeek function.

This constant is deprecated. You should use DefaultFormatSettings.LongDayNames instead.

See also

ShortDateFormat | Short Date Format string (subject to locale).
FormatDateTime | Return a string representation of a TDateTime value with a given format.
ShortDayNames | Names of days, abbreviated form.
ShortMonthNames | Names of months, abbreviated form.
DayOfWeek | Returns the day of the week.
DefaultFormatSettings | Storage for default settings


LongMonthNames

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

LongMonthNames (deprecated)

Full names of months.

Declaration

Source position: sysinth.inc line 103

var LongMonthNames: TMonthNameArray = ;

Description

LongMonthNames is an array with the full names of months. It is used by the date formatting routines. The initialization routines of the SysUtils unit initialize this string with a value conforming to the regional preferences of the user or system regional default.

This constant is deprecated. You should use DefaultFormatSettings.LongMonthNames instead.

See also

ShortDateFormat | Short Date Format string (subject to locale).
FormatDateTime | Return a string representation of a TDateTime value with a given format.
ShortMonthNames | Names of months, abbreviated form.
DefaultFormatSettings | Storage for default settings


LongRec

Record describing a longint value

Declaration

Source position: sysutilh.inc line 45

type LongRec = packed record
case Integer of
0: (
Hi: Word; | Upper byte
Lo: Word; | Lower byte
);
1: (
Bytes: array [0..3] of Byte; | Array of 4 bytes.
);
end;

Description

LongRec can be used to extract the parts of an long Integer: the high and low word, or the 4 separate bytes as a zero-based array of bytes. Note that the meaning of High and Low parts are different on various CPUs.

See also

WordRec | Record describing a word value.
Int64Rec | Record describing an Int64 value


LongTimeFormat

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

LongTimeFormat (deprecated)

Long time format string (subject to locale)

Declaration

Source position: sysinth.inc line 115

var LongTimeFormat: string = ;

Description

LongTimeFormat contains a template to format a time in full notation. It is used by the time formatting routines. The initialization routines of the SysUtils unit initialize this string with a value conforming to the regional preferences of the user or system regional default.

This constant is deprecated. You should use DefaultFormatSettings.LongTimeFormat instead.

See also

ShortTimeFormat | Short time format string (subject to locale).
FormatDateTime | Return a string representation of a TDateTime value with a given format.
TimeSeparator | Time separator character.
DefaultFormatSettings | Storage for default settings


MAX_PATH

Maximum length of a fully qualified filename (including path)

Declaration

Source position: sysutilh.inc line 273

const MAX_PATH = MaxPathLen;

Description

MAX_PATH is the maximum number of characters that a filename (including path) can contain on the current operating system.


MaxCurrency

Maximum currency value

Declaration

Source position: sysstrh.inc line 43

const MaxCurrency: Currency = 922337203685477.5807;


MaxDateTime

Maximum TDateTime value.

Declaration

Source position: sysstrh.inc line 39

const MaxDateTime: TDateTime = 2958465.99999999;


MinCurrency

Minimum Currency value

Declaration

Source position: sysstrh.inc line 42

const MinCurrency: Currency = - 922337203685477.5808;


MinDateTime

Minimum TDateTime value.

Declaration

Source position: sysstrh.inc line 38

const MinDateTime: TDateTime = - 693593.0;


MinsPerDay

Number of minutes per day.

Declaration

Source position: datih.inc line 29

const MinsPerDay = HoursPerDay * MinsPerHour;


MinsPerHour

Number of minutes per hour.

Declaration

Source position: datih.inc line 26

const MinsPerHour = 60;


MonthDays

Array with number of days in the months for leap and non-leap years.

Declaration

Source position: datih.inc line 43

const MonthDays: array [Boolean] of TDayTable = ((31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31), (31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31));


MSecsPerDay

Number of milliseconds per day

Declaration

Source position: datih.inc line 31

const MSecsPerDay = SecsPerDay * MSecsPerSec;


MSecsPerSec

Number of milliseconds per second

Declaration

Source position: datih.inc line 28

const MSecsPerSec = 1000;


NegCurrFormat

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

NegCurrFormat (deprecated)

Format string for negative currencies.

Declaration

Source position: sysinth.inc line 164

var NegCurrFormat: Byte = ;

Description

CurrencyFormat is the default format string for negative currencies. It is used by the float formatting routines. The initialization routines of the SysUtils unit initialize this string with a value conforming to the regional preferences of the user or system regional default:

0
Left parenthesis, currency symbol, amount, right parenthesis. Ex: ($1.2)
1
Negative sign, currency symbol, amount. Ex: -$1.2
2
Monetary symbol, negative sign, amount. Ex: $-1.2
3
Monetary symbol, amount, negative sign. Ex: $1.2-
4
Left parenthesis, amount, currency symbol, right parenthesis. Ex: (1.2$)
5
Negative sign, amount, currency symbol. Ex: -1.2$
5
6Amount, negative sign, currency symbol. Ex: 1.2-$
5
7Amount, currency symbol, negative sign. Ex: 1.2$-
5
8Negative sign, amount, space, currency symbol (as #5, adding a space before the currency symbol). Ex: -1.2 $
9
Negative sign, currency symbol, space, amount (as #1, adding a space after the currency symbol). Ex: -$ 1.2
10
Amount, space, currency symbol, negative sign (as #7, adding a space before the currency symbol). Ex: 1.2 $-
11
Monetary symbol, space, amount, negative sign (as #3, adding a space after the currency symbol). Ex: $ 1.2-
12
Monetary symbol, space, negative sign, amount (as #2, adding a space after the currency symbol). Ex: $ -1.2
13
Amount, negative sign, space, currency symbol (as #6, adding a space before the currency symbol). Ex: 1.2- $
14
Left parenthesis, currency symbol, space, amount, right parenthesis (as #0, adding a space after the currency symbol). Ex: ($ 1.2)
15
Left parenthesis, amount, space, currency symbol, right parenthesis (as ##4, adding a space before the currency symbol). Ex: (1.2 $)

See also

CurrencyDecimals | Number of decimals in currency amounts.
CurrencyFormat | Format string for currencies.
CurrencyString | Name of currency.
Format | Format a string with given arguments.
FloatToText | Return a string representation of a float, with a given format.
DefaultFormatSettings | Storage for default settings


NullStr

Pointer to an empty string

Declaration

Source position: sysstrh.inc line 56

const NullStr: PString = @ EmptyStr;


OnBeep

Event called by Beep to actually implement beep

Declaration

Source position: sysutilh.inc line 243

var OnBeep: TBeepHandler = Nil;

Description

OnBeep is calles whenever Beep is called. Beep contains no implementation to actually produce a beep, since there is no way to implement beep in a meaningful way for all possible implementations.

See also

Beep

Sound the system bell.


OnCreateGUID

Callback to create GUID values

Declaration

Source position: sysutilh.inc line 252

var OnCreateGUID: TCreateGUIDFunc = Nil;

Description

OnCreateGUID can be set to point to a custom routine that creates GUID values. If set, the CreateGUID function will use it to obtain a GUID value. If it is not set, a default implementation using random values will be used to create the unique value. The function should return a valid GUID in the GUID parameter, and should return zero in case of success.

See also

CreateGUID | Create a new GUID
TCreateGUIDFunc | Callback prototype to create GUIDs


OnGetApplicationName

Callback to get a customized application name.

Declaration

Source position: osutilsh.inc line 64

var OnGetApplicationName: TGetAppNameEvent = ;

Description

By default, the configuration file routines GetAppConfigDir and GetAppConfigFile use a default application name to construct a directory or filename. This callback can be used to provide an alternative application name.

Since the result of this callback will be used to construct a filename, care should be taken that the returned name does not contain directory separator characters or characters that cannot appear in a filename.

See also

TGetAppNameEvent | Callback type to get customized application name.
ApplicationName | Return a default application name
GetAppConfigDir | Return the appropriate directory for the application's configuration files.
GetAppConfigFile | Return an appropriate name for an application configuration file.


OnGetTempDir

Handler for GetTempDir function.

Declaration

Source position: osutilsh.inc line 65

var OnGetTempDir: TGetTempDirEvent = ;

Description

OnGetTempDir can be used to provide custom behaviour for the GetTempDir function. Note that the returned name should have a trailing directory delimiter character.

See also

GetTempDir | Return name of system's temporary directory
OnGetTempFile | Handler for GetTempFileName function.


OnGetTempFile

Handler for GetTempFileName function.

Declaration

Source position: osutilsh.inc line 66

var OnGetTempFile: TGetTempFileEvent = ;

Description

OnGetTempDir can be used to provide custom behaviour for the GetTempFileName function. Note that the values for Prefix and Dir should be observed.

See also

OnGetTempDir | Handler for GetTempDir function.
GetTempFileName | Return the name of a temporary file.


OnGetVendorName

Vendor name callback

Declaration

Source position: osutilsh.inc line 63

var OnGetVendorName: TGetVendorNameEvent = ;

Description

OnGetVendorName must be set in order for VendorName to return a value. It will then be used in GetAppConfigDir and GetAppConfigFile to determine the configuration directory. Set it to a callback that returns the actual vendor name for the application.

See also

VendorName | Return Application vendor Name
GetAppConfigDir | Return the appropriate directory for the application's configuration files.
GetAppConfigFile | Return an appropriate name for an application configuration file.


OnShowException

Callback to show unhandled exceptions.

Declaration

Source position: sysutilh.inc line 263

var OnShowException: procedure(

  Msg: ShortString

) = ;

Description

OnShowException is the callback that ShowException uses to display a message in a GUI application. For GUI applications, this variable should always be set. Note that no memory may be available when this callback is called, so the callback should already have all resources it needs, when the callback is set.

See also

ShowException | Show the current exception to the user.
ExceptionErrorMessage | Return a message describing the exception.


OWordRec

Identical to the Int128Rec record.

Declaration

Source position: sysutilh.inc line 86

type OWordRec = packed record
case Integer of
0: (
Hi: QWord; | High QWord of the 128-bit integer
Lo: QWord; | Low QWord of the 128-bit integer
);
1: (
DWords: array [0..3] of DWord; | The 128-bit integer as an array of 4 DWords
);
2: (
Words: array [0..7] of Word; | The 128-bit integer as an array of 8 words
);
3: (
Bytes: array [0..15] of Byte; | The 128-bit integer as an array of 16 bytes
);
end;

Description

OWordRec is a record defining a 128-bit integer. It is made up of 2 QWords or 4 DWords or 8 words or 16 bytes.

See also

LongRec | Record describing a longint value
WordRec | Record describing a word value.
Int128Rec | Record representing a 128-bit unsigned integer.


PathDelim

Path (directory) delimiter.

Declaration

Source position: sysutilh.inc line 270

const PathDelim = DirectorySeparator;

Description

PathDelim refers to the system unit's DirectorySeparator constant, it is for Delphi compatibility only.

See also

DriveDelim | Drive letter delimiter
PathSep | Path separator. (Separates paths in search path lists)


PathSep

Path separator. (Separates paths in search path lists)

Declaration

Source position: sysutilh.inc line 272

const PathSep = PathSeparator;

Description

PathSep refers to the system unit's PathSeparator constant, it is for Delphi compatibility only.

See also

PathDelim | Path (directory) delimiter.
DriveDelim | Drive letter delimiter


PByteArray

Pointer to an array of byte.

Declaration

Source position: sysutilh.inc line 98

type PByteArray = ^TByteArray;

Description

Generic pointer to TByteArray. Use to access memory regions as a byte array.

See also

TByteArray | Array of bytes
PWordArray | Pointer to an array of word.
TWordArray | Array of word (Unsigned 16 bit integer)


PChar related functions

Most PChar functions are the same as their counterparts in the STRINGS unit. The following functions are the same :

  1. StrCat : Concatenates two PChar strings.
  2. StrComp : Compares two PChar strings.
  3. StrCopy : Copies a PChar string.
  4. StrECopy : Copies a PChar string and returns a pointer to the terminating null byte.
  5. StrEnd : Returns a pointer to the terminating null byte.
  6. StrIComp : Case insensitive compare of 2 PChar strings.
  7. StrLCat : Appends at most L characters from one PChar to another PChar.
  8. StrLComp : Case sensitive compare of at most L characters of 2 PChar strings.
  9. StrLCopy : Copies at most L characters from one PChar to another.
  10. StrLen : Returns the length (exclusive terminating null byte) of a PChar string.
  11. StrLIComp : Case insensitive compare of at most L characters of 2 PChar strings.
  12. StrLower : Converts a PChar to all lowercase letters.
  13. StrMove : Moves one PChar to another.
  14. StrNew : Makes a copy of a PChar on the heap, and returns a pointer to this copy.
  15. StrPos : Returns the position of one PChar string in another?
  16. StrRScan : returns a pointer to the last occurrence of on PChar string in another one.
  17. StrScan : returns a pointer to the first occurrence of on PChar string in another one.
  18. StrUpper : Converts a PChar to all uppercase letters.

The subsequent functions are different from their counterparts in STRINGS, although the same examples can be used.


PDayTable

Pointer to TDayTable type.

Declaration

Source position: datih.inc line 19

type PDayTable = ^TDayTable;


pfBCB4Produced

Not used in Free Pascal.

Declaration

Source position: sysutilh.inc line 343

const pfBCB4Produced = $08000000;


pfDelphi4Produced

Not used in Free Pascal.

Declaration

Source position: sysutilh.inc line 344

const pfDelphi4Produced = $0C000000;


pfDesignOnly

Package is a design-time only package

Declaration

Source position: sysutilh.inc line 336

const pfDesignOnly = $00000002;


pfExeModule

Package is an executable

Declaration

Source position: sysutilh.inc line 334

const pfExeModule = $00000000;


pfIgnoreDupUnits

Ignore duplicate units in package

Declaration

Source position: sysutilh.inc line 338

const pfIgnoreDupUnits = $00000008;


pfLibraryModule

Package is a library

Declaration

Source position: sysutilh.inc line 345

const pfLibraryModule = $80000000;


pfModuleTypeMask

Mask for module type flags

Declaration

Source position: sysutilh.inc line 340

const pfModuleTypeMask = $C0000000;


pfNeverBuild

Never-build flag was specified when compiling package

Declaration

Source position: sysutilh.inc line 335

const pfNeverBuild = $00000001;


pfPackageModule

Package is a real package (not exe)

Declaration

Source position: sysutilh.inc line 339

const pfPackageModule = $40000000;


pfProducerMask

Mask for producer flags

Declaration

Source position: sysutilh.inc line 346

const pfProducerMask = $0C000000;


pfProducerUndefined

Not used in Free Pascal.

Declaration

Source position: sysutilh.inc line 342

const pfProducerUndefined = $04000000;


pfRunOnly

Package is a run-time only package

Declaration

Source position: sysutilh.inc line 337

const pfRunOnly = $00000004;


pfV3Produced

Not used in Free Pascal.

Declaration

Source position: sysutilh.inc line 341

const pfV3Produced = $00000000;


PString

Pointer to a ansistring

Declaration

Source position: sysstrh.inc line 22

type PString = ObjPas.PString;


PSysCharSet

Pointer to TSysCharSet type.

Declaration

Source position: sysstrh.inc line 249

type PSysCharSet = ^TSysCharSet;


PWordarray

Pointer to an array of word.

Declaration

Source position: sysutilh.inc line 101

type PWordarray = ^TWordArray;

Description

Generic pointer to TWordArray. Use to access memory regions as a word array.

See also

TWordArray | Array of word (Unsigned 16 bit integer)
PByteArray | Pointer to an array of byte.
TByteArray | Array of bytes


RTL_SIGBUS

Bus error signal number (Unix only)

Declaration

Source position: sysutils.pp line 70

const RTL_SIGBUS = 4;


RTL_SIGDEFAULT

Default signal handler (Unix only)

Declaration

Source position: sysutils.pp line 73

const RTL_SIGDEFAULT = - 1;


RTL_SIGFPE

Floating Point Error signal number (Unix only)

Declaration

Source position: sysutils.pp line 67

const RTL_SIGFPE = 1;


RTL_SIGILL

Illegal instruction signal number (Unix only)

Declaration

Source position: sysutils.pp line 69

const RTL_SIGILL = 3;


RTL_SIGINT

INTERRUPT signal number (Unix only)

Declaration

Source position: sysutils.pp line 66

const RTL_SIGINT = 0;


RTL_SIGLAST

Last signal number (Unix only)

Declaration

Source position: sysutils.pp line 72

const RTL_SIGLAST = RTL_SIGQUIT;


RTL_SIGQUIT

QUIT signal number (Unix only)

Declaration

Source position: sysutils.pp line 71

const RTL_SIGQUIT = 5;


RTL_SIGSEGV

Segmentation fault signal number (Unix only)

Declaration

Source position: sysutils.pp line 68

const RTL_SIGSEGV = 2;


SecsPerDay

Number of seconds per day

Declaration

Source position: datih.inc line 30

const SecsPerDay = MinsPerDay * SecsPerMin;


SecsPerMin

Number of seconds per minute

Declaration

Source position: datih.inc line 27

const SecsPerMin = 60;


ShortDateFormat

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

ShortDateFormat (deprecated)

Short Date Format string (subject to locale).

Declaration

Source position: sysinth.inc line 93

var ShortDateFormat: string = ;

Description

ShortDateFormat contains a template to format a date in a short format. It is used by the date formatting routines. The initialization routines of the SysUtils unit initialize this string with a value conforming to the regional preferences of the user or system regional default.

This constant is deprecated. You should use DefaultFormatSettings.ShortDateFormat instead.

See also

LongDateFormat | Long date format string (subject to locale).
FormatDateTime | Return a string representation of a TDateTime value with a given format.
DateSeparator | Date separator character (subject to locale).
DefaultFormatSettings | Storage for default settings


ShortDayNames

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

ShortDayNames (deprecated)

Names of days, abbreviated form.

Declaration

Source position: sysinth.inc line 106

var ShortDayNames: TWeekNameArray = ;

Description

ShortDayNames is an array with the abbreviated names of days. It is used by the date formatting routines. The initialization routines of the SysUtils unit initialize this string with a value conforming to the regional preferences of the user or system regional default.

The array is indexed by values as returned by the DayOfWeek function.

This constant is deprecated. You should use DefaultFormatSettings.ShortDayNames instead.

See also

ShortDateFormat | Short Date Format string (subject to locale).
FormatDateTime | Return a string representation of a TDateTime value with a given format.
LongDayNames | Full names of days.
ShortMonthNames | Names of months, abbreviated form.
DayOfWeek | Returns the day of the week.
DefaultFormatSettings | Storage for default settings


ShortMonthNames

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

ShortMonthNames (deprecated)

Names of months, abbreviated form.

Declaration

Source position: sysinth.inc line 100

var ShortMonthNames: TMonthNameArray = ;

Description

ShortMonthNames is an array with the abbreviated names of months. It is used by the date formatting routines. The initialization routines of the SysUtils unit initialize this string with a value conforming to the regional preferences of the user or system regional default.

This constant is deprecated. You should use DefaultFormatSettings.ShortMonthNames instead.

See also

ShortDateFormat | Short Date Format string (subject to locale).
FormatDateTime | Return a string representation of a TDateTime value with a given format.
LongMonthNames | Full names of months.
ShortDayNames | Names of days, abbreviated form.
DefaultFormatSettings | Storage for default settings


ShortTimeFormat

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

ShortTimeFormat (deprecated)

Short time format string (subject to locale).

Declaration

Source position: sysinth.inc line 112

var ShortTimeFormat: string = ;

Description

ShortTimeFormat contains a template to format a time in a short notation. It is used by the time formatting routines. The initialization routines of the SysUtils unit initialize this string with a value conforming to the regional preferences of the user or system regional default.

This constant is deprecated. You should use DefaultFormatSettings.ShortTimeFormat instead.

See also

LongTimeFormat | Long time format string (subject to locale)
FormatDateTime | Return a string representation of a TDateTime value with a given format.
TimeSeparator | Time separator character.
DefaultFormatSettings | Storage for default settings


String functions

Functions for handling strings.

Name | Description
AnsiCompareStr | Compare two strings
AnsiCompareText | Compare two strings, case insensitive
AnsiExtractQuotedStr | Removes quotes from string
AnsiLastChar | Get last character of string
AnsiLowerCase | Convert string to all-lowercase
AnsiQuotedStr | Qoutes a string
AnsiStrComp | Compare strings case-sensitive
AnsiStrIComp | Compare strings case-insensitive
AnsiStrLComp | Compare L characters of strings case sensitive
AnsiStrLIComp | Compare L characters of strings case insensitive
AnsiStrLastChar | Get last character of string
AnsiStrLower | Convert string to all-lowercase
AnsiStrUpper | Convert string to all-uppercase
AnsiUpperCase | Convert string to all-uppercase
AppendStr | Append 2 strings
AssignStr | Assign value of strings on heap
CompareStr | Compare two strings case sensitive
CompareText | Compare two strings case insensitive
DisposeStr | Remove string from heap
IsValidIdent | Is string a valid pascal identifier
LastDelimiter | Last occurance of character in a string
LeftStr | Get first N characters of a string
LoadStr | Load string from resources
LowerCase | Convert string to all-lowercase
NewStr | Allocate new string on heap
RightStr | Get last N characters of a string
StrAlloc | Allocate memory for string
StrBufSize | Reserve memory for a string
StrDispose | Remove string from heap
StrPas | Convert PChar to pascal string
StrPCopy | Copy pascal string
StrPLCopy | Copy N bytes of pascal string
UpperCase | Convert string to all-uppercase


SwitchChars

Characters which start a command-line switch

Declaration

Source position: sysstrh.inc line 244

const SwitchChars = ['-'];

Description

The characters in this set will be used by the FindCmdLineSwitch function to determine whether a command-line argument is a switch (an option) or a value. If the first character of an argument is in SwitchChars, it will be considered an option or switch.

See also

FindCmdLineSwitch

Check whether a certain switch is present on the command-line.


SysConfigDir

System configuration directory.

Declaration

Source position: osutilsh.inc line 50

const SysConfigDir: string = '';

Description

SysConfigDir is the default system configuration directory. It is set at application startup by the sysutils initialization routines.

This directory may be returned by the GetAppConfigDir call on some systems.

See also

GetAppConfigDir

Return the appropriate directory for the application's configuration files.


SysLocale

Variable with locale information

Declaration

Source position: sysinth.inc line 186

var SysLocale: TSysLocale = ;

Description

SysLocale is initialized by the initialization code of the SysUtils unit. For an explanation of the fields, see TSysLocale

See also

TSysLocale

Type describing the current locale


TArray

Generic array definition

Declaration

Source position: syshelph.inc line 4

type TArray = array of T;

Description

TArray is a generic array. It can be used to define dynamic arrays in generic functions or classes.

This definition is provided for Delphi compatibility only, it is not needed in Free Pascal, where 2 array types are equal if they element types are equal.

See also

TStringArray

Dynamic array of strings


TBeepHandler

Beep handler prototype

Declaration

Source position: sysutilh.inc line 240

type TBeepHandler = procedure;

Description

TBeepHandler is the prototype used by the OnBeep handler. This in turn is called by the Beep call to actually implement the beep functionality. The call takes no arguments.

See also

OnBeep | Event called by Beep to actually implement beep
Beep | Sound the system bell.


TByteArray

Array of bytes

Declaration

Source position: sysutilh.inc line 99

type TByteArray = array [0..32767] of Byte;

Description

TByteArray is a generic array definition, mostly for use as a base type of the PByteArray type.

See also

PByteArray | Pointer to an array of byte.
PWordArray | Pointer to an array of word.
TWordArray | Array of word (Unsigned 16 bit integer)


TBytes

Array of byte

Declaration

Source position: sysutilh.inc line 104

type TBytes = array of Byte;

Description

TBytes defines a dynamic array of bytes. This can be used to typecast e.g. strings to manipulate them byte for byte.

See also

BytesOf

Return the bytes in a string


TCharArray

Array of characters

Declaration

Source position: syshelph.inc line 6

type TCharArray = array of Char;

Description

TCharArray is a dynamic array of characters.

See also

TArray | Generic array definition
TStringArray | Dynamic array of strings


TCompareOption

String compare options

Declaration

Source position: syshelph.inc line 31

type TCompareOption = system.TCompareOption;

Description

TCompareOption is an alias for System.TCompareOption.

See also

System.TCompareOption

How to compare strings


TCompareOptions

Set of string compare options

Declaration

Source position: syshelph.inc line 32

type TCompareOptions = system.TCompareOptions;

Description

TCompareOptions is an alias for System.TCompareOptions.

See also

System.TCompareOptions

Set of TCompareOption


TCreateGUIDFunc

Callback prototype to create GUIDs

Declaration

Source position: sysutilh.inc line 249

type TCreateGUIDFunc = function(

  out GUID: TGuid

):Integer;

Description

TCreateGUIDFunc is the prototype for a GUID creation handler. On return, the GUID argument should contain a new (unique) GUID. The return value of the function should be zero for success, nonzero for failure.

See also

OnCreateGUID

Callback to create GUID values


TDayTable

Array of day names.

Declaration

Source position: datih.inc line 20

type TDayTable = array [1..12] of Word;


TEndian

Endianness of a CPU

Declaration

Source position: syshelph.inc line 8

type TEndian = (
Little, | Little endian (LSB first)
Big | Big endian (MSB first)
);

Description

TEndian indicates whether the platform is little endian (LSB first), or big endian (MSB first).


TEventType

Log event type

Declaration

Source position: osutilsh.inc line 59

type TEventType = (
etCustom, | Custom log event, with application-specific meaning
etInfo, | General information event message
etWarning, | Warning message
etError, | Error condition message
etDebug | Debug message.
);

Description

TEventType is a type to be used by logging mechanisms (in particular, the TCustomApplication and TEventLog classes. It can be used to filter events, and write only certain types of event to the event log.


TEventTypes

Set of TEventType

Declaration

Source position: osutilsh.inc line 60

type TEventTypes = set of (
etCustom, | Custom log event, with application-specific meaning
etInfo, | General information event message
etWarning, | Warning message
etError, | Error condition message
etDebug | Debug message.
);

Description

TEventTypes is a set type of TEventType, defined for convenience. It is used in the custom application classes for logging purposes.

See also

TEventType

Log event type


TExecuteFlags

Flags for ExecuteProcess

Declaration

Source position: osutilsh.inc line 15

type TExecuteFlags = set of (

  ExecInheritsHandles

The new process inherits all (file) handles owned by the current process

);

Description

TExecuteFlags is a set of flags to influence the behaviour of the ExecuteProcess call.

See also

ExecuteProcess

Execute another process (program).


TFilename

Filename type

Declaration

Source position: sysutilh.inc line 41

type TFilename = String;

Description

TFileName is used in the TSearchRec definition.

See also

TSearchRec

Record describing a search handle or result


TFilenameCaseMatch

Type describing how ExpandFileNameCase found the resulting filename

Declaration

Source position: finah.inc line 19

type TFilenameCaseMatch = (
mkNone, | No file was found
mkExactMatch, | The filename can be used to refer to a file on the system (findfirst will find it).
mkSingleMatch, | Exactly one match was found, but case didn't match.
mkAmbiguous | More than one file will match the filename in a case-insensitive way
);

Description

TFilenameCaseMatch describes how ExpandFileNameCase found the file.

See also

ExpandFileNameCase

Expand a filename entered as case insensitive to the full path as stored on the disk.


TFileRec

Record describing an untyped file.

Declaration

Source position: sysutilh.inc line 276

type TFileRec = FileRec;

Description

Alias for FileRec for Delphi compatibility.


TFileSearchOption

Options for the FileSearch call.

Declaration

Source position: filutilh.inc line 120

type TFileSearchOption = (
sfoImplicitCurrentDir, | Always search the current directory first, even if it is not specified.
sfoStripQuotes | Strip quotes from the components in the search path.
);

Description

TFileSearchOption enumerates the options that can be used in the FileSearch call to control the behaviour of the search mechanism

See also

TFileSearchOptions | Set of TFileSearchOption
FileSearch | Search for a file in a path.


TFileSearchOptions

Set of TFileSearchOption

Declaration

Source position: filutilh.inc line 121

type TFileSearchOptions = set of (
sfoImplicitCurrentDir, | Always search the current directory first, even if it is not specified.
sfoStripQuotes | Strip quotes from the components in the search path.
);

Description

TFileSearchOptions is a set of TFileSearchOption values, used in the FileSearch call when searching for files.

See also

TFileSearchOption | Options for the FileSearch call.
FileSearch | Search for a file in a path.


TFloatFormat

Formats for the FloatToText function.

Declaration

Source position: sysstrh.inc line 25

type TFloatFormat = (
ffGeneral, | General number format.
ffExponent, | Scientific format.
ffFixed, | Fixed point format.
ffNumber, | Fixed point format with thousand separatord
ffCurrency | Monetary format.
);

Description

TFloatFormat is used to determine how a float value should be formatted in the FloatToText function.

See also

FloatToText | Return a string representation of a float, with a given format.
FloatToStrF | Convert a float value to a string using a given format.


TFloatRec

Record descriing a float value

Declaration

Source position: sysstrh.inc line 29

type TFloatRec = record
Exponent: Integer; | Exponent part
Negative: Boolean; | Sign part
Digits: array [0..18] of Char; | Digits of fraction
end;

Description

TFloatRec is used to descibe a floating point value by the FloatToDecimal function.

See also

FloatToDecimal

Convert a float value to a TFloatRec value.


TFloatValue

Type of float to return in the buffer for TextToFloat.

Declaration

Source position: sysstrh.inc line 26

type TFloatValue = (
fvExtended, | Extended value
fvCurrency, | Currency value
fvSingle, | Single value
fvReal, | Real value
fvDouble, | Double value
fvComp | Comp value
);

Description

TFloatValue determines which kind of value should be returned in the (untyped) buffer used by the TextToFloat function.

See also

TextToFloat

Convert a buffer to a float value.


TFormatDateTimeOption

Additional options for FormatDateTime

Declaration

Source position: datih.inc line 21

type TFormatDateTimeOption = (

  fdoInterval

Format the time as an interval, 24+hours are presented as such

);

Description

TFormatDateTimeOption enumerates possible options to the FormatDateTime routine.

See also

FormatDateTime | Return a string representation of a TDateTime value with a given format.
TFormatDateTimeOptions | Set of TFormatDateTimeOption


TFormatDateTimeOptions

Set of TFormatDateTimeOption

Declaration

Source position: datih.inc line 22

type TFormatDateTimeOptions = set of (

  fdoInterval

Format the time as an interval, 24+hours are presented as such

);

Description

TFormatDateTimeOptions is a set of TFormatDateTimeOptions, and is used in the last argument of FormatDateTime

See also

FormatDateTime | Return a string representation of a TDateTime value with a given format.
TFormatDateTimeOptions | Set of TFormatDateTimeOption


TFormatSettings

Record with all the strings that determine formatting

Declaration

Source position: sysinth.inc line 33

type TFormatSettings = record
CurrencyFormat: Byte; | Currency format string
NegCurrFormat: Byte; | Negative currency format string
ThousandSeparator: Char; | Thousands separator character
DecimalSeparator: Char; | Decimal separator character
CurrencyDecimals: Byte; | Currency decimals
DateSeparator: Char; | Date separator character
TimeSeparator: Char; | Time separator character
ListSeparator: Char; | List separator character
CurrencyString: string; | Currency string
ShortDateFormat: string; | Short date format string
LongDateFormat: string; | Long Date Format string
TimeAMString: string; | AM time indicator string
TimePMString: string; | PM time indicator string
ShortTimeFormat: string; | Short time format string
LongTimeFormat: string; | Long time format string
ShortMonthNames: TMonthNameArray; | Array with short month names
LongMonthNames: TMonthNameArray; | Array with long month names
ShortDayNames: TWeekNameArray; | Array with short day names
LongDayNames: TWeekNameArray; | Long day names
TwoDigitYearCenturyWindow: Word; | Value for 2 digit year century window
end;

Description

TFormatSettings is a record that contains a copy of all variables which determine formatting in the various string formatting routines. It is used to pass local copies of these values to the various formatting routines in a thread-safe way.

See also

Format | Format a string with given arguments.
FormatDateTime | Return a string representation of a TDateTime value with a given format.
FormatFloat | Format a float according to a certain mask.


TGetAppNameEvent

Callback type to get customized application name.

Declaration

Source position: osutilsh.inc line 54

type TGetAppNameEvent = function: string;

Description

This callback type is used by the OnGetApplicationName to return an alternative application name.


TGetTempDirEvent

Function prototype for OnGetTempDir handler.

Declaration

Source position: osutilsh.inc line 55

type TGetTempDirEvent = function(

  Global: Boolean

):string;


TGetTempFileEvent

Function prototype for OnGetTempFile handler.

Declaration

Source position: osutilsh.inc line 56

type TGetTempFileEvent = function(

  const Dir: string;

  const Prefix: string

):string;


TGetVendorNameEvent

Prototype for OnGetVendorName event.

Declaration

Source position: osutilsh.inc line 53

type TGetVendorNameEvent = function: string;

Description

TGetVendorNameEvent is the function prototype for the OnGetVendorName callback, used by the VendorName function.

See also

OnGetVendorName | Vendor name callback
VendorName | Return Application vendor Name


THandle

File Handle type.

Declaration

Source position: sysutilh.inc line 37

type THandle = System.THandle;

Description

THandle refers to the definition of THandle in the system unit, and is provided for backward compatibility only.


ThousandSeparator

[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'sysutils' (#rtl)

ThousandSeparator (deprecated)

Thousand grouping character.

Declaration

Source position: sysinth.inc line 137

var ThousandSeparator: Char = ;

Description

ThousandSeparator is used to separate groups of thousands in floating point numbers or currencies. It is used by the float formatting routines. The initialization routines of the SysUtils unit initialize this string with a value conforming to the regional preferences of the user or system regional default.

This constant is deprecated. You should use DefaultFormatSettings.ThousandSeparator instead.

See also

DecimalSeparator | Decimal point separator.
Format | Format a string with given arguments.
FormatFloat | Format a float according to a certain mask.
FloatToStr | Convert a float value to a string using a fixed format.
DefaultFormatSettings | Storage for default settings


TIntegerSet

Set with size of integer.

Declaration

Source position: sysutilh.inc line 43

type TIntegerSet = set of ;

Description

TIntegerSet is a generic integer subrange set definition whose size fits in a single integer.


TMbcsByteType

Type of multi-byte character set.

Declaration

Source position: sysstrh.inc line 229

type TMbcsByteType = (
mbSingleByte, | Single bytes
mbLeadByte, | Uses lead-byte
mbTrailByte | Uses trailing byte
);


TMonthNameArray

Array type for array of month variables

Declaration

Source position: sysinth.inc line 30

type TMonthNameArray = array [1..12] of string;

Description

TMonthNameArray is used in the month long and short name arrays.

See also

DefaultFormatSettings | Storage for default settings
ShortMonthNames | Names of months, abbreviated form.
LongMonthNames | Full names of months.


TProcedure

Procedural type

Declaration

Source position: sysutilh.inc line 39

type TProcedure = procedure;

Description

TProcedure is a general definition of a procedural callback.


TRawbyteSearchRec

Record describing a search handle or result (single-byte string version)

Declaration

Source position: filutilh.inc line 62

type TRawbyteSearchRec = record
Time: LongInt; | Last modification timestamp
Size: Int64; | File size in bytes
Attr: LongInt; | File attributes
Name: RawByteString; | File name (single byte version)
ExcludeAttr: LongInt; | For internal use only
FindHandle: Pointer; | Native file search handle. For internal use only, treat as opaque
Mode: TMode; | File permissions (mode, Unix only)
end;

Description

TRawbyteSearchRec is a search handle description record using single-byte strings. It is initialized by a call to FindFirst and can be used to do subsequent calls to FindNext. It contains the result of these function calls. It must be used to close the search sequence with a call to FindClose.

Remark: Not all fields of this record should be used. Some of the fields are for internal use only. (PathOnly for example, is only provided for Kylix compatibility)
Remark: Note that for files with unicode filenames this is a converted value from the unicode filename. Depending on the codepage, this may or may not be a correct rendering of the correct unicode filename.

See also

FindFirst | Start a file search and return a findhandle
FindNext | Find the next entry in a findhandle.
FindClose | Close a find handle


TReplaceFlags

Flags for StringReplace function

Declaration

Source position: sysstrh.inc line 27

type TReplaceFlags = set of (
rfReplaceAll, | Replace all occurrences of the search string with the replacement string.
rfIgnoreCase | Search case insensitive.
);

Description

TReplaceFlags determines the behaviour of the StringReplace function.

See also

StringReplace

Replace occurrences of one substring with another in a string.


TrueBoolStrs

True Strings used in StrToBool conversion

Declaration

Source position: sysstrh.inc line 61

var TrueBoolStrs: array of string = ;

Description

TrueBoolStrs contains the strings that will result in a True return value by StrToBool.

See also

FalseBoolStrs | False Strings used in StrToBool conversion
StrToBool | Convert a string to a boolean value


TSearchRec

Record describing a search handle or result

Declaration

Source position: filutilh.inc line 80

type TSearchRec = TRawbyteSearchRec;

Description

TSearchRec is a search handle description record. It is initialized by a call to FindFirst and can be used to do subsequent calls to FindNext. It contains the result of these function calls. It must be used to close the search sequence with a call to FindClose.

Remark: Not all fields of this record should be used. Some of the fields are for internal use only. (PathOnly for example, is only provided for Kylix compatibility)

See also

FindFirst | Start a file search and return a findhandle
FindNext | Find the next entry in a findhandle.
FindClose | Close a find handle


TSignalState

State of the signal handler (unix only)

Declaration

Source position: sysutils.pp line 76

type TSignalState = (
ssNotHooked, | No signal handler is set for the signal.
ssHooked, | A signal handler is set by the RTL code for the signal.
ssOverridden | A signal handler was set for the signal by third-party code.
);

Description

TSignalState indicates the state of a signal handler in a unix system for a particular signal.

See also

InquireSignal

Check whether a signal handler is set (unix only)


TStringArray

Dynamic array of strings

Declaration

Source position: syshelph.inc line 5

type TStringArray = array of string;

Description

TStringArray is a dynamic array of strings.

See also

TArray | Generic array definition
TCharArray | Array of characters


TStringSplitOptions

String split options used in TSTringHelper.Split

Declaration

Source position: syshelph.inc line 35

type TStringSplitOptions = (
None, | No options specified. The default
ExcludeEmpty | Do not include empty strings in the result.
);

Description

TStringSplitOptions describes the possible options for TStringHelper.Split.

See also

TStringHelper.Split

Split a string in a number of parts


TSysCharSet

Set of characters.

Declaration

Source position: sysstrh.inc line 248

type TSysCharSet = set of AnsiChar;

Description

Generic set of characters type.


TSysLocale

Type describing the current locale

Declaration

Source position: sysinth.inc line 172

type TSysLocale = record
DefaultLCID: Integer; | Default locale ID
PriLangID: Integer; | Primary language ID
SubLangID: Integer; | Sub-language ID
case Byte of
1: (
FarEast: Boolean; | Multi-Byte Character Set used
MiddleEast: Boolean; | Reading direction is Right-to-left
);
2: (
MBCS: Boolean; | Multi-Byte Character Set used
RightToLeft: Boolean; | Reading direction is Right-to-left
);
end;

Description

TSysLocale describes the current locale. If Fareast or MBCS is True, then the current locale uses a Multi-Byte Character Set. If MiddleEast or RightToLeft is True then words and sentences are read from right to left.


TSystemTime

System time structure

Declaration

Source position: datih.inc line 99

type TSystemTime = record
Year: Word; | Year part
Month: Word; | Month part
Day: Word; | Day of month part
DayOfWeek: Word; |
Hour: Word; | Hour of the day
Minute: Word; | Minute of the hour
Second: Word; | Second of the minute
MilliSecond: Word; | Milliseconds in the second
end;

Description

The System time structure contains the date/time in a human-understandable format.


TTerminateProc

Terminate procedure procedural variable.

Declaration

Source position: sysutilh.inc line 256

type TTerminateProc = function: Boolean;

Description

TTerminateProc is the procedural type which should be used when adding exit procedures.

See also

AddTerminateProc

Add a procedure to the exit chain.


TTextRec

Record describing a text file.

Declaration

Source position: sysutilh.inc line 277

type TTextRec = TextRec;

Description

Alias for TextRec for Delphi compatibility.


TTimeStamp

TimeStamp structure

Declaration

Source position: datih.inc line 105

type TTimeStamp = record
Time: LongInt; | Time part
Date: LongInt; | Date part
end;

Description

TTimeStamp contains a timestamp, with the date and time parts specified as separate TDateTime values.


TUnicodeCharArray

Array of UnicodeChar

Declaration

Source position: sysunih.inc line 15

type TUnicodeCharArray = array of UnicodeChar;

Description

TUnicodeCharArray is a definition of an array of UnicodeChar elements.

See also

UnicodeChar

Unicode string character


TUnicodeSearchRec

Unicode searchrec record

Declaration

Source position: filutilh.inc line 47

type TUnicodeSearchRec = record
Time: LongInt; | Last modification timestamp
Size: Int64; | File size in bytes
Attr: LongInt; | File Attributes
Name: UnicodeString; | File name, unicode aware (no path)
ExcludeAttr: LongInt; | For internal use only
FindHandle: Pointer; | Native file search handle. For internal use only, treat as opaque
Mode: TMode; | File permissions (mode, Unix only)
end;

Description

TRawbyteSearchRec is a search handle description record using multi-byte strings. It is initialized by a call to FindFirst and can be used to do subsequent calls to FindNext. It contains the result of these function calls. It must be used to close the search sequence with a call to FindClose.

Remark: Not all fields of this record should be used. Some of the fields are for internal use only. (PathOnly for example, is only provided for Kylix compatibility)

See also

TRawByteSearchRec | Record describing a search handle or result (single-byte string version)
TSearchRec | Record describing a search handle or result
FindFirst | Start a file search and return a findhandle
FindNext | Find the next entry in a findhandle.
FindClose | Close a find handle


TUseBoolStrs

Use boolean strings

Declaration

Source position: syshelph.inc line 573

type TUseBoolStrs = (
False, | Numerical values should be used (0 and 1)
True | String representations should be used.
);

Description

TUseBoolStrs is an enumerated type which indicates whether bool strs must be used when converting boolean to strings.


TWeekNameArray

Array of 7 Strings for week day names

Declaration

Source position: sysinth.inc line 31

type TWeekNameArray = array [1..7] of string;

Description

TWeekNameArray is used in the day long and short name arrays.

See also

DefaultFormatSettings | Storage for default settings
ShortDayNames | Names of days, abbreviated form.
LongDayNames | Full names of days.


TwoDigitYearCenturyWindow

Window to determine what century 2 digit years are in.

Declaration

Source position: datih.inc line 48

var TwoDigitYearCenturyWindow: Word = ;


TWordArray

Array of word (Unsigned 16 bit integer)

Declaration

Source position: sysutilh.inc line 102

type TWordArray = array [0..16383] of Word;

Description

TWordArray is a generic array definition, mostly for use as a base type of the PWordArray type.

See also

PWordArray | Pointer to an array of word.
PByteArray | Pointer to an array of byte.
TByteArray | Array of bytes


Type Helpers for basic types

The sysutils unit contains type helpers for basic language types: boolean, ordinals (shortint, smallint, byte, word, integer, cardinal, int64, wqord, nativeint, nativeuint), strings, floating-point and GUID values. They can be used as-is, or they can be descended from to form your own type helpers.

See also

TGuidHelper | Helper type for TGUID
TStringHelper | Helper type for strings.
TByteHelper | Helper for a byte-typed ordinal value
TShortIntHelper | Helper for a ShortInt-typed ordinal value
TSmallIntHelper | Helper for a SmallInt-typed ordinal value
TWordHelper | Helper for a Word-typed ordinal value
TCardinalHelper | Helper for a Cardinal-typed ordinal value
TIntegerHelper | Helper for a Integer-typed ordinal value
TInt64Helper | Helper for a Int64-typed ordinal value
TQWordHelper | Helper for a QWord-typed ordinal value
TNativeIntHelper | Helper for a NativeInt-typed ordinal value
TBooleanHelper | Helper for the Boolean type.
TByteBoolHelper | Helper for the ByteBool type.
TWordBoolHelper | Helper for the WordBool type.
TLongBoolHelper | Helper for the LongBool type.
TSingleHelper | Helper for Single floating point type
TDoubleHelper | Helper for Double floating point type
TExtendedHelper | Helper for Extended floating point type


ufImplicitUnit

Unit was implicitly imported into package (did not appear in package contains list)

Declaration

Source position: sysutilh.inc line 353

const ufImplicitUnit = $10;


ufMainUnit

Unit is the main unit of the package

Declaration

Source position: sysutilh.inc line 349

const ufMainUnit = $01;


ufOrgWeakUnit

Unit is the original weak packaged unit

Declaration

Source position: sysutilh.inc line 352

const ufOrgWeakUnit = $08;


ufPackageUnit

Unit is a packaged unit (appeared in package contains list)

Declaration

Source position: sysutilh.inc line 350

const ufPackageUnit = $02;


ufWeakPackageUnit

Weak (original or not) packaged unit

Declaration

Source position: sysutilh.inc line 355

const ufWeakPackageUnit = ufPackageUnit or ufWeakUnit;


ufWeakUnit

Unit is a weak packaged unit

Declaration

Source position: sysutilh.inc line 351

const ufWeakUnit = $04;


Unicode and codepage awareness

The many functions that deal with filenames in the sysutils routines have been changed from AnsiString to RawByteString so they do not perform implict codepage conversions to the ansi code page. At the same time, overloaded versions that accept a unicode string have been created.

For routines that access actual OS functions using single-byte string APIS, the strings are converted to ensure that the OS routine receives a string with the correct encoding when using single-byte strings. This encoding is normally the DefaultFileSystemCodePage encoding.

On systems with a unicode I/O API (2-byte strings), the native API is used, meaning that unicode strings will be passed on as-is, but single-byte strings will be converted (implicitly) to Unicode.

The following is a minimal list of functions that have been changed and duplicated:

Name | Description
FileCreate | Create a new file and return a handle to it.
FileOpen | Open an existing file and return a filehandle
FileExists | Check whether a particular file exists in the filesystem.
DirectoryExists | Check whether a directory exists in the file system.
FileSetDate | Set the date of a file.
FileGetAttr | Return attributes of a file.
FileSetAttr | Set the attributes of a file.
DeleteFile | Delete a file from the filesystem.
RenameFile | Rename a file.
FileSearch | Search for a file in a path.
ExeSearch | Search for an executable
FindFirst | Start a file search and return a findhandle
FindNext | Find the next entry in a findhandle.
FindClose | Close a find handle
FileIsReadOnly | Check whether a file is read-only.
GetCurrentDir | Return the current working directory of the application.
SetCurrentDir | Set the current directory of the application.

The following functions do not interact with the OS, but may nevertheless change the codepage of the strings involved in their operation:

Name | Description
ChangeFileExt | Change the extension of a filename.
ExtractFilePath | Extract the path from a filename.
ExtractFileDrive | Extract the drive part from a filename.
ExtractFileName | Extract the filename part from a full path filename.
ExtractFileExt | Return the extension from a filename.
ExtractFileDir | Extract the drive and directory part of a filename.
ExtractShortPathName | Returns a 8.3 path name
ExpandFileName | Expand a relative filename to an absolute filename.
ExpandFileNameCase | Expand a filename entered as case insensitive to the full path as stored on the disk.
ExtractRelativepath | Extract a relative path from a filename, given a base directory.
ExpandUNCFileName | Expand a relative filename to an absolute UNC filename.
IncludeTrailingPathDelimiter | Add trailing directory separator to a pathname, if needed.
IncludeTrailingBackslash | Add trailing directory separator to a pathname, if needed.
ExcludeTrailingBackslash | Strip trailing directory separator from a pathname, if needed.
ExcludeTrailingPathDelimiter | Strip trailing directory separator from a pathname, if needed.
IncludeLeadingPathDelimiter | Prepend a path delimiter if there is not already one.
ExcludeLeadingPathDelimiter | Strip the leading path delimiter of a path
IsPathDelimiter | Is the character at the given position a pathdelimiter ?
DoDirSeparators | Convert known directory separators to the current directory separator.
SetDirSeparators | Set the directory separators to the known directory separators.
GetDirs | Return a list of directory names from a path.
ConcatPaths | Concatenate an array of paths to form a single path
GetEnvironmentVariable | Return the value of an environment variable.


UnixDateDelta

Number of days between 1.1.1900 and 1.1.1970

Declaration

Source position: datih.inc line 39

const UnixDateDelta = Trunc(UnixEpoch);


UnixEpoch

Starting point of the unix calendar (1/1/1970)

Declaration

Source position: datih.inc line 36

const UnixEpoch = JulianEpoch + TDateTime(2440587.5);


WordRec

Record describing a word value.

Declaration

Source position: sysutilh.inc line 55

type WordRec = packed record
Hi: Byte; | High byte of the word
Lo: Byte; | Low byte of the word.
end;

Description

LongRec can be used to extract the parts of a word: the high and low byte. Note that the meaning of the High and Low parts are different on various CPUs.

See also

LongRec | Record describing a longint value
Int64Rec | Record describing an Int64 value


_FILETIME

Filetime record type

Declaration

Source position: types.pp line 251

type _FILETIME = packed record
dwLowDateTime: DWORD; | Lower dword of the file date/time
dwHighDateTime: DWORD; | High dword of the file date/time
end;

Description

_FILETIME describes a file time stamp. It is defined or Delphi/Kylix compatibility and should not be used except when implementing or accessing the IStream interface. The TDateTime type should be used instead.

See also

IStream | COM stream abstraction
IStream.Stat | return information about the stream.


ArgList

Untyped pointer type

Declaration

Source position: types.pp line 248

type ArgList = Pointer;

Description

ArgList is defined for Delphi/Kylix compatibility and should not be used.


DWORD

Alias for cardinal type

Declaration

Source position: types.pp line 35

type DWORD = LongWord;


E_FAIL

COM/RPC Error code : operation failed

Declaration

Source position: types.pp line 184

const E_FAIL = HRESULT($80004005);

Description

Defined for Delphi compatibility, this should not be used.


E_INVALIDARG

COM/RPC Error code: Invalid arguments were specified.

Declaration

Source position: types.pp line 185

const E_INVALIDARG = HRESULT($80070057);

Description

Defined for Delphi compatibility, this should not be used.


FILETIME

Alias for the _FILETIME type

Declaration

Source position: types.pp line 260

type FILETIME = _FILETIME;


GUID_NULL

Null GUID

Declaration

Source position: types.pp line 161

const GUID_NULL: TGuid = '{00000000-0000-0000-0000-000000000000}';

Description

GUID_NULL is the definition of the NULL (empty) GUID.


Reference for unit 'Types'

Various types

uses

  System;

The system unit

Overview

Starting with D6, types from Windows specific units that were needed in Kylix were extracted to this unit. So it mostly contains type of Windows origin that are needed in the VCL framework.


Reference for unit 'Types': Constants

E_FAIL | COM/RPC Error code : operation failed
E_INVALIDARG | COM/RPC Error code: Invalid arguments were specified.
GUID_NULL | Null GUID
LOCK_EXCLUSIVE | Storage Lock stream data: lock exclusively for writing operation
LOCK_ONLYONCE | Storage Lock stream data: lock is granted only once
LOCK_WRITE | Storage Lock stream data: lock for writing operation
STATFLAG_DEFAULT | Storage Statistics should contain pwcsName structure
STATFLAG_NONAME | Storage Statistics must not contain pwcsName structure
STATFLAG_NOOPEN | Storage : Not implemented
STGTY_LOCKBYTES | Storage type - byte array
STGTY_PROPERTY | Storage type - Property storage
STGTY_STORAGE | Storage type - Storage
STGTY_STREAM | Storage type - stream
STG_E_ABNORMALAPIEXIT | Storage COM/RPC Error code: Abnormal exit of an API call.
STG_E_ACCESSDENIED | Storage COM/RPC Error code: access to specified resource is denied
STG_E_BADBASEADDRESS | Storage COM/RPC Error code: wrong address for OLE32.
STG_E_CANTSAVE | Storage COM/RPC Error code: cannot save
STG_E_DISKISWRITEPROTECTED | Storage COM/RPC Error code: Disk is read-only
STG_E_DOCFILECORRUPT | Storage COM/RPC Error code: Document file is corrupted
STG_E_EXTANTMARSHALLINGS | Storage COM/RPC Error code: extant marshallings exist on object
STG_E_FILEALREADYEXISTS | Storage COM/RPC Error code: the specified object already exists.
STG_E_FILENOTFOUND | Storage COM/RPC Error code: the file could not be found
STG_E_INCOMPLETE | Storage COM/RPC Error code: download interrupted, resulting in incomplete file.
STG_E_INSUFFICIENTMEMORY | Storage COM/RPC Error code: not enough operation for the operation
STG_E_INUSE | Storage COM/RPC Error code: object is in use.
STG_E_INVALIDFLAG | Storage COM/RPC Error code: invalid flag
STG_E_INVALIDFUNCTION | Storage COM/RPC Error code: An invalid operation was called.
STG_E_INVALIDHANDLE | Storage COM/RPC Error code: invalid object for operation
STG_E_INVALIDHEADER | Storage COM/RPC Error code: Not a valid compound file
STG_E_INVALIDNAME | Storage COM/RPC Error code: Not a valid name
STG_E_INVALIDPARAMETER | Storage COM/RPC Error code: an invalid parameter was specified.
STG_E_INVALIDPOINTER | Storage COM/RPC Error code: invalid pointer specified.
STG_E_LOCKVIOLATION | Storage COM/RPC Error code: A locking violation occurred
STG_E_MEDIUMFULL | Storage COM/RPC Error code: the medium was full.
STG_E_NOMOREFILES | Storage COM/RPC Error code: no more objects to return.
STG_E_NOTCURRENT | Storage COM/RPC Error code: contents changed by another user
STG_E_OLDDLL | Storage COM/RPC Error code: old format of DLL
STG_E_OLDFORMAT | Storage COM/RPC Error code: old compound file format
STG_E_PATHNOTFOUND | Storage COM/RPC Error code: the path could not be found
STG_E_PROPSETMISMATCHED | Storage COM/RPC Error code: Attempt to write a complex property to a simple property storage
STG_E_READFAULT | Storage COM/RPC Error code: Error during read operation
STG_E_REVERTED | Storage COM/RPC Error code: object no longer exists
STG_E_SEEKERROR | Storage COM/RPC Error code: Error during seek operation
STG_E_SHAREREQUIRED | Storage COM/RPC Error code: share.exe required for this operation
STG_E_SHAREVIOLATION | Storage COM/RPC Error code: A sharing violation occurred
STG_E_TERMINATED | Storage COM/RPC Error code: download terminated.
STG_E_TOOMANYOPENFILES | Storage COM/RPC Error code: too many open files.
STG_E_UNIMPLEMENTEDFUNCTION | Storage COM/RPC Error code: unimplemnted function
STG_E_UNKNOWN | Storage COM/RPC Error code: unknown error.
STG_E_WRITEFAULT | Storage COM/RPC Error code: Error during write operation
STG_S_BLOCK | Storage COM/RPC Error code: storage operation would block till more data comes available.
STG_S_CONVERTED | Storage COM/RPC Error code: object was converted to compound file.
STG_S_MONITORING | Storage COM/RPC Error code: ?
STG_S_RETRYNOW | Storage COM/RPC Error code: Retry operation
STREAM_SEEK_CUR | Storage Stream seek operation offset type : relative position
STREAM_SEEK_END | Storage Stream seek operation offset type : Position relative to end of stream
STREAM_SEEK_SET | Storage Stream seek operation offset type : set absolute position


Reference for unit 'Types': Types

ArgList | Untyped pointer type
DWORD | Alias for cardinal type
FILETIME | Alias for the _FILETIME type
Largeint | Alias for the Int64 type
LargeUint | Alias for the QWord type
LARGE_INT | Alias for the Int64 type
LARGE_UINT | Alias for the QWord type
PByte | Pointer to byte type
PCLSID | Pointer to TCLSID type
PDisplay | Untyped pointer type.
PDouble | Pointer do double type
PDWord | Pointer to DWord type
PEvent | Untyped pointer type.
PFileTime | Pointer to TFileTime type
PLargeInt | Pointer to LargeInt
PLargeuInt | Pointer to QWord type
PLongint | Pointer to longint type
POleStr | Pointer to WideChar
PPoint | Pointer to TPoint type.
PPOleStr | Pointer to POleStr type
PRect | Pointer to TRect structure
PSize | Pointer to TSize type
PSmallInt | Pointer to smallint type
PSmallPoint | Pointer to TSmallPoint type
PStatStg | Pointer to TStatStg record.
PXrmOptionDescRec | Pointer to TXrmOptionDescRec
Region | Untyped pointer type
STATSTG | Alias for the TStatStg type.
TagPoint | Alias for TPoint
TagSize | Alias for TSize
tagSTATSTG | Storage statistics type for IStream interface.
TArray4IntegerType
TBooleanDynArray | Dynamic array of booleans
TByteDynArray | Dynamic array of (8-bit, unsigned) bytes
TCardinalDynArray | Dynamic array of (32-bit, unsigned) cardinals
TCLSID | Class ID identifier (GUID)
TCompDynArray
TCurrencyArray
TDirection
TDoubleDynArray | Dynamic array of (Double-sized) floats
TDuplicates | Enumeration type, indicating what to do with duplicates in a list.
TEndian
TExtendedDynArray
TFileTime | Alias for the _FILETIME type
TInt64DynArray | Dynamic array of (64-bit, signed) int64s
TIntegerDynArray | Dynamic array of (32-bit, signed) integers
TListCallback | Method callback for list operations
TListStaticCallback | Callback for list operations
TLongWordDynArray | Dynamic array of (32-bit, unsigned) LongWords
TOleChar | Alias for the widechar type
TPoint | Point in a plane
TPointerDynArray | Dynamic array of untyped pointers
TPointF
TQWordDynArray | Dynamic array of (64-bit, unsigned) QWords
TRect | Rectangle in a plane
TRectF
TShortIntDynArray | Dynamic array of (8-bit, signed) shortints
TSingleDynArray | Array of (single-sized) floats
TSize | Area size
TSmallIntDynArray | Dynamic array of (16-bit, signed) smallints
TSmallPoint | Small point
TSplitRectType
TStatStg | Record describing storage medium.
TStringDynArray | Dynamic array of AnsiStrings
TValueRelationship
TWideStringDynArray | Dynamic array of WideStrings
TWordDynArray | Dynamic array of (16-bit, unsigned) words
TXrmOptionDescRec | Opaque record type
Widget | Untyped pointer type
WidgetClass | Untyped pointer type
XrmOptionDescRec | Alias for TXrmOptionDescRec
_FILETIME | Filetime record type


Reference for unit 'Types': Classes

IClassFactory | Class defined for ActiveX compatibility.
ISequentialStream | Sequential stream object interface
IStream | COM stream abstraction


Reference for unit 'Types': Procedures and functions

Bounds | Create a rectangle, given a position and size
CenterPoint | Return the center point of a rectangle
EqualRect | Check if two rectangles are equal.
InflateRect | Increase the rectangle in size, keeping it centered
IntersectRect | Return the intersection of 2 rectangles
IsRectEmpty | Check whether a rectangle is empty
OffsetRect | Offset the rectangle
Point | Create a point
PtInRect | Check whether a point is inside a rectangle.
Rect | Create a rectangle record
Size | Return the size of the rectangle
UnionRect | Return the union of 2 rectangles.


Index of all identifiers in unit 'Types'

A B C D E F G I L O P R S T U W X

A

ArgList

B

Big Bounds

C

CenterPoint

D

dupAccept | dupIgnore
dupError | DWORD

E

E_FAIL E_INVALIDARG EqualRect

F

FILETIME | FromBeginning
_FILETIME | FromEnd

G

GUID_NULL

I

IClassFactory | IntersectRect | IsRectEmpty
InflateRect | ISequentialStream | IStream

L

Largeint | LARGE_UINT | LOCK_ONLYONCE
LARGE_INT | Little | LOCK_WRITE
LargeUint | LOCK_EXCLUSIVE |

O

OffsetRect

P

PByte | PLargeInt | PRect
PCLSID | PLargeuInt | PSize
PDisplay | PLongint | PSmallInt
PDouble | Point | PSmallPoint
PDWord | POleStr | PStatStg
PEvent | PPoint | PtInRect
PFileTime | PPOleStr | PXrmOptionDescRec

R

Rect Region

S

Size | STG_E_INSUFFICIENTMEMORY | STG_E_SEEKERROR
srBottom | STG_E_INUSE | STG_E_SHAREREQUIRED
srLeft | STG_E_INVALIDFLAG | STG_E_SHAREVIOLATION
srRight | STG_E_INVALIDFUNCTION | STG_E_TERMINATED
srTop | STG_E_INVALIDHANDLE | STG_E_TOOMANYOPENFILES
STATFLAG_DEFAULT | STG_E_INVALIDHEADER | STG_E_UNIMPLEMENTEDFUNCTION
STATFLAG_NONAME | STG_E_INVALIDNAME | STG_E_UNKNOWN
STATFLAG_NOOPEN | STG_E_INVALIDPARAMETER | STG_E_WRITEFAULT
STATSTG | STG_E_INVALIDPOINTER | STG_S_BLOCK
STG_E_ABNORMALAPIEXIT | STG_E_LOCKVIOLATION | STG_S_CONVERTED
STG_E_ACCESSDENIED | STG_E_MEDIUMFULL | STG_S_MONITORING
STG_E_BADBASEADDRESS | STG_E_NOMOREFILES | STG_S_RETRYNOW
STG_E_CANTSAVE | STG_E_NOTCURRENT | STGTY_LOCKBYTES
STG_E_DISKISWRITEPROTECTED | STG_E_OLDDLL | STGTY_PROPERTY
STG_E_DOCFILECORRUPT | STG_E_OLDFORMAT | STGTY_STORAGE
STG_E_EXTANTMARSHALLINGS | STG_E_PATHNOTFOUND | STGTY_STREAM
STG_E_FILEALREADYEXISTS | STG_E_PROPSETMISMATCHED | STREAM_SEEK_CUR
STG_E_FILENOTFOUND | STG_E_READFAULT | STREAM_SEEK_END
STG_E_INCOMPLETE | STG_E_REVERTED | STREAM_SEEK_SET

T

TagPoint | TExtendedDynArray | TShortIntDynArray
TagSize | TFileTime | TSingleDynArray
tagSTATSTG | TInt64DynArray | TSize
TArray4IntegerType | TIntegerDynArray | TSmallIntDynArray
TBooleanDynArray | TListCallback | TSmallPoint
TByteDynArray | TListStaticCallback | TSplitRectType
TCardinalDynArray | TLongWordDynArray | TStatStg
TCLSID | TOleChar | TStringDynArray
TCompDynArray | TPoint | TValueRelationship
TCurrencyArray | TPointerDynArray | TWideStringDynArray
TDirection | TPointF | TWordDynArray
TDoubleDynArray | TQWordDynArray | TXrmOptionDescRec
TDuplicates | TRect |
TEndian | TRectF |

U

UnionRect

W

Widget WidgetClass

X

XrmOptionDescRec


LARGE_INT

Alias for the Int64 type

Declaration

Source position: types.pp line 44

type LARGE_INT = Largeint;

Description

LARGE_INT is an alias for the Int64 type defined in the system unit. This is an alias for Delphi/Kylix compatibility.


LARGE_UINT

Alias for the QWord type

Declaration

Source position: types.pp line 47

type LARGE_UINT = LargeUint;

Description

LARGE_UINT is an alias for the QWord type defined in the system unit. This is an alias for Delphi/Kylix compatibility.


Largeint

Alias for the Int64 type

Declaration

Source position: types.pp line 43

type Largeint = Int64;

Description

Largeint is an alias for the Int64 type defined in the system unit. This is an alias for Delphi/Kylix compatibility.


LargeUint

Alias for the QWord type

Declaration

Source position: types.pp line 46

type LargeUint = QWord;

Description

LargeUInt is an alias for the QWord type defined in the system unit. This is an alias for Delphi/Kylix compatibility.


LOCK_EXCLUSIVE

Storage Lock stream data: lock exclusively for writing operation

Declaration

Source position: types.pp line 173

const LOCK_EXCLUSIVE = 2;

Description

Defined for Delphi compatibility, this should not be used.


LOCK_ONLYONCE

Storage Lock stream data: lock is granted only once

Declaration

Source position: types.pp line 174

const LOCK_ONLYONCE = 4;

Description

Defined for Delphi compatibility, this should not be used.


LOCK_WRITE

Storage Lock stream data: lock for writing operation

Declaration

Source position: types.pp line 172

const LOCK_WRITE = 1;

Description

Defined for Delphi compatibility, this should not be used.


PByte

Pointer to byte type

Declaration

Source position: types.pp line 42

type PByte = System.PByte;

Description

PByte is defined in the system unit. This is an alias for Delphi/Kylix compatibility.


PCLSID

Pointer to TCLSID type

Declaration

Source position: types.pp line 233

type PCLSID = PGuid;

Description

PCLSID is a pointer to a TCLSID type.

See also

TCLSID

Class ID identifier (GUID)


PDisplay

Untyped pointer type.

Declaration

Source position: types.pp line 238

type PDisplay = Pointer;

Description

PDisplay is defined for Delphi/Kylix compatibility and should not be used.


PDouble

Pointer do double type

Declaration

Source position: types.pp line 40

type PDouble = System.PDouble;

Description

PDouble is defined in the system unit. This is an alias for Delphi/Kylix compatibility.


PDWord

Pointer to DWord type

Declaration

Source position: types.pp line 236

type PDWord = ^DWORD;

Description

PDWord is equivalent to the PCardinal type.

See also

DWord

Alias for cardinal type


PEvent

Untyped pointer type.

Declaration

Source position: types.pp line 239

type PEvent = Pointer;

Description

PEvent is defined for Delphi/Kylix compatibility and should not be used.


PFileTime

Pointer to TFileTime type

Declaration

Source position: types.pp line 261

type PFileTime = ^TFileTime;


PLargeInt

Pointer to LargeInt

Declaration

Source position: types.pp line 45

type PLargeInt = ^Largeint;

Description

PLargeInt is an alias for the PInt64 type defined in the system unit. This is an alias for Delphi/Kylix compatibility.


PLargeuInt

Pointer to QWord type

Declaration

Source position: types.pp line 48

type PLargeuInt = ^LargeUint;

Description

PLargeUInt is an alias for the PQWord type defined in the system unit. This is an alias for Delphi/Kylix compatibility.


PLongint

Pointer to longint type

Declaration

Source position: types.pp line 37

type PLongint = System.PLongint;

Description

PLongint is defined in the system unit. This is an alias for Delphi/Kylix compatibility.


POleStr

Pointer to WideChar

Declaration

Source position: types.pp line 154

type POleStr = PWideChar;

Description

POleStr is a pointer to a (double) null-terminated array of TOleChar characters.

See also

TOleChar

Alias for the widechar type


PPoint

Pointer to TPoint type.

Declaration

Source position: typshrdh.inc line 90

type PPoint = ^TPoint;

Description

PPoint is a typed pointer to the TPoint type.

See also

TPoint

Point in a plane


PPOleStr

Pointer to POleStr type

Declaration

Source position: types.pp line 155

type PPOleStr = ^POleStr;

Description

PPOleStr is a typed pointer to a POleStr variable.

See also

POleStr

Pointer to WideChar


PRect

Pointer to TRect structure

Declaration

Source position: typshrdh.inc line 162

type PRect = ^TRect;

Description

PRect is a typed pointer to the TRect type.

See also

TRect

Rectangle in a plane


PSize

Pointer to TSize type

Declaration

Source position: typshrdh.inc line 60

type PSize = ^TSize;

Description

PSize is a typed pointer to the TSize type.


PSmallInt

Pointer to smallint type

Declaration

Source position: types.pp line 38

type PSmallInt = System.PSmallInt;

Description

PSmallInt is defined in the system unit. This is an alias for Delphi/Kylix compatibility.


PSmallPoint

Pointer to TSmallPoint type

Declaration

Source position: typshrdh.inc line 28

type PSmallPoint = ^TSmallPoint;

Description

PSmallPoint is a typed pointer to the TSmallPoint record.

See also

TSmallPoint

Small point


PStatStg

Pointer to TStatStg record.

Declaration

Source position: types.pp line 287

type PStatStg = ^TStatStg;

See also

TStatStg

Record describing storage medium.


PXrmOptionDescRec

Pointer to TXrmOptionDescRec

Declaration

Source position: types.pp line 244

type PXrmOptionDescRec = ^TXrmOptionDescRec;

Description

PXrmOptionDescRec is defined for Delphi/Kylix compatibility and should not be used.


Region

Untyped pointer type

Declaration

Source position: types.pp line 249

type Region = Pointer;

Description

Region is defined for Delphi/Kylix compatibility and should not be used.


STATFLAG_DEFAULT

Storage Statistics should contain pwcsName structure

Declaration

Source position: types.pp line 176

const STATFLAG_DEFAULT = 0;

Description

Defined for Delphi compatibility, this should not be used.


STATFLAG_NONAME

Storage Statistics must not contain pwcsName structure

Declaration

Source position: types.pp line 177

const STATFLAG_NONAME = 1;

Description

Defined for Delphi compatibility, this should not be used.


STATFLAG_NOOPEN

Storage : Not implemented

Declaration

Source position: types.pp line 178

const STATFLAG_NOOPEN = 2;

Description

Defined for Delphi compatibility, this should not be used.


STATSTG

Alias for the TStatStg type.

Declaration

Source position: types.pp line 286

type STATSTG = TStatStg;

See also

TStatStg

Record describing storage medium.


STG_E_ABNORMALAPIEXIT

Storage COM/RPC Error code: Abnormal exit of an API call.

Declaration

Source position: types.pp line 206

const STG_E_ABNORMALAPIEXIT = HRESULT($800300FA);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_ACCESSDENIED

Storage COM/RPC Error code: access to specified resource is denied

Declaration

Source position: types.pp line 191

const STG_E_ACCESSDENIED = HRESULT($80030005);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_BADBASEADDRESS

Storage COM/RPC Error code: wrong address for OLE32.

Declaration

Source position: types.pp line 221

const STG_E_BADBASEADDRESS = HRESULT($80030110);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_CANTSAVE

Storage COM/RPC Error code: cannot save

Declaration

Source position: types.pp line 215

const STG_E_CANTSAVE = HRESULT($80030103);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_DISKISWRITEPROTECTED

Storage COM/RPC Error code: Disk is read-only

Declaration

Source position: types.pp line 196

const STG_E_DISKISWRITEPROTECTED = HRESULT($80030013);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_DOCFILECORRUPT

Storage COM/RPC Error code: Document file is corrupted

Declaration

Source position: types.pp line 220

const STG_E_DOCFILECORRUPT = HRESULT($80030109);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_EXTANTMARSHALLINGS

Storage COM/RPC Error code: extant marshallings exist on object

Declaration

Source position: types.pp line 219

const STG_E_EXTANTMARSHALLINGS = HRESULT($80030108);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_FILEALREADYEXISTS

Storage COM/RPC Error code: the specified object already exists.

Declaration

Source position: types.pp line 202

const STG_E_FILEALREADYEXISTS = HRESULT($80030050);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_FILENOTFOUND

Storage COM/RPC Error code: the file could not be found

Declaration

Source position: types.pp line 188

const STG_E_FILENOTFOUND = HRESULT($80030002);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_INCOMPLETE

Storage COM/RPC Error code: download interrupted, resulting in incomplete file.

Declaration

Source position: types.pp line 222

const STG_E_INCOMPLETE = HRESULT($80030201);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_INSUFFICIENTMEMORY

Storage COM/RPC Error code: not enough operation for the operation

Declaration

Source position: types.pp line 193

const STG_E_INSUFFICIENTMEMORY = HRESULT($80030008);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_INUSE

Storage COM/RPC Error code: object is in use.

Declaration

Source position: types.pp line 212

const STG_E_INUSE = HRESULT($80030100);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_INVALIDFLAG

Storage COM/RPC Error code: invalid flag

Declaration

Source position: types.pp line 211

const STG_E_INVALIDFLAG = HRESULT($800300FF);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_INVALIDFUNCTION

Storage COM/RPC Error code: An invalid operation was called.

Declaration

Source position: types.pp line 187

const STG_E_INVALIDFUNCTION = HRESULT($80030001);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_INVALIDHANDLE

Storage COM/RPC Error code: invalid object for operation

Declaration

Source position: types.pp line 192

const STG_E_INVALIDHANDLE = HRESULT($80030006);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_INVALIDHEADER

Storage COM/RPC Error code: Not a valid compound file

Declaration

Source position: types.pp line 207

const STG_E_INVALIDHEADER = HRESULT($800300FB);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_INVALIDNAME

Storage COM/RPC Error code: Not a valid name

Declaration

Source position: types.pp line 208

const STG_E_INVALIDNAME = HRESULT($800300FC);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_INVALIDPARAMETER

Storage COM/RPC Error code: an invalid parameter was specified.

Declaration

Source position: types.pp line 203

const STG_E_INVALIDPARAMETER = HRESULT($80030057);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_INVALIDPOINTER

Storage COM/RPC Error code: invalid pointer specified.

Declaration

Source position: types.pp line 194

const STG_E_INVALIDPOINTER = HRESULT($80030009);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_LOCKVIOLATION

Storage COM/RPC Error code: A locking violation occurred

Declaration

Source position: types.pp line 201

const STG_E_LOCKVIOLATION = HRESULT($80030021);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_MEDIUMFULL

Storage COM/RPC Error code: the medium was full.

Declaration

Source position: types.pp line 204

const STG_E_MEDIUMFULL = HRESULT($80030070);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_NOMOREFILES

Storage COM/RPC Error code: no more objects to return.

Declaration

Source position: types.pp line 195

const STG_E_NOMOREFILES = HRESULT($80030012);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_NOTCURRENT

Storage COM/RPC Error code: contents changed by another user

Declaration

Source position: types.pp line 213

const STG_E_NOTCURRENT = HRESULT($80030101);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_OLDDLL

Storage COM/RPC Error code: old format of DLL

Declaration

Source position: types.pp line 217

const STG_E_OLDDLL = HRESULT($80030105);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_OLDFORMAT

Storage COM/RPC Error code: old compound file format

Declaration

Source position: types.pp line 216

const STG_E_OLDFORMAT = HRESULT($80030104);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_PATHNOTFOUND

Storage COM/RPC Error code: the path could not be found

Declaration

Source position: types.pp line 189

const STG_E_PATHNOTFOUND = HRESULT($80030003);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_PROPSETMISMATCHED

Storage COM/RPC Error code: Attempt to write a complex property to a simple property storage

Declaration

Source position: types.pp line 205

const STG_E_PROPSETMISMATCHED = HRESULT($800300F0);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_READFAULT

Storage COM/RPC Error code: Error during read operation

Declaration

Source position: types.pp line 199

const STG_E_READFAULT = HRESULT($8003001E);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_REVERTED

Storage COM/RPC Error code: object no longer exists

Declaration

Source position: types.pp line 214

const STG_E_REVERTED = HRESULT($80030102);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_SEEKERROR

Storage COM/RPC Error code: Error during seek operation

Declaration

Source position: types.pp line 197

const STG_E_SEEKERROR = HRESULT($80030019);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_SHAREREQUIRED

Storage COM/RPC Error code: share.exe required for this operation

Declaration

Source position: types.pp line 218

const STG_E_SHAREREQUIRED = HRESULT($80030106);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_SHAREVIOLATION

Storage COM/RPC Error code: A sharing violation occurred

Declaration

Source position: types.pp line 200

const STG_E_SHAREVIOLATION = HRESULT($80030020);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_TERMINATED

Storage COM/RPC Error code: download terminated.

Declaration

Source position: types.pp line 223

const STG_E_TERMINATED = HRESULT($80030202);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_TOOMANYOPENFILES

Storage COM/RPC Error code: too many open files.

Declaration

Source position: types.pp line 190

const STG_E_TOOMANYOPENFILES = HRESULT($80030004);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_UNIMPLEMENTEDFUNCTION

Storage COM/RPC Error code: unimplemnted function

Declaration

Source position: types.pp line 210

const STG_E_UNIMPLEMENTEDFUNCTION = HRESULT($800300FE);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_UNKNOWN

Storage COM/RPC Error code: unknown error.

Declaration

Source position: types.pp line 209

const STG_E_UNKNOWN = HRESULT($800300FD);

Description

Defined for Delphi compatibility, this should not be used.


STG_E_WRITEFAULT

Storage COM/RPC Error code: Error during write operation

Declaration

Source position: types.pp line 198

const STG_E_WRITEFAULT = HRESULT($8003001D);

Description

Defined for Delphi compatibility, this should not be used.


STG_S_BLOCK

Storage COM/RPC Error code: storage operation would block till more data comes available.

Declaration

Source position: types.pp line 226

const STG_S_BLOCK = $00030201;

Description

Defined for Delphi compatibility, this should not be used.


STG_S_CONVERTED

Storage COM/RPC Error code: object was converted to compound file.

Declaration

Source position: types.pp line 225

const STG_S_CONVERTED = $00030200;

Description

Defined for Delphi compatibility, this should not be used.


STG_S_MONITORING

Storage COM/RPC Error code: ?

Declaration

Source position: types.pp line 228

const STG_S_MONITORING = $00030203;

Description

Defined for Delphi compatibility, this should not be used.


STG_S_RETRYNOW

Storage COM/RPC Error code: Retry operation

Declaration

Source position: types.pp line 227

const STG_S_RETRYNOW = $00030202;

Description

Defined for Delphi compatibility, this should not be used.


STGTY_LOCKBYTES

Storage type - byte array

Declaration

Source position: types.pp line 165

const STGTY_LOCKBYTES = 3;

Description

Defined for Delphi compatibility, this should not be used.


STGTY_PROPERTY

Storage type - Property storage

Declaration

Source position: types.pp line 166

const STGTY_PROPERTY = 4;

Description

Defined for Delphi compatibility, this should not be used.


STGTY_STORAGE

Storage type - Storage

Declaration

Source position: types.pp line 163

const STGTY_STORAGE = 1;

Description

Defined for Delphi compatibility, this should not be used.


STGTY_STREAM

Storage type - stream

Declaration

Source position: types.pp line 164

const STGTY_STREAM = 2;

Description

Defined for Delphi compatibility, this should not be used.


STREAM_SEEK_CUR

Storage Stream seek operation offset type : relative position

Declaration

Source position: types.pp line 169

const STREAM_SEEK_CUR = 1;

Description

Defined for Delphi compatibility, this should not be used.


STREAM_SEEK_END

Storage Stream seek operation offset type : Position relative to end of stream

Declaration

Source position: types.pp line 170

const STREAM_SEEK_END = 2;

Description

Defined for Delphi compatibility, this should not be used.


STREAM_SEEK_SET

Storage Stream seek operation offset type : set absolute position

Declaration

Source position: types.pp line 168

const STREAM_SEEK_SET = 0;

Description

Defined for Delphi compatibility, this should not be used.


TagPoint

[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'Types' (#rtl)

TagPoint (deprecated)

Alias for TPoint

Declaration

Source position: types.pp line 88

type TagPoint = TPoint;

Description

tagPOINT is a simple alias for TPoint

See also

TPoint

Point in a plane


TagSize

[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'Types' (#rtl)

TagSize (deprecated)

Alias for TSize

Declaration

Source position: types.pp line 87

type TagSize = TSize;

Description

tagSize is an alias for the TSize type.

See also

TSize

Area size


tagSTATSTG

Storage statistics type for IStream interface.

Declaration

Source position: types.pp line 272

type tagSTATSTG = record
pwcsName: POleStr; | Name for the storage object. Typically the filename.
dwType: DWORD; | Storage type
cbSize: LARGE_UINT; | Storage size
mtime: TFileTime; | Modification time
ctime: TFileTime; | Creation time
atime: TFileTime; | Last access time
grfMode: DWORD; | ?
grfLocksSupported: DWORD; | Locking operations supported by Storage type
clsid: TCLSID; | Class ID for the storage type
grfStateBits: DWORD; | State bits
reserved: DWORD; | Reserved bits
end;

Description

tagSTATSTG is used in the IStream.Stat call. It describes a storage medium (typically a file).

See also

IStream.Stat

return information about the stream.


TArray4IntegerType

Declaration

Source position: typshrdh.inc line 26

type TArray4IntegerType = array [0..3] of LongInt;


TBooleanDynArray

Dynamic array of booleans

Declaration

Source position: types.pp line 50

type TBooleanDynArray = array of Boolean;

Description

TBooleanDynArray is a standard definition of a dynamical array of booleans.

See also

TIntegerDynArray | Dynamic array of (32-bit, signed) integers
TByteDynArray | Dynamic array of (8-bit, unsigned) bytes


TByteDynArray

Dynamic array of (8-bit, unsigned) bytes

Declaration

Source position: types.pp line 51

type TByteDynArray = array of Byte;

Description

TByteDynArray is a standard definition of a dynamical array of (8-bit, unsigned) bytes.

See also

TIntegerDynArray | Dynamic array of (32-bit, signed) integers
TCardinalDynArray | Dynamic array of (32-bit, unsigned) cardinals
TWordDynArray | Dynamic array of (16-bit, unsigned) words
TShortIntDynArray | Dynamic array of (8-bit, signed) shortints
TSmallIntDynArray | Dynamic array of (16-bit, signed) smallints
TInt64DynArray | Dynamic array of (64-bit, signed) int64s


TCardinalDynArray

Dynamic array of (32-bit, unsigned) cardinals

Declaration

Source position: types.pp line 52

type TCardinalDynArray = array of Cardinal;

Description

TCardinalDynArray is a standard definition of a dynamical array of (32-bit, unsigned) cardinals.

See also

TIntegerDynArray | Dynamic array of (32-bit, signed) integers
TWordDynArray | Dynamic array of (16-bit, unsigned) words
TSmallIntDynArray | Dynamic array of (16-bit, signed) smallints
TShortIntDynArray | Dynamic array of (8-bit, signed) shortints
TByteDynArray | Dynamic array of (8-bit, unsigned) bytes
TInt64DynArray | Dynamic array of (64-bit, signed) int64s


TCLSID

Class ID identifier (GUID)

Declaration

Source position: types.pp line 234

type TCLSID = TGuid;

Description

TCLSID is an alias for the #rtl.system.TGUID type.

See also

#rtl.system.TGUID

Standard GUID representation type.


TCompDynArray

Declaration

Source position: types.pp line 68

type TCompDynArray = array of Comp;


TCurrencyArray

Declaration

Source position: types.pp line 63

type TCurrencyArray = array of currency;


TDirection

Declaration

Source position: types.pp line 32

type TDirection = (

  FromBeginning,

  FromEnd

);


TDoubleDynArray

Dynamic array of (Double-sized) floats

Declaration

Source position: types.pp line 66

type TDoubleDynArray = array of Double;

Description

TSoubleDynArray is a standard definition of a dynamical array of doubles. (regular floating point type)

See also

TSingleDynArray

Array of (single-sized) floats


TDuplicates

Enumeration type, indicating what to do with duplicates in a list.

Declaration

Source position: types.pp line 150

type TDuplicates = (
dupIgnore, | Ignore the new item, do not add it to the list.
dupAccept, | Accept duplicates, adding them to the list.
dupError | Raise an error when an attempt is made to add a duplicate.
);

Description

TDuplicates can be used to indicate how a list structure acts on the addition of a duplicate item to the list.

dupIgnore
Ignore the new item, do not add it to the list.
dupAccept
Accept duplicates, adding them to the list.
dupError
Raise an error when an attempt is made to add a duplicate.


TEndian

Declaration

Source position: types.pp line 31

type TEndian = (

  Big,

  Little

);


TExtendedDynArray

Declaration

Source position: types.pp line 67

type TExtendedDynArray = array of Extended;


TFileTime

Alias for the _FILETIME type

Declaration

Source position: types.pp line 259

type TFileTime = _FILETIME;


TInt64DynArray

Dynamic array of (64-bit, signed) int64s

Declaration

Source position: types.pp line 53

type TInt64DynArray = array of Int64;

Description

TInt64DynArray is a standard definition of a dynamical array of (64-bit, signed) int64s.

See also

TIntegerDynArray | Dynamic array of (32-bit, signed) integers
TCardinalDynArray | Dynamic array of (32-bit, unsigned) cardinals
TWordDynArray | Dynamic array of (16-bit, unsigned) words
TSmallIntDynArray | Dynamic array of (16-bit, signed) smallints
TByteDynArray | Dynamic array of (8-bit, unsigned) bytes
TShortIntDynArray | Dynamic array of (8-bit, signed) shortints


TIntegerDynArray

Dynamic array of (32-bit, signed) integers

Declaration

Source position: types.pp line 54

type TIntegerDynArray = array of Integer;

Description

TIntegerDynArray is a standard definition of a dynamical array of (32-bit, signed) integers.

See also

TCardinalDynArray | Dynamic array of (32-bit, unsigned) cardinals
TWordDynArray | Dynamic array of (16-bit, unsigned) words
TSmallIntDynArray | Dynamic array of (16-bit, signed) smallints
TByteDynArray | Dynamic array of (8-bit, unsigned) bytes


TListCallback

Method callback for list operations

Declaration

Source position: types.pp line 157

type TListCallback = procedure(

  data: pointer;

  arg: pointer

) of object;

Description

TListCallback is the prototype for a Foreach operation on a list. It will be called with as Data the pointer in the list, and Arg will contain the extra user data added to the Foreach call. It can be used in methods of objects; for a version that can be used as a global procedure, see TListStaticCallback

See also

TListStaticCallback

Callback for list operations


TListStaticCallback

Callback for list operations

Declaration

Source position: types.pp line 158

type TListStaticCallback = procedure(

  data: pointer;

  arg: pointer

);

Description

TListStaticCallback is the prototype for a Foreach operation on a list. It will be called with as Data the pointer in the list, and Arg will contain the extra user data added to the Foreach call. It can be used in plain procedures; for a version that can be used as a method, see TListCallback

See also

TListCallback

Method callback for list operations


TLongWordDynArray

Dynamic array of (32-bit, unsigned) LongWords

Declaration

Source position: types.pp line 55

type TLongWordDynArray = array of LongWord;

Description

TLongWordDynArray is a standard definition of a dynamical array of (32-bit, unsigned) LongWords.

See also

TIntegerDynArray | Dynamic array of (32-bit, signed) integers
TCardinalDynArray | Dynamic array of (32-bit, unsigned) cardinals
TWordDynArray | Dynamic array of (16-bit, unsigned) words
TSmallIntDynArray | Dynamic array of (16-bit, signed) smallints
TByteDynArray | Dynamic array of (8-bit, unsigned) bytes
TShortIntDynArray | Dynamic array of (8-bit, signed) shortints
TInt64DynArray | Dynamic array of (64-bit, signed) int64s
TQWordDynArray | Dynamic array of (64-bit, unsigned) QWords


TOleChar

Alias for the widechar type

Declaration

Source position: types.pp line 153

type TOleChar = WideChar;

Description

TOleChar is an alias for the WideChar type, defined in the system unit.

See also

POleStr

Pointer to WideChar


TPoint

Point in a plane

Declaration

Source position: typshrdh.inc line 62

type TPoint = packed record
x: LongInt; | Horizontal position
y: LongInt; | Vertical position
public
class function Zero;
function Add();
function Distance();
function IsZero;
function Subtract();
procedure SetLocation();
procedure SetLocation();
procedure Offset();
procedure Offset();
class function PointInCircle();
class operator equal(TPoint,TPoint):Boolean();
class operator notequal(TPoint,TPoint):Boolean();
class operator add(TPoint,TPoint):TPoint();
class operator subtract(TPoint,TPoint):TPoint();
class operator assign(TSmallPoint):TPoint();
class operator explicit(TPoint):TSmallPoint();
end;

Description

TPoint is a generic definition of a point in a 2-dimensional discrete plane, where X indicates the horizontal position, and Y the vertical position (positions usually measured in pixels), and 0,0 is the origin of the plane.

Usually, the origin is the upper-left corner of the screen, with Y increasing as one moves further down the screen - this is opposite to the mathematical view where Y increases as one moves upwards.

The coordinates are integers, (32-bit, signed) so the coordinate system runs from -MaxInt to MaxInt.

See also

TRect | Rectangle in a plane
TSize | Area size


TPointerDynArray

Dynamic array of untyped pointers

Declaration

Source position: types.pp line 56

type TPointerDynArray = array of Pointer;

See also

TStringDynArray

Dynamic array of AnsiStrings


TPointF

Declaration

Source position: types.pp line 92

type TPointF = packed record

  x: Single;

  y: Single;

public

  function Add();

  function Add();

  function Distance();

  function DotProduct();

  function IsZero;

  function Subtract();

  function Subtract();

  procedure SetLocation();

  procedure SetLocation();

  procedure SetLocation();

  procedure Offset();

  procedure Offset();

  procedure Offset();

  function Scale();

  function Ceiling;

  function Truncate;

  function Floor;

  function Round;

  function Length;

  class operator equal(TPointF,TPointF):Boolean();

  class operator notequal(TPointF,TPointF):Boolean();

  class operator add(TPointF,TPointF):TPointF();

  class operator subtract(TPointF,TPointF):TPointF();

  class operator negative(TPointF):TPointF();

  class operator multiply(TPointF,TPointF):Single();

  class operator multiply(TPointF,single):TPointF();

  class operator multiply(single,TPointF):TPointF();

end;


TQWordDynArray

Dynamic array of (64-bit, unsigned) QWords

Declaration

Source position: types.pp line 57

type TQWordDynArray = array of QWord;

Description

TQWordDynArray is a standard definition of a dynamical array of (64-bit, unsigned) QWords.

See also

TIntegerDynArray | Dynamic array of (32-bit, signed) integers
TCardinalDynArray | Dynamic array of (32-bit, unsigned) cardinals
TWordDynArray | Dynamic array of (16-bit, unsigned) words
TSmallIntDynArray | Dynamic array of (16-bit, signed) smallints
TByteDynArray | Dynamic array of (8-bit, unsigned) bytes
TShortIntDynArray | Dynamic array of (8-bit, signed) shortints
TInt64DynArray | Dynamic array of (64-bit, signed) int64s


TRect

Rectangle in a plane

Declaration

Source position: typshrdh.inc line 101

type TRect = packed record
public
constructor Create();
constructor Create();
constructor Create();
constructor Create();
constructor Create();
class operator equal(TRect,TRect):Boolean();
class operator notequal(TRect,TRect):Boolean();
class operator add(TRect,TRect):TRect();
class operator multiply(TRect,TRect):TRect();
class function Empty;
procedure NormalizeRect;
function IsEmpty;
function Contains();
function Contains();
function IntersectsWith();
class function Intersect();
procedure Intersect();
class function Union();
procedure Union();
class function Union();
procedure Offset();
procedure Offset();
procedure SetLocation();
procedure SetLocation();
procedure Inflate();
procedure Inflate();
function CenterPoint;
function SplitRect();
function SplitRect();
property Height: LongInt; [rw]
property Width: LongInt; [rw]
property Size: TSize; [rw]
property Location: TPoint; [rw]
case LongInt of
0: (
Left: LongInt; | Horizontal position of left edge
Top: LongInt; | Vertical position of top edge
Right: LongInt; | Horizontal position of right edge
Bottom: LongInt; | Vertical position of bottom edge
);
1: (
TopLeft: TPoint; | Position of top-left corner
BottomRight: TPoint; | Position of bottom-right corner
);
2: (
Vector: TArray4IntegerType;
);
end;

Description

TRect defines a rectangle in a discrete plane. It is described by the horizontal (left, right) or vertical (top, Bottom) positions (in pixels) of the edges, or, alternatively, by the coordinates of the top left (TopLeft) and bottom right (BottomRight) corners.

See also

TPoint | Point in a plane
TSize | Area size


TRectF

Declaration

Source position: types.pp line 130

type TRectF = packed record

public

  function Union();

  procedure Offset();

  property Width: Single; [rw]

  property Height: Single; [rw]

  case Integer of

    0: (

        Left: Single;

        Top: Single;

        Right: Single;

        Bottom: Single;

      );

    1: (

        TopLeft: TPointF;

        BottomRight: TPointF;

      );

end;


TShortIntDynArray

Dynamic array of (8-bit, signed) shortints

Declaration

Source position: types.pp line 58

type TShortIntDynArray = array of ShortInt;

Description

TShortintDynArray is a standard definition of a dynamical array of (8-bit, signed) shortints.

See also

TIntegerDynArray | Dynamic array of (32-bit, signed) integers
TCardinalDynArray | Dynamic array of (32-bit, unsigned) cardinals
TWordDynArray | Dynamic array of (16-bit, unsigned) words
TSmallIntDynArray | Dynamic array of (16-bit, signed) smallints
TByteDynArray | Dynamic array of (8-bit, unsigned) bytes
TInt64DynArray | Dynamic array of (64-bit, signed) int64s


TSingleDynArray

Array of (single-sized) floats

Declaration

Source position: types.pp line 65

type TSingleDynArray = array of Single;

Description

TSingleDynArray is a standard definition of a dynamical array of singles. (smallest floating point type)

See also

TDoubleDynArray

Dynamic array of (Double-sized) floats


TSize

Area size

Declaration

Source position: typshrdh.inc line 38

type TSize = packed record
cx: LongInt; | Width in pixels
cy: LongInt; | Height in pixels
public
function Add();
function Distance();
function IsZero;
function Subtract();
class operator equal(TSize,TSize):Boolean();
class operator notequal(TSize,TSize):Boolean();
class operator add(TSize,TSize):TSize();
class operator subtract(TSize,TSize):TSize();
property Width: LongInt; [rw]
property Height: LongInt; [rw]
end;

Description

TSize is a type to describe the size of a rectangular area, where cx is the width, cy is the height (in pixels) of the rectangle.

See also

TRect

Rectangle in a plane


TSmallIntDynArray

Dynamic array of (16-bit, signed) smallints

Declaration

Source position: types.pp line 59

type TSmallIntDynArray = array of SmallInt;

Description

TSmallintDynArray is a standard definition of a dynamical array of (16-bit, unsigned) integers.

See also

TIntegerDynArray | Dynamic array of (32-bit, signed) integers
TCardinalDynArray | Dynamic array of (32-bit, unsigned) cardinals
TShortIntDynArray | Dynamic array of (8-bit, signed) shortints
TWordDynArray | Dynamic array of (16-bit, unsigned) words
TByteDynArray | Dynamic array of (8-bit, unsigned) bytes
TInt64DynArray | Dynamic array of (64-bit, signed) int64s


TSmallPoint

Small point

Declaration

Source position: typshrdh.inc line 29

type TSmallPoint = packed record
X: SmallInt; | Horizontal position in the plane.
Y: SmallInt; | Vertical position in the plane.
end;

Description

TSmallPoint defines a point in a 2-dimensional plane, just like TPoint, but the coordinates have a smaller range: The coordinates are smallints (16-bit, signed) and they run from -MaxSmallInt to maxSmallint.

See also

TPoint

Point in a plane


TSplitRectType

Declaration

Source position: typshrdh.inc line 92

type TSplitRectType = (

  srLeft,

  srRight,

  srTop,

  srBottom

);


TStatStg

Record describing storage medium.

Declaration

Source position: types.pp line 285

type TStatStg = tagSTATSTG;

Description

TStatStg is a record type describing a storage medium. It is uses in the IStream.Stat function.

See also

IStream.Stat

return information about the stream.


TStringDynArray

Dynamic array of AnsiStrings

Declaration

Source position: types.pp line 60

type TStringDynArray = array of AnsiString;

Description

TStringDynArray is a standard definition of a dynamical array of Ansistrings.

See also

TIntegerDynArray | Dynamic array of (32-bit, signed) integers
TWideStringDynArray | Dynamic array of WideStrings


TValueRelationship

Declaration

Source position: types.pp line 33

type TValueRelationship = - 1..1;


TWideStringDynArray

Dynamic array of WideStrings

Declaration

Source position: types.pp line 61

type TWideStringDynArray = array of WideString;

Description

TWideStringDynArray is a standard definition of a dynamical array of WideStrings.

See also

TStringDynArray

Dynamic array of AnsiStrings


TWordDynArray

Dynamic array of (16-bit, unsigned) words

Declaration

Source position: types.pp line 62

type TWordDynArray = array of Word;

Description

TWordDynArray is a standard definition of a dynamical array of (16-bit, unsigned) words.

See also

TIntegerDynArray | Dynamic array of (32-bit, signed) integers
TCardinalDynArray | Dynamic array of (32-bit, unsigned) cardinals
TSmallIntDynArray | Dynamic array of (16-bit, signed) smallints
TShortIntDynArray | Dynamic array of (8-bit, signed) shortints
TByteDynArray | Dynamic array of (8-bit, unsigned) bytes
TInt64DynArray | Dynamic array of (64-bit, signed) int64s


TXrmOptionDescRec

Opaque record type

Declaration

Source position: types.pp line 241

type TXrmOptionDescRec = record

end;

Description

TXrmOptionDescRec is defined for Delphi/Kylix compatibility and should not be used.


Widget

Untyped pointer type

Declaration

Source position: types.pp line 246

type Widget = Pointer;

Description

Widget is defined for Delphi/Kylix compatibility and should not be used.


WidgetClass

Untyped pointer type

Declaration

Source position: types.pp line 247

type WidgetClass = Pointer;

Description

WidgetClass is defined for Delphi/Kylix compatibility and should not be used.


XrmOptionDescRec

Alias for TXrmOptionDescRec

Declaration

Source position: types.pp line 243

type XrmOptionDescRec = TXrmOptionDescRec;

Description

XrmOptionDescRec is defined for Delphi/Kylix compatibility and should not be used.


Auxiliary functions

Other typinfo related functions.

Name | Description
GetEnumName | Get an enumerated type element name
GetEnumValue | Get ordinal number of an enumerated type, based on the name.
GetEnumNameCount | Get number of elements in an enumerated type.
GetTypeData | Skip type name and return a pointer to the type data
SetToString | Convert a set to its string representation
StringToSet | Convert a string representation of a set to a set


BooleanIdents

Names for boolean values

Declaration

Source position: typinfo.pp line 435

const BooleanIdents: array [Boolean] of string = ('False', 'True');


DotSep

Name separator character

Declaration

Source position: typinfo.pp line 436

const DotSep: string = '.';


Examining published property information

Functions for retrieving or examining property information

Name | Description
FindPropInfo | Getting property type information, With error checking.
GetPropInfo | Getting property type information, No error checking.
GetPropInfos | Find property information of a certain kind
GetObjectPropClass | Return the declared class of an object property
GetPropList | Get a list of all published properties
IsPublishedProp | Is a property published
IsStoredProp | Is a property stored
PropIsType | Is a property of a certain kind
PropType | Return the type of a property


Reference for unit 'typinfo'

Access Run-Time Type Information (RTTI)

uses
System, | The system unit
sysutils; | Various system utilities.

Overview

The TypInfo unit contains many routines which can be used for the querying of the Run-Time Type Information (RTTI) which is generated by the compiler for classes that are compiled under the {$M+} switch. This information can be used to retrieve or set property values for published properties for totally unknown classes. In particular, it can be used to stream classes. The TPersistent class in the Classes unit is compiled in the {$M+} state and serves as the base class for all classes that need to be streamed.

The unit should be compatible to the Delphi unit with the same name.

The examples in this chapter use a rttiobj auxiliary unit, which contains an object that has a published property for all supported types. It also contains some auxiliary routines and definitions. This unit is included in the documentation sources, in the directory typinfex.

Related topics

AuxiliaryTypinfo | Auxiliary functions
ManipulatePropValues | Getting or setting property values
ExaminePropInfo | Examining published property information


Reference for unit 'typinfo': Constants

BooleanIdents | Names for boolean values
DotSep | Name separator character
OnGetPropValue | Callback to get a property value as a variant.
OnGetVariantprop | Callback to get a variant property value.
OnSetPropValue | Callback to set a property value as a variant.
OnSetVariantprop | Callback to set a variant property value.
ptConst | Constant used in acces method
ptField | Property acces directly from field
ptStatic | Property acces via static method
ptVirtual | Property acces via virtual method
tkAny | Any property type
tkMethods | Only method properties. (event handlers)
tkProcedure | Procedure kind
tkProperties | Real properties. (not methods)
tkString | Alias for the tsSString enumeration value


Reference for unit 'typinfo': Types

PManagedField | Pointer to TManagedField
PProcedureParam | Pointer to TProcedureParam
PPropInfo | Pointer to TPropInfo record
PPropList | Pointer to TPropList
PPTypeInfo | Pointer to PTypeInfo pointer
PTypeData | Pointer to TTypeData record.
PTypeInfo | Pointer to TTypeInfo record
PVmtFieldEntry | Pointer to #rtl.typinfo.TVmtFieldEntry type.
PVmtFieldTable | Pointer to #rtl.typinfo.TVmtFieldTable type.
ShortStringBase | Short string type definition
TArrayTypeData | Array type data
TCallConv | Calling convention enumerator
TFloatType | The size of a float type.
TGetPropValue | Callback type for the OnGetPropValue callback event
TGetVariantProp | Callback type for the OnGetVariantProp callback event
TIntfFlag | Type of interface.
TIntfFlags | Set of TIntfFlag.
TIntfFlagsBase | Set of TIntfFlag.
TManagedField | Managed field description
TMethodKind | Method type description
TOrdType | Alias for TOrdType.
TParamFlag | Function or procedure parameter flags.
TParamFlags | The kind of parameter for a method
TProcedureParam | Procedure parameter description
TProcedureSignature | Procedure signature description record
TProcInfoProc | Property info callback method
TPropData | Property data record
TPropInfo | Record describing one published property of a class
TPropList | Array of property information pointers
TSetPropValue | Callback type for the OnSetPropValue callback event
TSetVariantProp | Callback type for the OnSetVariantProp callback event
TTypeData | Class properties type data record.
TTypeInfo | Type information record
TTypeKind | Type of a property.
TTypeKinds | Set of TTypeKind enumeration.
TVmtFieldEntry | Describe a field of a record/class
TVmtFieldTable | Table of field descriptions for a class or record type.


Reference for unit 'typinfo': Classes

EPropertyConvertError | Exception raised when converting a property
EPropertyError | Exception raised in case of an error in one of the functions.


Reference for unit 'typinfo': Procedures and functions

FindPropInfo | Return property information by property name.
GetEnumName | Return name of enumeration constant.
GetEnumNameCount | Return number of names in an enumerated type
GetEnumProp | Return the value of an enumeration type property.
GetEnumValue | Get ordinal value for enumerated type by name
GetFloatProp | Return value of floating point property
GetInt64Prop | return value of an Int64 property
GetInterfaceProp | Return interface-typed property
GetMethodProp | Return value of a method property
GetObjectProp | Return value of an object-type property.
GetObjectPropClass | Return class of property.
GetOrdProp | Get the value of an ordinal property
GetPropInfo | Return property type information, by property name.
GetPropInfos | Return a list of published properties.
GetPropList | Return a list of a certain type of published properties.
GetPropValue | Get property value as a string.
GetRawInterfaceProp | Get a raw (CORBA) interface property.
GetSetProp | Return the value of a set property.
GetStrProp | Return the value of a string property.
GetTypeData | Return a pointer to type data, based on type information.
GetUnicodeStrProp | Get UnicodeString-valued property
GetVariantProp | Return the value of a variant property.
GetWideStrProp | Read a widestring property
IsPublishedProp | Check whether a published property exists.
IsStoredProp | Check whether a property is stored.
PropIsType | Check the type of a published property.
PropType | Return the type of a property
SetEnumProp | Set value of an enumerated-type property
SetFloatProp | Set value of a float property.
SetInt64Prop | Set value of a Int64 property
SetInterfaceProp | Set interface-valued property
SetMethodProp | Set the value of a method property
SetObjectProp | Set the value of an object-type property.
SetOrdProp | Set value of an ordinal property
SetPropValue | Set property value as variant
SetRawInterfaceProp | Set a raw (CORBA) interface property.
SetSetProp | Set value of set-typed property.
SetStrProp | Set value of a string property
SetToString | Convert set to a string description
SetUnicodeStrProp | Set UnicodeString-valued property
SetVariantProp | Set value of a variant property
SetWideStrProp | Set a widestring property
StringToSet | Convert string description to a set.


Index of all identifiers in unit 'typinfo'

B C D E F G I M O P S T

B

BooleanIdents

C

ccCdecl | ccMWPascal | ccSafeCall
ccCppdecl | ccOldFPCCall | ccSoftFloat
ccFar16 | ccPascal | ccStdCall
ccInternProc | ccReg | ccSysCall

D

DotSep

E

EPropertyConvertError EPropertyError

F

FindPropInfo | ftCurr | ftExtended
ftComp | ftDouble | ftSingle

G

GetEnumName | GetObjectProp | GetSetProp
GetEnumNameCount | GetObjectPropClass | GetStrProp
GetEnumProp | GetOrdProp | GetTypeData
GetEnumValue | GetPropInfo | GetUnicodeStrProp
GetFloatProp | GetPropInfos | GetVariantProp
GetInt64Prop | GetPropList | GetWideStrProp
GetInterfaceProp | GetPropValue |
GetMethodProp | GetRawInterfaceProp |

I

ifDispatch | ifHasGuid | IsPublishedProp
ifDispInterface | ifHasStrGUID | IsStoredProp

M

mkClassConstructor | mkClassProcedure | mkFunction
mkClassDestructor | mkConstructor | mkOperatorOverload
mkClassFunction | mkDestructor | mkProcedure

O

OnGetPropValue | otSByte | otULong
OnGetVariantprop | otSLong | otUWord
OnSetPropValue | otSWord |
OnSetVariantprop | otUByte |

P

pfAddress | PProcedureParam | ptField
pfArray | PPropInfo | ptStatic
pfConst | PPropList | ptVirtual
pfOut | PPTypeInfo | PTypeData
pfReference | PropIsType | PTypeInfo
pfVar | PropType | PVmtFieldEntry
PManagedField | ptConst | PVmtFieldTable

S

SetEnumProp | SetOrdProp | SetUnicodeStrProp
SetFloatProp | SetPropValue | SetVariantProp
SetInt64Prop | SetRawInterfaceProp | SetWideStrProp
SetInterfaceProp | SetSetProp | ShortStringBase
SetMethodProp | SetStrProp | StringToSet
SetObjectProp | SetToString |

T

TArrayTypeData | tkInteger | tkWString
TCallConv | tkInterface | TManagedField
TFloatType | tkInterfaceRaw | TMethodKind
TGetPropValue | tkLString | TOrdType
TGetVariantProp | tkMethod | TParamFlag
TIntfFlag | tkMethods | TParamFlags
TIntfFlags | tkObject | TProcedureParam
TIntfFlagsBase | tkPointer | TProcedureSignature
tkAny | tkProcedure | TProcInfoProc
tkArray | tkProcVar | TPropData
tkAString | tkProperties | TPropInfo
tkBool | tkQWord | TPropList
tkChar | tkRecord | TSetPropValue
tkClass | tkSet | TSetVariantProp
tkClassRef | tkSString | TTypeData
tkDynArray | tkString | TTypeInfo
tkEnumeration | tkUChar | TTypeKind
tkFile | tkUnknown | TTypeKinds
tkFloat | tkUString | TVmtFieldEntry
tkHelper | tkVariant | TVmtFieldTable
tkInt64 | tkWChar |


Getting or setting property values

Functions to set or set a property's value.

Name | Description
GetEnumProp | Return the value of an enumerated type property
GetFloatProp | Return the value of a float property
GetInt64Prop | Return the value of an Int64 property
GetMethodProp | Return the value of a procedural type property
GetObjectProp | Return the value of an object property
GetOrdProp | Return the value of an ordinal type property
GetPropValue | Return the value of a property as a variant
GetSetProp | Return the value of a set property
GetStrProp | Return the value of a string property
GetWideStrProp | Return the value of a widestring property
GetVariantProp | Return the value of a variant property
SetEnumProp | Set the value of an enumerated type property
SetFloatProp | Set the value of a float property
SetInt64Prop | Set the value of an Int64 property
SetMethodProp | Set the value of a procedural type property
SetObjectProp | Set the value of an object property
SetOrdProp | Set the value of an ordinal type property
SetPropValue | Set the value of a property trhough a variant
SetSetProp | Set the value of a set property
SetStrProp | Set the value of a string property
SetWideStrProp | Set the value of a widestring property
SetVariantProp | Set the value of a variant property


OnGetPropValue

Callback to get a property value as a variant.

Declaration

Source position: typinfo.pp line 448

const OnGetPropValue: TGetPropValue = Nil;

Description

This callback is set by the variants unit to enable reading of properties as a variant. If set, it is called by the GetPropValue function.


OnGetVariantprop

Callback to get a variant property value.

Declaration

Source position: typinfo.pp line 450

const OnGetVariantprop: TGetVariantProp = Nil;

Description

This callback is set by the variants unit to enable reading of variant properties If set, it is called by the GetVariantProp function.


OnSetPropValue

Callback to set a property value as a variant.

Declaration

Source position: typinfo.pp line 449

const OnSetPropValue: TSetPropValue = Nil;

Description

This callback is set by the variants unit to enable writing of properties as a variant. If set, it is called by the SetPropValue function.


OnSetVariantprop

Callback to set a variant property value.

Declaration

Source position: typinfo.pp line 451

const OnSetVariantprop: TSetVariantProp = Nil;

Description

This callback is set by the variants unit to enable writing of variant properties. If set, it is called by the GetVariantProp function.


PManagedField

Pointer to TManagedField

Declaration

Source position: typinfo.pp line 130

type PManagedField = ^TManagedField;

Description

PManagedField is a pointer to TManagedField. It is used to describe automatically managed fields in records when the type kind is tkRecord.

See also

TManagedField | Managed field description
TTypeKind | Type of a property.
TTypeData | Class properties type data record.


PProcedureParam

Pointer to TProcedureParam

Declaration

Source position: typinfo.pp line 140

type PProcedureParam = ^TProcedureParam;

Description

PProcedureParam is a pointer to TProcedureParam. It is used in TProcedureSignature.

See also

TProcedureParam | Procedure parameter description
TProcedureSignature | Procedure signature description record


PPropInfo

Pointer to TPropInfo record

Declaration

Source position: typinfo.pp line 279

type PPropInfo = ^TPropInfo;


PPropList

Pointer to TPropList

Declaration

Source position: typinfo.pp line 301

type PPropList = ^TPropList;


PPTypeInfo

Pointer to PTypeInfo pointer

Declaration

Source position: typinfo.pp line 114

type PPTypeInfo = ^PTypeInfo;


ptConst

Constant used in acces method

Declaration

Source position: typinfo.pp line 76

const ptConst = 3;


ptField

Property acces directly from field

Declaration

Source position: typinfo.pp line 73

const ptField = 0;


ptStatic

Property acces via static method

Declaration

Source position: typinfo.pp line 74

const ptStatic = 1;


ptVirtual

Property acces via virtual method

Declaration

Source position: typinfo.pp line 75

const ptVirtual = 2;


PTypeData

Pointer to TTypeData record.

Declaration

Source position: typinfo.pp line 164

type PTypeData = ^TTypeData;


PTypeInfo

Pointer to TTypeInfo record

Declaration

Source position: typinfo.pp line 113

type PTypeInfo = ^TTypeInfo;


PVmtFieldEntry

Pointer to #rtl.typinfo.TVmtFieldEntry type.

Declaration

Source position: typinfo.pp line 82

type PVmtFieldEntry = ^TVmtFieldEntry;

See also

TVmtFieldEntry | Describe a field of a record/class
TVmtFieldTable | Table of field descriptions for a class or record type.


PVmtFieldTable

Pointer to #rtl.typinfo.TVmtFieldTable type.

Declaration

Source position: typinfo.pp line 93

type PVmtFieldTable = ^TVmtFieldTable;

See also

TVmtFieldTable

Table of field descriptions for a class or record type.


ShortStringBase

Short string type definition

Declaration

Source position: typinfo.pp line 80

type ShortStringBase = string;

Description

ShortStringBase is the base definition of a short string.


TArrayTypeData

Array type data

Declaration

Source position: typinfo.pp line 118

type TArrayTypeData = packed record
Size: SizeInt; | Declared size of the array
ElCount: SizeInt; | Total number of elements in the array
ElType: PTypeInfo; | Type information for an element in the array
DimCount: Byte; | Number of dimensions in the array
Dims: array [0..255] of PTypeInfo; | Range information for each dimension in the array
end;

Description

TArrayTypeData is used to describe arrays in RTTI. It can be encountered when the type kind is tkArray, and is used for both static and dynamic arrays and single or multi-dimensional arrays. The type of the array elements is described in elType, and the ranges for each of the dimensions (specified in DimCount in Dims.

See also

TTypeInfo | Type information record
TTypeKind | Type of a property.
TTypeData | Class properties type data record.


TCallConv

Calling convention enumerator

Declaration

Source position: typinfo.pp line 66

type TCallConv = (
ccReg, | Register calling convention
ccCdecl, | Cdecl calling convention.
ccPascal, | Pascal calling convention.
ccStdCall, | stdcall calling convention.
ccSafeCall, | SafeCall calling convention.
ccCppdecl, | Cppdecl calling convention
ccFar16, | Far16 calling convention (Delphi compatibility)
ccOldFPCCall, | OldFPCCall calling convention (deprecated)
ccInternProc, | InternProc calling convention (compiler internal)
ccSysCall, | SysCall calling convention.
ccSoftFloat, | Softfloat calling convention.
ccMWPascal | MWPascal (MetroWerks Pascal) calling convention.
);

Description

TCallConv is a type describing the calling convention used by a method. It contains an element for all supported calling conventions.


TFloatType

The size of a float type.

Declaration

Source position: typinfo.pp line 52

type TFloatType = (
ftSingle, | Single-sized float
ftDouble, | Double-sized float
ftExtended, | Extended-size float
ftComp, | Comp-type float
ftCurr | Currency-type float
);


TGetPropValue

Callback type for the OnGetPropValue callback event

Declaration

Source position: typinfo.pp line 440

type TGetPropValue = function(

  Instance: TObject;

  PropInfo: PPropInfo;

  PreferStrings: Boolean

):Variant;

Description

The callback function must return the property with name PropName of instance Instance. If PreferStrings is true, it should favour converting the property to a string value. The function needs to return the variant with the property value.


TGetVariantProp

Callback type for the OnGetVariantProp callback event

Declaration

Source position: typinfo.pp line 442

type TGetVariantProp = function(

  Instance: TObject;

  PropInfo: PPropInfo

):Variant;

Description

The callback function must return the variant property with name PropName of instance Instance.


TIntfFlag

Type of interface.

Declaration

Source position: typinfo.pp line 59

type TIntfFlag = (
ifHasGuid, | Interface has GUID identifier
ifDispInterface, | Interface is a dual dispatch interface
ifDispatch, | Interface is a dispatch interface
ifHasStrGUID | Interface has a string GUID identifier
);


TIntfFlags

Set of TIntfFlag.

Declaration

Source position: typinfo.pp line 60

type TIntfFlags = set of (
ifHasGuid, | Interface has GUID identifier
ifDispInterface, | Interface is a dual dispatch interface
ifDispatch, | Interface is a dispatch interface
ifHasStrGUID | Interface has a string GUID identifier
);


TIntfFlagsBase

Set of TIntfFlag.

Declaration

Source position: typinfo.pp line 61

type TIntfFlagsBase = set of (
ifHasGuid, | Interface has GUID identifier
ifDispInterface, | Interface is a dual dispatch interface
ifDispatch, | Interface is a dispatch interface
ifHasStrGUID | Interface has a string GUID identifier
);


tkAny

Any property type

Declaration

Source position: typinfo.pp line 307

const tkAny = [Low(TTypeKind)..High(TTypeKind)];


tkMethods

Only method properties. (event handlers)

Declaration

Source position: typinfo.pp line 308

const tkMethods = [tkMethod];


tkProcedure

Procedure kind

Declaration

Source position: typinfo.pp line 306

const tkProcedure = tkProcVar;


tkProperties

Real properties. (not methods)

Declaration

Source position: typinfo.pp line 309

const tkProperties = tkAny - tkMethods - [tkUnknown];


tkString

Alias for the tsSString enumeration value

Declaration

Source position: typinfo.pp line 305

const tkString = tkSString;


TManagedField

Managed field description

Declaration

Source position: typinfo.pp line 131

type TManagedField = packed record
TypeRef: PTypeInfo; | Type information for the field
FldOffset: SizeInt; | Offset in the record memory layout
end;

Description

TManagedField describes 1 managed field in a record. It consists of type information (TypeRef) and an offset in the record's memory layout (FldOffset). Size can be determined from the type information.

See also

TManagedField | Managed field description
TTypeKind | Type of a property.
TTypeData | Class properties type data record.


TMethodKind

Method type description

Declaration

Source position: typinfo.pp line 54

type TMethodKind = (
mkProcedure, | Procedure method.
mkFunction, | Function method
mkConstructor, | Class constructor
mkDestructor, | Class Desctructor
mkClassProcedure, | Class procedure
mkClassFunction, | Class function
mkClassConstructor, | Class constructor method.
mkClassDestructor, | Class destructor method.
mkOperatorOverload | Operator overloader
);


TOrdType

Alias for TOrdType.

Declaration

Source position: typinfo.pp line 49

type TOrdType = (
otSByte, | Signed byte
otUByte, | Unsigned byte
otSWord, | Signed word
otUWord, | Unsigned word
otSLong, | Signed longint
otULong | Unsigned longing (Cardinal)
);

Description

If the property is and ordinal type, then TOrdType determines the size and sign of the ordinal type:


TParamFlag

Function or procedure parameter flags.

Declaration

Source position: typinfo.pp line 57

type TParamFlag = (
pfVar, | Parameter is a var parameter (passed by reference)
pfConst, | Parameter is a const parameter (i.e. cannot be modified)
pfArray, | Parameter is an array parameter
pfAddress, | Parameter is passed by address
pfReference, | Parameter is passed by reference
pfOut | Parameter is a string parameter
);

Description

TParamFlag describes a parameter.


TParamFlags

The kind of parameter for a method

Declaration

Source position: typinfo.pp line 58

type TParamFlags = set of (
pfVar, | Parameter is a var parameter (passed by reference)
pfConst, | Parameter is a const parameter (i.e. cannot be modified)
pfArray, | Parameter is an array parameter
pfAddress, | Parameter is passed by address
pfReference, | Parameter is passed by reference
pfOut | Parameter is a string parameter
);


TProcedureParam

Procedure parameter description

Declaration

Source position: typinfo.pp line 141

type TProcedureParam = packed record
Flags: Byte; | Flags for this parameter (see TParamFlags)
ParamType: PTypeInfo; | Type information for this parameter
Name: ShortString; | Parameter name as in declaration.
end;

Description

TProcedureParam describes a single parameter to a procedure (or function).


TProcedureSignature

Procedure signature description record

Declaration

Source position: typinfo.pp line 151

type TProcedureSignature = packed record
Flags: Byte; | Flags for this procedure
CC: TCallConv; | Calling convention for this procedure
ResultType: PTypeInfo; | Result type info (Nil if no result)
ParamCount: Byte; | Number of parameter descriptionss following the signature.
function GetParam(); | Get parameter signature
end;

Description

TProcedureSignature describes a procedure/method call signature. It consists of some flags (Flags), a calling convention (CC), the result type (ResultType) if any, and a list of ParamCount parameters (of type TProcedureParam).

See also

TProcedureParam | Procedure parameter description
TCallConv | Calling convention enumerator


GetParam

Get parameter signature

Declaration

Source position: typinfo.pp line 161

function TProcedureSignature.GetParam(

  ParamIndex: Integer

):PProcedureParam;

Description

GetParam can be used to retrieve a pointer to the description of a parameter. The index ParamIndex is zero-based.

Errors

In case of an invalid parameter index, Nil is returned.

See also

TProcedureParam

Procedure parameter description


TProcInfoProc

Property info callback method

Declaration

Source position: typinfo.pp line 299

type TProcInfoProc = procedure(

  PropInfo: PPropInfo

) of object;


TPropData

Property data record

Declaration

Source position: typinfo.pp line 269

type TPropData = packed record
PropCount: Word; | Property count.
PropList: record | Property list
_alignmentdummy: PtrInt;
end;
end;

Description

The TPropData record is not used, but is provided for completeness and compatibility with Delphi.


TPropInfo

Record describing one published property of a class

Declaration

Source position: typinfo.pp line 280

type TPropInfo = packed record
PropType: PTypeInfo; | Property type
GetProc: CodePointer; | Read handler
SetProc: CodePointer; | Write handler
StoredProc: CodePointer; | Procedure pointer for stored keyword.
Index: Integer; | Index for array properties
Default: LongInt; | Default value
NameIndex: SmallInt; | Index for indexed properties
PropProcs: Byte; | Flags describing property procedures.
Name: ShortString; | Property name
end;

Description

The TPropInfo record describes one published property of a class. The property information of a class are stored as an array of TPropInfo records.

The Name field is stored not with 255 characters, but with just as many characters as required to store the name.


TPropList

Array of property information pointers

Declaration

Source position: typinfo.pp line 302

type TPropList = array [0..65535] of PPropInfo;


TSetPropValue

Callback type for the OnSetPropValue callback event

Declaration

Source position: typinfo.pp line 441

type TSetPropValue = procedure(

  Instance: TObject;

  PropInfo: PPropInfo;

  const Value: Variant

);

Description

The callback function must set the property with name PropName of instance Instance to Value.


TSetVariantProp

Callback type for the OnSetVariantProp callback event

Declaration

Source position: typinfo.pp line 443

type TSetVariantProp = procedure(

  Instance: TObject;

  PropInfo: PPropInfo;

  const Value: Variant

);

Description

The callback function must set the variant property with name PropName of instance to Value.


TTypeData

Class properties type data record.

Declaration

Source position: typinfo.pp line 165

type TTypeData = packed record
case TTypeKind of
tkUnKnown, tkLString, tkWString, tkVariant, tkUString: (
);
tkAString: (
CodePage: Word; | Codepage for a single-byte string type
);
tkInteger, tkChar, tkEnumeration, tkBool, tkWChar, tkSet: (
OrdType: TOrdType; | Type is an ordinal type
case TTypeKind of
tkInteger, tkChar, tkEnumeration, tkBool, tkWChar: (
MinValue: LongInt; | Minimum value for the (subrange) type.
MaxValue: LongInt; | Maxmimum value for the (subrange) type.
case TTypeKind of
tkEnumeration: (
BaseType: PTypeInfo; | Base type on which this type is based.
NameList: ShortString; | List of names for an enumerated type
);
);
tkSet: (
CompType: PTypeInfo; | Comp type
);
);
tkFloat: (
FloatType: TFloatType; | Float type
);
tkSString: (
MaxLength: Byte; | Maximum length (for a shortstring type)
);
tkClass: (
ClassType: TClass; | Class type
ParentInfo: PTypeInfo; | Parent class type info
PropCount: SmallInt; | Property count for class type
UnitName: ShortString; | Unit name in which type is defined.
);
tkRecord: (
RecSize: Integer; | Record size for records
ManagedFldCount: Integer; | Number of managed fields (followed by managed field info)
);
tkHelper: (
HelperParent: PTypeInfo; | Type information for parent helper class
ExtendedInfo: PTypeInfo; | Type information for the extended type (record or class).
HelperProps: SmallInt; | Number of properties provided by the helper.
HelperUnit: ShortString; | Unit the helper class is defined in.
);
tkMethod: (
MethodKind: TMethodKind; | Kind of method
ParamCount: Byte; | Method parameter count
ParamList: array [0..1023] of Char; | Type data for parameters
);
tkProcVar: (
ProcSig: TProcedureSignature; | Procedure signature for procedure type
);
tkInt64: (
MinInt64Value: Int64; | Minimum Int64 value for subrange type.
MaxInt64Value: Int64; | Maximum int64 value for subrange type.
);
tkQWord: (
MinQWordValue: QWord; | Minimum QWord value for a subrange type.
MaxQWordValue: QWord; | Maximum QWord value for a subrange type.
);
tkInterface: (
IntfParent: PTypeInfo; | Parent interface type data.
IntfFlags: TIntfFlagsBase; | Interface flags
GUID: TGuid; | GUID identification for interface
IntfUnit: ShortString; | Interface unit.
);
tkInterfaceRaw: (
RawIntfParent: PTypeInfo; | Raw interface parent.
RawIntfFlags: TIntfFlagsBase; | Raw interface parent flags.
IID: TGuid; | GUID identifying raw interface.
RawIntfUnit: ShortString; | Raw interface unit.
IIDStr: ShortString; | IID string representation of interface
);
tkArray: (
ArrayData: TArrayTypeData; | Array element data
);
tkDynArray: (
elSize: PtrUInt; | Dynamical array element size
elType2: PTypeInfo; | Dynamical array Element type
varType: LongInt; | Dynamical array element type
elType: PTypeInfo; | Dynamical array Element type
DynUnitName: ShortStringBase; | Unit name
);
tkClassRef: (
InstanceType: PTypeInfo; | Pointer to instance type data
);
tkPointer: (
RefType: PTypeInfo; | Type info for referred type (Nil for untyped pointer)
);
end;

Description

If the typeinfo kind is tkClass, then the property information follows the UnitName string, as an array of TPropInfo records.


TTypeInfo

Type information record

Declaration

Source position: typinfo.pp line 107

type TTypeInfo = record
Kind: TTypeKind; | Type kind
Name: ShortString; | Type name
end;

Description

The TypeInfo function returns a pointer to a TTypeInfo record.

Note that the Name field is stored with as much bytes as needed to store the name, it is not padded to 255 characters. The type data immediately follows the TTypeInfo record as a TTypeData record.


TTypeKind

Type of a property.

Declaration

Source position: typinfo.pp line 42

type TTypeKind = (
tkUnknown, | Unknown property type.
tkInteger, | Integer property.
tkChar, | Char property.
tkEnumeration, | Enumeration type property.
tkFloat, | Float property.
tkSet, | Set property.
tkMethod, | Method property.
tkSString, | Shortstring property.
tkLString, | Longstring property.
tkAString, | Ansistring property.
tkWString, | Widestring property.
tkVariant, | Variant property.
tkArray, | Array property.
tkRecord, | Record property.
tkInterface, | Interface property.
tkClass, | Class property.
tkObject, | Object property.
tkWChar, | Widechar property.
tkBool, | Boolean property.
tkInt64, | Int64 property.
tkQWord, | QWord property.
tkDynArray, | Dynamical array property.
tkInterfaceRaw, | Raw interface property.
tkProcVar, | Procedural variable
tkUString, | Unicode string
tkUChar, | Unicode character
tkHelper, | Helper class type.
tkFile, | File type (both text and binary)
tkClassRef, | Class of type
tkPointer | Pointer type
);


TTypeKinds

Set of TTypeKind enumeration.

Declaration

Source position: typinfo.pp line 79

type TTypeKinds = set of (
tkUnknown, | Unknown property type.
tkInteger, | Integer property.
tkChar, | Char property.
tkEnumeration, | Enumeration type property.
tkFloat, | Float property.
tkSet, | Set property.
tkMethod, | Method property.
tkSString, | Shortstring property.
tkLString, | Longstring property.
tkAString, | Ansistring property.
tkWString, | Widestring property.
tkVariant, | Variant property.
tkArray, | Array property.
tkRecord, | Record property.
tkInterface, | Interface property.
tkClass, | Class property.
tkObject, | Object property.
tkWChar, | Widechar property.
tkBool, | Boolean property.
tkInt64, | Int64 property.
tkQWord, | QWord property.
tkDynArray, | Dynamical array property.
tkInterfaceRaw, | Raw interface property.
tkProcVar, | Procedural variable
tkUString, | Unicode string
tkUChar, | Unicode character
tkHelper, | Helper class type.
tkFile, | File type (both text and binary)
tkClassRef, | Class of type
tkPointer | Pointer type
);


TVmtFieldEntry

Describe a field of a record/class

Declaration

Source position: typinfo.pp line 83

type TVmtFieldEntry = packed record
FieldOffset: PtrUInt; | Offset of the field from the start of the class data
TypeIndex: Word; | Type of the field
Name: ShortString; | Name of the field
end;

Description

TVmtFieldEntry records are generated by the compiler for all fields of a record or class that have RTTI associated with them. They describe the field as known to the compiler.

See also

PVmtFieldEntry | Pointer to #rtl.typinfo.TVmtFieldEntry type.
TVmtFieldTable | Table of field descriptions for a class or record type.


TVmtFieldTable

Table of field descriptions for a class or record type.

Declaration

Source position: typinfo.pp line 94

type TVmtFieldTable = packed record
Count: Word; | Number of fields in the table
ClassTab: Pointer; | Class table
Fields: array [0..0] of TVmtFieldEntry; | Array of fields. Note that the elements in the table have variable size
end;

Description

TVmtFieldTable describes the fields for which RTTI was generated. A TVmtFieldTable entry is generated by the compiler in the RTI information, it is not something one creates manually. Basically it contains a list of TVmtFieldEntry values.

See also

TVmtFieldEntry

Describe a field of a record/class


ENDIAN_SUFFIX

Suffixes for endianness.

Declaration

Source position: unicodedata.pas line 444

const ENDIAN_SUFFIX: array [TEndianKind] of string = ('le', 'be');

Description

ENDIAN_SUFFIX contains the suffixes used in LoadCollation when constructing a collation filename for a language.

See also

LoadCollation

Load a binary collation data file from file


ERROR_INVALID_CODEPOINT_SEQUENCE

Error exit code for UnicodeToLower/UnicodeToUpper

Declaration

Source position: unicodedata.pas line 355

const ERROR_INVALID_CODEPOINT_SEQUENCE = 1;

See also

UnicodeToLower | Transform unicode string to lowercase
UnicodeToUpper | Transform unicode string to uppercase


HIGH_SURROGATE_BEGIN

First value for high surrogate values.

Declaration

Source position: unicodedata.pas line 102

const HIGH_SURROGATE_BEGIN = Word($D800);

See also

LOW_SURROGATE_END | Last value for low surrogate values.
LOW_SURROGATE_BEGIN | First value for low surrogate values.
HIGH_SURROGATE_END | Last value for high surrogate values.
HIGH_SURROGATE_COUNT | Number of high surrogate values.


HIGH_SURROGATE_COUNT

Number of high surrogate values.

Declaration

Source position: unicodedata.pas line 104

const HIGH_SURROGATE_COUNT = HIGH_SURROGATE_END - HIGH_SURROGATE_BEGIN + 1;

See also

LOW_SURROGATE_END | Last value for low surrogate values.
LOW_SURROGATE_BEGIN | First value for low surrogate values.
HIGH_SURROGATE_END | Last value for high surrogate values.
HIGH_SURROGATE_BEGIN | First value for high surrogate values.


HIGH_SURROGATE_END

Last value for high surrogate values.

Declaration

Source position: unicodedata.pas line 103

const HIGH_SURROGATE_END = Word($DBFF);

See also

LOW_SURROGATE_END | Last value for low surrogate values.
LOW_SURROGATE_BEGIN | First value for low surrogate values.
HIGH_SURROGATE_BEGIN | First value for high surrogate values.
HIGH_SURROGATE_COUNT | Number of high surrogate values.


Reference for unit 'unicodedata'

Unicode data management

uses

  System;

The system unit

Overview

The fpwidestring unit relies on having relevant unicode collation data linked in the binary. The unicode data is managed using the routines in the unicodedata unit. The FPC project distributes some unicode collation data in .bco files which can be loaded using the LoadCollation routines. The LoadCollation is the main routine of this unit.

All collation data requires at least the Default Unicode Collation Element Table to be registered (called DUCET). The DUCET encoding is provided by the unicodeducet unit, part of the rtl-unicode package.

There are two ways to register collations :

  1. at compile time: by including the desired collation unit, for example for Russian and Japanese languages to be available you will have to include collation_ru and collation_ja from package "rtl-unicode".
  2. at runtime using the abovementioned LoadCollation function.

The two ways can co-exist: some collations may be compile time included (for example for most used collations) and others can be loaded at runtime in the same application.

The binary collation files are endian sensitive:

  • there are files for little endian systems named collation__le.bco (such as collation_ru_le.bco and collation_ja_le.bco)
  • there are files for big endian systems named collation__be.bco (such as collation_ru_be.bco and collation_ja_be.bco).

Note that the compile time units collation units (collation_lang.pas) include already the unicodeducet.pas (DUCET) unit so it is not necessary to include it manually, contrary to the binary files. So an application that only uses the binary collation files should at least include the unicodeducet unit or manually load the binary collation collation_ducet_le.bco or collation_ducet_be.bco, depending on the endianness of the platform. The LoadCollation call using a directory and the language ducet automatically select the correct file.


Reference for unit 'unicodedata': Resource strings

SCollationNotFound
'Collation not found : "%s".'


Reference for unit 'unicodedata': Constants

ENDIAN_SUFFIX | Suffixes for endianness.
ERROR_INVALID_CODEPOINT_SEQUENCE | Error exit code for UnicodeToLower/UnicodeToUpper
HIGH_SURROGATE_BEGIN | First value for high surrogate values.
HIGH_SURROGATE_COUNT | Number of high surrogate values.
HIGH_SURROGATE_END | Last value for high surrogate values.
LOW_SURROGATE_BEGIN | First value for low surrogate values.
LOW_SURROGATE_END | Last value for low surrogate values.
MAX_LEGAL_UTF32 | Maximum value of a legally encoded UTF32 value (currently unused)
MAX_WORD | Maximum value of a WORD typed value
ROOT_COLLATION_NAME | Name of the root collation (used if no collation name is given)
UCS4_HALF_BASE | Offset for UCS4 character encoding
UCS4_HALF_MASK | Unused currently
UGC_ClosePunctuation | Unicode token category: Close punctuation
UGC_CombiningMark | Unicode token category: Uppercase letter
UGC_ConnectPunctuation | Unicode token category: Connect punctuation
UGC_Control | Unicode token category: control token
UGC_CurrencySymbol | Unicode token category: Currency symbol
UGC_DashPunctuation | Unicode token category: Dash punctuation
UGC_DecimalNumber | Unicode token category: Uppercase letter
UGC_EnclosingMark | Unicode token category: Uppercase letter
UGC_FinalPunctuation | Unicode token category: Final punctuation
UGC_Format | Unicode token category: Formatting token
UGC_InitialPunctuation | Unicode token category: Initial punctuation
UGC_LetterNumber | Unicode token category: Letter-number
UGC_LineSeparator | Unicode token category: Line separator
UGC_LowercaseLetter | Unicode general category: Lowercase letter
UGC_MathSymbol | Unicode token category: Math symbol
UGC_ModifierLetter | Unicode general category: modifier letter
UGC_ModifierSymbol | Unicode token category: modifier symbol
UGC_NonSpacingMark | Unicode general category: Non-spacing mark
UGC_OpenPunctuation | Unicode token category: Open puntctuation
UGC_OtherLetter | Unicode general category: Other letter
UGC_OtherNumber | Unicode token category: Other number
UGC_OtherPunctuation | Unicode token category: Other punctuation
UGC_OtherSymbol | Unicode token category: Other symbol
UGC_ParagraphSeparator | Unicode token category: Paragraph separator
UGC_PrivateUse | Unicode token category: For private use
UGC_SpaceSeparator | Unicode token category: Space separator
UGC_Surrogate | Unicode token category: Surrogate token
UGC_TitlecaseLetter | Unicode general category: Titlecase letter
UGC_Unassigned | Unicode token category: As yet unassigned
UGC_UppercaseLetter | Unicode general category: Uppercase letter
ZERO_UINT24 | Empty TUInt24Rec value


Reference for unit 'unicodedata': Types

PUCA_DataBook | Pointer to TUCA_DataBook type.
PUCA_PropItemContextRec | Pointer to TUCA_PropItemContextRec
PUCA_PropItemContextTreeNodeRec | Pointer to TUCA_PropItemContextTreeNodeRec
PUCA_PropItemContextTreeRec | Pointer to TUCA_PropItemContextTreeRec
PUCA_PropItemRec | Pointer to TUCA_PropItemRec
PUCA_PropWeights | Pointer to TUCA_PropWeights
PUC_Prop | Pointer to TUC_Prop record
PUInt24 | Pointer to TUInt24Rec
TCollationField | Options for the collation data
TCollationFields | Set of TCollationField
TCollationName | Collation name string type (fixed lenght)
TEndianKind | Endianness enumerator
TUCASortKey | Array of TUCASortKeyItem
TUCASortKeyItem | Alias for WORD
TUCA_DataBook | Collation data book
TUCA_PropItemContextRec | Internal structure for unicode collation data encoding.
TUCA_PropItemContextTreeNodeRec | Internal tree node structure for sorted storage of unicode collation data.
TUCA_PropItemContextTreeRec | Internal tree structure for sorted storage of unicode collation data
TUCA_PropItemRec | Unicode Collation data item properties
TUCA_PropWeights | Weights
TUCA_VariableKind | Options for weighting data
TUC_Prop | Unicode character properties record
TUInt24Rec | Unicode integer 24-bit data
UInt24 | Alias for TUInt24Rec


Reference for unit 'unicodedata': Procedures and functions

CanonicalOrder | Put unicode string in canonical order.
CompareSortKey | Compare two sort keys.
ComputeSortKey | Compute the sort key for a string
FindCollation | Find a collation by name
FreeCollation | Free collation data.
FromUCS4 | Convert UCS4 to UNicodeChar
GetCollationCount | Return the number of known collations.
GetProps | Get unicode character data
GetPropUCA | Get unicode collation algorithm properties for a unicode character
IncrementalCompareString | Compare 2 strings using the specified collation
LoadCollation | Load a binary collation data file from file
NormalizeNFD | Perform unicode normalization D on a string
PrepareCollation | Prepare a collation for use in the list
RegisterCollation | Register a new collation
ToUCS4 | Encode unicode UTF16 surrogate pair to UCS4 character
UnicodeIsHighSurrogate | Check if a UTF16 character is the high character in a surrogate pair.
UnicodeIsLowSurrogate | Check if a UTF16 character is the low character in a surrogate pair.
UnicodeIsSurrogatePair | Check if a pair of UTF16 encoded characters is a valid surrogate pair.
UnicodeToLower | Transform unicode string to lowercase
UnicodeToUpper | Transform unicode string to uppercase
UnregisterCollation | Remove a collation from the list of known collections.
UnregisterCollations | Unregister all collations.


Index of all identifiers in unit 'unicodedata'

B C E F G H I L M N P R S T U V Z

B

BackWard Big

C

CanonicalOrder CompareSortKey ComputeSortKey

E

ENDIAN_SUFFIX ERROR_INVALID_CODEPOINT_SEQUENCE

F

FindCollation FreeCollation FromUCS4

G

GetCollationCount GetProps GetPropUCA

H

HIGH_SURROGATE_BEGIN HIGH_SURROGATE_COUNT HIGH_SURROGATE_END

I

IncrementalCompareString

L

Little | LOW_SURROGATE_BEGIN
LoadCollation | LOW_SURROGATE_END

M

MAX_LEGAL_UTF32 MAX_WORD

N

NormalizeNFD

P

PrepareCollation | PUCA_PropItemContextTreeNodeRec | PUCA_PropWeights
PUCA_DataBook | PUCA_PropItemContextTreeRec | PUC_Prop
PUCA_PropItemContextRec | PUCA_PropItemRec | PUInt24

R

RegisterCollation ROOT_COLLATION_NAME

S

SCollationNotFound

T

TCollationField | TUCA_PropItemContextRec | TUCASortKeyItem
TCollationFields | TUCA_PropItemContextTreeNodeRec | TUCA_VariableKind
TCollationName | TUCA_PropItemContextTreeRec | TUC_Prop
TEndianKind | TUCA_PropItemRec | TUInt24Rec
ToUCS4 | TUCA_PropWeights |
TUCA_DataBook | TUCASortKey |

U

ucaBlanked | UGC_FinalPunctuation | UGC_ParagraphSeparator
ucaIgnoreSP | UGC_Format | UGC_PrivateUse
ucaNonIgnorable | UGC_InitialPunctuation | UGC_SpaceSeparator
ucaShifted | UGC_LetterNumber | UGC_Surrogate
ucaShiftedTrimmed | UGC_LineSeparator | UGC_TitlecaseLetter
UCS4_HALF_BASE | UGC_LowercaseLetter | UGC_Unassigned
UCS4_HALF_MASK | UGC_MathSymbol | UGC_UppercaseLetter
UGC_ClosePunctuation | UGC_ModifierLetter | UInt24
UGC_CombiningMark | UGC_ModifierSymbol | UnicodeIsHighSurrogate
UGC_ConnectPunctuation | UGC_NonSpacingMark | UnicodeIsLowSurrogate
UGC_Control | UGC_OpenPunctuation | UnicodeIsSurrogatePair
UGC_CurrencySymbol | UGC_OtherLetter | UnicodeToLower
UGC_DashPunctuation | UGC_OtherNumber | UnicodeToUpper
UGC_DecimalNumber | UGC_OtherPunctuation | UnregisterCollation
UGC_EnclosingMark | UGC_OtherSymbol | UnregisterCollations

V

VariableHighLimit VariableLowLimit

Z

ZERO_UINT24


LOW_SURROGATE_BEGIN

First value for low surrogate values.

Declaration

Source position: unicodedata.pas line 99

const LOW_SURROGATE_BEGIN = Word($DC00);

See also

LOW_SURROGATE_END | Last value for low surrogate values.
HIGH_SURROGATE_END | Last value for high surrogate values.
HIGH_SURROGATE_BEGIN | First value for high surrogate values.
HIGH_SURROGATE_COUNT | Number of high surrogate values.


LOW_SURROGATE_END

Last value for low surrogate values.

Declaration

Source position: unicodedata.pas line 100

const LOW_SURROGATE_END = Word($DFFF);

See also

LOW_SURROGATE_BEGIN | First value for low surrogate values.
HIGH_SURROGATE_END | Last value for high surrogate values.
HIGH_SURROGATE_BEGIN | First value for high surrogate values.
HIGH_SURROGATE_COUNT | Number of high surrogate values.


MAX_LEGAL_UTF32

Maximum value of a legally encoded UTF32 value (currently unused)

Declaration

Source position: unicodedata.pas line 107

const MAX_LEGAL_UTF32 = $10FFFF;


MAX_WORD

Maximum value of a WORD typed value

Declaration

Source position: unicodedata.pas line 98

const MAX_WORD = High(Word);

Description

MAX_WORD is the maximum value of a WORD typed value.


PUC_Prop

Pointer to TUC_Prop record

Declaration

Source position: unicodedata.pas line 206

type PUC_Prop = ^TUC_Prop;

See also

TUC_Prop

Unicode character properties record


PUCA_DataBook

Pointer to TUCA_DataBook type.

Declaration

Source position: unicodedata.pas line 329

type PUCA_DataBook = ^TUCA_DataBook;

See also

TUCA_DataBook

Collation data book


PUCA_PropItemContextRec

Pointer to TUCA_PropItemContextRec

Declaration

Source position: unicodedata.pas line 254

type PUCA_PropItemContextRec = ^TUCA_PropItemContextRec;

See also

TUCA_PropItemContextRec

Internal structure for unicode collation data encoding.


PUCA_PropItemContextTreeNodeRec

Pointer to TUCA_PropItemContextTreeNodeRec

Declaration

Source position: unicodedata.pas line 256

type PUCA_PropItemContextTreeNodeRec = ^TUCA_PropItemContextTreeNodeRec;

See also

TUCA_PropItemContextTreeNodeRec

Internal tree node structure for sorted storage of unicode collation data.


PUCA_PropItemContextTreeRec

Pointer to TUCA_PropItemContextTreeRec

Declaration

Source position: unicodedata.pas line 283

type PUCA_PropItemContextTreeRec = ^TUCA_PropItemContextTreeRec;

See also

TUCA_PropItemContextTreeRec

Internal tree structure for sorted storage of unicode collation data


PUCA_PropItemRec

Pointer to TUCA_PropItemRec

Declaration

Source position: unicodedata.pas line 320

type PUCA_PropItemRec = ^TUCA_PropItemRec;

See also

TUCA_PropItemRec

Unicode Collation data item properties


PUCA_PropWeights

Pointer to TUCA_PropWeights

Declaration

Source position: unicodedata.pas line 243

type PUCA_PropWeights = ^TUCA_PropWeights;

See also

TUCA_PropWeights

Weights


PUInt24

Pointer to TUInt24Rec

Declaration

Source position: unicodedata.pas line 195

type PUInt24 = ^UInt24;

See also

TUInt24Rec

Unicode integer 24-bit data


ROOT_COLLATION_NAME

Name of the root collation (used if no collation name is given)

Declaration

Source position: unicodedata.pas line 354

const ROOT_COLLATION_NAME = 'DUCET';


TCollationField

Options for the collation data

Declaration

Source position: unicodedata.pas line 350

type TCollationField = (
BackWard, | Backwards encoded
VariableLowLimit, | Has lower bound on variable weights
VariableHighLimit | Has upper bound on variable weights
);

Description

TCollationField describes some properties of the collation data items.

See also

TCollationFields

Set of TCollationField


TCollationFields

Set of TCollationField

Declaration

Source position: unicodedata.pas line 351

type TCollationFields = set of (
BackWard, | Backwards encoded
VariableLowLimit, | Has lower bound on variable weights
VariableHighLimit | Has upper bound on variable weights
);

See also

TCollationField

Options for the collation data


TCollationName

Collation name string type (fixed lenght)

Declaration

Source position: unicodedata.pas line 327

type TCollationName = string;


TEndianKind

Endianness enumerator

Declaration

Source position: unicodedata.pas line 442

type TEndianKind = (
Little, | Little-endian platform
Big | Big-endian platform
);

Description

TEndianKind is an auxiliary enumerated type to enumerate the endianness of platforms.


TUC_Prop

Unicode character properties record

Declaration

Source position: unicodedata.pas line 215

type TUC_Prop = packed record
public
CategoryData: Byte; | Category data
CCC: Byte; |
NumericIndex: Byte; | Index in numeric values array
SimpleUpperCase: UInt24; | Simple uppercase version
SimpleLowerCase: UInt24; | Simple lowercase version
DecompositionID: SmallInt; | Decomposition ID
property Category: Byte; [rw] | Get the category
property WhiteSpace: Boolean; [rw] | Is the character considered whitespace
property HangulSyllable: Boolean; [rw] | Is the character a hangul syllable
property NumericValue: Double; [r] | Numeric value
end;

Description

TUC_Prop describes the collation characteristics of a unicode character. It is an internal structure which should not be used directly, the actual structure is subject to change.


TUC_Prop.Category

Get the category

Declaration

Source position: unicodedata.pas line 233

public property TUC_Prop.Category : Byte
  read GetCategory
  write SetCategory;

Description

CategoryData provides access to the category part of CategoryData (encoded).


TUC_Prop.HangulSyllable

Is the character a hangul syllable

Declaration

Source position: unicodedata.pas line 235

public property TUC_Prop.HangulSyllable : Boolean
  read GetHangulSyllable
  write SetHangulSyllable;

Description

Whitespace provides easy access to the HangulSyllable part of CategoryData (encoded).


TUC_Prop.NumericValue

Numeric value

Declaration

Source position: unicodedata.pas line 236

public property TUC_Prop.NumericValue : Double
  read GetNumericValue;

Description

NumericValue uses numericalindex to get the numerical value.


TUC_Prop.WhiteSpace

Is the character considered whitespace

Declaration

Source position: unicodedata.pas line 234

public property TUC_Prop.WhiteSpace : Boolean
  read GetWhiteSpace
  write SetWhiteSpace;

Description

Whitespace provides easy access to the Whitespace part of CategoryData (encoded).


TUCA_DataBook

Collation data book

Declaration

Source position: unicodedata.pas line 330

type TUCA_DataBook = record
public
Base: PUCA_DataBook; | Collation set on which this collation set is based.
Version: TCollationName; | Version of this collation.
CollationName: TCollationName; | Name of this collation
VariableWeight: TUCA_VariableKind; | How collation weights are encoded
Backwards: ; | Is the collation weighting in backwards direction
BMP_Table1: PByte; | Basic Multilingual Plane Data, table 1 (code points U+0000..U+FFFF)
BMP_Table2: PUInt24; | Basic Multilingual Plane Data, table 2 (code points U+0000..U+FFFF)
OBMP_Table1: PWord; | Data for code points above U+FFFF, table 1
OBMP_Table2: PUInt24; | Data for code points above U+FFFF, table 2
PropCount: Integer; | Property count (number of items in table)
Props: PUCA_PropItemRec; | Property data.
VariableLowLimit: Word; | First variable weighted weight
VariableHighLimit: Word; | Last variable weighted weight
Dynamic: Boolean; | Indicates the data was loaded from file (True) or is compiled-in (False).
function IsVariable(); | Check if a weight is a variable weight
end;

Description

TUCA_DataBook describes a Unicode Collation Alghorithm data set. data sets can be registered using the RegisterCollation function or loaded from file using LoadCollation. A collation data book must be specified when comparing unicode strings.

See also

RegisterCollation | Register a new collation
LoadCollation | Load a binary collation data file from file
IncrementalCompareString | Compare 2 strings using the specified collation


IsVariable

Check if a weight is a variable weight

Declaration

Source position: unicodedata.pas line 347

function TUCA_DataBook.IsVariable(

  const AWeight: PUCA_PropWeights

):Boolean;

Arguments

AWeight

Weight to check

Function result

True if the weight is in the variable range.

Description

IsVariable checks whether AWeight is between the VariableLowLimit and VariableHighLimit limits.


TUCA_PropItemContextRec

Internal structure for unicode collation data encoding.

Declaration

Source position: unicodedata.pas line 246

type TUCA_PropItemContextRec = packed record
public
CodePointCount: Byte; | Number of code points.
WeightCount: Byte; | Number of weights.
function GetCodePoints; | get the address of actual code points.
function GetWeights; | Get the Address of actual weights.
end;

Description

This is an internal structure which should not be used directly, the actual structure is subject to change.


GetCodePoints

get the address of actual code points.

Declaration

Source position: unicodedata.pas line 251

function TUCA_PropItemContextRec.GetCodePoints: PUInt24;

Function result

address of actual code points.


GetWeights

Get the Address of actual weights.

Declaration

Source position: unicodedata.pas line 252

function TUCA_PropItemContextRec.GetWeights: PUCA_PropWeights;

Function result

Address of actual weights.


TUCA_PropItemContextTreeNodeRec

Internal tree node structure for sorted storage of unicode collation data.

Declaration

Source position: unicodedata.pas line 257

type TUCA_PropItemContextTreeNodeRec = packed record
public
Left: Word; | Offset of left branch of the tree
Right: Word; | Offset of right branch of the tree
Data: TUCA_PropItemContextRec; | Data for this node.
function GetLeftNode; | Access to left tree node data
function GetRightNode; | Access to right tree node data
end;

Description

This is an internal structure for the tree which should not be used directly, the actual structure is subject to change.

See also

TUCA_PropItemContextTreeRec

Internal tree structure for sorted storage of unicode collation data


GetLeftNode

Access to left tree node data

Declaration

Source position: unicodedata.pas line 263

function TUCA_PropItemContextTreeNodeRec.GetLeftNode: PUCA_PropItemContextTreeNodeRec;

Function result

Address of left node


GetRightNode

Access to right tree node data

Declaration

Source position: unicodedata.pas line 264

function TUCA_PropItemContextTreeNodeRec.GetRightNode: PUCA_PropItemContextTreeNodeRec;

Function result

Address of right node


TUCA_PropItemContextTreeRec

Internal tree structure for sorted storage of unicode collation data

Declaration

Source position: unicodedata.pas line 270

type TUCA_PropItemContextTreeRec = packed record
public
Size: UInt24; | Size of the tree data
function GetData; | Access to tree data (getter for Data property)
property Data: PUCA_PropItemContextTreeNodeRec; [r] | Read-only access to tree data
function Find(); | Find data for encoded character
end;

Description

This is an internal tree structure for storing unicode collation data which should not be used directly, the actual structure is subject to change.

See also

TUCA_PropItemContextTreeNodeRec

Internal tree node structure for sorted storage of unicode collation data.


TUCA_PropItemContextTreeRec.Data

Read-only access to tree data

Declaration

Source position: unicodedata.pas line 275

public property TUCA_PropItemContextTreeRec.Data : PUCA_PropItemContextTreeNodeRec
  read GetData;


Find

Find data for encoded character

Declaration

Source position: unicodedata.pas line 277

function TUCA_PropItemContextTreeRec.Find(

  const AChars: PUInt24;

  const ACharCount: Integer;

  out ANode: PUCA_PropItemContextTreeNodeRec

):Boolean;

Arguments

AChars | Unicode character to search
ACharCount | Number of encoding elements
ANode | Pointer to collation data.

Function result

True if collation data was found

Description

Find searches the tree for the collation data for the character encoded in AChars (ACharCount). It returns true if the data was found, false if not. A pointer to the collation data is returned in ANode.


GetData

Access to tree data (getter for Data property)

Declaration

Source position: unicodedata.pas line 274

function TUCA_PropItemContextTreeRec.GetData: PUCA_PropItemContextTreeNodeRec;

Function result

Address of the tree data


TUCA_PropItemRec

Unicode Collation data item properties

Declaration

Source position: unicodedata.pas line 287

type TUCA_PropItemRec = packed record
public
WeightLength: Byte; | Number of weights
ChildCount: Byte; | Number of childs
Size: Word; | Total size (in bytes) of data
Flags: Byte; | Flags for this item
function HasCodePoint; | Check flags whether a codepoint is present.
property CodePoint: UInt24; [r] | Get the codepoint
function IsValid; | Check flags for validity
procedure GetWeightArray(); | Return an array of weights
function GetSelfOnlySize; | Size of this item data (in bytes).
function GetContextual; | Check if the contextual bit is set in the flags (getter for Contextual)
property Contextual: Boolean; [r] | Check if the contextual bit is set in the flags
function GetContext; | Access to context data
function IsDeleted; | Check flags if deleted bit is set
function IsWeightCompress_1; | Check whether weight compression flag 1 is set
function IsWeightCompress_2; | Check whether weight compression flag 2 is set
end;

Description

TUCA_PropItemRec encodes 1 entry from the Unicode Collation data in an encoded form.

See also

TUCA_PropItemContextTreeRec

Internal tree structure for sorted storage of unicode collation data


TUCA_PropItemRec.CodePoint

Get the codepoint

Declaration

Source position: unicodedata.pas line 304

public property TUCA_PropItemRec.CodePoint : UInt24
  read GetCodePoint;

Description

Access to codepoint if HasCodePoint returns true. If HasCodePoint returns false, an exception will be raised.


TUCA_PropItemRec.Contextual

Check if the contextual bit is set in the flags

Declaration

Source position: unicodedata.pas line 313

public property TUCA_PropItemRec.Contextual : Boolean
  read GetContextual;


GetContext

Access to context data

Declaration

Source position: unicodedata.pas line 314

function TUCA_PropItemRec.GetContext: PUCA_PropItemContextTreeRec;

Function result

Address of context data.

Description

GetContext returns a pointer to the context data. It is Nil if the context flag is not set.


GetContextual

Check if the contextual bit is set in the flags (getter for Contextual)

Declaration

Source position: unicodedata.pas line 312

function TUCA_PropItemRec.GetContextual: Boolean;

Function result

True if the bit is set.


GetSelfOnlySize

Size of this item data (in bytes).

Declaration

Source position: unicodedata.pas line 310

function TUCA_PropItemRec.GetSelfOnlySize: Cardinal;

Function result

Size, in bytes

Description

Return the size of the item's data and properties.


GetWeightArray

Return an array of weights

Declaration

Source position: unicodedata.pas line 309

procedure TUCA_PropItemRec.GetWeightArray(

  ADest: PUCA_PropWeights

);

Arguments

ADest

Memory location to which weight data will be copied.

Description

GetWeightArray returns an array with the weights in ADest. ADest must point to enough room for WeightLength weights.


HasCodePoint

Check flags whether a codepoint is present.

Declaration

Source position: unicodedata.pas line 303

function TUCA_PropItemRec.HasCodePoint: Boolean;

Function result

True if a codepoint is present.


IsDeleted

Check flags if deleted bit is set

Declaration

Source position: unicodedata.pas line 316

function TUCA_PropItemRec.IsDeleted: Boolean;

Function result

True if the deleted bit is set


IsValid

Check flags for validity

Declaration

Source position: unicodedata.pas line 307

function TUCA_PropItemRec.IsValid: Boolean;

Function result

true if the flags validity bit is set


IsWeightCompress_1

Check whether weight compression flag 1 is set

Declaration

Source position: unicodedata.pas line 317

function TUCA_PropItemRec.IsWeightCompress_1: Boolean;

Function result

True if weight compression flag 1 is set


IsWeightCompress_2

Check whether weight compression flag 2 is set

Declaration

Source position: unicodedata.pas line 318

function TUCA_PropItemRec.IsWeightCompress_2: Boolean;

Function result

True if weight compression flag 2 is set


TUCA_PropWeights

Weights

Declaration

Source position: unicodedata.pas line 240

type TUCA_PropWeights = packed record

  Weights: array [0..2] of Word;

Weights of collation data

end;

Description

TUC_PropWeights describes the weights of collation characteristics of a unicode character. It is an internal structure which should not be used directly, the actual structure is subject to change.


TUCA_VariableKind

Options for weighting data

Declaration

Source position: unicodedata.pas line 322

type TUCA_VariableKind = (
ucaShifted, | Variable collation elements are reset to zero at levels one through three
ucaNonIgnorable, | Variable collation elements are not reset to be quaternary collation elements
ucaBlanked, | Variable collation elements and any subsequent ignorable collation elements are reset so that all weights (except for the identical level) are zero
ucaShiftedTrimmed, | This option is the same as Shifted, except that all trailing FFFFs are trimmed from the sort key.
ucaIgnoreSP | Not implemented (variant of Shifted that reduces the set of variable collation elements to include only spaces and punctuation)
);


TUCASortKey

Array of TUCASortKeyItem

Declaration

Source position: unicodedata.pas line 390

type TUCASortKey = array of TUCASortKeyItem;

See also

TUCASortKeyItem

Alias for WORD


TUCASortKeyItem

Alias for WORD

Declaration

Source position: unicodedata.pas line 389

type TUCASortKeyItem = Word;


TUInt24Rec

Unicode integer 24-bit data

Declaration

Source position: unicodedata.pas line 150

type TUInt24Rec = packed record
public
byte2: Byte; | Third byte
byte1: Byte; | Second byte
byte0: Byte; | First byte
class operator implicit(TUInt24Rec):Cardinal(); | Assign TUInt24Rec to cardinal
class operator implicit(TUInt24Rec):LongInt(); | Assign TUInt24Rec to longint
class operator implicit(TUInt24Rec):Word(); | Assign TUInt24Rec to word
class operator implicit(TUInt24Rec):Byte(); | Assign TUInt24Rec to byte
class operator implicit(Cardinal):TUInt24Rec(); | Assign TUInt24Recfrom Cardinal
class operator equal(TUInt24Rec,TUInt24Rec):Boolean(); | Determine equality of 2 TUInt24Rec records
class operator equal(TUInt24Rec,Cardinal):Boolean(); | Check if cardinal and TUInt24Rec are equal
class operator equal(Cardinal,TUInt24Rec):Boolean(); | Check whether a TUInt24Rec value equals a cardinal value.
class operator equal(TUInt24Rec,LongInt):Boolean(); | Check whether a TUInt24Rec value equals a longint value.
class operator equal(LongInt,TUInt24Rec):Boolean(); | Check whether a TUInt24Rec value equals a longint value.
class operator equal(TUInt24Rec,Word):Boolean(); | Check whether a TUInt24Rec value equals a word value.
class operator equal(Word,TUInt24Rec):Boolean(); | Check whether a TUInt24Rec value equals a word value.
class operator equal(TUInt24Rec,Byte):Boolean(); | Check whether a TUInt24Rec value equals a byte value.
class operator equal(Byte,TUInt24Rec):Boolean(); | Check whether a TUInt24Rec value equals a byte value.
class operator notequal(TUInt24Rec,TUInt24Rec):Boolean(); | Check whether 2 TUInt24Rec values differ.
class operator notequal(TUInt24Rec,Cardinal):Boolean(); | Check whether a TUInt24Rec value differs from a cardinal value.
class operator notequal(Cardinal,TUInt24Rec):Boolean(); | Check whether a TUInt24Rec value differs from a cardinal value.
class operator greaterthan(TUInt24Rec,TUInt24Rec):Boolean(); | Check whether a TUInt24Rec value is greater than another TUInt24Rec value
class operator greaterthan(TUInt24Rec,Cardinal):Boolean(); | Check whether a TUInt24Rec value is greater than a cardinal value
class operator greaterthan(Cardinal,TUInt24Rec):Boolean(); | Check whether a cardinal value is greater than a TUInt24Rec value
class operator greaterthanorequal(TUInt24Rec,TUInt24Rec):Boolean(); | Check whether a TUInt24Rec value is greater than or equal to a cardinal value
class operator greaterthanorequal(TUInt24Rec,Cardinal):Boolean(); | Check whether a TUInt24Rec value is greater than or equal to a cardinal value
class operator greaterthanorequal(Cardinal,TUInt24Rec):Boolean(); | Check whether a cardinal value is greater than or equal to a TUInt24Rec value
class operator lessthan(TUInt24Rec,TUInt24Rec):Boolean(); | Check whether a TUInt24Rec value is less than another TUInt24Rec value
class operator lessthan(TUInt24Rec,Cardinal):Boolean(); | Check whether a TUInt24Rec value is less than a cardinal value
class operator lessthan(Cardinal,TUInt24Rec):Boolean(); | Check whether a cardinal value is less than a TUInt24Rec value
class operator lessthanorequal(TUInt24Rec,TUInt24Rec):Boolean(); | Check whether a TUInt24Rec value is less than or equal to another TUInt24Rec value
class operator lessthanorequal(TUInt24Rec,Cardinal):Boolean(); | Check whether a TUInt24Rec value is less than or equal to a cardinal value
class operator lessthanorequal(Cardinal,TUInt24Rec):Boolean(); | Check whether a cardinal value is less than or equal to a TUInt24Rec value
end;

Description

Unicode data exists mostly of 24-bit data (3 bytes). This type is meant to deal efficiently with this data. it has members to split out the data in bytes, and functions to query the various properties stored in the data.


equal(Byte,TUInt24Rec):Boolean

Check whether a TUInt24Rec value equals a byte value.

Declaration

Source position: unicodedata.pas line 175

class operator TUInt24Rec.equal(Byte,TUInt24Rec):Boolean(

  a: Byte;

  b: TUInt24Rec

):Boolean;

Arguments

a | Byte value to compare
b | TUInt24Rec to compare

Function result

True if a and b are equal

Description

The byte b is considered equal to a if it equals byte0 and byte1 and byte1 are zero.


equal(Cardinal,TUInt24Rec):Boolean

Check whether a TUInt24Rec value equals a cardinal value.

Declaration

Source position: unicodedata.pas line 166

class operator TUInt24Rec.equal(Cardinal,TUInt24Rec):Boolean(

  a: Cardinal;

  b: TUInt24Rec

):Boolean;

Arguments

a | Cardinal to compare
b | TUInt24Rec to compare

Function result

True if a and b are equal

Description

The cardinal a is considered equal to b if the fourth byte (LSB) is zero, and the first three bytes equal byte0, byte1, and byte2.


equal(LongInt,TUInt24Rec):Boolean

Check whether a TUInt24Rec value equals a longint value.

Declaration

Source position: unicodedata.pas line 169

class operator TUInt24Rec.equal(LongInt,TUInt24Rec):Boolean(

  a: LongInt;

  b: TUInt24Rec

):Boolean;

Arguments

a | Longint value to compare
b | TUInt24Rec to compare

Function result

True if a and b are equal

Description

The longint a is considered equal to b if the fourth byte (LSB) is zero, and the first three bytes equal byte0, byte1, and byte2.


equal(TUInt24Rec,Cardinal):Boolean

Check if cardinal and TUInt24Rec are equal

Declaration

Source position: unicodedata.pas line 165

class operator TUInt24Rec.equal(TUInt24Rec,Cardinal):Boolean(

  a: TUInt24Rec;

  b: Cardinal

):Boolean;

Arguments

a | TUInt24Rec to compare
b | Cardinal to compare

Function result

True if a and b are equal

Description

The cardinal b is considered equal to a if the fourth byte (LSB) is zero, and the first three bytes equal byte0, byte1, and byte2.


equal(TUInt24Rec,LongInt):Boolean

Check whether a TUInt24Rec value equals a longint value.

Declaration

Source position: unicodedata.pas line 168

class operator TUInt24Rec.equal(TUInt24Rec,LongInt):Boolean(

  a: TUInt24Rec;

  b: LongInt

):Boolean;

Arguments

a | TUInt24Rec to compare
b | Longint value to compare

Function result

True if a and b are equal

Description

The longint b is considered equal to a if the fourth byte (LSB) is zero, and the first three bytes equal byte0, byte1, and byte2.


equal(TUInt24Rec,Word):Boolean

Check whether a TUInt24Rec value equals a word value.

Declaration

Source position: unicodedata.pas line 171

class operator TUInt24Rec.equal(TUInt24Rec,Word):Boolean(

  a: TUInt24Rec;

  b: Word

):Boolean;

Arguments

a | TUInt24Rec to compare
b | Word value to compare

Function result

True if a and b are equal

Description

The word b is considered equal to a if its 2 bytes equal byte0, byte1 and byte2 is zero.


equal(TUInt24Rec,TUInt24Rec):Boolean

Determine equality of 2 TUInt24Rec records

Declaration

Source position: unicodedata.pas line 163

class operator TUInt24Rec.equal(TUInt24Rec,TUInt24Rec):Boolean(

  a: TUInt24Rec;

  b: TUInt24Rec

):Boolean;

Arguments

a | First record
b | Second record

Function result

True if a equals b.

Description

The 2 records are considered equal if the 3 bytes are equal.


equal(TUInt24Rec,Byte):Boolean

Check whether a TUInt24Rec value equals a byte value.

Declaration

Source position: unicodedata.pas line 174

class operator TUInt24Rec.equal(TUInt24Rec,Byte):Boolean(

  a: TUInt24Rec;

  b: Byte

):Boolean;

Arguments

a | TUInt24Rec to compare
b | Byte value to compare

Function result

True if a and b are equal

Description

The byte b is considered equal to a if it equals byte0 and byte1 and byte1 are zero.


equal(Word,TUInt24Rec):Boolean

Check whether a TUInt24Rec value equals a word value.

Declaration

Source position: unicodedata.pas line 172

class operator TUInt24Rec.equal(Word,TUInt24Rec):Boolean(

  a: Word;

  b: TUInt24Rec

):Boolean;

Arguments

a | Word value to compare
b | TUInt24Rec to compare

Function result

True if a and b are equal

Description

The word a is considered equal to b if its 2 bytes equal byte0, byte1 and byte2 is zero.


greaterthan(Cardinal,TUInt24Rec):Boolean

Check whether a cardinal value is greater than a TUInt24Rec value

Declaration

Source position: unicodedata.pas line 182

class operator TUInt24Rec.greaterthan(Cardinal,TUInt24Rec):Boolean(

  a: Cardinal;

  b: TUInt24Rec

):Boolean;

Arguments

a | Cardinal value to compare
b | TUInt24Rec to compare

Function result

True if a is greater than b

Description

The comparison is done by comparing 3 first bytes of the cardinal value with bytes byte0, byte1 and byte2.


greaterthan(TUInt24Rec,Cardinal):Boolean

Check whether a TUInt24Rec value is greater than a cardinal value

Declaration

Source position: unicodedata.pas line 181

class operator TUInt24Rec.greaterthan(TUInt24Rec,Cardinal):Boolean(

  a: TUInt24Rec;

  b: Cardinal

):Boolean;

Arguments

a | TUInt24Rec to compare
b | Cardinal value to compare

Function result

True if a is greater than b

Description

The comparison is done by comparing 3 first bytes of the cardinal value with bytes byte0, byte1 and byte2.


greaterthan(TUInt24Rec,TUInt24Rec):Boolean

Check whether a TUInt24Rec value is greater than another TUInt24Rec value

Declaration

Source position: unicodedata.pas line 180

class operator TUInt24Rec.greaterthan(TUInt24Rec,TUInt24Rec):Boolean(

  a: TUInt24Rec;

  b: TUInt24Rec

):Boolean;

Arguments

a | First TUInt24Rec to compare
b | Second TUInt24Rec to compare

Function result

True if a is greater than b

Description

The comparison is done by comparing 3 bytes byte0, byte1 and byte2


greaterthanorequal(Cardinal,TUInt24Rec):Boolean

Check whether a cardinal value is greater than or equal to a TUInt24Rec value

Declaration

Source position: unicodedata.pas line 185

class operator TUInt24Rec.greaterthanorequal(Cardinal,TUInt24Rec):Boolean(

  a: Cardinal;

  b: TUInt24Rec

):Boolean;

Arguments

a | Cardinal value to compare
b | TUInt24Rec to compare

Function result

True if a is greater than or equal to b

Description

The comparison is done by comparing 3 first bytes of the cardinal value with bytes byte0, byte1 and byte2.


greaterthanorequal(TUInt24Rec,Cardinal):Boolean

Check whether a TUInt24Rec value is greater than or equal to a cardinal value

Declaration

Source position: unicodedata.pas line 184

class operator TUInt24Rec.greaterthanorequal(TUInt24Rec,Cardinal):Boolean(

  a: TUInt24Rec;

  b: Cardinal

):Boolean;

Arguments

a | TUInt24Rec to compare
b | Cardinal value to compare

Function result

True if a is greater than or equal to b

Description

The comparison is done by comparing 3 first bytes of the cardinal value with bytes byte0, byte1 and byte2.


greaterthanorequal(TUInt24Rec,TUInt24Rec):Boolean

Check whether a TUInt24Rec value is greater than or equal to a cardinal value

Declaration

Source position: unicodedata.pas line 183

class operator TUInt24Rec.greaterthanorequal(TUInt24Rec,TUInt24Rec):Boolean(

  a: TUInt24Rec;

  b: TUInt24Rec

):Boolean;

Arguments

a | First TUInt24Rec to compare
b | Second TUInt24Rec to compare

Function result

True if a is greater than or equal to b

Description

The comparison is done by comparing 3 first bytes of the cardinal value with bytes byte0, byte1 and byte2.


implicit(Cardinal):TUInt24Rec

Assign TUInt24Recfrom Cardinal

Declaration

Source position: unicodedata.pas line 162

class operator TUInt24Rec.implicit(Cardinal):TUInt24Rec(

  a: Cardinal

):TUInt24Rec;

Arguments

a

Cardinal to assign from

Function result

Resulting TUInt24Rec

Description

Assign from cardinal, byte0 to MSB.

Errors

If the value is too big (>$FFFFFF) to be assigned, an overflow error occurs.

See also

TUInt24Rec.implicit(TUInt24Rec):Longint | Assign TUInt24Rec to longint
TUInt24Rec.implicit(TUInt24Rec):Word | Assign TUInt24Rec to word
TUInt24Rec.implicit(TUInt24Rec):Byte | Assign TUInt24Rec to byte
TUInt24Rec.implicit(Longint):TUInt24Rec
TUInt24Rec.implicit(Word):TUInt24Rec
TUInt24Rec.implicit(Byte):TUInt24Rec


implicit(TUInt24Rec):Cardinal

Assign TUInt24Rec to cardinal

Declaration

Source position: unicodedata.pas line 158

class operator TUInt24Rec.implicit(TUInt24Rec):Cardinal(

  a: TUInt24Rec

):Cardinal;

Arguments

a

TUInt24Rec record to assign

Function result

Cardinal to assign to

Description

Assign to cardinal, byte0 to MSB and so on.

See also

TUInt24Rec.implicit(TUInt24Rec):LongInt | Assign TUInt24Rec to longint
TUInt24Rec.implicit(TUInt24Rec):Word | Assign TUInt24Rec to word
TUInt24Rec.implicit(TUInt24Rec):Byte | Assign TUInt24Rec to byte
TUInt24Rec.implicit(Cardinal):TUInt24Rec | Assign TUInt24Recfrom Cardinal
TUInt24Rec.implicit(Longint):TUInt24Rec
TUInt24Rec.implicit(Word):TUInt24Rec
TUInt24Rec.implicit(Byte):TUInt24Rec


implicit(TUInt24Rec):LongInt

Assign TUInt24Rec to longint

Declaration

Source position: unicodedata.pas line 159

class operator TUInt24Rec.implicit(TUInt24Rec):LongInt(

  a: TUInt24Rec

):LongInt;

Arguments

a

TUInt24Rec record to assign

Function result

Longint to assign to

Description

Assign to cardinal, byte0 to MSB and so on.

See also

TUInt24Rec.implicit(TUInt24Rec):Cardinal | Assign TUInt24Rec to cardinal
TUInt24Rec.implicit(TUInt24Rec):Word | Assign TUInt24Rec to word
TUInt24Rec.implicit(TUInt24Rec):Byte | Assign TUInt24Rec to byte


implicit(TUInt24Rec):Word

Assign TUInt24Rec to word

Declaration

Source position: unicodedata.pas line 160

class operator TUInt24Rec.implicit(TUInt24Rec):Word(

  a: TUInt24Rec

):Word;

Arguments

a

TUInt24Rec record to assign

Function result

Word to assign to

Description

Assign to word, byte0 to MSB, byte1 to MSB.

Errors

If the value is too big (>$FFFF) to be assigned, an overflow error occurs.

See also

TUInt24Rec.implicit(TUInt24Rec):Cardinal | Assign TUInt24Rec to cardinal
TUInt24Rec.implicit(TUInt24Rec):Longint | Assign TUInt24Rec to longint
TUInt24Rec.implicit(TUInt24Rec):Byte | Assign TUInt24Rec to byte
TUInt24Rec.implicit(Cardinal):TUInt24Rec | Assign TUInt24Recfrom Cardinal
TUInt24Rec.implicit(Longint):TUInt24Rec
TUInt24Rec.implicit(Word):TUInt24Rec
TUInt24Rec.implicit(Byte):TUInt24Rec


implicit(TUInt24Rec):Byte

Assign TUInt24Rec to byte

Declaration

Source position: unicodedata.pas line 161

class operator TUInt24Rec.implicit(TUInt24Rec):Byte(

  a: TUInt24Rec

):Byte;

Arguments

a

TUInt24Rec record to assign

Function result

Byte to assign to

Description

Assign to byte, byte0 is assigned.

Errors

If the value is too big (>$FF) to be assigned, an overflow error occurs.

See also

TUInt24Rec.implicit(TUInt24Rec):Cardinal | Assign TUInt24Rec to cardinal
TUInt24Rec.implicit(TUInt24Rec):Longint | Assign TUInt24Rec to longint
TUInt24Rec.implicit(TUInt24Rec):Word | Assign TUInt24Rec to word
TUInt24Rec.implicit(Cardinal):TUInt24Rec | Assign TUInt24Recfrom Cardinal
TUInt24Rec.implicit(Longint):TUInt24Rec
TUInt24Rec.implicit(Word):TUInt24Rec
TUInt24Rec.implicit(Byte):TUInt24Rec


lessthan(Cardinal,TUInt24Rec):Boolean

Check whether a cardinal value is less than a TUInt24Rec value

Declaration

Source position: unicodedata.pas line 188

class operator TUInt24Rec.lessthan(Cardinal,TUInt24Rec):Boolean(

  a: Cardinal;

  b: TUInt24Rec

):Boolean;

Arguments

a | Cardinal value to compare
b | TUInt24Rec to compare>

Function result

True if a is less than b


lessthan(TUInt24Rec,Cardinal):Boolean

Check whether a TUInt24Rec value is less than a cardinal value

Declaration

Source position: unicodedata.pas line 187

class operator TUInt24Rec.lessthan(TUInt24Rec,Cardinal):Boolean(

  a: TUInt24Rec;

  b: Cardinal

):Boolean;

Arguments

a | TUInt24Rec to compare
b | Cardinal value to compare

Function result

True if a is less than b

Description

The comparison is done by comparing 3 first bytes of the cardinal value with bytes byte0, byte1 and byte2.


lessthan(TUInt24Rec,TUInt24Rec):Boolean

Check whether a TUInt24Rec value is less than another TUInt24Rec value

Declaration

Source position: unicodedata.pas line 186

class operator TUInt24Rec.lessthan(TUInt24Rec,TUInt24Rec):Boolean(

  a: TUInt24Rec;

  b: TUInt24Rec

):Boolean;

Arguments

a | First TUInt24Rec to compare
b | Second TUInt24Rec to compare

Function result

True if a is less than b

Description

The comparison is done by comparing the bytes byte0, byte1 and byte2.


lessthanorequal(Cardinal,TUInt24Rec):Boolean

Check whether a cardinal value is less than or equal to a TUInt24Rec value

Declaration

Source position: unicodedata.pas line 191

class operator TUInt24Rec.lessthanorequal(Cardinal,TUInt24Rec):Boolean(

  a: Cardinal;

  b: TUInt24Rec

):Boolean;

Arguments

a | Cardinal value to compare
b | TUInt24Rec to compare

Function result

True if a is less than or equal to b

Description

The comparison is done by comparing 3 first bytes of the cardinal value with bytes byte0, byte1 and byte2.


lessthanorequal(TUInt24Rec,Cardinal):Boolean

Check whether a TUInt24Rec value is less than or equal to a cardinal value

Declaration

Source position: unicodedata.pas line 190

class operator TUInt24Rec.lessthanorequal(TUInt24Rec,Cardinal):Boolean(

  a: TUInt24Rec;

  b: Cardinal

):Boolean;

Arguments

a | TUInt24Rec to compare
b | Cardinal value to compare

Function result

True if a is less than or equal to b

Description

The comparison is done by comparing 3 first bytes of the cardinal value with bytes byte0, byte1 and byte2.


lessthanorequal(TUInt24Rec,TUInt24Rec):Boolean

Check whether a TUInt24Rec value is less than or equal to another TUInt24Rec value

Declaration

Source position: unicodedata.pas line 189

class operator TUInt24Rec.lessthanorequal(TUInt24Rec,TUInt24Rec):Boolean(

  a: TUInt24Rec;

  b: TUInt24Rec

):Boolean;

Arguments

a | First TUInt24Rec to compare
b | Second TUInt24Rec to compare

Function result

True if a is less than or equal to b

Description

The comparison is done by comparing the bytes byte0, byte1 and byte2.


notequal(Cardinal,TUInt24Rec):Boolean

Check whether a TUInt24Rec value differs from a cardinal value.

Declaration

Source position: unicodedata.pas line 179

class operator TUInt24Rec.notequal(Cardinal,TUInt24Rec):Boolean(

  a: Cardinal;

  b: TUInt24Rec

):Boolean;

Arguments

a | Cardinal value to compare
b | TUInt24Rec to compare

Function result

True if a and b are different

Description

The cardinal a is considered not equal to b if the fourth byte (LSB) is nonzero, or one of the first three bytes differ from byte0, byte1, and byte2.


notequal(TUInt24Rec,Cardinal):Boolean

Check whether a TUInt24Rec value differs from a cardinal value.

Declaration

Source position: unicodedata.pas line 178

class operator TUInt24Rec.notequal(TUInt24Rec,Cardinal):Boolean(

  a: TUInt24Rec;

  b: Cardinal

):Boolean;

Arguments

a | TUInt24Rec to compare
b | Cardinal value to compare

Function result

True if a and b are different

Description

The cardinal a is considered not equal to b if the fourth byte (LSB) is nonzero, or one of the first three bytes differ from byte0, byte1, and byte2.


notequal(TUInt24Rec,TUInt24Rec):Boolean

Check whether 2 TUInt24Rec values differ.

Declaration

Source position: unicodedata.pas line 177

class operator TUInt24Rec.notequal(TUInt24Rec,TUInt24Rec):Boolean(

  a: TUInt24Rec;

  b: TUInt24Rec

):Boolean;

Arguments

a | First TUInt24Rec to compare
b | Second TUInt24Rec to compare

Function result

True if a and b are different

Description

The comparison is done by comparing byte0, byte1 and byte2.


UCS4_HALF_BASE

Offset for UCS4 character encoding

Declaration

Source position: unicodedata.pas line 105

const UCS4_HALF_BASE = LongWord($10000);


UCS4_HALF_MASK

Unused currently

Declaration

Source position: unicodedata.pas line 106

const UCS4_HALF_MASK = Word($3FF);


UGC_ClosePunctuation

Unicode token category: Close punctuation

Declaration

Source position: unicodedata.pas line 128

const UGC_ClosePunctuation = 14;


UGC_CombiningMark

Unicode token category: Uppercase letter

Declaration

Source position: unicodedata.pas line 118

const UGC_CombiningMark = 6;


UGC_ConnectPunctuation

Unicode token category: Connect punctuation

Declaration

Source position: unicodedata.pas line 125

const UGC_ConnectPunctuation = 11;


UGC_Control

Unicode token category: control token

Declaration

Source position: unicodedata.pas line 142

const UGC_Control = 25;


UGC_CurrencySymbol

Unicode token category: Currency symbol

Declaration

Source position: unicodedata.pas line 134

const UGC_CurrencySymbol = 19;


UGC_DashPunctuation

Unicode token category: Dash punctuation

Declaration

Source position: unicodedata.pas line 126

const UGC_DashPunctuation = 12;


UGC_DecimalNumber

Unicode token category: Uppercase letter

Declaration

Source position: unicodedata.pas line 121

const UGC_DecimalNumber = 8;


UGC_EnclosingMark

Unicode token category: Uppercase letter

Declaration

Source position: unicodedata.pas line 119

const UGC_EnclosingMark = 7;


UGC_FinalPunctuation

Unicode token category: Final punctuation

Declaration

Source position: unicodedata.pas line 130

const UGC_FinalPunctuation = 16;


UGC_Format

Unicode token category: Formatting token

Declaration

Source position: unicodedata.pas line 143

const UGC_Format = 26;


UGC_InitialPunctuation

Unicode token category: Initial punctuation

Declaration

Source position: unicodedata.pas line 129

const UGC_InitialPunctuation = 15;


UGC_LetterNumber

Unicode token category: Letter-number

Declaration

Source position: unicodedata.pas line 122

const UGC_LetterNumber = 9;


UGC_LineSeparator

Unicode token category: Line separator

Declaration

Source position: unicodedata.pas line 139

const UGC_LineSeparator = 23;


UGC_LowercaseLetter

Unicode general category: Lowercase letter

Declaration

Source position: unicodedata.pas line 112

const UGC_LowercaseLetter = 1;


UGC_MathSymbol

Unicode token category: Math symbol

Declaration

Source position: unicodedata.pas line 133

const UGC_MathSymbol = 18;


UGC_ModifierLetter

Unicode general category: modifier letter

Declaration

Source position: unicodedata.pas line 114

const UGC_ModifierLetter = 3;


UGC_ModifierSymbol

Unicode token category: modifier symbol

Declaration

Source position: unicodedata.pas line 135

const UGC_ModifierSymbol = 20;


UGC_NonSpacingMark

Unicode general category: Non-spacing mark

Declaration

Source position: unicodedata.pas line 117

const UGC_NonSpacingMark = 5;


UGC_OpenPunctuation

Unicode token category: Open puntctuation

Declaration

Source position: unicodedata.pas line 127

const UGC_OpenPunctuation = 13;


UGC_OtherLetter

Unicode general category: Other letter

Declaration

Source position: unicodedata.pas line 115

const UGC_OtherLetter = 4;


UGC_OtherNumber

Unicode token category: Other number

Declaration

Source position: unicodedata.pas line 123

const UGC_OtherNumber = 10;


UGC_OtherPunctuation

Unicode token category: Other punctuation

Declaration

Source position: unicodedata.pas line 131

const UGC_OtherPunctuation = 17;


UGC_OtherSymbol

Unicode token category: Other symbol

Declaration

Source position: unicodedata.pas line 136

const UGC_OtherSymbol = 21;


UGC_ParagraphSeparator

Unicode token category: Paragraph separator

Declaration

Source position: unicodedata.pas line 140

const UGC_ParagraphSeparator = 24;


UGC_PrivateUse

Unicode token category: For private use

Declaration

Source position: unicodedata.pas line 145

const UGC_PrivateUse = 28;


UGC_SpaceSeparator

Unicode token category: Space separator

Declaration

Source position: unicodedata.pas line 138

const UGC_SpaceSeparator = 22;


UGC_Surrogate

Unicode token category: Surrogate token

Declaration

Source position: unicodedata.pas line 144

const UGC_Surrogate = 27;


UGC_TitlecaseLetter

Unicode general category: Titlecase letter

Declaration

Source position: unicodedata.pas line 113

const UGC_TitlecaseLetter = 2;


UGC_Unassigned

Unicode token category: As yet unassigned

Declaration

Source position: unicodedata.pas line 146

const UGC_Unassigned = 29;


UGC_UppercaseLetter

Unicode general category: Uppercase letter

Declaration

Source position: unicodedata.pas line 111

const UGC_UppercaseLetter = 0;


UInt24

Alias for TUInt24Rec

Declaration

Source position: unicodedata.pas line 194

type UInt24 = TUInt24Rec;

See also

TUInt24Rec

Unicode integer 24-bit data


ZERO_UINT24

Empty TUInt24Rec value

Declaration

Source position: unicodedata.pas line 198

const ZERO_UINT24: UInt24 = (byte2: 0; byte1: 0; byte0: 0);

Description

TUInt24Rec value with all bytes zero.

See also

TUInt24Rec

Unicode integer 24-bit data


Reference for unit 'unicodeducet'

Root Unicode collation (DUCET)

uses

  System;

The system unit

Overview

The unicodeducet unit registers the root Unicode collation (DUCET). This collation is needed by all other collations, so any collation unit will include this file.

This unit does not contain any routines. It simply registers the collation in the initialization section of the unit, so including the unit in the uses clause of the program is sufficient.


Index of all identifiers in unit 'unicodeducet'

Documentation generated on: May 12 2018


coff_t

character offset type.

Declaration

Source position: aliasctp.inc line 59

type coff_t = UnixType.TOff;


csize_t

Character size type.

Declaration

Source position: aliasctp.inc line 57

type csize_t = UnixType.size_t;


fs_ext

File system type (TStatFS): (ext) Extended

Declaration

Source position: unxconst.inc line 72

const fs_ext = $137d;


fs_ext2

File system type (TStatFS): (ext2) Second extended

Declaration

Source position: unxconst.inc line 71

const fs_ext2 = $ef53;


fs_iso

File system type (TStatFS): ISO 9660

Declaration

Source position: unxconst.inc line 73

const fs_iso = $9660;


fs_minix

File system type (TStatFS): Minix

Declaration

Source position: unxconst.inc line 74

const fs_minix = $137f;


fs_minix_30

File system type (TStatFS): Minix 3.0

Declaration

Source position: unxconst.inc line 75

const fs_minix_30 = $138f;


fs_minux_V2

File system type (TStatFS): Minix V2

Declaration

Source position: unxconst.inc line 76

const fs_minux_V2 = $2468;


fs_msdos

File system type (TStatFS): MSDOS (FAT)

Declaration

Source position: unxconst.inc line 77

const fs_msdos = $4d44;


fs_nfs

File system type (TStatFS): NFS

Declaration

Source position: unxconst.inc line 78

const fs_nfs = $6969;


fs_old_ext2

File system type (TStatFS): (ext2) Old second extended

Declaration

Source position: unxconst.inc line 70

const fs_old_ext2 = $ef51;


fs_proc

File system type (TStatFS): PROC fs

Declaration

Source position: unxconst.inc line 79

const fs_proc = $9fa0;


fs_xia

File system type (TStatFS): XIA

Declaration

Source position: unxconst.inc line 80

const fs_xia = $012FD16D;


Reference for unit 'Unix'

Extended Unix functionality.

uses
System, | The system unit
BaseUnix, | Basic Unix functionality
unixtype; | Basic unix types


Reference for unit 'Unix': Constants

ARG_MAX | Maximum number of arguments to a program.
fs_ext | File system type (TStatFS): (ext) Extended
fs_ext2 | File system type (TStatFS): (ext2) Second extended
fs_iso | File system type (TStatFS): ISO 9660
fs_minix | File system type (TStatFS): Minix
fs_minix_30 | File system type (TStatFS): Minix 3.0
fs_minux_V2 | File system type (TStatFS): Minix V2
fs_msdos | File system type (TStatFS): MSDOS (FAT)
fs_nfs | File system type (TStatFS): NFS
fs_old_ext2 | File system type (TStatFS): (ext2) Old second extended
fs_proc | File system type (TStatFS): PROC fs
fs_xia | File system type (TStatFS): XIA
IOCtl_TCGETS | IOCTL call number: get Terminal Control settings
LOCK_EX | FpFLock Exclusive lock
LOCK_NB | FpFLock Non-blocking operation
LOCK_SH | FpFLock Shared lock
LOCK_UN | FpFLock unlock
MAP_FAILED | Error return value for mmap: mmap operation failed.
MAP_FIXED | #rtl.baseunix.FpMMap map type: Interpret addr exactly
MAP_PRIVATE | #rtl.baseunix.FpMMap map type: Changes are private
MAP_SHARED | #rtl.baseunix.FpMMap map type: Share changes
MAP_TYPE | #rtl.baseunix.FpMMap map type: Bitmask for type of mapping
MS_ASYNC | Asynchronous operation flag for msync call
MS_INVALIDATE | Invalidate other mappings of file flag for msync call
MS_SYNC | Synchronous operation flag for msync call
NAME_MAX | Maximum filename length.
Open_Accmode | Bitmask to determine access mode in open flags.
Open_Append | File open mode: Append to file
Open_Creat | File open mode: Create if file does not yet exist.
Open_Direct | File open mode: Minimize caching effects
Open_Directory | File open mode: File must be directory.
Open_Excl | File open mode: Open exclusively
Open_LargeFile | File open mode: Open for 64-bit I/O
Open_NDelay | File open mode: Alias for Open_NonBlock
Open_NoCtty | File open mode: No TTY control.
Open_NoFollow | File open mode: Fail if file is symbolic link.
Open_NonBlock | File open mode: Open in non-blocking mode
Open_RdOnly | File open mode: Read only
Open_RdWr | File open mode: Read/Write
Open_Sync | File open mode: Write to disc at once
Open_Trunc | File open mode: Truncate file to length 0
Open_WrOnly | File open mode: Write only
PATH_MAX | Maximum pathname length.
PRIO_PGRP | #rtl.baseunix.fpGetPriority option: Get process group priority.
PRIO_PROCESS | #rtl.baseunix.fpGetPriority option: Get process priority.
PRIO_USER | #rtl.baseunix.fpGetPriority option: Get user priority.
PROT_EXEC | #rtl.baseunix.FpMMap memory access: page can be executed
PROT_NONE | #rtl.baseunix.FpMMap memory access: page can not be accessed
PROT_READ | #rtl.baseunix.FpMMap memory access: page can be read
PROT_WRITE | #rtl.baseunix.FpMMap memory access: page can be written
P_IN | Input file descriptor of pipe pair.
P_OUT | Output file descriptor of pipe pair.
SIG_MAXSIG | Maximum system signal number.
STAT_IFBLK | File (#rtl.baseunix.stat record) mode: Block device
STAT_IFCHR | File (#rtl.baseunix.stat record) mode: Character device
STAT_IFDIR | File (#rtl.baseunix.stat record) mode: Directory
STAT_IFIFO | File (#rtl.baseunix.stat record) mode: FIFO
STAT_IFLNK | File (#rtl.baseunix.stat record) mode: Link
STAT_IFMT | File (#rtl.baseunix.stat record) mode: File type bit mask
STAT_IFREG | File (#rtl.baseunix.stat record) mode: Regular file
STAT_IFSOCK | File (#rtl.baseunix.stat record) mode: Socket
STAT_IRGRP | File (#rtl.baseunix.stat record) mode: Group read permission
STAT_IROTH | File (#rtl.baseunix.stat record) mode: Other read permission
STAT_IRUSR | File (#rtl.baseunix.stat record) mode: Owner read permission
STAT_IRWXG | File (#rtl.baseunix.stat record) mode: Group permission bits mask
STAT_IRWXO | File (#rtl.baseunix.stat record) mode: Other permission bits mask
STAT_IRWXU | File (#rtl.baseunix.stat record) mode: Owner permission bits mask
STAT_ISGID | File (#rtl.baseunix.stat record) mode: GID bit set
STAT_ISUID | File (#rtl.baseunix.stat record) mode: UID bit set
STAT_ISVTX | File (#rtl.baseunix.stat record) mode: Sticky bit set
STAT_IWGRP | File (#rtl.baseunix.stat record) mode: Group write permission
STAT_IWOTH | File (#rtl.baseunix.stat record) mode: Other write permission
STAT_IWUSR | File (#rtl.baseunix.stat record) mode: Owner write permission
STAT_IXGRP | File (#rtl.baseunix.stat record) mode: Others execute permission
STAT_IXOTH | File (#rtl.baseunix.stat record) mode: Others execute permission
STAT_IXUSR | File (#rtl.baseunix.stat record) mode: Others execute permission
SYS_NMLN | Max system name length.
Wait_Any | #rtl.baseunix.fpWaitPID: Wait on any process
Wait_Clone | #rtl.baseunix.fpWaitPID: Wait on clone processes only.
Wait_MyPGRP | #rtl.baseunix.fpWaitPID: Wait processes from current process group
Wait_NoHang | #rtl.baseunix.fpWaitPID: Do not wait
Wait_UnTraced | #rtl.baseunix.fpWaitPID: Also report stopped but untraced processes


Reference for unit 'Unix': Types

cbool | Boolean type
cchar | Alias for #rtl.UnixType.cchar
cdouble | Double precision real format.
cfloat | Floating-point real format
cint | C type: integer (natural size)
cint16 | C type: 16 bits sized, signed integer.
cint32 | C type: 32 bits sized, signed integer.
cint64 | C type: 64 bits sized, signed integer.
cint8 | C type: 8 bits sized, signed integer.
clock_t | Clock ticks type
clong | C type: long signed integer (double sized)
clonglong | C type: 64-bit (double long) signed integer.
coff_t | character offset type.
cschar | Signed character type
cshort | C type: short signed integer (half sized)
csigned | Signed integer
csint | Signed integer
csize_t | Character size type.
cslong | Signed long
cslonglong | Signed longlong type
csshort | Short signed integer type
cuchar | Alias for #rtl.UnixType.cuchar
cuint | C type: unsigned integer (natural size)
cuint16 | C type: 16 bits sized, unsigned integer.
cuint32 | C type: 32 bits sized, unsigned integer.
cuint64 | C type: 64 bits sized, unsigned integer.
cuint8 | C type: 8 bits sized, unsigned integer.
culong | C type: long unsigned integer (double sized)
culonglong | C type: 64-bit (double long) unsigned integer.
cunsigned | Alias for #rtl.unixtype.cunsigned
cushort | C type: short unsigned integer (half sized)
dev_t | Device descriptor type.
gid_t | Group ID type.
ino_t | Inode type.
mode_t | Inode mode type.
nlink_t | Number of links type.
off_t | Offset type.
pcbool | Pointer to boolean type
pcchar | Alias for #rtl.UnixType.pcchar
pcdouble | Pointer to cdouble type.
pcfloat | Pointer to cfloat type.
pcint | Pointer to cInt type.
pcint16 | Pointer to 16-bit signed integer type
pcint32 | Pointer to signed 32-bit integer type
pcint64 | Pointer to signed 64-bit integer type
pcint8 | Pointer to 8-bits signed integer type
pClock | Pointer to TClock type.
pclong | Pointer to cLong type.
pclonglong | Pointer to longlong type.
pcschar | Pointer to signed character type
pcshort | Pointer to cShort type.
pcsigned | Pointer to signed integer
pcsint | Pointer to signed integer
pcsize_t | Pointer to character size type pcsize_t.
pcslong | Pointer to signed long
pcslonglong | Pointer to Signed longlong type
pcsshort | Pointer to short signed integer type
pcuchar | Alias for #rtl.UnixType.pcuchar
pcuint | Pointer to cUInt type.
pcuint16 | Pointer to 16-bit unsigned integer type
pcuint32 | Pointer to unsigned 32-bit integer type
pcuint64 | Pointer to unsigned 64-bit integer type
pcuint8 | Pointer to 8-bits unsigned integer type
pculong | Pointer to cuLong type.
pculonglong | Unsigned longlong type
pcunsigned | Alias for #rtl.unixtype.pcunsigned
pcushort | Pointer to cuShort type.
pDev | Pointer to TDev type.
pGid | Pointer to TGid type.
pid_t | Process ID type.
pIno | Pointer to TIno type.
pMode | Pointer to TMode type.
pnLink | Pointer to TnLink type.
pOff | Pointer to TOff type.
pPid | Pointer to TPid type.
pSize | Pointer to TSize type.
pSize_t | Pointer to type Size_t.
pSocklen | Pointer to TSockLen type.
psSize | Pointer to TsSize type
pstatfs | Pointer to statfs type
pthread_cond_t | Thread conditional variable type.
pthread_mutex_t | Thread mutex type.
pthread_t | Posix thread type.
pTime | Pointer to TTime type.
ptimespec | Pointer to timespec type.
ptimeval | Pointer to timeval type.
ptime_t | Pointer to time_t type.
pUid | Pointer to TUid type.
size_t | Size specification type.
socklen_t | Socket address length type.
ssize_t | Small size type.
TClock | Alias for clock_t type.
TDev | Alias for dev_t type.
TFSearchOption | Describes the search strategy used by FSearch
TGid | Alias for gid_t type.
timespec | Short time specification type.
timeval | Time specification type.
time_t | Time span type
TIno | Alias for ino_t type.
TIOCtlRequest | Alias for the TIOCtlRequest type in unixtypes
TMode | Alias for mode_t type.
TnLink | Alias for nlink_t type.
TOff | Alias for off_t type.
TPid | Alias for pid_t type.
Tpipe | Array describing a pipe pair of filedescriptors.
TSize | Alias for size_t type
TSocklen | Alias for socklen_t type.
TsSize | Alias for ssize_t type
tstatfs | Record describing a file system in the fpstatfs call.
TTime | Alias for TTime type.
Ttimespec | Alias for TimeSpec type.
TTimeVal | Alias for timeval type.
TUid | Alias for uid_t type.
uid_t | User ID type


Reference for unit 'Unix': Procedures and functions

AssignPipe | Create a set of pipe file handlers
AssignStream | Assign stream for in and output to a program
FpExecL | Execute process (using argument list, environment)
FpExecLE | Execute process (using argument list, environment)
FpExecLP | Execute process (using argument list, environment; search path)
FpExecLPE | Execute a program in the path, and pass it an environment
FpExecV | Execute process
FpExecVP | Execute process, search path
FpExecVPE | Execute process, search path using environment
fpFlock | Lock a file (advisory lock)
fpfStatFS | Retrieve filesystem information.
fpfsync | Flush cached data to disk
fpgettimeofday | Return kernel time of day in GMT
fpStatFS | Retrieve filesystem information.
fpSystem | Execute and feed command to system shell
FSearch | Search for file in search path.
GetDomainName | Return current domain name
GetHostName | Return host name
GetLocalTimezone | Return local timzeone information
GetTimezoneFile | Return name of timezone information file
PClose | Close file opened with POpen
POpen | Pipe file to standard input/output of program
ReadTimezoneFile | Read the timezone file and initialize time routines
ReReadLocalTime | Re-Read the local time files.
SeekDir | Seek to position in directory
SelectText | Wait for event on text file.
SigRaise | Raise a signal (send to current process)
TellDir | Return current location in a directory
WaitProcess | Wait for process to terminate.
WIFSTOPPED | Check whether the process is currently stopped.
W_EXITCODE | Construct an exit status based on an return code and signal.
W_STOPCODE | Construct an exit status based on a signal.


Reference for unit 'Unix': Variables

tzdaylight | Indicates whether daylight savings time is active.
tzname | Timezone name.


Index of all identifiers in unit 'Unix'

A C D F G I L M N O P R S T U W

A

ARG_MAX AssignPipe AssignStream

C

cbool | clonglong | cuint
cchar | coff_t | cuint16
cdouble | cschar | cuint32
cfloat | cshort | cuint64
cint | csigned | cuint8
cint16 | csint | culong
cint32 | csize_t | culonglong
cint64 | cslong | cunsigned
cint8 | cslonglong | CurrentDirectoryFirst
clock_t | csshort | CurrentDirectoryLast
clong | cuchar | cushort

D

dev_t

F

FpExecL | fpfsync | fs_minix_30
FpExecLE | fpgettimeofday | fs_minux_V2
FpExecLP | fpStatFS | fs_msdos
FpExecLPE | fpSystem | fs_nfs
FpExecV | FSearch | fs_old_ext2
FpExecVP | fs_ext | fs_proc
FpExecVPE | fs_ext2 | fs_xia
fpFlock | fs_iso |
fpfStatFS | fs_minix |

G

GetDomainName | GetLocalTimezone | gid_t
GetHostName | GetTimezoneFile |

I

ino_t IOCtl_TCGETS

L

LOCK_EX | LOCK_SH
LOCK_NB | LOCK_UN

M

MAP_FAILED | MAP_SHARED | MS_ASYNC
MAP_FIXED | MAP_TYPE | MS_INVALIDATE
MAP_PRIVATE | mode_t | MS_SYNC

N

NAME_MAX nlink_t NoCurrentDirectory

O

off_t | Open_Excl | Open_RdOnly
Open_Accmode | Open_LargeFile | Open_RdWr
Open_Append | Open_NDelay | Open_Sync
Open_Creat | Open_NoCtty | Open_Trunc
Open_Direct | Open_NoFollow | Open_WrOnly
Open_Directory | Open_NonBlock |

P

PATH_MAX | pcsshort | pPid
pcbool | pcuchar | PRIO_PGRP
pcchar | pcuint | PRIO_PROCESS
pcdouble | pcuint16 | PRIO_USER
pcfloat | pcuint32 | PROT_EXEC
pcint | pcuint64 | PROT_NONE
pcint16 | pcuint8 | PROT_READ
pcint32 | pculong | PROT_WRITE
pcint64 | pculonglong | pSize
pcint8 | pcunsigned | pSize_t
pClock | pcushort | pSocklen
pclong | pDev | psSize
pclonglong | pGid | pstatfs
PClose | pid_t | pthread_cond_t
pcschar | P_IN | pthread_mutex_t
pcshort | pIno | pthread_t
pcsigned | pMode | pTime
pcsint | pnLink | ptimespec
pcsize_t | pOff | ptime_t
pcslong | POpen | ptimeval
pcslonglong | P_OUT | pUid

R

ReadTimezoneFile ReReadLocalTime

S

SeekDir | STAT_IFLNK | STAT_ISUID
SelectText | STAT_IFMT | STAT_ISVTX
SIG_MAXSIG | STAT_IFREG | STAT_IWGRP
SigRaise | STAT_IFSOCK | STAT_IWOTH
size_t | STAT_IRGRP | STAT_IWUSR
socklen_t | STAT_IROTH | STAT_IXGRP
ssize_t | STAT_IRUSR | STAT_IXOTH
STAT_IFBLK | STAT_IRWXG | STAT_IXUSR
STAT_IFCHR | STAT_IRWXO | SYS_NMLN
STAT_IFDIR | STAT_IRWXU |
STAT_IFIFO | STAT_ISGID |

T

TClock | TIOCtlRequest | tstatfs
TDev | TMode | TTime
TellDir | TnLink | Ttimespec
TFSearchOption | TOff | TTimeVal
TGid | TPid | TUid
timespec | Tpipe | tzdaylight
time_t | TSize | tzname
timeval | TSocklen |
TIno | TsSize |

U

uid_t

W

Wait_Any | Wait_NoHang | W_EXITCODE
Wait_Clone | WaitProcess | WIFSTOPPED
Wait_MyPGRP | Wait_UnTraced | W_STOPCODE


IOCtl_TCGETS

IOCTL call number: get Terminal Control settings

Declaration

Source position: unxconst.inc line 86

const IOCtl_TCGETS = $5401;


LOCK_EX

FpFLock Exclusive lock

Declaration

Source position: unix.pp line 36

const LOCK_EX = 2;


LOCK_NB

FpFLock Non-blocking operation

Declaration

Source position: unix.pp line 38

const LOCK_NB = 4;


LOCK_SH

FpFLock Shared lock

Declaration

Source position: unix.pp line 35

const LOCK_SH = 1;


LOCK_UN

FpFLock unlock

Declaration

Source position: unix.pp line 37

const LOCK_UN = 8;


MAP_FAILED

Error return value for mmap: mmap operation failed.

Declaration

Source position: unix.pp line 46

const MAP_FAILED = baseunix.MAP_FAILED;


MAP_FIXED

#rtl.baseunix.FpMMap map type: Interpret addr exactly

Declaration

Source position: unix.pp line 50

const MAP_FIXED = baseunix.MAP_FIXED;


MAP_PRIVATE

#rtl.baseunix.FpMMap map type: Changes are private

Declaration

Source position: unix.pp line 48

const MAP_PRIVATE = baseunix.MAP_PRIVATE;


MAP_SHARED

#rtl.baseunix.FpMMap map type: Share changes

Declaration

Source position: unix.pp line 47

const MAP_SHARED = baseunix.MAP_SHARED;


MAP_TYPE

#rtl.baseunix.FpMMap map type: Bitmask for type of mapping

Declaration

Source position: unix.pp line 49

const MAP_TYPE = baseunix.MAP_TYPE;


MS_ASYNC

[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'Unix' (#rtl)

MS_ASYNC (deprecated)

Asynchronous operation flag for msync call

Declaration

Source position: unix.pp line 54

const MS_ASYNC = 1;


MS_INVALIDATE

[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'Unix' (#rtl)

MS_INVALIDATE (deprecated)

Invalidate other mappings of file flag for msync call

Declaration

Source position: unix.pp line 56

const MS_INVALIDATE = 2;


MS_SYNC

[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'Unix' (#rtl)

MS_SYNC (deprecated)

Synchronous operation flag for msync call

Declaration

Source position: unix.pp line 55

const MS_SYNC = 4;


Open_Accmode

Bitmask to determine access mode in open flags.

Declaration

Source position: unxconst.inc line 17

const Open_Accmode = 3;


Open_Append

File open mode: Append to file

Declaration

Source position: unxconst.inc line 25

const Open_Append = 2 shl 9;


Open_Creat

File open mode: Create if file does not yet exist.

Declaration

Source position: unxconst.inc line 21

const Open_Creat = 1 shl 6;


Open_Direct

File open mode: Minimize caching effects

Declaration

Source position: unxconst.inc line 29

const Open_Direct = 4 shl 12;


Open_Directory

File open mode: File must be directory.

Declaration

Source position: unxconst.inc line 31

const Open_Directory = 2 shl 15;


Open_Excl

File open mode: Open exclusively

Declaration

Source position: unxconst.inc line 22

const Open_Excl = 2 shl 6;


Open_LargeFile

File open mode: Open for 64-bit I/O

Declaration

Source position: unxconst.inc line 30

const Open_LargeFile = 1 shl 15;


Open_NDelay

File open mode: Alias for Open_NonBlock

Declaration

Source position: unxconst.inc line 27

const Open_NDelay = Open_NonBlock;


Open_NoCtty

File open mode: No TTY control.

Declaration

Source position: unxconst.inc line 23

const Open_NoCtty = 4 shl 6;


Open_NoFollow

File open mode: Fail if file is symbolic link.

Declaration

Source position: unxconst.inc line 32

const Open_NoFollow = 4 shl 15;


Open_NonBlock

File open mode: Open in non-blocking mode

Declaration

Source position: unxconst.inc line 26

const Open_NonBlock = 4 shl 9;


Open_RdOnly

File open mode: Read only

Declaration

Source position: unxconst.inc line 18

const Open_RdOnly = 0;


Open_RdWr

File open mode: Read/Write

Declaration

Source position: unxconst.inc line 20

const Open_RdWr = 2;


Open_Sync

File open mode: Write to disc at once

Declaration

Source position: unxconst.inc line 28

const Open_Sync = 1 shl 12;


Open_Trunc

File open mode: Truncate file to length 0

Declaration

Source position: unxconst.inc line 24

const Open_Trunc = 1 shl 9;


Open_WrOnly

File open mode: Write only

Declaration

Source position: unxconst.inc line 19

const Open_WrOnly = 1;


P_IN

Input file descriptor of pipe pair.

Declaration

Source position: unix.pp line 32

const P_IN = 1;


P_OUT

Output file descriptor of pipe pair.

Declaration

Source position: unix.pp line 33

const P_OUT = 2;


pcsize_t

Pointer to character size type pcsize_t.

Declaration

Source position: aliasctp.inc line 57

type pcsize_t = UnixType.psize_t;


PRIO_PGRP

#rtl.baseunix.fpGetPriority option: Get process group priority.

Declaration

Source position: aliasptp.inc line 88

const PRIO_PGRP = UnixType.PRIO_PGRP;


PRIO_PROCESS

#rtl.baseunix.fpGetPriority option: Get process priority.

Declaration

Source position: aliasptp.inc line 87

const PRIO_PROCESS = UnixType.PRIO_PROCESS;


PRIO_USER

#rtl.baseunix.fpGetPriority option: Get user priority.

Declaration

Source position: aliasptp.inc line 89

const PRIO_USER = UnixType.PRIO_USER;


PROT_EXEC

#rtl.baseunix.FpMMap memory access: page can be executed

Declaration

Source position: unix.pp line 43

const PROT_EXEC = baseunix.PROT_EXEC;


PROT_NONE

#rtl.baseunix.FpMMap memory access: page can not be accessed

Declaration

Source position: unix.pp line 44

const PROT_NONE = baseunix.PROT_NONE;


PROT_READ

#rtl.baseunix.FpMMap memory access: page can be read

Declaration

Source position: unix.pp line 41

const PROT_READ = baseunix.PROT_READ;


PROT_WRITE

#rtl.baseunix.FpMMap memory access: page can be written

Declaration

Source position: unix.pp line 42

const PROT_WRITE = baseunix.PROT_WRITE;


pSize_t

Pointer to type Size_t.

Declaration

Source position: aliasptp.inc line 46

type pSize_t = UnixType.pSize_t;


pstatfs

Pointer to statfs type

Declaration

Source position: aliasptp.inc line 77

type pstatfs = UnixType.PStatFs;

See also

TStatFS

Record describing a file system in the fpstatfs call.


STAT_IFBLK

File (#rtl.baseunix.stat record) mode: Block device

Declaration

Source position: unxconst.inc line 46

const STAT_IFBLK = $6000;


STAT_IFCHR

File (#rtl.baseunix.stat record) mode: Character device

Declaration

Source position: unxconst.inc line 48

const STAT_IFCHR = $2000;


STAT_IFDIR

File (#rtl.baseunix.stat record) mode: Directory

Declaration

Source position: unxconst.inc line 47

const STAT_IFDIR = $4000;


STAT_IFIFO

File (#rtl.baseunix.stat record) mode: FIFO

Declaration

Source position: unxconst.inc line 49

const STAT_IFIFO = $1000;


STAT_IFLNK

File (#rtl.baseunix.stat record) mode: Link

Declaration

Source position: unxconst.inc line 44

const STAT_IFLNK = $a000;


STAT_IFMT

File (#rtl.baseunix.stat record) mode: File type bit mask

Declaration

Source position: unxconst.inc line 42

const STAT_IFMT = $f000;


STAT_IFREG

File (#rtl.baseunix.stat record) mode: Regular file

Declaration

Source position: unxconst.inc line 45

const STAT_IFREG = $8000;


STAT_IFSOCK

File (#rtl.baseunix.stat record) mode: Socket

Declaration

Source position: unxconst.inc line 43

const STAT_IFSOCK = $c000;


STAT_IRGRP

File (#rtl.baseunix.stat record) mode: Group read permission

Declaration

Source position: unxconst.inc line 60

const STAT_IRGRP = STAT_IROTH shl 3;


STAT_IROTH

File (#rtl.baseunix.stat record) mode: Other read permission

Declaration

Source position: unxconst.inc line 55

const STAT_IROTH = $4;


STAT_IRUSR

File (#rtl.baseunix.stat record) mode: Owner read permission

Declaration

Source position: unxconst.inc line 65

const STAT_IRUSR = STAT_IROTH shl 6;


STAT_IRWXG

File (#rtl.baseunix.stat record) mode: Group permission bits mask

Declaration

Source position: unxconst.inc line 59

const STAT_IRWXG = STAT_IRWXO shl 3;


STAT_IRWXO

File (#rtl.baseunix.stat record) mode: Other permission bits mask

Declaration

Source position: unxconst.inc line 54

const STAT_IRWXO = $7;


STAT_IRWXU

File (#rtl.baseunix.stat record) mode: Owner permission bits mask

Declaration

Source position: unxconst.inc line 64

const STAT_IRWXU = STAT_IRWXO shl 6;


STAT_ISGID

File (#rtl.baseunix.stat record) mode: GID bit set

Declaration

Source position: unxconst.inc line 51

const STAT_ISGID = $0400;


STAT_ISUID

File (#rtl.baseunix.stat record) mode: UID bit set

Declaration

Source position: unxconst.inc line 50

const STAT_ISUID = $0800;


STAT_ISVTX

File (#rtl.baseunix.stat record) mode: Sticky bit set

Declaration

Source position: unxconst.inc line 52

const STAT_ISVTX = $0200;


STAT_IWGRP

File (#rtl.baseunix.stat record) mode: Group write permission

Declaration

Source position: unxconst.inc line 61

const STAT_IWGRP = STAT_IWOTH shl 3;


STAT_IWOTH

File (#rtl.baseunix.stat record) mode: Other write permission

Declaration

Source position: unxconst.inc line 56

const STAT_IWOTH = $2;


STAT_IWUSR

File (#rtl.baseunix.stat record) mode: Owner write permission

Declaration

Source position: unxconst.inc line 66

const STAT_IWUSR = STAT_IWOTH shl 6;


STAT_IXGRP

File (#rtl.baseunix.stat record) mode: Others execute permission

Declaration

Source position: unxconst.inc line 62

const STAT_IXGRP = STAT_IXOTH shl 3;


STAT_IXOTH

File (#rtl.baseunix.stat record) mode: Others execute permission

Declaration

Source position: unxconst.inc line 57

const STAT_IXOTH = $1;


STAT_IXUSR

File (#rtl.baseunix.stat record) mode: Others execute permission

Declaration

Source position: unxconst.inc line 67

const STAT_IXUSR = STAT_IXOTH shl 6;


TFSearchOption

Describes the search strategy used by FSearch

Declaration

Source position: unix.pp line 129

type TFSearchOption = (
NoCurrentDirectory, | Do not search the current directory unless it is specified in the search path.
CurrentDirectoryFirst, | Search the current directory first, before all directories in the search path.
CurrentDirectoryLast | Search the current directory last, after all directories in the search path
);

See also

FSearch

Search for file in search path.


TIOCtlRequest

Alias for the TIOCtlRequest type in unixtypes

Declaration

Source position: aliasptp.inc line 26

type TIOCtlRequest = UnixType.TIOCtlRequest;


Tpipe

[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'Unix' (#rtl)

Tpipe (deprecated)

Array describing a pipe pair of filedescriptors.

Declaration

Source position: unix.pp line 60

type Tpipe = baseunix.tfildes;


tstatfs

Record describing a file system in the fpstatfs call.

Declaration

Source position: aliasptp.inc line 76

type tstatfs = UnixType.TStatFs;

Description

StatFS returns in Info information about the filesystem on which the file Path resides. Info is of type TStatFS.

The function returns zero if the call was succesful, a nonzero value is returned if the call failed.

Errors

Extended error information is returned by the FpGetErrno function:

sys_enotdir
A component of Path is not a directory.
sys_einval
Invalid character in Path.
sys_enoent
Path does not exist.
sys_eaccess
Search permission is denied for component inPath.
sys_eloop
A circular symbolic link was encountered in Path.
sys_eio
An error occurred while reading from the filesystem.

See also

#rtl.baseunix.FpStat | Retrieve file information about a file descriptor.
#rtl.baseunix.FpLStat | Return information about symbolic link. Do not follow the link

Example

program Example30;

{ Program to demonstrate the FSStat function. }

uses BaseUnix,Unix,UnixType;

var s : string;
    fd : cint;
    info : tstatfs;

begin
  writeln ('Info about current partition : ');
  s:='.';
  while s<>'q' do
    begin
    Fd:=fpOpen(S,O_RDOnly);
    if (fd>=0) then
      begin
      if fpfstatfs (fd,@info)<>0 then
        begin
        writeln('Fstat failed. Errno : ',fpgeterrno);
        halt (1);
        end;
      FpClose(fd);
      writeln;
      writeln ('Result of fsstat on file ''',s,'''.');
{$if defined(Linux) or defined(sunos)}
      // SysV like.
      writeln ('fstype  : ',info.fstype);
{$else}
      // BSD like, incl Mac OS X.
      writeln ('fstype  : ',info.ftype);
{$endif}

      writeln ('bsize   : ',info.bsize);
      writeln ('bfree   : ',info.bfree);
      writeln ('bavail  : ',info.bavail);
      writeln ('files   : ',info.files);
      writeln ('ffree   : ',info.ffree);
      {$ifdef FreeBSD}
      writeln ('fsid    : ',info.fsid[0]);
      {$else}
      writeln ('fsid    : ',info.fsid[0]);
      writeln ('Namelen : ',info.namelen);
      {$endif}
      write ('Type name of file to do fsstat. (q quits) :');
      readln (s)

      end;
    end;
end.


tzdaylight

Indicates whether daylight savings time is active.

Declaration

Source position: unix.pp line 65

var tzdaylight: Boolean = ;


tzname

Timezone name.

Declaration

Source position: unix.pp line 66

var tzname: array [boolean] of PChar = ;


Wait_Any

#rtl.baseunix.fpWaitPID: Wait on any process

Declaration

Source position: unxconst.inc line 37

const Wait_Any = - 1;


Wait_Clone

#rtl.baseunix.fpWaitPID: Wait on clone processes only.

Declaration

Source position: unxconst.inc line 39

const Wait_Clone = $80000000;


Wait_MyPGRP

#rtl.baseunix.fpWaitPID: Wait processes from current process group

Declaration

Source position: unxconst.inc line 38

const Wait_MyPGRP = 0;


Wait_NoHang

#rtl.baseunix.fpWaitPID: Do not wait

Declaration

Source position: unxconst.inc line 35

const Wait_NoHang = 1;


Wait_UnTraced

#rtl.baseunix.fpWaitPID: Also report stopped but untraced processes

Declaration

Source position: unxconst.inc line 36

const Wait_UnTraced = 2;


Reference for unit 'unixcp'

Code Page name to number conversions

uses
System, | The system unit
BaseUnix; | Basic Unix functionality

Overview

The unixcp unit provides routines to handle mapping of code page names to numerical values as used in libiconv>. The GetCodepageByName function is the main function for this. The GetCodepageData can be used to map a code page number to a name. These function can be used for instance to map code page information in environment variables to code page numbers used in string encodings. The supported code page names are the ones commonly in use in libiconv.

This unit is used for example in unit cwstring.


Reference for unit 'unixcp': Constants

UnixCpMap | Map with codepage names.
UnixCpMapLimit | Number of code pages in map UnixCpMap.


Reference for unit 'unixcp': Types

TUnixCpData

Structure to map code page number to name


Reference for unit 'unixcp': Procedures and functions

GetCodepageByName | Find code page by name
GetCodepageData | Return index of codepage.
GetSystemCodepage | Return the system code page based on the program environment.


Index of all identifiers in unit 'unixcp'

G T U

G

GetCodepageByName GetCodepageData GetSystemCodepage

T

TUnixCpData

U

UnixCpMap UnixCpMapLimit


TUnixCpData

Structure to map code page number to name

Declaration

Source position: unixcp.pp line 27

type TUnixCpData = record
cp: Word; | Code page number
name: ansistring; | Code page name
end;

Description

TUnixCpData contains 2 fields necessary to construct a map between code page number (cp) and name (name).

See also

UnixCpMap

Map with codepage names.


UnixCpMap

Map with codepage names.

Declaration

Source position: unixcp.pp line 37

const UnixCpMap: array [-1..UnixCpMapLimit] of TUnixCpData = ((cp: 0; name: 'UTF-8'), (cp: 37; name: 'IBM037'), (cp: 37; name: 'IBM-037'), (cp: 154; name: 'CP154'), (cp: 154; name: 'CYRILLIC-ASIAN'), (cp: 154; name: 'PT154'), (cp: 154; name: 'PTCP154'), (cp: 154; name: 'CSPTCP154'), (cp: 437; name: '437'), (cp: 437; name: 'CP437'), (cp: 437; name: 'IBM-437'), (cp: 437; name: 'CSPC8CODEPAGE437'), (cp: 437; name: 'IBM437'), (cp: 500; name: 'IBM500'), (cp: 500; name: 'IBM-500'), (cp: 708; name: 'ASMO-708'), (cp: 720; name: 'DOS-720'), (cp: 737; name: 'CP737'), (cp: 737; name: 'ibm737'), (cp: 775; name: 'CP775'), (cp: 775; name: 'IBM775'), (cp: 775; name: 'CSPC775BALTIC'), (cp: 775; name: 'ibm775'), (cp: 850; name: '850'), (cp: 850; name: 'CP850'), (cp: 850; name: 'IBM850'), (cp: 850; name: 'CSPC850MULTILINGUAL'), (cp: 850; name: 'ibm850'), (cp: 852; name: '852'), (cp: 852; name: 'CP852'), (cp: 852; name: 'IBM852'), (cp: 852; name: 'CSPCP852'), (cp: 852; name: 'ibm852'), (cp: 853; name: 'CP853'), (cp: 855; name: '855'), (cp: 855; name: 'CP855'), (cp: 855; name: 'IBM855'), (cp: 855; name: 'CSIBM855'), (cp: 855; name: 'IBM855'), (cp: 857; name: '857'), (cp: 857; name: 'CP857'), (cp: 857; name: 'IBM857'), (cp: 857; name: 'CSIBM857'), (cp: 857; name: 'ibm857'), (cp: 858; name: 'CP858'), (cp: 858; name: 'IBM00858'), (cp: 860; name: '860'), (cp: 860; name: 'CP860'), (cp: 860; name: 'IBM860'), (cp: 860; name: 'CSIBM860'), (cp: 860; name: 'IBM860'), (cp: 861; name: '861'), (cp: 861; name: 'CP-IS'), (cp: 861; name: 'CP861'), (cp: 861; name: 'IBM861'), (cp: 861; name: 'CSIBM861'), (cp: 861; name: 'ibm861'), (cp: 862; name: '862'), (cp: 862; name: 'CP862'), (cp: 862; name: 'IBM862'), (cp: 862; name: 'CSPC862LATINHEBREW'), (cp: 862; name: 'DOS-862'), (cp: 863; name: '863'), (cp: 863; name: 'CP863'), (cp: 863; name: 'CSIBM863'), (cp: 863; name: 'IBM863'), (cp: 864; name: 'CP864'), (cp: 864; name: 'CSIBM864'), (cp: 864; name: 'IBM864'), (cp: 865; name: '865'), (cp: 865; name: 'IBM-865'), (cp: 865; name: 'CP865'), (cp: 865; name: 'CSIBM865'), (cp: 865; name: 'IBM865'), (cp: 866; name: '866'), (cp: 866; name: 'CP866'), (cp: 866; name: 'IBM866'), (cp: 866; name: 'CSIBM866'), (cp: 866; name: 'cp866'), (cp: 869; name: '869'), (cp: 869; name: 'IBM-869'), (cp: 869; name: 'CP-GR'), (cp: 869; name: 'CP869'), (cp: 869; name: 'IBM869'), (cp: 869; name: 'CSIBM869'), (cp: 869; name: 'ibm869'), (cp: 870; name: 'IBM870'), (cp: 874; name: 'CP874'), (cp: 874; name: 'WINDOWS-874'), (cp: 874; name: 'windows-874'), (cp: 875; name: 'cp875'), (cp: 932; name: 'CP932'), (cp: 932; name: 'IBM-943'), (cp: 932; name: 'MS932'), (cp: 932; name: 'SHIFFT_JIS'), (cp: 932; name: 'SHIFFT_JIS-MS'), (cp: 932; name: 'SJIS'), (cp: 932; name: 'SJIS-MS'), (cp: 932; name: 'SJIS-OPEN'), (cp: 932; name: 'SJIS-WIN'), (cp: 932; name: 'WINDOWS-31J'), (cp: 932; name: 'WINDOWS-932'), (cp: 932; name: 'CSWINDOWS31J'), (cp: 932; name: 'shift_jis'), (cp: 932; name: 'shift-jis'), (cp: 936; name: 'CP936'), (cp: 936; name: 'GBK'), (cp: 936; name: 'MS936'), (cp: 936; name: 'WINDOWS-936'), (cp: 936; name: 'gb2312'), (cp: 949; name: 'CP949'), (cp: 949; name: 'UHC'), (cp: 949; name: 'EUC-KR'), (cp: 949; name: 'ks_c_5601-1987'), (cp: 950; name: 'CP950'), (cp: 950; name: 'BIG5'), (cp: 950; name: 'big5'), (cp: 1026; name: 'IBM1026'), (cp: 1047; name: 'IBM01047'), (cp: 1125; name: 'CP1125'), (cp: 1125; name: 'IBM-1125'), (cp: 1133; name: 'CP1133'), (cp: 1133; name: 'IBM-1133'), (cp: 1133; name: 'IBM-CP1133'), (cp: 1140; name: 'IBM01140'), (cp: 1141; name: 'IBM01141'), (cp: 1142; name: 'IBM01142'), (cp: 1143; name: 'IBM01143'), (cp: 1144; name: 'IBM01144'), (cp: 1145; name: 'IBM01145'), (cp: 1146; name: 'IBM01146'), (cp: 1147; name: 'IBM01147'), (cp: 1148; name: 'IBM01148'), (cp: 1149; name: 'IBM01149'), (cp: 1200; name: 'UTF-16LE'), (cp: 1200; name: 'UTF16LE'), (cp: 1200; name: 'UCS-2LE'), (cp: 1200; name: 'CP1200'), (cp: 1201; name: 'UTF-16BE'), (cp: 1201; name: 'UTF16BE'), (cp: 1201; name: 'UCS-2BE'), (cp: 1201; name: 'unicodeFFFE'), (cp: 1201; name: 'CP1201'), (cp: 1250; name: 'CP1250'), (cp: 1250; name: 'MS-EE'), (cp: 1250; name: 'WINDOWS-1250'), (cp: 1250; name: 'windows-1250'), (cp: 1251; name: 'CP1251'), (cp: 1251; name: 'MS-CYRL'), (cp: 1251; name: 'WINDOWS-1251'), (cp: 1251; name: 'windows-1251'), (cp: 1252; name: 'CP819'), (cp: 1252; name: 'IBM819'), (cp: 1252; name: 'CP1252'), (cp: 1252; name: 'MS-ANSI'), (cp: 1252; name: 'WINDOWS-1252'), (cp: 1252; name: 'windows-1252'), (cp: 1253; name: 'CP1253'), (cp: 1253; name: 'MS-GREEK'), (cp: 1253; name: 'WINDOWS-1253'), (cp: 1253; name: 'windows-1253'), (cp: 1254; name: 'CP1254'), (cp: 1254; name: 'MS-TURK'), (cp: 1254; name: 'WINDOWS-1254'), (cp: 1254; name: 'windows-1254'), (cp: 1255; name: 'CP1255'), (cp: 1255; name: 'MS-HEBR'), (cp: 1255; name: 'WINDOWS-1255'), (cp: 1255; name: 'windows-1255'), (cp: 1256; name: 'CP1256'), (cp: 1256; name: 'MS-ARAB'), (cp: 1256; name: 'WINDOWS-1256'), (cp: 1256; name: 'windows-1256'), (cp: 1257; name: 'CP1257'), (cp: 1257; name: 'WINBALTRIM'), (cp: 1257; name: 'WINDOWS-1257'), (cp: 1257; name: 'windows-1257'), (cp: 1258; name: 'CP1258'), (cp: 1258; name: 'WINDOWS-1258'), (cp: 1258; name: 'windows-1258'), (cp: 1361; name: 'CP1361'), (cp: 1361; name: 'JOHAB'), (cp: 1361; name: 'Johab'), (cp: 10000; name: 'macintosh'), (cp: 10001; name: 'x-mac-japanese'), (cp: 10002; name: 'x-mac-chinesetrad'), (cp: 10003; name: 'x-mac-korean'), (cp: 10004; name: 'x-mac-arabic'), (cp: 10005; name: 'x-mac-hebrew'), (cp: 10006; name: 'x-mac-greek'), (cp: 10007; name: 'x-mac-cyrillic'), (cp: 10008; name: 'x-mac-chinesesimp'), (cp: 10010; name: 'x-mac-romanian'), (cp: 10017; name: 'x-mac-ukrainian'), (cp: 10021; name: 'x-mac-thai'), (cp: 10029; name: 'x-mac-ce'), (cp: 10079; name: 'x-mac-icelandic'), (cp: 10081; name: 'x-mac-turkish'), (cp: 10082; name: 'x-mac-croatian'), (cp: 12000; name: 'UTF-32LE'), (cp: 12000; name: 'CP12000'), (cp: 12000; name: 'UTF32LE'), (cp: 12001; name: 'UTF-32BE'), (cp: 12001; name: 'CP12001'), (cp: 12001; name: 'UTF32BE'), (cp: 20000; name: 'x-Chinese_CNS'), (cp: 20001; name: 'x-cp20001'), (cp: 20002; name: 'x_Chinese-Eten'), (cp: 20003; name: 'x-cp20003'), (cp: 20004; name: 'x-cp20004'), (cp: 20005; name: 'x-cp20005'), (cp: 20105; name: 'x-IA5'), (cp: 20106; name: 'x-IA5-German'), (cp: 20107; name: 'x-IA5-Swedish'), (cp: 20108; name: 'x-IA5-Norwegian'), (cp: 20127; name: 'US-ASCII'), (cp: 20127; name: 'ASCII'), (cp: 20127; name: 'ANSI_X3.4-1968'), (cp: 20127; name: 'ANSI_X3.4-1986'), (cp: 20127; name: 'CP367'), (cp: 20127; name: 'IBM367'), (cp: 20127; name: 'ISO-IR-6'), (cp: 20127; name: 'ISO646-US'), (cp: 20127; name: 'ISO_646.IRV:1991'), (cp: 20127; name: 'US'), (cp: 20127; name: 'CSASCII'), (cp: 20127; name: 'us-ascii'), (cp: 20261; name: 'x-cp20261'), (cp: 20269; name: 'x-cp20269'), (cp: 20273; name: 'IBM273'), (cp: 20277; name: 'IBM277'), (cp: 20278; name: 'IBM278'), (cp: 20280; name: 'IBM280'), (cp: 20284; name: 'IBM284'), (cp: 20285; name: 'IBM285'), (cp: 20290; name: 'IBM290'), (cp: 20297; name: 'IBM297'), (cp: 20420; name: 'IBM420'), (cp: 20423; name: 'IBM423'), (cp: 20424; name: 'IBM424'), (cp: 20833; name: 'x-EBCDIC-KoreanExtended'), (cp: 20838; name: 'IBM-Thai'), (cp: 20866; name: 'koi8-r'), (cp: 20871; name: 'IBM871'), (cp: 20880; name: 'IBM880'), (cp: 20905; name: 'IBM905'), (cp: 20924; name: 'IBM00924'), (cp: 20932; name: 'EUC-JP'), (cp: 20936; name: 'x-cp20936'), (cp: 20949; name: 'x-cp20949'), (cp: 21025; name: 'cp1025'), (cp: 21866; name: 'koi8-u'), (cp: 28591; name: 'ISO-8859-1'), (cp: 28591; name: 'ISO-IR-100'), (cp: 28591; name: 'ISO8859-1'), (cp: 28591; name: 'ISO_8859-1'), (cp: 28591; name: 'ISO_8859-1:1987'), (cp: 28591; name: 'L1'), (cp: 28591; name: 'LATIN1'), (cp: 28591; name: 'CSISOLATIN1'), (cp: 28591; name: 'iso-8859-1'), (cp: 28591; name: 'iso8859-1'), (cp: 28592; name: 'iso-8859-2'), (cp: 28592; name: 'iso8859-2'), (cp: 28593; name: 'iso-8859-3'), (cp: 28593; name: 'iso8859-3'), (cp: 28594; name: 'iso-8859-4'), (cp: 28594; name: 'iso8859-4'), (cp: 28595; name: 'iso-8859-5'), (cp: 28595; name: 'iso8859-5'), (cp: 28596; name: 'iso-8859-6'), (cp: 28596; name: 'iso8859-6'), (cp: 28597; name: 'iso-8859-7'), (cp: 28597; name: 'iso8859-7'), (cp: 28598; name: 'iso-8859-8'), (cp: 28598; name: 'iso8859-8'), (cp: 28599; name: 'iso-8859-9'), (cp: 28599; name: 'iso8859-9'), (cp: 28603; name: 'iso-8859-13'), (cp: 28603; name: 'iso8859-13'), (cp: 28605; name: 'iso-8859-15'), (cp: 28605; name: 'iso8859-15'), (cp: 29001; name: 'x-Europa'), (cp: 38598; name: 'iso-8859-8-i'), (cp: 38598; name: 'iso8859-8-i'), (cp: 50220; name: 'iso-2022-jp'), (cp: 50221; name: 'ISO-2022-JP'), (cp: 50221; name: 'CP50221'), (cp: 50221; name: 'ISO-2022-JP-MS'), (cp: 50221; name: 'ISO2022-JP'), (cp: 50221; name: 'ISO2022-JP-MS'), (cp: 50221; name: 'MS50221'), (cp: 50221; name: 'WINDOWS-50221'), (cp: 50221; name: 'csISO2022JP'), (cp: 50222; name: 'iso-2022-jp'), (cp: 50225; name: 'iso-2022-kr'), (cp: 50225; name: 'iso2022-kr'), (cp: 50227; name: 'x-cp50227'), (cp: 51932; name: 'EUC-JP'), (cp: 51932; name: 'CP51932'), (cp: 51932; name: 'MS51932'), (cp: 51932; name: 'WINDOWS-51932'), (cp: 51932; name: 'euc-jp'), (cp: 51936; name: 'EUC-CN'), (cp: 51949; name: 'euc-kr'), (cp: 52936; name: 'hz-gb-2312'), (cp: 54936; name: 'GB18030'), (cp: 57002; name: 'x-iscii-de'), (cp: 57003; name: 'x-iscii-be'), (cp: 57004; name: 'x-iscii-ta'), (cp: 57005; name: 'x-iscii-te'), (cp: 57006; name: 'x-iscii-as'), (cp: 57007; name: 'x-iscii-or'), (cp: 57008; name: 'x-iscii-ka'), (cp: 57009; name: 'x-iscii-ma'), (cp: 57010; name: 'x-iscii-gu'), (cp: 57011; name: 'x-iscii-pa'), (cp: 65001; name: 'UTF-8'), (cp: 65001; name: 'CP65001'), (cp: 65001; name: 'UTF8'));

Description

UnixCpMap is a fixed structure with codepage number/codepage name pairs. It is used in GetCodepageData, GetSystemCodepage and GetCodepageByName to map code page names to numbers and vice versa.

The map is ordered on code page number, and for equal code page numbers, the names are ordered so the most common one is used first.

See also

GetCodepageData | Return index of codepage.
GetSystemCodepage | Return the system code page based on the program environment.
GetCodepageByName | Find code page by name


UnixCpMapLimit

Number of code pages in map UnixCpMap.

Declaration

Source position: unixcp.pp line 36

const UnixCpMapLimit = 406 - 83;

See also

UnixCpMap

Map with codepage names.


_pthread_fastlock

Fast lock (mutex) type (opaque).

Declaration

Source position: ptypes.inc line 254

type _pthread_fastlock = record
__status: clong; | ?
__spinlock: cint; | ?
end;

Description

_pthread_fastlock describes a thread mutex. It should be considered an opaque record, the names of the fields can change anytime.


_PTHREAD_MUTEX_ADAPTIVE_NP

Mutex options:

Declaration

Source position: ptypes.inc line 377

const _PTHREAD_MUTEX_ADAPTIVE_NP = 3;


_PTHREAD_MUTEX_DEFAULT

Mutex options:

Declaration

Source position: ptypes.inc line 382

const _PTHREAD_MUTEX_DEFAULT = _PTHREAD_MUTEX_NORMAL;


_PTHREAD_MUTEX_ERRORCHECK

Mutex options:

Declaration

Source position: ptypes.inc line 381

const _PTHREAD_MUTEX_ERRORCHECK = _PTHREAD_MUTEX_ERRORCHECK_NP;


_PTHREAD_MUTEX_ERRORCHECK_NP

Mutex options: double lock returns an error code.

Declaration

Source position: ptypes.inc line 376

const _PTHREAD_MUTEX_ERRORCHECK_NP = 2;


_PTHREAD_MUTEX_FAST_NP

Mutex options: Fast mutex

Declaration

Source position: ptypes.inc line 383

const _PTHREAD_MUTEX_FAST_NP = _PTHREAD_MUTEX_ADAPTIVE_NP;


_PTHREAD_MUTEX_NORMAL

Mutex options:

Declaration

Source position: ptypes.inc line 379

const _PTHREAD_MUTEX_NORMAL = _PTHREAD_MUTEX_TIMED_NP;


_PTHREAD_MUTEX_RECURSIVE

Mutex options:

Declaration

Source position: ptypes.inc line 380

const _PTHREAD_MUTEX_RECURSIVE = _PTHREAD_MUTEX_RECURSIVE_NP;


_PTHREAD_MUTEX_RECURSIVE_NP

Mutex options: recursive mutex

Declaration

Source position: ptypes.inc line 375

const _PTHREAD_MUTEX_RECURSIVE_NP = 1;


_PTHREAD_MUTEX_TIMED_NP

Mutex options: ?

Declaration

Source position: ptypes.inc line 374

const _PTHREAD_MUTEX_TIMED_NP = 0;


ARG_MAX

Max number of command-line arguments.

Declaration

Source position: ptypes.inc line 389

const ARG_MAX = 131072;


cbool

Boolean type

Declaration

Source position: ctypes.inc line 50

type cbool = longbool;


cchar

C type: 8-bit signed integer

Declaration

Source position: ctypes.inc line 26

type cchar = cint8;


cdouble

Double precision real format.

Declaration

Source position: ctypes.inc line 64

type cdouble = Double;


cfloat

Floating-point real format

Declaration

Source position: ctypes.inc line 63

type cfloat = single;


cint

C type: integer (natural size)

Declaration

Source position: ctypes.inc line 38

type cint = cint32;


cint8

C type: 8 bits sized, signed integer.

Declaration

Source position: ctypes.inc line 24

type cint8 = ShortInt;


cint16

C type: 16 bits sized, signed integer.

Declaration

Source position: ctypes.inc line 30

type cint16 = SmallInt;


cint32

C type: 32 bits sized, signed integer.

Declaration

Source position: ctypes.inc line 36

type cint32 = LongInt;


cint64

C type: 64 bits sized, signed integer.

Declaration

Source position: ctypes.inc line 44

type cint64 = Int64;


clock_t

Clock ticks type

Declaration

Source position: ptypes.inc line 112

type clock_t = cuint64;


clong

C type: long signed integer (double sized)

Declaration

Source position: ctypes.inc line 53

type clong = Int64;


clongdouble

Long double

Declaration

Source position: ctypes.inc line 65

type clongdouble = extended;

Description

Usually translates to an extended, but is CPU dependent.


clonglong

C type: 64-bit (double long) signed integer.

Declaration

Source position: ctypes.inc line 46

type clonglong = cint64;


cschar

Signed character type

Declaration

Source position: ctypes.inc line 27

type cschar = cint8;


cshort

C type: short signed integer (half sized)

Declaration

Source position: ctypes.inc line 32

type cshort = cint16;


csigned

Signed integer

Declaration

Source position: ctypes.inc line 41

type csigned = cint;

Description

csigned is an alias for cint.


csint

Signed integer

Declaration

Source position: ctypes.inc line 39

type csint = cint32;


cslong

Signed long

Declaration

Source position: ctypes.inc line 54

type cslong = Int64;

Description

The size is CPU dependent.


cslonglong

Signed longlong type

Declaration

Source position: ctypes.inc line 47

type cslonglong = cint64;

Description

cslonglong is an alias for clonglong.


csshort

Short signed integer type

Declaration

Source position: ctypes.inc line 33

type csshort = cint16;


cuchar

C type: 8-bit unsigned integer

Declaration

Source position: ctypes.inc line 28

type cuchar = cuint8;


cuint

C type: unsigned integer (natural size)

Declaration

Source position: ctypes.inc line 40

type cuint = cuint32;


cuint8

C type: 8 bits sized, unsigned integer.

Declaration

Source position: ctypes.inc line 25

type cuint8 = Byte;


cuint16

C type: 16 bits sized, unsigned integer.

Declaration

Source position: ctypes.inc line 31

type cuint16 = Word;


cuint32

C type: 32 bits sized, unsigned integer.

Declaration

Source position: ctypes.inc line 37

type cuint32 = LongWord;


cuint64

C type: 64 bits sized, unsigned integer.

Declaration

Source position: ctypes.inc line 45

type cuint64 = QWord;


culong

C type: long unsigned integer (double sized)

Declaration

Source position: ctypes.inc line 55

type culong = QWord;


culonglong

C type: 64-bit (double long) unsigned integer.

Declaration

Source position: ctypes.inc line 48

type culonglong = cuint64;


cunsigned

Alias for #rtl.unixtype.cuint

Declaration

Source position: ctypes.inc line 42

type cunsigned = cuint;


cushort

C type: short unsigned integer (half sized)

Declaration

Source position: ctypes.inc line 34

type cushort = cuint16;


dev_t

Device descriptor type.

Declaration

Source position: ptypes.inc line 65

type dev_t = cuint64;


gid_t

Group ID type.

Declaration

Source position: ptypes.inc line 138

type gid_t = cuint32;


Reference for unit 'unixtype'

Basic unix types

uses

  System;

The system unit

Overview

The unixtype unit contains the definitions of basic unix types. It was initially implemented by Marco van de Voort.

When porting to a new unix platform, this unit should be adapted to the sizes and conventions of the platform to which the compiler is ported.


Reference for unit 'unixtype': Constants

ARG_MAX | Max number of command-line arguments.
NAME_MAX | Max length (in bytes) of filename
PATH_MAX | Max length (in bytes) of pathname
Prio_PGrp | #rtl.baseunix.fpGetPriority option: Get process group priority.
Prio_Process | #rtl.baseunix.fpGetPriority option: Get process priority.
Prio_User | #rtl.baseunix.fpGetPriority option: Get user priority.
pthreadrwlocksize | Size of pthread_rwlock_t _data structure
SIG_MAXSIG | Maximum signal number.
SYS_NMLN | Max system namelength
_PTHREAD_MUTEX_ADAPTIVE_NP | Mutex options:
_PTHREAD_MUTEX_DEFAULT | Mutex options:
_PTHREAD_MUTEX_ERRORCHECK | Mutex options:
_PTHREAD_MUTEX_ERRORCHECK_NP | Mutex options: double lock returns an error code.
_PTHREAD_MUTEX_FAST_NP | Mutex options: Fast mutex
_PTHREAD_MUTEX_NORMAL | Mutex options:
_PTHREAD_MUTEX_RECURSIVE | Mutex options:
_PTHREAD_MUTEX_RECURSIVE_NP | Mutex options: recursive mutex
_PTHREAD_MUTEX_TIMED_NP | Mutex options: ?


Reference for unit 'unixtype': Types

cbool | Boolean type
cchar | C type: 8-bit signed integer
cdouble | Double precision real format.
cfloat | Floating-point real format
cint | C type: integer (natural size)
cint16 | C type: 16 bits sized, signed integer.
cint32 | C type: 32 bits sized, signed integer.
cint64 | C type: 64 bits sized, signed integer.
cint8 | C type: 8 bits sized, signed integer.
clock_t | Clock ticks type
clong | C type: long signed integer (double sized)
clongdouble | Long double
clonglong | C type: 64-bit (double long) signed integer.
cschar | Signed character type
cshort | C type: short signed integer (half sized)
csigned | Signed integer
csint | Signed integer
cslong | Signed long
cslonglong | Signed longlong type
csshort | Short signed integer type
cuchar | C type: 8-bit unsigned integer
cuint | C type: unsigned integer (natural size)
cuint16 | C type: 16 bits sized, unsigned integer.
cuint32 | C type: 32 bits sized, unsigned integer.
cuint64 | C type: 64 bits sized, unsigned integer.
cuint8 | C type: 8 bits sized, unsigned integer.
culong | C type: long unsigned integer (double sized)
culonglong | C type: 64-bit (double long) unsigned integer.
cunsigned | Alias for #rtl.unixtype.cuint
cushort | C type: short unsigned integer (half sized)
dev_t | Device descriptor type.
gid_t | Group ID type.
ino64_t | 64-bit inode
ino_t | Inode type.
ipc_pid_t | Process ID
kDev_t | Kernel device type
mbstate_t | Opaque type for multi-byte character routines
mbstate_value_t | Opaque type for multi-byte character routines
mode_t | Inode mode type.
nlink_t | Number of links type.
off64_t | 64-bit offset type.
off_t | Offset type.
pcbool | Pointer to boolean type
pcchar | Pointer to #rtl.UnixType.cchar
pcdouble | Pointer to cdouble type.
pcfloat | Pointer to cfloat type.
pcint | Pointer to cInt type.
pcint16 | Pointer to 16-bit signed integer type
pcint32 | Pointer to signed 32-bit integer type
pcint64 | Pointer to signed 64-bit integer type
pcint8 | Pointer to 8-bits signed integer type
pClock | Pointer to TClock type.
pclong | Pointer to cLong type.
pclongdouble | Pointer to long double
pclonglong | Pointer to longlong type.
pcschar | Pointer to signed character type
pcshort | Pointer to cShort type.
pcsigned | Pointer to signed integer
pcsint | Pointer to signed integer
pcslong | Pointer to signed long
pcslonglong | Pointer to Signed longlong type
pcsshort | Pointer to short signed integer type
pcuchar | Pointer to #rtl.UnixType.cuchar
pcuint | Pointer to cUInt type.
pcuint16 | Pointer to 16-bit unsigned integer type
pcuint32 | Pointer to unsigned 32-bit integer type
pcuint64 | Pointer to unsigned 64-bit integer type
pcuint8 | Pointer to 8-bits unsigned integer type
pculong | Pointer to cuLong type.
pculonglong | Unsigned longlong type
pcunsigned | Pointer to #rtl.unixtype.cunsigned
pcushort | Pointer to cuShort type.
pDev | Pointer to TDev type.
pGid | Pointer to TGid type.
pid_t | Process ID type.
pIno | Pointer to TIno type.
pIno64 | Pointer to ino64_t
pkDev | Pointer to TkDev type.
pmbstate_t | Pointer to mbstate_t type
pMode | Pointer to TMode type.
pnLink | Pointer to TnLink type.
pOff | Pointer to TOff type.
pOff64 | Pointer to off64_t type
pPid | Pointer to TPid type.
pSize | Pointer to TSize type.
psize_t | Pointer to size_t type.
pSockLen | Pointer to TSockLen type.
pSSize | Pointer to TsSize type
PStatFS | Pointer to TStatFS type.
pthread_attr_t | Thread attributes record. Opaque.
pthread_condattr_t | Conditional variable attributes type (opaque).
pthread_cond_t | Thread conditional variable (opaque).
pthread_key_t | Thread local storage key (opaque)
pthread_mutexattr_t | Mutex attributes type (opaque).
pthread_mutex_t | Thread mutex type (opaque).
pthread_rwlockattr_t | R/W lock attributes (opaque).
pthread_rwlock_t | Read/Write lock type (opaque)
pthread_t | Thread description record
pTime | Pointer to TTime type.
ptimespec | Pointer to timespec record.
ptimeval | Pointer to timeval record.
ptime_t | Pointer to time_t type.
pUid | Pointer to TUid type.
pwchar_t | Pointer to wchar_t type.
sched_param | Scheduling parameter description record.
sem_t | Semaphore type. (opaque)
size_t | Size specification type.
socklen_t | Socket address length type.
ssize_t | Small size type.
TClock | Alias for clock_t type.
TDev | Alias for dev_t type.
TGid | Alias for gid_t type.
timespec | Record specifying time interval.
timeval | Time specification type.
time_t | Time span type
TIno | Alias for ino_t type.
TIno64 | Alias for ino64_t
TIOCtlRequest | Opaque type used in FpIOCtl
TkDev | Alias for kDev_t type.
TMode | Alias for mode_t type.
TnLink | Alias for nlink_t type.
TOff | Alias for off_t type.
TOff64 | Alias for off64_t type.
TPid | Alias for pid_t type.
TSize | Alias for size_t type
TSockLen | Alias for socklen_t type.
TSSize | Alias for ssize_t type
TStatfs | Record describing a file system in the unix.fpstatfs call.
TTime | Alias for TTime type.
TTimeSpec | Alias for TimeSpec type.
TTimeVal | Alias for TimeVal record.
TUid | Alias for uid_t type.
uid_t | User ID type
wchar_t | Wide character type.
wint_t | Wide character size type.
_pthread_fastlock | Fast lock (mutex) type (opaque).


Index of all identifiers in unit 'unixtype'

A C D G I K M N O P S T U W

A

ARG_MAX

C

cbool | clong | cuchar
cchar | clongdouble | cuint
cdouble | clonglong | cuint16
cfloat | cschar | cuint32
cint | cshort | cuint64
cint16 | csigned | cuint8
cint32 | csint | culong
cint64 | cslong | culonglong
cint8 | cslonglong | cunsigned
clock_t | csshort | cushort

D

dev_t

G

gid_t

I

ino64_t ino_t ipc_pid_t

K

kDev_t

M

mbstate_t mbstate_value_t mode_t

N

NAME_MAX nlink_t

O

off64_t off_t

P

PATH_MAX | pcuint8 | pthread_condattr_t
pcbool | pculong | pthread_cond_t
pcchar | pculonglong | _pthread_fastlock
pcdouble | pcunsigned | pthread_key_t
pcfloat | pcushort | _PTHREAD_MUTEX_ADAPTIVE_NP
pcint | pDev | pthread_mutexattr_t
pcint16 | pGid | _PTHREAD_MUTEX_DEFAULT
pcint32 | pid_t | _PTHREAD_MUTEX_ERRORCHECK
pcint64 | pIno | _PTHREAD_MUTEX_ERRORCHECK_NP
pcint8 | pIno64 | _PTHREAD_MUTEX_FAST_NP
pClock | pkDev | _PTHREAD_MUTEX_NORMAL
pclong | pmbstate_t | _PTHREAD_MUTEX_RECURSIVE
pclongdouble | pMode | _PTHREAD_MUTEX_RECURSIVE_NP
pclonglong | pnLink | pthread_mutex_t
pcschar | pOff | _PTHREAD_MUTEX_TIMED_NP
pcshort | pOff64 | pthread_rwlockattr_t
pcsigned | pPid | pthreadrwlocksize
pcsint | Prio_PGrp | pthread_rwlock_t
pcslong | Prio_Process | pthread_t
pcslonglong | Prio_User | pTime
pcsshort | pSize | ptimespec
pcuchar | psize_t | ptime_t
pcuint | pSockLen | ptimeval
pcuint16 | pSSize | pUid
pcuint32 | PStatFS | pwchar_t
pcuint64 | pthread_attr_t |

S

sched_param | size_t | SYS_NMLN
sem_t | socklen_t |
SIG_MAXSIG | ssize_t |

T

TClock | TIOCtlRequest | TSockLen
TDev | TkDev | TSSize
TGid | TMode | TStatfs
timespec | TnLink | TTime
time_t | TOff | TTimeSpec
timeval | TOff64 | TTimeVal
TIno | TPid | TUid
TIno64 | TSize |

U

uid_t

W

wchar_t wint_t


ino64_t

64-bit inode

Declaration

Source position: ptypes.inc line 77

type ino64_t = cuint64;

Description

ino64_t is an inode type capable of containing 64-bit inodes.


ino_t

Inode type.

Declaration

Source position: ptypes.inc line 73

type ino_t = clong;


ipc_pid_t

Process ID

Declaration

Source position: ptypes.inc line 139

type ipc_pid_t = cint;


kDev_t

Kernel device type

Declaration

Source position: ptypes.inc line 69

type kDev_t = cushort;


mbstate_t

Opaque type for multi-byte character routines

Declaration

Source position: ptypes.inc line 208

type mbstate_t = record
__count: cint; | Do not use
__value: mbstate_value_t; | Do not use
end;

Description

This type should never be used directly.


mbstate_value_t

Opaque type for multi-byte character routines

Declaration

Source position: ptypes.inc line 202

type mbstate_value_t = record
case Byte of
0: (
__wch: wint_t; | Do not use
);
1: (
__wchb: array [0..3] of Char; | Do not use
);
end;

Description

This type should never be used directly. It is part of the mbstate_t type.


mode_t

Inode mode type.

Declaration

Source position: ptypes.inc line 82

type mode_t = cint;


NAME_MAX

Max length (in bytes) of filename

Declaration

Source position: ptypes.inc line 390

const NAME_MAX = 255;


nlink_t

Number of links type.

Declaration

Source position: ptypes.inc line 89

type nlink_t = cuint32;


off64_t

64-bit offset type.

Declaration

Source position: ptypes.inc line 101

type off64_t = cint64;


off_t

Offset type.

Declaration

Source position: ptypes.inc line 94

type off_t = cint64;


PATH_MAX

Max length (in bytes) of pathname

Declaration

Source position: ptypes.inc line 391

const PATH_MAX = 4095;


pcbool

Pointer to boolean type

Declaration

Source position: ctypes.inc line 50

type pcbool = ^cbool;

Description

Pointer to boolean type cbool


pcchar

Pointer to #rtl.UnixType.cchar

Declaration

Source position: ctypes.inc line 26

type pcchar = ^cchar;


pcdouble

Pointer to cdouble type.

Declaration

Source position: ctypes.inc line 64

type pcdouble = ^cdouble;


pcfloat

Pointer to cfloat type.

Declaration

Source position: ctypes.inc line 63

type pcfloat = ^cfloat;


pcint

Pointer to cInt type.

Declaration

Source position: ctypes.inc line 38

type pcint = ^cint;


pcint8

Pointer to 8-bits signed integer type

Declaration

Source position: ctypes.inc line 24

type pcint8 = ^cint8;


pcint16

Pointer to 16-bit signed integer type

Declaration

Source position: ctypes.inc line 30

type pcint16 = ^cint16;


pcint32

Pointer to signed 32-bit integer type

Declaration

Source position: ctypes.inc line 36

type pcint32 = ^cint32;


pcint64

Pointer to signed 64-bit integer type

Declaration

Source position: ctypes.inc line 44

type pcint64 = ^cint64;


pClock

Pointer to TClock type.

Declaration

Source position: ptypes.inc line 127

type pClock = ^clock_t;


pclong

Pointer to cLong type.

Declaration

Source position: ctypes.inc line 53

type pclong = ^clong;


pclongdouble

Pointer to long double

Declaration

Source position: ctypes.inc line 65

type pclongdouble = ^clongdouble;

Description

Pointer to the long double type clongdouble


pclonglong

Pointer to longlong type.

Declaration

Source position: ctypes.inc line 46

type pclonglong = ^clonglong;


pcschar

Pointer to signed character type

Declaration

Source position: ctypes.inc line 27

type pcschar = ^cschar;

Description

Pointer to character type cschar.


pcshort

Pointer to cShort type.

Declaration

Source position: ctypes.inc line 32

type pcshort = ^cshort;


pcsigned

Pointer to signed integer

Declaration

Source position: ctypes.inc line 41

type pcsigned = ^csigned;

Description

Pointer to signed integer type csigned.


pcsint

Pointer to signed integer

Declaration

Source position: ctypes.inc line 39

type pcsint = ^csint;

Description

Pointer to signed integer type csint


pcslong

Pointer to signed long

Declaration

Source position: ctypes.inc line 54

type pcslong = ^cslong;

Description

Pointer ot the signed long cslong


pcslonglong

Pointer to Signed longlong type

Declaration

Source position: ctypes.inc line 47

type pcslonglong = ^cslonglong;

Description

Pointer to Signed longlong type cslonglong


pcsshort

Pointer to short signed integer type

Declaration

Source position: ctypes.inc line 33

type pcsshort = ^csshort;

Description

Pointer to short signed integer type csshort


pcuchar

Pointer to #rtl.UnixType.cuchar

Declaration

Source position: ctypes.inc line 28

type pcuchar = ^cuchar;


pcuint

Pointer to cUInt type.

Declaration

Source position: ctypes.inc line 40

type pcuint = ^cuint;


pcuint8

Pointer to 8-bits unsigned integer type

Declaration

Source position: ctypes.inc line 25

type pcuint8 = ^cuint8;


pcuint16

Pointer to 16-bit unsigned integer type

Declaration

Source position: ctypes.inc line 31

type pcuint16 = ^cuint16;


pcuint32

Pointer to unsigned 32-bit integer type

Declaration

Source position: ctypes.inc line 37

type pcuint32 = ^cuint32;


pcuint64

Pointer to unsigned 64-bit integer type

Declaration

Source position: ctypes.inc line 45

type pcuint64 = ^cuint64;


pculong

Pointer to cuLong type.

Declaration

Source position: ctypes.inc line 55

type pculong = ^culong;


pculonglong

Unsigned longlong type

Declaration

Source position: ctypes.inc line 48

type pculonglong = ^culonglong;


pcunsigned

Pointer to #rtl.unixtype.cunsigned

Declaration

Source position: ctypes.inc line 42

type pcunsigned = ^cunsigned;


pcushort

Pointer to cuShort type.

Declaration

Source position: ctypes.inc line 34

type pcushort = ^cushort;


pDev

Pointer to TDev type.

Declaration

Source position: ptypes.inc line 67

type pDev = ^dev_t;


pGid

Pointer to TGid type.

Declaration

Source position: ptypes.inc line 148

type pGid = ^gid_t;


pid_t

Process ID type.

Declaration

Source position: ptypes.inc line 105

type pid_t = cint;


pIno

Pointer to TIno type.

Declaration

Source position: ptypes.inc line 75

type pIno = ^ino_t;


pIno64

Pointer to ino64_t

Declaration

Source position: ptypes.inc line 79

type pIno64 = ^ino64_t;

See also

ino64_t

64-bit inode


pkDev

Pointer to TkDev type.

Declaration

Source position: ptypes.inc line 71

type pkDev = ^kDev_t;


pmbstate_t

Pointer to mbstate_t type

Declaration

Source position: ptypes.inc line 212

type pmbstate_t = ^mbstate_t;


pMode

Pointer to TMode type.

Declaration

Source position: ptypes.inc line 87

type pMode = ^mode_t;


pnLink

Pointer to TnLink type.

Declaration

Source position: ptypes.inc line 91

type pnLink = ^nlink_t;


pOff

Pointer to TOff type.

Declaration

Source position: ptypes.inc line 99

type pOff = ^off_t;


pOff64

Pointer to off64_t type

Declaration

Source position: ptypes.inc line 103

type pOff64 = ^off64_t;


pPid

Pointer to TPid type.

Declaration

Source position: ptypes.inc line 107

type pPid = ^pid_t;


Prio_PGrp

#rtl.baseunix.fpGetPriority option: Get process group priority.

Declaration

Source position: ptypes.inc line 405

const Prio_PGrp = 1;


Prio_Process

#rtl.baseunix.fpGetPriority option: Get process priority.

Declaration

Source position: ptypes.inc line 404

const Prio_Process = 0;


Prio_User

#rtl.baseunix.fpGetPriority option: Get user priority.

Declaration

Source position: ptypes.inc line 406

const Prio_User = 2;


pSize

Pointer to TSize type.

Declaration

Source position: ptypes.inc line 122

type pSize = ^size_t;


psize_t

Pointer to size_t type.

Declaration

Source position: ptypes.inc line 123

type psize_t = pSize;


pSockLen

Pointer to TSockLen type.

Declaration

Source position: ptypes.inc line 155

type pSockLen = ^socklen_t;


pSSize

Pointer to TsSize type

Declaration

Source position: ptypes.inc line 125

type pSSize = ^ssize_t;


PStatFS

Pointer to TStatFS type.

Declaration

Source position: ptypes.inc line 200

type PStatFS = ^TStatfs;


pthread_attr_t

Thread attributes record. Opaque.

Declaration

Source position: ptypes.inc line 231

type pthread_attr_t = record
__detachstate: cint; | ?
__schedpolicy: cint; | ?
__schedparam: sched_param; | ?
__inheritsched: cint; | ?
__scope: cint; | ?
__guardsize: size_t; | ?
__stackaddr_set: cint; | ?
__stackaddr: pointer; | ?
__stacksize: size_t; | ?
end;

Description

pthread_attr_t describes the thread attributes. It should be considered an opaque record, the names of the fields can change anytime. Use the appropriate functions to set the thread attributes.


pthread_cond_t

Thread conditional variable (opaque).

Declaration

Source position: ptypes.inc line 293

type pthread_cond_t = record
__c_lock: _pthread_fastlock; | ?
__c_waiting: pointer; | ?
__padding: array [0..48-1-sizeof(_pthread_fastlock)-sizeof(pointer)-sizeof(clonglong)] of Byte; | ?
__align: clonglong; | ?
end;

Description

pthread_cond_t describes a thread conditional variable. It should be considered an opaque record, the names of the fields can change anytime.


pthread_condattr_t

Conditional variable attributes type (opaque).

Declaration

Source position: ptypes.inc line 311

type pthread_condattr_t = record

  __dummy: cint;

?

end;

Description

pthread_condattr_t describes the attributes of a thread mutex. It should be considered an opaque record, the names of the fields can change anytime.


pthread_key_t

Thread local storage key (opaque)

Declaration

Source position: ptypes.inc line 326

type pthread_key_t = cuint;


pthread_mutex_t

Thread mutex type (opaque).

Declaration

Source position: ptypes.inc line 259

type pthread_mutex_t = record
__m_reserved: cint; | ?
__m_count: cint; | ?
__m_owner: pointer; | ?
__m_kind: cint; | ?
__m_lock: _pthread_fastlock; | ?
end;

Description

_pthread_mutex_t describes a thread mutex. It should be considered an opaque record, the names of the fields can change anytime.


pthread_mutexattr_t

Mutex attributes type (opaque).

Declaration

Source position: ptypes.inc line 278

type pthread_mutexattr_t = record

  __mutexkind: cint;

?

end;

Description

pthread_mutexattr_t describes the attributes of a thread mutex. It should be considered an opaque record, the names of the fields can change anytime.


pthread_rwlock_t

Read/Write lock type (opaque)

Declaration

Source position: ptypes.inc line 333

type pthread_rwlock_t = record
case Boolean of
False: (
_data: array [0..pthreadrwlocksize-1] of Char; | internal structure
);
True: (
align: clong; | Internal structure
);
end;

Description

pthread_rwlock_t describes a lock. It should be considered an opaque record, the names of the fields can change anytime.


pthread_rwlockattr_t

R/W lock attributes (opaque).

Declaration

Source position: ptypes.inc line 349

type pthread_rwlockattr_t = record
__lockkind: cint; | ?
__pshared: cint; | ?
end;

Description

pthread_rwlockattr_t describes the attributes of a lock. It should be considered an opaque record, the names of the fields can change anytime.


pthread_t

Thread description record

Declaration

Source position: ptypes.inc line 214

type pthread_t = culong;


pthreadrwlocksize

Size of pthread_rwlock_t _data structure

Declaration

Source position: ptypes.inc line 329

const pthreadrwlocksize = 56;


pTime

Pointer to TTime type.

Declaration

Source position: ptypes.inc line 130

type pTime = ^time_t;


ptime_t

Pointer to time_t type.

Declaration

Source position: ptypes.inc line 131

type ptime_t = ^time_t;


ptimespec

Pointer to timespec record.

Declaration

Source position: ptypes.inc line 168

type ptimespec = ^timespec;


ptimeval

Pointer to timeval record.

Declaration

Source position: ptypes.inc line 161

type ptimeval = ^timeval;


pUid

Pointer to TUid type.

Declaration

Source position: ptypes.inc line 146

type pUid = ^uid_t;


pwchar_t

Pointer to wchar_t type.

Declaration

Source position: ptypes.inc line 134

type pwchar_t = ^wchar_t;


sched_param

Scheduling parameter description record.

Declaration

Source position: ptypes.inc line 216

type sched_param = record

  __sched_priority: cint;

Priority.

end;


sem_t

Semaphore type. (opaque)

Declaration

Source position: ptypes.inc line 365

type sem_t = record
__sem_lock: _pthread_fastlock; | ?
__sem_value: cint; | ?
__sem_waiting: pointer; | ?
end;

Description

sem_t describes a thread semaphore. It should be considered an opaque record, the names of the fields can change anytime.


SIG_MAXSIG

Maximum signal number.

Declaration

Source position: ptypes.inc line 399

const SIG_MAXSIG = 128;


size_t

Size specification type.

Declaration

Source position: ptypes.inc line 110

type size_t = cuint64;


socklen_t

Socket address length type.

Declaration

Source position: ptypes.inc line 153

type socklen_t = cuint32;


ssize_t

Small size type.

Declaration

Source position: ptypes.inc line 111

type ssize_t = cint64;


SYS_NMLN

Max system namelength

Declaration

Source position: ptypes.inc line 392

const SYS_NMLN = 65;


TClock

Alias for clock_t type.

Declaration

Source position: ptypes.inc line 126

type TClock = clock_t;


TDev

Alias for dev_t type.

Declaration

Source position: ptypes.inc line 66

type TDev = dev_t;


TGid

Alias for gid_t type.

Declaration

Source position: ptypes.inc line 147

type TGid = gid_t;


time_t

Time span type

Declaration

Source position: ptypes.inc line 113

type time_t = cint64;


timespec

Record specifying time interval.

Declaration

Source position: ptypes.inc line 164

type timespec = record
tv_sec: time_t; | Seconds
tv_nsec: clong; | Nanoseconds
end;


timeval

Time specification type.

Declaration

Source position: ptypes.inc line 157

type timeval = record
tv_sec: time_t; | Seconds
tv_usec: clong; | Microseconds
end;


TIno

Alias for ino_t type.

Declaration

Source position: ptypes.inc line 74

type TIno = ino_t;


TIno64

Alias for ino64_t

Declaration

Source position: ptypes.inc line 78

type TIno64 = ino64_t;

See also

ino64_t

64-bit inode


TIOCtlRequest

Opaque type used in FpIOCtl

Declaration

Source position: ptypes.inc line 150

type TIOCtlRequest = cint;


TkDev

Alias for kDev_t type.

Declaration

Source position: ptypes.inc line 70

type TkDev = kDev_t;


TMode

Alias for mode_t type.

Declaration

Source position: ptypes.inc line 86

type TMode = mode_t;


TnLink

Alias for nlink_t type.

Declaration

Source position: ptypes.inc line 90

type TnLink = nlink_t;


TOff

Alias for off_t type.

Declaration

Source position: ptypes.inc line 98

type TOff = off_t;


TOff64

Alias for off64_t type.

Declaration

Source position: ptypes.inc line 102

type TOff64 = off64_t;


TPid

Alias for pid_t type.

Declaration

Source position: ptypes.inc line 106

type TPid = pid_t;


TSize

Alias for size_t type

Declaration

Source position: ptypes.inc line 121

type TSize = size_t;


TSockLen

Alias for socklen_t type.

Declaration

Source position: ptypes.inc line 154

type TSockLen = socklen_t;


TSSize

Alias for ssize_t type

Declaration

Source position: ptypes.inc line 124

type TSSize = ssize_t;


TStatfs

Record describing a file system in the unix.fpstatfs call.

Declaration

Source position: ptypes.inc line 172

type TStatfs = record
fstype: clong; | File system type
bsize: clong; | Block size
blocks: culong; | Total number of blocks
bfree: culong; | Number of free blocks
bavail: culong; | Number of available blocks
files: culong; | Number of files
ffree: culong; | ?
fsid: array [0..1] of cint; | ?
namelen: clong; | Max name length for files.
frsize: clong; | Optimal block transfer size
spare: array [0..4] of clong; | Pad bytes. Do not use.
end;


TTime

Alias for TTime type.

Declaration

Source position: unixtype.pp line 24

type TTime = time_t;


TTimeSpec

Alias for TimeSpec type.

Declaration

Source position: ptypes.inc line 169

type TTimeSpec = timespec;


TTimeVal

Alias for TimeVal record.

Declaration

Source position: ptypes.inc line 162

type TTimeVal = timeval;


TUid

Alias for uid_t type.

Declaration

Source position: ptypes.inc line 145

type TUid = uid_t;


uid_t

User ID type

Declaration

Source position: ptypes.inc line 137

type uid_t = cuint32;


wchar_t

Wide character type.

Declaration

Source position: ptypes.inc line 133

type wchar_t = cint32;


wint_t

Wide character size type.

Declaration

Source position: ptypes.inc line 120

type wint_t = cint32;


ComStr

[Overview][Types][Procedures and functions][Variables][Index] Reference for unit 'unixutil' (#rtl)

ComStr (deprecated)

Command-line string type.

Declaration

Source position: unixutil.pp line 34

type ComStr = string;


DirStr

[Overview][Types][Procedures and functions][Variables][Index] Reference for unit 'unixutil' (#rtl)

DirStr (deprecated)

Filename directory part string type.

Declaration

Source position: unixutil.pp line 36

type DirStr = string;


ExtStr

[Overview][Types][Procedures and functions][Variables][Index] Reference for unit 'unixutil' (#rtl)

ExtStr (deprecated)

Filename extension part string type.

Declaration

Source position: unixutil.pp line 38

type ExtStr = string;


Reference for unit 'unixutil'

Unix utility routines.

uses

  System;

The system unit

Overview

The UnixUtil unit contains some of the routines that were present in the old Linux unit, but which do not really belong in the unix or baseunix units.

Most of the functions described here have cross-platform counterparts in the SysUtils unit. It is therefore recommended to use that unit.


Reference for unit 'unixutil': Types

ComStr | Command-line string type.
DirStr | Filename directory part string type.
ExtStr | Filename extension part string type.
NameStr | Filename name part string type.
PathStr | Filename full path string type.


Reference for unit 'unixutil': Procedures and functions

ArrayStringToPPchar | Concert an array of string to an array of null-terminated strings
EpochToLocal | Convert epoch time to local time
GetFS | Return file selector
GregorianToJulian | Converts a gregorian date to a julian date
JulianToGregorian | Converts a julian date to a gregorian date
LocalToEpoch | Convert local time to epoch (unix) time
StringToPPChar | Split string in list of null-terminated strings


Reference for unit 'unixutil': Variables

Tzseconds

Seconds west of GMT


Index of all identifiers in unit 'unixutil'

A C D E G J L N P S T

A

ArrayStringToPPchar

C

ComStr

D

DirStr

E

EpochToLocal ExtStr

G

GetFS GregorianToJulian

J

JulianToGregorian

L

LocalToEpoch

N

NameStr

P

PathStr

S

StringToPPChar

T

Tzseconds


NameStr

[Overview][Types][Procedures and functions][Variables][Index] Reference for unit 'unixutil' (#rtl)

NameStr (deprecated)

Filename name part string type.

Declaration

Source position: unixutil.pp line 37

type NameStr = string;


PathStr

[Overview][Types][Procedures and functions][Variables][Index] Reference for unit 'unixutil' (#rtl)

PathStr (deprecated)

Filename full path string type.

Declaration

Source position: unixutil.pp line 35

type PathStr = string;


Tzseconds

Seconds west of GMT

Declaration

Source position: unixutil.pp line 31

var Tzseconds: LongInt = ;


Black

Black color attribute

Declaration

Source position: videoh.inc line 44

const Black = 0;


Blink

Blink attribute

Declaration

Source position: videoh.inc line 64

const Blink = 128;


Blue

Blue color attribute

Declaration

Source position: videoh.inc line 45

const Blue = 1;


Brown

Brown color attribute

Declaration

Source position: videoh.inc line 50

const Brown = 6;


cpBlink

Video driver supports blink attribute

Declaration

Source position: videoh.inc line 68

const cpBlink = $0002;


cpChangeCursor

Video driver supports changing cursor shape.

Declaration

Source position: videoh.inc line 72

const cpChangeCursor = $0020;


cpChangeFont

Video driver supports changing screen font.

Declaration

Source position: videoh.inc line 70

const cpChangeFont = $0008;


cpChangeMode

Video driver supports changing mode

Declaration

Source position: videoh.inc line 71

const cpChangeMode = $0010;


cpColor

Video driver supports color

Declaration

Source position: videoh.inc line 69

const cpColor = $0004;


cpUnderLine

Video driver supports underline attribute

Declaration

Source position: videoh.inc line 67

const cpUnderLine = $0001;


crBlock

Block cursor

Declaration

Source position: videoh.inc line 77

const crBlock = 2;


crHalfBlock

Half block cursor

Declaration

Source position: videoh.inc line 78

const crHalfBlock = 3;


crHidden

Hide cursor

Declaration

Source position: videoh.inc line 75

const crHidden = 0;


crUnderLine

Underline cursor

Declaration

Source position: videoh.inc line 76

const crUnderLine = 1;


CursorLines

Currently visible scanlines of cursor.

Declaration

Source position: videoh.inc line 99

var CursorLines: Byte = ;

Description

CursorLines is a bitmask which determines which cursor lines are visible and which are not. Each set bit corresponds to a cursorline being shown.

This variable is not supported on all platforms, so it should be used sparingly.


CursorX

Current write cursor X position.

Declaration

Source position: videoh.inc line 94

var CursorX: Word = ;

Description

Current horizontal position in the screen where items will be written.


CursorY

Current write cursor Y position.

Declaration

Source position: videoh.inc line 95

var CursorY: Word = ;

Description

Current vertical position in the screen where items will be written.


Cyan

Cyan color attribute

Declaration

Source position: videoh.inc line 47

const Cyan = 3;


DarkGray

Dark gray color attribute

Declaration

Source position: videoh.inc line 54

const DarkGray = 8;


errOk

No error

Declaration

Source position: videoh.inc line 168

const errOk = 0;


ErrorCode

Error code returned by the last operation.

Declaration

Source position: videoh.inc line 169

const ErrorCode: LongInt = ErrOK;


ErrorHandler

Error handler routine

Declaration

Source position: videoh.inc line 171

const ErrorHandler: TErrorHandler = @ DefaultErrorHandler;

Description

The ErrorHandler variable can be set to a custom-error handling function. It is set by default to the DefaultErrorHandler function.


ErrorInfo

Pointer to extended error information.

Declaration

Source position: videoh.inc line 170

const ErrorInfo: Pointer = Nil;


errVioBase

Base value for video errors

Declaration

Source position: videoh.inc line 82

const errVioBase = 1000;


errVioInit

Video driver initialization error.

Declaration

Source position: videoh.inc line 83

const errVioInit = errVioBase + 1;


errVioNoSuchMode

Invalid video mode

Declaration

Source position: videoh.inc line 86

const errVioNoSuchMode = errVioBase + 3;


errVioNotSupported

Unsupported video function

Declaration

Source position: videoh.inc line 85

const errVioNotSupported = errVioBase + 2;


external_codepage

Codepage used by the terminal.

Declaration

Source position: video.pp line 54

var external_codepage: Tencoding = ;

Description

This variable is for internal use only and should not be used.

See also

TEncoding | Various encodings of the input and output descriptors
internal_codepage | Internal codepage used by the video system


FVMaxWidth

Maximum screen buffer width.

Declaration

Source position: videoh.inc line 113

const FVMaxWidth = 240;


Green

Green color attribute

Declaration

Source position: videoh.inc line 46

const Green = 2;


Reference for unit 'video'

Screen handling unit

uses

  System;

The system unit

Overview

The Video unit implements a screen access layer which is system independent. It can be used to write on the screen in a system-independent way, which should be optimal on all platforms for which the unit is implemented.

The working of the Video is simple: After calling InitVideo, the array VideoBuf contains a representation of the video screen of size ScreenWidth*ScreenHeight, going from left to right and top to bottom when walking the array elements: VideoBuf[0] contains the character and color code of the top-left character on the screen. VideoBuf[ScreenWidth] contains the data for the character in the first column of the second row on the screen, and so on.

To write to the 'screen', the text to be written should be written to the VideoBuf array. Calling UpdateScreen will then cp the text to the screen in the most optimal way. (an example can be found further on).

The color attribute is a combination of the foreground and background color, plus the blink bit. The bits describe the various color combinations:

bits 0-3
The foreground color. Can be set using all color constants.
bits 4-6
The background color. Can be set using a subset of the color constants.
bit 7
The blinking bit. If this bit is set, the character will appear blinking.

Each possible color has a constant associated with it, see the constants section for a list of constants.

The foreground and background color can be combined to a color attribute with the following code:

Attr:=ForeGroundColor + (BackGroundColor shl 4);

The color attribute can be logically or-ed with the blink attribute to produce a blinking character:

Atrr:=Attr or blink;

But not all drivers may support this.

The contents of the VideoBuf array may be modified: This is 'writing' to the screen. As soon as everything that needs to be written in the array is in the VideoBuf array, calling UpdateScreen will copy the contents of the array screen to the screen, in a manner that is as efficient as possible.

The updating of the screen can be prohibited to optimize performance; To this end, the LockScreenUpdate function can be used: This will increment an internal counter. As long as the counter differs from zero, calling UpdateScreen will not do anything. The counter can be lowered with UnlockScreenUpdate. When it reaches zero, the next call to UpdateScreen will actually update the screen. This is useful when having nested procedures that do a lot of screen writing.

The video unit also presents an interface for custom screen drivers, thus it is possible to override the default screen driver with a custom screen driver, see the SetVideoDriver call. The current video driver can be retrieved using the GetVideoDriver call.

Remark: The video unit should not be used together with the crt unit. Doing so will result in very strange behaviour, possibly program crashes.

Related topics

vidutil | Examples utility unit
viddriver | Writing a custom video driver


Reference for unit 'video': Constants

Black | Black color attribute
Blink | Blink attribute
Blue | Blue color attribute
Brown | Brown color attribute
cpBlink | Video driver supports blink attribute
cpChangeCursor | Video driver supports changing cursor shape.
cpChangeFont | Video driver supports changing screen font.
cpChangeMode | Video driver supports changing mode
cpColor | Video driver supports color
cpUnderLine | Video driver supports underline attribute
crBlock | Block cursor
crHalfBlock | Half block cursor
crHidden | Hide cursor
crUnderLine | Underline cursor
Cyan | Cyan color attribute
DarkGray | Dark gray color attribute
errOk | No error
ErrorCode | Error code returned by the last operation.
ErrorHandler | Error handler routine
ErrorInfo | Pointer to extended error information.
errVioBase | Base value for video errors
errVioInit | Video driver initialization error.
errVioNoSuchMode | Invalid video mode
errVioNotSupported | Unsupported video function
FVMaxWidth | Maximum screen buffer width.
Green | Green color attribute
LightBlue | Light Blue color attribute
LightCyan | Light cyan color attribute
LightGray | Light gray color attribute
LightGreen | Light green color attribute
LightMagenta | Light magenta color attribute
LightRed | Light red color attribute
LowAscii | Low 32 ASCII character availability
Magenta | Magenta color attribute
NoExtendedFrame | Disable transformation of control characters on Unix terminals
Red | Red color attribute
ScreenHeight | Current screen height
ScreenWidth | Current screen Width
vioOK | No errors occurred
White | White color attribute
Yellow | Yellow color attribute


Reference for unit 'video': Types

PVideoBuf | Pointer type to TVideoBuf
PVideoCell | Pointer type to TVideoCell
PVideoMode | Pointer to TVideoMode record.
TErrorHandler | Error handler prototype
TErrorHandlerReturnValue | Type used to report and respond to error conditions
TVideoBuf | Screen array type
TVideoCell | One cell (=screen position) in the video buffer
TVideoDriver | Video driver record
TVideoMode | Record type descrbing a video mode.
TVideoModeSelector | Video mode selection callback prototype.


Reference for unit 'video': Procedures and functions

ClearScreen | Clear the video screen.
DefaultErrorHandler | Default error handling routine.
DoneVideo | Disable video driver.
GetCapabilities | Get current driver capabilities.
GetCursorType | Get screen cursor type
GetLockScreenCount | Get the screen lock update count.
GetVideoDriver | Get a copy of the current video driver.
GetVideoMode | Return current video mode
GetVideoModeCount | Get the number of video modes supported by the driver.
GetVideoModeData | Get the specifications for a video mode
InitVideo | Initialize video driver.
LockScreenUpdate | Prevent further screen updates.
SetCursorPos | Set write cursor position.
SetCursorType | Set cursor type
SetVideoDriver | Install a new video driver.
SetVideoMode | Set current video mode.
UnlockScreenUpdate | Unlock screen update.
UpdateScreen | Update physical screen with internal screen image.


Reference for unit 'video': Variables

CursorLines | Currently visible scanlines of cursor.
CursorX | Current write cursor X position.
CursorY | Current write cursor Y position.
OldVideoBuf | Last written screen image.
ScreenColor | Indicate whether current screen supports colors
VideoBuf | Current screen image.
VideoBufSize | Size of the screen image.


Index of all identifiers in unit 'video'

B C D E F G I K L M N O P R S T U V W Y

B

Black | Blue
Blink | Brown

C

ClearScreen | cpChangeFont | crUnderLine
cp437 | cpChangeMode | CursorLines
cp850 | cpColor | CursorX
cp852 | cpUnderLine | CursorY
cp866 | crBlock | Cyan
cpBlink | crHalfBlock |
cpChangeCursor | crHidden |

D

DarkGray DefaultErrorHandler DoneVideo

E

errAbort | ErrorHandler | errVioInit
errContinue | ErrorInfo | errVioNoSuchMode
errOk | errRetry | errVioNotSupported
ErrorCode | errVioBase | external_codepage

F

FVMaxWidth

G

GetCapabilities | GetVideoDriver | GetVideoModeData
GetCursorType | GetVideoMode | Green
GetLockScreenCount | GetVideoModeCount |

I

InitVideo | iso05 | iso13
internal_codepage | iso06 | iso14
iso01 | iso07 | iso15
iso02 | iso08 | iso_codepages
iso03 | iso09 |
iso04 | iso10 |

K

koi8r

L

LightBlue | LightGreen | LockScreenUpdate
LightCyan | LightMagenta | LowAscii
LightGray | LightRed |

M

Magenta

N

NoExtendedFrame

O

OldVideoBuf

P

PVideoBuf PVideoCell PVideoMode

R

Red

S

ScreenColor | SetCursorPos | SetVideoMode
ScreenHeight | SetCursorType |
ScreenWidth | SetVideoDriver |

T

Tencoding | TVideoBuf | TVideoMode
TErrorHandler | TVideoCell | TVideoModeSelector
TErrorHandlerReturnValue | TVideoDriver |

U

UnlockScreenUpdate UpdateScreen utf8

V

vga_codepages | VideoBufSize
VideoBuf | vioOK

W

White

Y

Yellow


internal_codepage

Internal codepage used by the video system

Declaration

Source position: video.pp line 54

var internal_codepage: Tencoding = ;

Description

This variable is for internal use only and should not be used.

See also

TEncoding | Various encodings of the input and output descriptors
external_codepage | Codepage used by the terminal.


iso_codepages

Set of code pages that use a ISO encoding

Declaration

Source position: video.pp line 51

const iso_codepages = [iso01, iso02, iso03, iso04, iso05, iso06, iso07, iso08, iso09, iso10, iso13, iso14, iso15];

Description

iso_codepages is a set containing all code pages that use an ISO encoding.

See also

TEncoding | Various encodings of the input and output descriptors
vga_codepages | Set of code pages that are a normal VGA codepage


LightBlue

Light Blue color attribute

Declaration

Source position: videoh.inc line 55

const LightBlue = 9;


LightCyan

Light cyan color attribute

Declaration

Source position: videoh.inc line 57

const LightCyan = 11;


LightGray

Light gray color attribute

Declaration

Source position: videoh.inc line 51

const LightGray = 7;


LightGreen

Light green color attribute

Declaration

Source position: videoh.inc line 56

const LightGreen = 10;


LightMagenta

Light magenta color attribute

Declaration

Source position: videoh.inc line 59

const LightMagenta = 13;


LightRed

Light red color attribute

Declaration

Source position: videoh.inc line 58

const LightRed = 12;


LowAscii

Low 32 ASCII character availability

Declaration

Source position: videoh.inc line 110

const LowAscii = True;

Description

On some systems, the low 32 values of the DOS code page are necessary for the ASCII control codes and cannot be displayed by programs. If LowAscii is true, you can use the low 32 ASCII values. If it is false, you must avoid using them.

LowAscii can be implemented either through a constant, variable or property. You should under no circumstances assume that you can write to LowAscii, or take its address.


Magenta

Magenta color attribute

Declaration

Source position: videoh.inc line 49

const Magenta = 5;


NoExtendedFrame

Disable transformation of control characters on Unix terminals

Declaration

Source position: videoh.inc line 111

const NoExtendedFrame = False;

Description

The VT100 character set only has line drawing characters consisting of a single line. If this value is true, the line drawing characters with two lines will be automatically converted to single lines.

NoExtendedFrame can be implemented either through a constant, variable or property. You should under no circumstances assume that you can write to NoExtendedFrame, or take its address.


OldVideoBuf

Last written screen image.

Declaration

Source position: videoh.inc line 97

var OldVideoBuf: PVideoBuf = ;

Description

The OldVideoBuf contains the state of the video screen after the last screen update. The UpdateScreen function uses this array to decide which characters on screen should be updated, and which not.

Note that the OldVideoBuf array may be ignored by some drivers, so it should not be used. The Array is in the interface section of the video unit mainly so drivers that need it can make use of it.


PVideoBuf

Pointer type to TVideoBuf

Declaration

Source position: videoh.inc line 26

type PVideoBuf = ^TVideoBuf;


PVideoCell

Pointer type to TVideoCell

Declaration

Source position: videoh.inc line 23

type PVideoCell = ^TVideoCell;


PVideoMode

Pointer to TVideoMode record.

Declaration

Source position: videoh.inc line 15

type PVideoMode = ^TVideoMode;


Red

Red color attribute

Declaration

Source position: videoh.inc line 48

const Red = 4;


ScreenColor

Indicate whether current screen supports colors

Declaration

Source position: videoh.inc line 93

var ScreenColor: Boolean = ;

Description

ScreenColor indicates whether the current screen supports colors.


ScreenHeight

Current screen height

Declaration

Source position: videoh.inc line 90

const ScreenHeight: Word = 0;


ScreenWidth

Current screen Width

Declaration

Source position: videoh.inc line 89

const ScreenWidth: Word = 0;


Tencoding

Various encodings of the input and output descriptors

Declaration

Source position: video.pp line 27

type Tencoding = (
cp437, | Codepage 437
cp850, | Codepage 850
cp852, | Codepage 852
cp866, | Codepage 866
koi8r, | KOI8-R codepage
iso01, | ISO 8859-1
iso02, | ISO 8859-2
iso03, | ISO 8859-3
iso04, | ISO 8859-4
iso05, | ISO 8859-5
iso06, | ISO 8859-6
iso07, | ISO 8859-7
iso08, | ISO 8859-8
iso09, | ISO 8859-9
iso10, | ISO 8859-10
iso13, | ISO 8859-13
iso14, | ISO 8859-14
iso15, | ISO 8859-15
utf8 | UTF-8 encoding
);

Description

This type is available under Unix-like operating systems only.


TErrorHandler

Error handler prototype

Declaration

Source position: videoh.inc line 159

type TErrorHandler = function(

  Code: LongInt;

  Info: Pointer

):TErrorHandlerReturnValue;

Description

The TErrorHandler function is used to register an own error handling function. It should be used when installing a custom error handling function, and must return one of the above values.

Code should contain the error code for the error condition, and the Info parameter may contain any data type specific to the error code passed to the function.


TErrorHandlerReturnValue

Type used to report and respond to error conditions

Declaration

Source position: videoh.inc line 154

type TErrorHandlerReturnValue = (
errRetry, | retry the operation
errAbort, | abort and return error code
errContinue | abort without returning an errorcode.
);


TVideoBuf

Screen array type

Declaration

Source position: videoh.inc line 25

type TVideoBuf = array [0..32759] of TVideoCell;

Description

The TVideoBuf type represents the screen.


TVideoCell

One cell (=screen position) in the video buffer

Declaration

Source position: videoh.inc line 22

type TVideoCell = Word;

Description

TVideoCell describes one character on the screen. One of the bytes contains the color attribute with which the character is drawn on the screen, and the other byte contains the ASCII code of the character to be drawn. The exact position of the different bytes in the record is operating system specific. On most little-endian systems, the high byte represents the color attribute, while the low-byte represents the ASCII code of the character to be drawn.


TVideoDriver

Video driver record

Declaration

Source position: videoh.inc line 28

type TVideoDriver = record
InitDriver: procedure; | Initializes the driver
DoneDriver: procedure; | Finalizes the driver (used for cleanup)
UpdateScreen: procedure( | Force an update of the screen
Force: Boolean
);
ClearScreen: procedure; | Clear the screen
SetVideoMode: function( | Set the video mode
const Mode: TVideoMode
):Boolean;
GetVideoModeCount: function: Word; | Get number of supported video modes
GetVideoModeData: function( | Return data for the selected video mode
Index: Word;
var Data: TVideoMode
):Boolean;
SetCursorPos: procedure( | Set the cursos position.
NewCursorX: Word;
NewCursorY: Word
);
GetCursorType: function: Word; | Get the current cursor type.
SetCursorType: procedure( | Set the current cursos type.
NewType: Word
);
GetCapabilities: function: Word; | Get the capabilities of the driver.
end;

Description

TVideoDriver record can be used to install a custom video driver, with the SetVideoDriver call.

An explanation of all fields can be found there.


TVideoMode

Record type descrbing a video mode.

Declaration

Source position: videoh.inc line 16

type TVideoMode = record
Col: Word; | Number of columns for display
Row: Word; | Number of rows for display
Color: Boolean; | Color support
end;

Description

The TVideoMode record describes a videomode. Its fields are self-explaining: Col,Row describe the number of columns and rows on the screen for this mode. Color is True if this mode supports colors, or False if not.


TVideoModeSelector

Video mode selection callback prototype.

Declaration

Source position: videoh.inc line 20

type TVideoModeSelector = function(

  const VideoMode: TVideoMode;

  Params: LongInt

):Boolean;


vga_codepages

Set of code pages that are a normal VGA codepage

Declaration

Source position: video.pp line 50

const vga_codepages = [cp437, cp850, cp852, cp866];

Description

vga_codepages is a set containing all code pages that can be considered a normal vga font (as in use on early VGA cards) Note that KOI8-R has line drawing characters in wrong place.

See also

TEncoding | Various encodings of the input and output descriptors
iso_codepages | Set of code pages that use a ISO encoding


Writing a custom video driver

Writing a custom video driver is not difficult, and generally means implementing a couple of functions, which whould be registered with the SetVideoDriver function. The various functions that can be implemented are located in the TVideoDriver record:

TVideoDriver = Record
  InitDriver        : Procedure;
  DoneDriver        : Procedure;
  UpdateScreen      : Procedure(Force : Boolean);
  ClearScreen       : Procedure;
  SetVideoMode      : Function (Const Mode : TVideoMode) : Boolean;
  GetVideoModeCount : Function : Word;
  GetVideoModeData  : Function(Index : Word; Var Data : TVideoMode) : Boolean;
  SetCursorPos      : procedure (NewCursorX, NewCursorY: Word);
  GetCursorType     : function : Word;
  SetCursorType     : procedure (NewType: Word);
  GetCapabilities   : Function : Word;
end;

Not all of these functions must be implemented. In fact, the only absolutely necessary function to write a functioning driver is the UpdateScreen function. The general calls in the Video unit will check which functionality is implemented by the driver.

The functionality of these calls is the same as the functionality of the calls in the video unit, so the expected behaviour can be found in the previous section. Some of the calls, however, need some additional remarks.

InitDriver
Called by InitVideo, this function should initialize any data structures needed for the functionality of the driver, maybe do some screen initializations. The function is guaranteed to be called only once; It can only be called again after a call to DoneVideo. The variables ScreenWidth and ScreenHeight should be initialized correctly after a call to this function, as the InitVideo call will initialize the VideoBuf and OldVideoBuf arrays based on their values.
DoneDriver
This should clean up any structures that have been initialized in the InitDriver function. It should possibly also restore the screen as it was before the driver was initialized. The VideoBuf and OldVideoBuf arrays will be disposed of by the general DoneVideo call.
UpdateScreen
This is the only required function of the driver. It should update the screen based on the VideoBuf array's contents. It can optimize this process by comparing the values with values in the OldVideoBuf array. After updating the screen, the UpdateScreen procedure should update the OldVideoBuf by itself. If the Force parameter is True, the whole screen should be updated, not just the changed values.
ClearScreen
If there is a faster way to clear the screen than to write spaces in all character cells, then it can be implemented here. If the driver does not implement this function, then the general routines will write spaces in all video cells, and will call UpdateScreen(True).
SetVideoMode
Should set the desired video mode, if available. It should return True if the mode was set, False if not.
GetVideoModeCount
Should return the number of supported video modes. If no modes are supported, this function should not be implemented; the general routines will return 1. (for the current mode)
GetVideoModeData
Should return the data for the Index-th mode; Index is zero based. The function should return true if the data was returned correctly, false if Index contains an invalid index. If this is not implemented, then the general routine will return the current video mode when Index equals 0.
GetCapabilities
If this function is not implemented, zero (i.e. no capabilities) will be returned by the general function.

The following unit shows how to override a video driver, with a driver that writes debug information to a file. The unit can be used in any of the demonstration programs, by simply including it in the uses clause. Setting DetailedVideoLogging to True will create a more detailed log (but will also slow down functioning)

Example

unit viddbg;

Interface

uses video;

Procedure StartVideoLogging;
Procedure StopVideoLogging;
Function  IsVideoLogging : Boolean;
Procedure  SetVideoLogFileName(FileName : String);

Const
  DetailedVideoLogging : Boolean = False;

Implementation

uses sysutils,keyboard;

var
  NewVideoDriver,
  OldVideoDriver : TVideoDriver;
  Active,Logging : Boolean;
  LogFileName : String;
  VideoLog : Text;

Function TimeStamp : String;

begin
  TimeStamp:=FormatDateTime('hh:nn:ss',Time());
end;

Procedure StartVideoLogging;

begin
  Logging:=True;
  Writeln(VideoLog,'Start logging video operations at: ',TimeStamp);
end;

Procedure StopVideoLogging;

begin
  Writeln(VideoLog,'Stop logging video operations at: ',TimeStamp);
  Logging:=False;
end;

Function IsVideoLogging : Boolean;

begin
  IsVideoLogging:=Logging;
end;

Var
  ColUpd,RowUpd : Array[0..1024] of Integer;

Procedure DumpScreenStatistics(Force : Boolean);

Var
  I,Count : Integer;

begin
  If Force then
    Write(VideoLog,'forced ');
  Writeln(VideoLog,'video update at ',TimeStamp,' : ');
  FillChar(Colupd,SizeOf(ColUpd),#0);
  FillChar(Rowupd,SizeOf(RowUpd),#0);
  Count:=0;
  For I:=0 to VideoBufSize div SizeOf(TVideoCell) do
    begin
    If VideoBuf^[i]<>OldVideoBuf^[i] then
      begin
      Inc(Count);
      Inc(ColUpd[I mod ScreenWidth]);
      Inc(RowUpd[I div ScreenHeight]);
      end;
    end;
  Write(VideoLog,Count,' videocells differed divided over ');
  Count:=0;
  For I:=0 to ScreenWidth-1 do
    If ColUpd[I]<>0 then
      Inc(Count);
  Write(VideoLog,Count,' columns and ');
  Count:=0;
  For I:=0 to ScreenHeight-1 do
    If RowUpd[I]<>0 then
      Inc(Count);
  Writeln(VideoLog,Count,' rows.');
  If DetailedVideoLogging Then
   begin
   For I:=0 to ScreenWidth-1 do
     If (ColUpd[I]<>0) then
       Writeln(VideoLog,'Col ',i,' : ',ColUpd[I]:3,' rows changed');
   For I:=0 to ScreenHeight-1 do
     If (RowUpd[I]<>0) then
       Writeln(VideoLog,'Row ',i,' : ',RowUpd[I]:3,' colums changed');
   end;
end;

Procedure LogUpdateScreen(Force : Boolean);

begin
  If Logging then
    DumpScreenStatistics(Force);
  OldVideoDriver.UpdateScreen(Force);
end;

Procedure LogInitVideo;

begin
  OldVideoDriver.InitDriver();
  Assign(VideoLog,logFileName);
  Rewrite(VideoLog);
  Active:=True;
  StartVideoLogging;
end;

Procedure LogDoneVideo;

begin
  StopVideoLogging;
  Close(VideoLog);
  Active:=False;
  OldVideoDriver.DoneDriver();
end;

Procedure SetVideoLogFileName(FileName : String);

begin
  If Not Active then
    LogFileName:=FileName;
end;

Initialization
  GetVideoDriver(OldVideoDriver);
  NewVideoDriver:=OldVideoDriver;
  NewVideoDriver.UpdateScreen:=@LogUpdateScreen;
  NewVideoDriver.InitDriver:=@LogInitVideo;
  NewVideoDriver.DoneDriver:=@LogDoneVideo;
  LogFileName:='Video.log';
  Logging:=False;
  SetVideoDriver(NewVideoDriver);
end.


VideoBuf

Current screen image.

Declaration

Source position: videoh.inc line 96

var VideoBuf: PVideoBuf = ;

Description

VideoBuf forms the heart of the Video unit: This variable represents the physical screen. Writing to this array and calling UpdateScreen will write the actual characters to the screen.


VideoBufSize

Size of the screen image.

Declaration

Source position: videoh.inc line 98

var VideoBufSize: LongInt = ;

Description

Current size of the video buffer pointed to by VideoBuf


Examples utility unit

The examples in this section make use of the unit vidutil, which contains the TextOut function. This function writes a text to the screen at a given location. It looks as follows:

Example

unit vidutil;

Interface

uses
  video;

Procedure TextOut(X,Y : Word;Const S : String);

Implementation

Procedure TextOut(X,Y : Word;Const S : String);

Var
  W,P,I,M : Word;

begin
  P:=((X-1)+(Y-1)*ScreenWidth);
  M:=Length(S);
  If P+M>ScreenWidth*ScreenHeight then
    M:=ScreenWidth*ScreenHeight-P;
  For I:=1 to M do
    VideoBuf^[P+I-1]:=Ord(S[i])+($07 shl 8);
end;

end.


vioOK

No errors occurred

Declaration

Source position: videoh.inc line 81

const vioOK = 0;


White

White color attribute

Declaration

Source position: videoh.inc line 61

const White = 15;


Yellow

Yellow color attribute

Declaration

Source position: videoh.inc line 60

const Yellow = 14;


directvideo

Direct video access

Declaration

Source position: wincrt.pp line 37

var directvideo: Boolean = ;

Description

On windows, this variable is ignored.


Reference for unit 'wincrt'

Auxiliary windows routines for the graph unit

uses

  System;

The system unit

Overview

The wincrt unit provides some auxiliary routines for use with the graph unit, namely keyboard support. It has no connection with the crt unit, nor with the Turbo-Pascal for Windows WinCrt unit. As such, it should not be used by end users. Refer to the crt unit instead.


Reference for unit 'wincrt': Procedures and functions

delay | Pause program execution
keypressed | Check if a key was pressed.
nosound | Stop the speaker
readkey | Read a key from the keyboard
sound | Sound PC speaker
textmode | Set indicated text mode


Reference for unit 'wincrt': Variables

directvideo | Direct video access
lastmode | Unused


Index of all identifiers in unit 'wincrt'

D K L N R S T

D

delay directvideo

K

keypressed

L

lastmode

N

nosound

R

readkey

S

sound

T

textmode


lastmode

Unused

Declaration

Source position: wincrt.pp line 40

var lastmode: Word = ;

Description

Is supposed to contain the last used video mode, but is actually unused.


CSIDL_ADMINTOOLS

ID for the personal "Start Menu\Programs\Administrative tools" folder (In the user's personal folder)

Declaration

Source position: windirs.pp line 59

const CSIDL_ADMINTOOLS = $0030;


CSIDL_APPDATA

ID for the roaming "Application Data" folder (in the user's personal folder)

Declaration

Source position: windirs.pp line 42

const CSIDL_APPDATA = $001A;


CSIDL_CDBURN_AREA

ID for the personal "Local Settings\Application Data\Microsoft\CD Burning" folder (Under "All users" folder)

Declaration

Source position: windirs.pp line 63

const CSIDL_CDBURN_AREA = $003B;


CSIDL_COMMON_ADMINTOOLS

ID for the common "Start Menu\Programs\Administrative tools" folder (Under "All users" folder)

Declaration

Source position: windirs.pp line 58

const CSIDL_COMMON_ADMINTOOLS = $002F;


CSIDL_COMMON_APPDATA

ID for the common "Application Data" folder (Under "All users" folder)

Declaration

Source position: windirs.pp line 49

const CSIDL_COMMON_APPDATA = $0023;


CSIDL_COMMON_DESKTOPDIRECTORY

ID for the public "Desktop" folder (Under "All users" folder)

Declaration

Source position: windirs.pp line 41

const CSIDL_COMMON_DESKTOPDIRECTORY = $0019;


CSIDL_COMMON_DOCUMENTS

ID for the common "Documents" folder (Under "All users" folder)

Declaration

Source position: windirs.pp line 57

const CSIDL_COMMON_DOCUMENTS = $002E;


CSIDL_COMMON_FAVORITES

ID for the public "Favorites" folder (Under "All users" folder)

Declaration

Source position: windirs.pp line 45

const CSIDL_COMMON_FAVORITES = $001F;


CSIDL_COMMON_MUSIC

ID for the common "Documents\My Music" folder (Under "All users" folder)

Declaration

Source position: windirs.pp line 60

const CSIDL_COMMON_MUSIC = $0035;


CSIDL_COMMON_PICTURES

ID for the common "Documents\My Pictures" folder (Under "All users" folder)

Declaration

Source position: windirs.pp line 61

const CSIDL_COMMON_PICTURES = $0036;


CSIDL_COMMON_PROGRAMS

ID for the public "Programs" folder (Under "All users" Start menu folder)

Declaration

Source position: windirs.pp line 39

const CSIDL_COMMON_PROGRAMS = $0017;


CSIDL_COMMON_STARTMENU

ID for the public "Start Menu" folder (Under "All users")

Declaration

Source position: windirs.pp line 38

const CSIDL_COMMON_STARTMENU = $0016;


CSIDL_COMMON_STARTUP

ID for the public "Startup" folder (Under "All users\Start menu\Programs" folder)

Declaration

Source position: windirs.pp line 40

const CSIDL_COMMON_STARTUP = $0018;


CSIDL_COMMON_TEMPLATES

ID for the common "Templates" folder (Under "All users" folder)

Declaration

Source position: windirs.pp line 56

const CSIDL_COMMON_TEMPLATES = $002D;


CSIDL_COMMON_VIDEO

ID for the common "Documents\My Video" folder (Under "All users" folder)

Declaration

Source position: windirs.pp line 62

const CSIDL_COMMON_VIDEO = $0037;


CSIDL_COOKIES

ID for the "Cookies" folder (in the user's personal folder)

Declaration

Source position: windirs.pp line 47

const CSIDL_COOKIES = $0021;


CSIDL_DESKTOPDIRECTORY

ID for the "Desktop" folder (in the user's personal folder)

Declaration

Source position: windirs.pp line 35

const CSIDL_DESKTOPDIRECTORY = $0010;


CSIDL_FAVORITES

ID for the "Favourites" folder (in the user's personal folder)

Declaration

Source position: windirs.pp line 28

const CSIDL_FAVORITES = $0006;


CSIDL_FLAG_CREATE

Flag to specify if the requested folder must be created if it didn't exist yet.

Declaration

Source position: windirs.pp line 66

const CSIDL_FLAG_CREATE = $8000;


CSIDL_HISTORY

ID for the "History" folder (in the user's personal folder)

Declaration

Source position: windirs.pp line 48

const CSIDL_HISTORY = $0022;


CSIDL_INTERNET_CACHE

ID for the "Temporary Internet Files" folder (in the user's personal folder)

Declaration

Source position: windirs.pp line 46

const CSIDL_INTERNET_CACHE = $0020;


CSIDL_LOCAL_APPDATA

ID for the local "Application Data" folder (in the user's personal folder)

Declaration

Source position: windirs.pp line 44

const CSIDL_LOCAL_APPDATA = $001C;


CSIDL_MYMUSIC

ID for the "My Music" folder (in the user's personal folder)

Declaration

Source position: windirs.pp line 33

const CSIDL_MYMUSIC = $000D;


CSIDL_MYPICTURES

ID for the "My Pictures" folder (in the user's personal folder)

Declaration

Source position: windirs.pp line 53

const CSIDL_MYPICTURES = $0027;


CSIDL_MYVIDEO

ID for the "My Videos" folder (in the user's personal folder)

Declaration

Source position: windirs.pp line 34

const CSIDL_MYVIDEO = $000E;


CSIDL_NETHOOD

ID for the "Nethood" folder (in the user's personal folder)

Declaration

Source position: windirs.pp line 36

const CSIDL_NETHOOD = $0013;


CSIDL_PERSONAL

ID for the "My Documents" folder (in the user's personal folder)

Declaration

Source position: windirs.pp line 27

const CSIDL_PERSONAL = $0005;


CSIDL_PRINTHOOD

ID for the "Printhood" folder (in the user's personal folder)

Declaration

Source position: windirs.pp line 43

const CSIDL_PRINTHOOD = $001B;


CSIDL_PROFILE

ID for the user's personal folder

Declaration

Source position: windirs.pp line 54

const CSIDL_PROFILE = $0028;


CSIDL_PROFILES

ID for the parent folder for the user's folders

Declaration

Source position: windirs.pp line 64

const CSIDL_PROFILES = $003E;


CSIDL_PROGRAM_FILES

ID for the "Program Files" folder (alias for CSIDL_PROGRAMS)

Declaration

Source position: windirs.pp line 52

const CSIDL_PROGRAM_FILES = $0026;


CSIDL_PROGRAM_FILES_COMMON

ID for the Common folder under the "Program Files" folder.

Declaration

Source position: windirs.pp line 55

const CSIDL_PROGRAM_FILES_COMMON = $002B;


CSIDL_PROGRAMS

ID for the "Program files" folder

Declaration

Source position: windirs.pp line 26

const CSIDL_PROGRAMS = $0002;


CSIDL_RECENT

ID for the "Recent" folder (in the user's personal folder)

Declaration

Source position: windirs.pp line 30

const CSIDL_RECENT = $0008;


CSIDL_SENDTO

ID for the "Send to" folder (in the user's personal folder)

Declaration

Source position: windirs.pp line 31

const CSIDL_SENDTO = $0009;


CSIDL_STARTMENU

ID for the "Start menu" folder (in the user's personal folder)

Declaration

Source position: windirs.pp line 32

const CSIDL_STARTMENU = $000B;


CSIDL_STARTUP

ID for the "Startup" menu folder (in the user's personal folder)

Declaration

Source position: windirs.pp line 29

const CSIDL_STARTUP = $0007;


CSIDL_SYSTEM

ID for the Windows System32 dir.

Declaration

Source position: windirs.pp line 51

const CSIDL_SYSTEM = $0025;


CSIDL_TEMPLATES

ID for the "Templates" folder (in the user's personal folder)

Declaration

Source position: windirs.pp line 37

const CSIDL_TEMPLATES = $0015;


CSIDL_WINDOWS

ID for the Windows installation dir.

Declaration

Source position: windirs.pp line 50

const CSIDL_WINDOWS = $0024;


Reference for unit 'windirs'

Get names of special directories under windows

uses
System, | The system unit
windows; | loadlibrary support

Overview

This unit contains only one function: GetWindowsSpecialDir. It is a simple pascal wrapper around the shfolder.dll library, and is available under Windows only.


Reference for unit 'windirs': Constants

CSIDL_ADMINTOOLS | ID for the personal "Start Menu\Programs\Administrative tools" folder (In the user's personal folder)
CSIDL_APPDATA | ID for the roaming "Application Data" folder (in the user's personal folder)
CSIDL_CDBURN_AREA | ID for the personal "Local Settings\Application Data\Microsoft\CD Burning" folder (Under "All users" folder)
CSIDL_COMMON_ADMINTOOLS | ID for the common "Start Menu\Programs\Administrative tools" folder (Under "All users" folder)
CSIDL_COMMON_APPDATA | ID for the common "Application Data" folder (Under "All users" folder)
CSIDL_COMMON_DESKTOPDIRECTORY | ID for the public "Desktop" folder (Under "All users" folder)
CSIDL_COMMON_DOCUMENTS | ID for the common "Documents" folder (Under "All users" folder)
CSIDL_COMMON_FAVORITES | ID for the public "Favorites" folder (Under "All users" folder)
CSIDL_COMMON_MUSIC | ID for the common "Documents\My Music" folder (Under "All users" folder)
CSIDL_COMMON_PICTURES | ID for the common "Documents\My Pictures" folder (Under "All users" folder)
CSIDL_COMMON_PROGRAMS | ID for the public "Programs" folder (Under "All users" Start menu folder)
CSIDL_COMMON_STARTMENU | ID for the public "Start Menu" folder (Under "All users")
CSIDL_COMMON_STARTUP | ID for the public "Startup" folder (Under "All users\Start menu\Programs" folder)
CSIDL_COMMON_TEMPLATES | ID for the common "Templates" folder (Under "All users" folder)
CSIDL_COMMON_VIDEO | ID for the common "Documents\My Video" folder (Under "All users" folder)
CSIDL_COOKIES | ID for the "Cookies" folder (in the user's personal folder)
CSIDL_DESKTOPDIRECTORY | ID for the "Desktop" folder (in the user's personal folder)
CSIDL_FAVORITES | ID for the "Favourites" folder (in the user's personal folder)
CSIDL_FLAG_CREATE | Flag to specify if the requested folder must be created if it didn't exist yet.
CSIDL_HISTORY | ID for the "History" folder (in the user's personal folder)
CSIDL_INTERNET_CACHE | ID for the "Temporary Internet Files" folder (in the user's personal folder)
CSIDL_LOCAL_APPDATA | ID for the local "Application Data" folder (in the user's personal folder)
CSIDL_MYMUSIC | ID for the "My Music" folder (in the user's personal folder)
CSIDL_MYPICTURES | ID for the "My Pictures" folder (in the user's personal folder)
CSIDL_MYVIDEO | ID for the "My Videos" folder (in the user's personal folder)
CSIDL_NETHOOD | ID for the "Nethood" folder (in the user's personal folder)
CSIDL_PERSONAL | ID for the "My Documents" folder (in the user's personal folder)
CSIDL_PRINTHOOD | ID for the "Printhood" folder (in the user's personal folder)
CSIDL_PROFILE | ID for the user's personal folder
CSIDL_PROFILES | ID for the parent folder for the user's folders
CSIDL_PROGRAMS | ID for the "Program files" folder
CSIDL_PROGRAM_FILES | ID for the "Program Files" folder (alias for CSIDL_PROGRAMS)
CSIDL_PROGRAM_FILES_COMMON | ID for the Common folder under the "Program Files" folder.
CSIDL_RECENT | ID for the "Recent" folder (in the user's personal folder)
CSIDL_SENDTO | ID for the "Send to" folder (in the user's personal folder)
CSIDL_STARTMENU | ID for the "Start menu" folder (in the user's personal folder)
CSIDL_STARTUP | ID for the "Startup" menu folder (in the user's personal folder)
CSIDL_SYSTEM | ID for the Windows System32 dir.
CSIDL_TEMPLATES | ID for the "Templates" folder (in the user's personal folder)
CSIDL_WINDOWS | ID for the Windows installation dir.


Reference for unit 'windirs': Procedures and functions

GetWindowsSpecialDir

Get the location of a special directory.

GetWindowsSpecialDirUnicode

GetWindowsSystemDirectory

GetWindowsSystemDirectoryUnicode


Index of all identifiers in unit 'windirs'

C G

C

CSIDL_ADMINTOOLS | CSIDL_COMMON_VIDEO | CSIDL_PROFILE
CSIDL_APPDATA | CSIDL_COOKIES | CSIDL_PROFILES
CSIDL_CDBURN_AREA | CSIDL_DESKTOPDIRECTORY | CSIDL_PROGRAM_FILES
CSIDL_COMMON_ADMINTOOLS | CSIDL_FAVORITES | CSIDL_PROGRAM_FILES_COMMON
CSIDL_COMMON_APPDATA | CSIDL_FLAG_CREATE | CSIDL_PROGRAMS
CSIDL_COMMON_DESKTOPDIRECTORY | CSIDL_HISTORY | CSIDL_RECENT
CSIDL_COMMON_DOCUMENTS | CSIDL_INTERNET_CACHE | CSIDL_SENDTO
CSIDL_COMMON_FAVORITES | CSIDL_LOCAL_APPDATA | CSIDL_STARTMENU
CSIDL_COMMON_MUSIC | CSIDL_MYMUSIC | CSIDL_STARTUP
CSIDL_COMMON_PICTURES | CSIDL_MYPICTURES | CSIDL_SYSTEM
CSIDL_COMMON_PROGRAMS | CSIDL_MYVIDEO | CSIDL_TEMPLATES
CSIDL_COMMON_STARTMENU | CSIDL_NETHOOD | CSIDL_WINDOWS
CSIDL_COMMON_STARTUP | CSIDL_PERSONAL |
CSIDL_COMMON_TEMPLATES | CSIDL_PRINTHOOD |

G

GetWindowsSpecialDir | GetWindowsSystemDirectory
GetWindowsSpecialDirUnicode | GetWindowsSystemDirectoryUnicode


Reference for unit 'x86'

Intel X86 specific routines for Unix platforms.

uses
System, | The system unit
BaseUnix; | Basic Unix functionality

Overview

The x86 unit contains some of the routines that were present in the 1.0.X Linux unit, and which were Intel (PC) architecture specific.

These calls have been preserved for compatibility, but should be considered deprecated: they are not portable and may not even work on future Linux versions.


Reference for unit 'x86': Procedures and functions

fpIOperm | Set permission on IO ports
fpIoPL | Set I/O privilege level
ReadPort | Read data from a PC port
ReadPortB | Read bytes from a PC port
ReadPortL | Read longints from a PC port
ReadPortW | Read Words from a PC port
WritePort | Write data to PC port
WritePortB | Write byte to PC port
WritePortl | Write longint to PC port.
WritePortW | Write Word to PC port


Index of all identifiers in unit 'x86'

F R W

F

fpIOperm fpIoPL

R

ReadPort | ReadPortL
ReadPortB | ReadPortW

W

WritePort | WritePortl
WritePortB | WritePortW