Ver Mensaje Individual
  #12  
Antiguo 09-12-2009
cocute cocute is offline
Miembro
 
Registrado: nov 2008
Posts: 403
Reputación: 16
cocute Va por buen camino
He probado a quitar los memos y poner 2 tstringlist pero no me funciona, no hace nada, tambien he probado con Tstrings pero me da "error abtracto" o algo asi.
Que puede fallar? el mismo código con memos funciona.


Código PHP:
procedure TForm1.FormActivate(SenderTObject);
var 
ind,tt:integer;
    
file1,file2:TStringlist;
begin
file1
:= TStringlist.create;
file2:= TStringlist.create;
file1.text:=idHttp1.Get('http://www.aemet.es/es/eltiempo/prediccion/localidades?l=22001');
 for 
ind := 0 to file1.Count-do
   
begin
    
if file1.ValueFromIndex[ind]='<h2 class="titulo">' then
        begin
           
for tt := ind to file1.Count-do
            
begin
             file2
.Add(file1.ValueFromIndex[tt]);
              if 
file1.ValueFromIndex[tt]=' <form name="frmMunicipio" method="get" action="/es/eltiempo/prediccion/localidades">' then
                begin
                 file2
.ValueFromIndex[0]:= '<link rel="stylesheet" type="text/css" media="screen"  href="http://www.aemet.es/css/estilos.css" /><h2 class="titulo">';
                 
file2.text:= StringReplacefile2.text,'/imagenes/','http://www.aemet.es/imagenes/',[rfReplaceAll]);
                 
wb1.LoadFromStrings(file2);
                 
file1.Free;
                 
file2.Free;
                 exit
                
end;
            
end;
         
end;
      
end
end

Última edición por cocute fecha: 09-12-2009 a las 16:02:51.
Responder Con Cita