Ver Mensaje Individual
  #11  
Antiguo 12-02-2008
Avatar de PepeLolo
PepeLolo PepeLolo is offline
Miembro
 
Registrado: jun 2003
Ubicación: Fuenlabrada - Madrid - Espagna
Posts: 265
Reputación: 21
PepeLolo Va por buen camino
Talking

Otro ejemplo totalmente funcional.

Código Delphi [-]
unit Unit2;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;
type
  TForm2 = class(TForm)
    Efile: TEdit;
    Label1: TLabel;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
var
  Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
Var cStrings :TStrings;
    nLeng, i :Integer;
    cLetra :Char;
begin
  cStrings := TStrings.Create;
  try
    cStrings.LoadFromFile(Efile.text);
    nLeng := Length(cStrings.Text);
    for I := 0 to nLeng do
     begin
        cLetra := cStrings.Text[i];   // Leer letra a letra o mejor dicho carácter a carácter
        // lo que quieras hacer con dicha letra
     end;
  finally
     cStrings.free;
  end;
end;
end.

un saludo
__________________
PepeLolo
El hombre el único virus que mide más de unas cuantas micras
Responder Con Cita