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

Quedo de 10

Aqui pongo como quedó el código completo espero que sirva para futuras consultas.

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);
    procedure ContarLetras;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  Letras: Integer;

implementation

{$R *.DFM}

procedure TForm1.ContarLetras;
Var
  I,Z: Integer;
  cTemp :  String;
begin
  Z := 0;
  cTemp := Memo1.Lines.Text;
  For I := 1 to  Length(cTemp) do
      if ord(cTemp[i]) < 32 then
         inc(Z);
  StaticText1.Caption := IntToStr(Length(cTemp) - Z);
end;

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

procedure TForm1.Memo1Change(Sender: TObject);
begin
  ContarLetras;
end;

end.

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