Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #12  
Antiguo 09-12-2009
[maeyanes] maeyanes is offline
Capo de los Capos
 
Registrado: may 2003
Ubicación: Campeche, México
Posts: 2.732
Poder: 26
maeyanes Va por buen camino
Hola...

Cita:
Empezado por cocute Ver Mensaje
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=22080');
 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
Checando este código con el que pusiste usando el TMemo, veo que es muy diferente. Aquí una versión usando TStringList:

Código Delphi [-]
var
  Web: TStringList;
  Temp: TStringList;
  ind: Integer;
  tt: Integer;

begin
  Web := TStringList.Create;
  Temp := TStringList.Create;
  try
    //cargo la web en un TStringList
    Web.Text := idHttp1.Get('http://www.aemet.es/es/eltiempo/prediccion/localidades?l=22001');
    for ind := 0 to Pred(Web.Count) do
      if Web[ind] = '< h2 class="titulo" >' then
        for tt := ind to Pred(Web.Count) do
        begin
          Temp.Add(Web[tt]);
          if Web[tt] = ' < form name="frmMunicipio" method="get" ' +
            'action="/es/eltiempo/prediccion/localidades" >' then
          begin
            Temp[0] := '< link rel="stylesheet" type="text/css" media="screen" ' + 
              'href="http://www.aemet.es/css/estilos.css" / >< h2 class="titulo" >';
            Temp.Text := StringReplace(Temp.Text, '/imagenes/', 
              'http://www.aemet.es/imagenes/', [rfReplaceAll]);
            wb1.LoadFromStrings(Temp);
            Exit
          end
        end
  finally
    Web.Free;
    Temp.Free
  end
end;


Saludos...

P.D. TString es una clase abstracta y es por eso que cuando quieres instanciar un objeto de esa clase obtienes el error "abstracto"

Última edición por maeyanes fecha: 09-12-2009 a las 17:04:27.
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Alguien sabe como hacer esto? MaMu Gráficos 3 18-05-2007 18:33:43
Alguien sabe como hacer que una query sea modificable pjmedina Varios 20 12-04-2007 11:17:27
Alguien sabe como hacer que tu aplicacion se ejecute... Supra Varios 7 05-02-2005 21:10:09
Alguien sabe como hacer un ShotDown a Firebird 1.51???? AGAG4 Conexión con bases de datos 3 28-10-2004 18:02:21
¿alguien sabe hacer esto? (conexion a mySQL desde delphi pero sin acceso...) seccion31 Internet 24 27-08-2004 17:14:23


La franja horaria es GMT +2. Ahora son las 14:07:35.


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
Copyright 1996-2007 Club Delphi