SysUtils.TFormatSettings
Contents |
Delphi-Informationen
von SysUtils.pas
TFormatSettings = record CurrencyFormat: Byte; NegCurrFormat: Byte; ThousandSeparator: Char; DecimalSeparator: Char; CurrencyDecimals: Byte; DateSeparator: Char; TimeSeparator: Char; ListSeparator: Char; CurrencyString: string; ShortDateFormat: string; LongDateFormat: string; TimeAMString: string; TimePMString: string; ShortTimeFormat: string; LongTimeFormat: string; ShortMonthNames: :TFormatSettings.:1; LongMonthNames: :TFormatSettings.:2; ShortDayNames: :TFormatSettings.:3; LongDayNames: :TFormatSettings.:4; TwoDigitYearCenturyWindow: Word; end;
Unit: SysUtils
Typ: Struktur
C++-Informationen
von SysUtils.hpp
TFormatSettings = class
Unit: SysUtils
Typ: Klasse
Klassenfelder: Felder von SysUtils.TFormatSettings
Klassentypen: Typen von SysUtils.TFormatSettings
Beschreibung
TFormatSettings definiert einen Thread-sicheren String-Formatierungskontext.
TFormatSettings definiert eine Datenstruktur mit Gebietsschema-Informationen, die von String-Formatierungsroutinen verwendet werden. Jedes Element von TFormatSettings entspricht der gleichnamigen globalen Variablen. Eine Variable des Typs TFormatSettings definiert einen Thread-sicheren Kontext, den Formatierungsfunktionen anstelle des globalen Standardkontextes (der nicht Thread-sicher ist) verwenden.
So erstellen und verwenden Sie die von TFormatSettings definierte Thread-sichere Umgebung:
Definieren Sie eine Variable des Typs TFormatSettings.
Rufen Sie GetLocaleFormatSettings auf, um die Gebietsschema-Informationen in die TFormatSettings-Variable zu schreiben.
Übergeben Sie die TFormatSettings-Variable als letzen Parameter an die String-Formatierungsroutine.
Jede Routine, der ein TFormatSettings-Parameter übergeben werden kann, ist Thread-sicher und überlädt die entsprechende Funktion, in der die globalen Formatierungsvariablen verwendet werden.