The Conroy & Conroy Subroutine Library - Pascal Interface
2.1 Pascal Interface
The Pascal sources for the Subroutine Library can be used directly, rather than using the binary libraries. This provides
a wider range of compatibility and options for Pascal programs. The entire library can be used with FPC and Delphi 6.0 (and later).
Parts of it are compatible with earlier versions of Delphi, Borland Pascal, and other compilers (such as Gnu Pascal), but there is
no plan to maintain the sources for anything prior to Delphi 6.0. Note: FPC objects descend from TObject, which defines a bunch of
COM methods, and therefore is not compatible with the pure CORBA objects used in the General interface. Thus, FPC users are forced
to use the sources instead. Although non-COM objects are supported by FPC, a bug in FPC prevents the ability to obtain
such objects from the DLLs. Not all code supports Delphi Firemonkey and/or mobile platform. Those routines which do are specifically noted in the header comments. Otherwise assume they have not been confirmed to work with Mobile platforms.
All type definitions begin with "T" to distinguish them from other identifiers. Futher, if a class is a static class, the "T" is followed by "S". Otherwise, the class is assumed to be dynamic. In most cases, both types of class are defined, where the dynamic version is a wrapper for the static version. Thus, you can use either version in Delphi. For classes that descend from the common COM interface, the class name starts with "TCOM_". Finally, "P" is used to denote the type of: a pointer to an object ("PS" indicates a pointer to a static object).
2.1.1 Conditional Compilation symbols
All routines in the subroutine library, and any Pascal code that calls them, must include the EDEFINES.INC file.
This defines several useful conditional compilation symbols that are used to provide for compilation under various compiler and system platforms. These symbols are described below along with the other conditional compilation
symbols used by the subroutine library.
The conditional symbols fit into the following categories:
Platform: Information about software/hardware platform, including Operating system and compiler.
Capabilities: Information about which features are available.
C&C: Options and debugging.
Note: Use of platform symbols should be avoided outside of EDEFINES.INC. Instead, use the capabilities symbols.
Conditional Symbols:
Symbol | Category | Description |
---|---|---|
Compiler: |
||
TP | Platform | Turbo Pascal |
TP4 | Platform | Turbo Pascal 4.0 |
TP4UP | Platform | Turbo Pascal 4.0 or later |
TP5 | Platform | Turbo Pascal 5.0 |
TP5UP | Platform | Turbo Pascal 5.0 or later |
TP55 | Platform | Turbo Pascal 5.5 |
TP55UP | Platform | Turbo Pascal 5.5 or later |
TP6 | Platform | Turbo Pascal 6.0 |
TP6UP | Platform | Turbo Pascal 6.0 or later |
TPW | Platform | Turbo Pascal for Windows |
TPW10 | Platform | Turbo Pascal for Windows 1.0 |
TPW10UP | Platform | Turbo Pascal for Windows 1.0 or later |
TPW15 | Platform | Turbo Pascal for Windows 1.5 |
TPW15UP | Platform | Turbo Pascal for Windows 1.5 or later |
BP7 | Platform | Borland Pascal 7.0 |
DELPHI1 | Platform | Delphi 1.0 |
DELPHI2 | Platform | Delphi 2.0 |
DELPHI3 | Platform | Delphi 3.0 |
DELPHI4 | Platform | Delphi 4.0 |
DELPHI5 | Platform | Delphi 5.0 |
DELPHI6 | Platform | Delphi 6.0 |
DELPHI7 | Platform | Delphi 7.0 |
DELPHI2005 | Platform | Delphi 2005 |
DELPHI2006 | Platform | Delphi 2006 |
DELPHI2007 | Platform | Delphi 2007 |
DELPHI2009 | Platform | Delphi 2009 |
DELPHI2010 | Platform | Delphi 2010 |
KYLIX1 | Platform | Kylix 1.0 |
CBUILDER1 | Platform | C++ Builder 1.0 |
CBUILDER3 | Platform | C++ Builder 3.0 |
CBUILDER4 | Platform | C++ Builder 4.0 |
CBUILDER5 | Platform | C++ Builder 5.0 |
Minimum compiler versions: |
||
DELPHI1UP | Platform | Delphi 1.0 and above (any Delphi) |
DELPHI2UP | Platform | Delphi 2.0 and above |
DELPHI3UP | Platform | Delphi 3.0 and above |
DELPHI4UP | Platform | Delphi 4.0 and above |
DELPHI5UP | Platform | Delphi 5.0 and above |
DELPHI6UP | Platform | Delphi 6.0 and above |
DELPHI7UP | Platform | Delphi 7and above |
DELPHI2005UP | Platform | Delphi 2005 and above |
DELPHI2006UP | Platform | Delphi 2006 and above |
DELPHI2007UP | Platform | Delphi 2007 and above |
DELPHI2009UP | Platform | Delphi 2009 and above |
DELPHI2010UP | Platform | Delphi 2010 and above |
DELPHIXE | Platform | Delphi XE |
DELPHIXEUP | Platform | Delphi XE or later |
DELPHIXE2 | Platform | Delphi XE2 |
DELPHIXE2UP | Platform | Delphi XE2 or later |
DELPHIXE3 | Platform | Delphi XE3 |
DELPHIXE3UP | Platform | Delphi XE3 or later |
DELPHIXE4 | Platform | Delphi XE4 |
DELPHIXE4UP | Platform | Delphi XE4 or later |
DELPHIXE5 | Platform | Delphi XE5 |
DELPHIXE5UP | Platform | Delphi XE5 or later |
DELPHIXE6 | Platform | Delphi XE6 |
DELPHIXE6UP | Platform | Delphi XE6 or later |
KYLIX1UP | Platform | Kylix 1.0 and above (any Kylix) |
CBUILDER1UP | Platform | C++Builder 1.0 and above or Delphi 2 and above (any C++Builder) |
CBUILDER3UP | Platform | C++Builder 3.0 and above or Delphi 2 and above (any C++Builder) |
CBUILDER4UP | Platform | C++Builder 4.0 and above or Delphi 2 and above (any C++Builder) |
CBUILDER5UP | Platform | C++Builder 5.0 and above or Delphi 2 and above (any C++Builder) |
Compiler types: |
||
BP | Platform | Borland Pascal (not Delphi or C++Builder) |
DELPHI | Platform | Any Delphi version (but not C++Builder or Kylix) |
KYLIX | Platform | Any Kylix version |
NET | Platform | .Net |
CBUILDER | Platform | Any C++Builder (Pascal) |
CBUILDER | Platform | Any C++Builder (Pascal) |
FPC_OR_DELPHI | Platform | Either FPC or DELPHI. |
DELPHI_16BIT | Platform | 16-bit Delphi. |
DELPHI_32BIT | Platform | 32-bit Delphi. |
CBUILDER_32BIT | Platform | 32bit C++Builder's Pascal (but not Delphi). |
DOS | Platform | Any MSDOS (plain and DPMI) |
REALMODE | Platform | 16-bit realmode DOS. |
PROTECTEDMODE | Platform | 16-bit DPMI DOS. |
MSWINDOWS | Platform | Any Windows platform. |
WIN16 | Platform | 16-bit Windows. |
WIN32 | Platform | 32-bit Windows. |
LINUX32 | Platform | 32-bit Linux. |
LINUX64 | Platform | 64-bit Linux. |
_16BIT | Platform | 16-bit application. |
_32BIT | Platform | 32-bit application. |
_64BIT | Platform | 64-bit application. |
WINDOWS_OR_CONSOLE | Platform | Either Windows GUI or Console mode. |
Capabilities: |
||
ASM_CPUID | Capabilities | cpuid instruction supported by internal assembler. |
CARDINAL | Capabilities | Cardinal data type (usigned 32-bit integer) supported. |
DELEGATION | Capabilities | Delegation is supported. |
DIRECT_RAM_ACCESS | Capabilities | Direct access to RAM, via Mem[], is supported. |
DYNAMIC_ARRAYS | Capabilities | Dynamic arrays are supported. |
DYNAMIC_OBJECTS | Capabilities | Dynamic (heap) objects supported. |
DYNAMIC_STRING_INITIALIZATION | Capabilities | Dynamic strings in static objects are initialized and finalized automatically. If not set, dynamic strings should be initialized in static class constructors and finalized in static class destructors. |
DYNAMIC_STRINGS | Capabilities | Dynamic strings are supported. |
EXCEPTIONS | Capabilities | Exceptions are supported. |
FUNCTION_RESULT_REQUIRED | Capabilities | Functions must have a target for what they return. |
INLINE_FUNCTIONS | Capabilities | Inline functions are supported. |
INT64 | Capabilities | True 64-bit integers (non-COMP int64) supported. |
OLEVARIANT | Capabilities | OLE variants are supported. |
OVERLOAD | Capabilities | Overloaded functions are supported. |
PROPERTIES | Capabilities | Properties supported. See also STATIC_PROPERTIES. |
REAL48 | Capabilities | Real48 data type is supported. |
RECORD_RETURNS | Capabilities | Functions can return record structures. Otherwise only simple data types can be returned. |
REINTRODUCE | Capabilities | reintroduce is supported on methods. |
STATIC_PROPERTIES | Capabilities | Properties are supported in static objects. |
STDCALL_SUPPORTED | Capabilities | stdcall calling convention (and keyword) is supported. |
UNIT_INIT_AND_FINAL | Capabilities | Unit initialization/finalization supported. |
VARIABLE_DECLARATION_ASSIGN | Capabilities | Assigning a variable a value in its declaration supported. |
WIDESTRINGS | Capabilities | Widestring data type is supported. |
CL_CONTROL_HELPCONTEXT | Capabilities | TControl.HelpContext, .HelpKeyword, and .HelpType supported. |
CL_LIST_CAPACITY | Capabilities | True if TList has .Capacity property. |
C&C: |
||
CC_Regression_Test | C&C | Surrounds regression test code. If defined, the application will run regression tests when it starts. |
CC_Balance | C&C | Used to validate proper pairing of matched operations (such as allocations and deallocations). |
CC_Debug | C&C | Surrounds debugging code. If defined, debugging code will be included in the compile. This can slow the application down due to the extra work involved with logging data, etc. It may also enable certain options, especially on UI elements. |
CC_Auto_Free_Application_Manager | C&C | If defined, the application manager is automatically destroyed as the application exits. |
CC_Auto_Free_Operating_System | C&C | If defined, the Operating System interface is automatically destroyed as the application exits. |
CC_Track_Resources | C&C | If defined, resources are tracked. |
CC_Validate | C&C | If defined, data is validated. For instance, calls to methods of nil objects is checked for. |