Global Variables
Go Up to Using the RTL (Run-Time Library)
Deprecated Global Variables Removed; Use FormatSettings Instead
Twenty global variables that previously resided in System.SysUtils, and which have been deprecated for several years, have now been removed from the product. These global variables typically pertain to date, time, and currency format (CurrencyString, LongTimeFormat, ShortMonthNames, and so on).
The declarations for these removed global variables previously contained comments about their deprecation, as follows:
Instances of these global variables in your code now result in a compiler error, as follows:
There are two workarounds:
- Use the corresponding fields of the System.SysUtils.FormatSettings global variable. For example, if your code used System.SysUtils.NegCurrFormat, you can substitute:
FormatSettings.NegCurrFormat
- Create your own TFormatSettings structure and call the overloaded functions that take the structure.
The deprecated global variables include the following:
| Global Variable (System.SysUtils) |
Corresponding TFormatSettings Field |
|---|---|
|
CurrencyDecimals |
|
|
CurrencyFormat |
|
|
CurrencyString |
|
|
DateSeparator |
|
|
DecimalSeparator |
|
|
ListSeparator |
|
|
LongDateFormat |
|
|
LongDayNames |
|
|
LongDayNames |
|
|
LongTimeFormat |
|
|
NegCurrFormat |
|
|
ShortDateFormat |
|
|
ShortDayNames |
|
|
ShortMonthNames |
|
|
ShortTimeFormat |
|
|
ThousandSeparator |
|
|
TimeAMString |
|
|
TimePMString |
|
|
TimeSeparator |
|
|
TwoDigitYearCenturyWindow |
