Ver Mensaje Individual
  #8  
Antiguo 31-01-2007
[egostar] egostar is offline
Registrado
 
Registrado: feb 2006
Posts: 6.572
Reputación: 27
egostar Va camino a la fama
Vaya

Tambien este funcionó a la perfeccion.

Código Delphi [-]
unit UContadorLetras;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Buttons;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    StaticText1: TStaticText;
    Label1: TLabel;
    BitBtn1: TBitBtn;
    procedure FormShow(Sender: TObject);
    procedure Memo1Change(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  Letras: Integer;

implementation

{$R *.DFM}

procedure TForm1.FormShow(Sender: TObject);
begin
  Letras := 0;
  StaticText1.Caption := inttostr(Letras);
end;

procedure TForm1.Memo1Change(Sender: TObject);
var
  Str: String;
  i,j: integer;
begin
  Str:= Memo1.Lines.Text;
  j:= 0;
  for i:= 1 to Length(Str) do
    if (Str[i] <> #13) and (Str[i] <> #10) then
      inc(j);
  StaticText1.Caption:= IntToStr(j);
end;

end.

Muchas gracias seoane.
__________________
"La forma de empezar es dejar de hablar y empezar a hacerlo." - Walt Disney
Responder Con Cita