Ver Mensaje Individual
  #3  
Antiguo 27-04-2007
Avatar de seoane
[seoane] seoane is offline
Miembro Premium
 
Registrado: feb 2004
Ubicación: A Coruña, España
Posts: 3.717
Reputación: 26
seoane Va por buen camino
La verdad es que la función pretendía ser mas de lo que al final fue

"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;
Responder Con Cita