Buenas tardes a todos.
Tengo el siguiente codigo puesto en el main form:
Código Delphi
[-]procedure TF_Inici.ApplicationMessage(var Msg: TMsg; var Handled: Boolean);
var
Fmt: TFormatSettings;
begin
Fmt := TFormatSettings.Create;
Fmt.DecimalSeparator:='.';
Fmt.ThousandSeparator:=',';
SysUtils.FormatSettings := Fmt;
end;
y en las declaraciones publicas este codigo:
Código Delphi
[-] public
Usuari: Integer;
Path, Vers: string;
procedure ApplicationMessage(var Msg: TMsg; var Handled: Boolean);
end;
En el On Create del form este código:
Código Delphi
[-]procedure TF_Inici.FormCreate(Sender: TObject);
begin
Application.OnMessage:=ApplicationMessage;
Pues bien, no funciona en la última linea, me dice Fmt =(error evaluating), pero si situo el cursor sobre Fmt antes de hacer la evaluacion, el Decimal Separator vale '.' y el Thousand separator ',' que es lo que quiero que guarde FormatSettings.
Alguna idea?
Otro metodo de realizar este proceso?
Gracias y saludos
Josep