Posts

Showing posts with the label CurrencyString

E2003 Undeclared identifier 'ShortDateFormat' error in Delphi XE3 or later versions

E2003 Undeclared identifier 'ShortDateFormat' error in Delphi XE3  or later versions When we upgrade a Delphi old version application to Delphi XE3 or latest one then if we have used ' ShortDateFormat ' global variable in our project then we will get 'E2003 Undeclared identifier 'ShortDateFormat' compiler error. Why we get this error? As some global variables typically pertain to Date, Time and Currency format ( CurrencyString , ShorDateFormat, LongTimeFormat, ShortMonthNames, and so on) have been deprecated and removed declaration from Delphi XE3 or later versions. In old Delphi versions we can find this variables declaration in 'System.SysUtils' unit but from Delphi XE3 those are moved with TFormatSettings Record. Workarounds to solve this error. We can replace ' ShortDateFormat ' with 'Formatsettings.ShortDateFormat'. And ' FormatSettings ' is a global variable of 'TFormatSettings' type declared in ' SysUtils ...