Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guνa de estilo Temas de Hoy

Coloboraciσn Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #3  
Antiguo 09-06-2008
Avatar de Caro
*Caro* Caro is offline
Moderadora
 
Registrado: jul 2004
Ubicaciσn: Cochabamba, Bolivia
Posts: 2.544
Poder: 24
Caro Va por buen camino
Hola Paulao, te pongo otro ejemplo.

Cσdigo Delphi [-]
function TForm1.Contenido(Linea, Cadena : String; PosInicio:Integer): String;
var
 CadRestante : String;
 PosFinal       : Integer;
 Resultado     : String;
begin
 CadRestante := Copy(Linea, PosInicio+Length(Cadena), Length(Linea));
 if CadRestante[1] =' ' then
  CadRestante := Copy(CadRestante, 2, Length(CadRestante)-1);
 PosFinal := Pos(' ', CadRestante);
 if PosFinal >0 then
  Resultado := Copy(CadRestante, 1, PosFinal-1)
 else
  Resultado := Copy(CadRestante, 1, Length(CadRestante));
 Result := Resultado;
end;
 
procedure TForm1.Button1Click(Sender: TObject);
var
 Archivo  : TextFile;
 Linea    : String;
 BandItem : Boolean;
 PosInicio, PosItem  : Integer;
 Cont : String;
begin
 AssignFile(Archivo, 'archivo.txt');
 Reset(Archivo);
 BandItem := False;
 While not Eof(Archivo) do
  begin
   Readln(Archivo, Linea);
 
   PosItem := Pos('ITEM', Linea);
   if (PosItem<>0) or (BandItem) then
    begin
     BandItem := True;
     Memo1.Lines.Add(Linea);
     if Pos('SUBTOTAL', Linea)>0 then
      BandItem := False;
    end
   else
    begin
     PosInicio := Pos('CCF:', Linea);
     if PosInicio>0 then
      begin
       showmessage(Contenido(Linea, 'CCF:',PosInicio));
       PosInicio := 0;
      end;
     PosInicio := Pos('COO:', Linea);
     if PosInicio>0 then
      begin
       showmessage(Contenido(Linea, 'COO:',PosInicio));
       PosInicio := 0;
      end;
     PosInicio := Pos('CNPJ/CPF CONSUMIDOR:', Linea);
     if PosInicio>0 then
      begin
       showmessage(Contenido(Linea, 'CNPJ/CPF CONSUMIDOR:',PosInicio));
       PosInicio := 0;
      end;
     PosInicio := Pos('NOME:', Linea);
     if PosInicio>0 then
      begin
       showmessage(Contenido(Linea, 'NOME:',PosInicio));
       PosInicio := 0;
      end;
    end;
  end;
end;

Saluditos
__________________
Disfruten cada minuto de su vida a lado de sus seres queridos como si fuese el ultimo, uno nunca sabe lo que puede pasar.
Responder Con Cita
 



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
ftFmtMemo to text johurgi Varios 1 20-10-2006 17:45:01
Duda sobre Archivos enviados por medio de firebird sin guardarlo en la BD RONPABLO Firebird e Interbase 6 13-10-2006 23:49:44
Guardar lo que tengo en un Edit1.text y edit2.text en una base de datos firebird jorgeluisc Conexiσn con bases de datos 1 23-04-2006 18:29:28
Convertir Archivos DFM de binario a Texto (Text DFM) DiDi Varios 4 21-04-2005 19:39:43
duda sobre archivos de texto eduarcol Varios 4 05-02-2004 15:06:31


La franja horaria es GMT +2. Ahora son las 09:25:54.


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