C and C++ use #defines in several ways. In a C header file #define can be used This chapter describes the translation of #define into Delphi constants. The format for declaring constants in C is: For example: The translation in Delphi is: 2.3.1. Hexadecimal values C uses the prefix 0x to specify a hexadecimal value. For example, the C declaration translates to Delphi as
#define NameOfConstant Value
#define TIME_ZONE_ID_UNKNOWN 0 #define TIME_ZONE_ID_STANDARD 1#define TIME_ZONE_ID_DAYLIGHT 2
CONST TIME_ZONE_ID_UNKNOWN = 0; TIME_ZONE_ID_STANDARD = 1; TIME_ZONE_ID_DAYLIGHT = 2;
#define MY_CONSTANT 0xFF
CONST MY_CONSTANT = $FF;
