Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   FormatSettings (https://www.clubdelphi.com/foros/showthread.php?t=42981)

Rockin 27-04-2007 14:44:29

FormatSettings
 
Buenas a todos:

Estoy intentando aplicar el truco de obtener la temperatura (http://www.clubdelphi.com/trucos/index.php?id=395)
de tu localidad, pero al compilar me da el siguiente error y no se por que es.

[Error] Principal.pas(171): Undeclared identifier: 'TFormatSettings'
[Error] Principal.pas(174): Undeclared identifier: 'GetLocaleFormatSettings'

¿alguien me puede ayudar?

gluglu 27-04-2007 14:52:52

Tienes incluida la unidad 'SysUtils' en tu cláusula Uses ?

P.D. Sólo informar que el código del aeropuerto de Málaga es LEMG

Saludos, ;)

seoane 27-04-2007 15:19:31

La verdad es que la función pretendía ser mas de lo que al final fue :p

"Parseaba" la fecha, la hora, la estación, etc ... pero si lo único que quieres es la temperatura no hace falta tanta tontería. Aquí te dejo la versión recortada:
Código Delphi [-]
function Temperatura(Estacion: String): Integer;
begin
  Result:= MAXINT;
  with TStringList.Create do
  try
    DelimitedText:= Bajar(Format(
      'ftp://tgftp.nws.noaa.gov/data/observations/metar/stations/%s.TXT',
      [Estacion]));
    Delete(0);
    Delete(0);
    if Count > 0 then
    begin
      while (pos('/',Strings[0]) = 0) do
      begin
        Delete(0);
        if Count = 0 then
          exit;
      end;
      Result:= GetNum(Strings[0]);
    end;
  finally
    Free;
  end;
end;

Rockin 27-04-2007 17:22:36

Con la versión recortada funciona perfectamente.

Gracias.


La franja horaria es GMT +2. Ahora son las 21:37:17.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi