AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Anderes Verhalten in 12.3

Ein Thema von Edelfix · begonnen am 17. Apr 2025 · letzter Beitrag vom 18. Apr 2025
 
Andreas13

Registriert seit: 14. Okt 2006
Ort: Nürnberg
730 Beiträge
 
Delphi XE5 Professional
 
#5

AW: Anderes Verhalten in 12.3

  Alt 18. Apr 2025, 10:51
Hallo Edelfix,
damit beim Umsteigen von einer auf eine andere Delphi-Versionen sich soche Überraschungen in Grenzen halten, verwende ich zum eindeutigen Setzen meiner Format-Settings folgende Routine:
Delphi-Quellcode:
Procedure MyFormatSettings;
// Setzt DecimalSeparator etc. per Initialization
// Quelle:
// DecimalSeparator in SysUtils and System.SysUtils - Stack Overflow.pdf
// http://stackoverflow.com/questions/25109497/decimalseparator-in-sysutils-and-system-sysutils
// von Rodrigo Garcia

Var
  MyFormat: TFormatSettings; // --> TFormatSettings = record, daher KEIN MyFormat.Free!

Begin
  MyFormat:= TFormatSettings.Create;
    
  MyFormat.DecimalSeparator := '.'; // ',';
  MyFormat.ThousandSeparator:= ','; // '.';
  MyFormat.CurrencyDecimals := 2;
  MyFormat.DateSeparator := '/';
  MyFormat.ShortDateFormat := 'dd/mm/yyyy';
  MyFormat.LongDateFormat := 'dd/mm/yyyy';
  MyFormat.TimeSeparator := ':';
  MyFormat.TimeAMString := 'AM';
  MyFormat.TimePMString := 'PM';
  MyFormat.ShortTimeFormat := 'hh:nn';
  MyFormat.LongTimeFormat := 'hh:nn:ss';
  MyFormat.CurrencyString := 'R€'; // 'R$';

  System.SysUtils.FormatSettings:= MyFormat;
//
// TFormatSettings = record, daher KEIN MyFormat.Free!
End;{Procedure MyFormatSettings}
{------------------------------}
MyFormatSettings wird per Initialisierung in allen betroffenen eigenen Units eingebunden:
Delphi-Quellcode:
Unit Meine_Mathematische_Bibliothek; // etc.

Interface
...

Implementation

Uses
  System.SysUtils;
...

Initialization
  MyFormatSettings;
...
Finalization // ExitProcedures
...
End.
Vielleicht hilft es Dir.
Viel Erfolg!
Grüße, Andreas
Wenn man seinem Nächsten einen steilen Berg hinaufhilft, kommt man selbst dem Gipfel näher. (John C. Cornelius)
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:38 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz