Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use TFormatSettings.Create without being specific to a platform?

I have the following in Delphi XE:

fSettings := TFormatSettings.Create(LOCALE_USER_DEFAULT);

But I always get a warning on compile:

W1002 Symbol 'Create' is specific to a platform

What is the correct way to do this, so that I do not get a warning?

like image 318
croceldon Avatar asked Feb 01 '12 16:02

croceldon


1 Answers

You have two options

1) Use the overload version which uses a string instead of a TLocaleID

class function Create(const LocaleName: string): TFormatSettings; overload; static;

2) Disable the warning locally

{$WARN SYMBOL_PLATFORM OFF}
    fSettings := TFormatSettings.Create(LOCALE_USER_DEFAULT);
{$WARN SYMBOL_PLATFORM ON}
like image 108
RRUZ Avatar answered Sep 19 '22 19:09

RRUZ