RSS Forums RSS
Please support our Pascal and Delphi advertiser: Programming Forums

Character/letter count

Join Date: Apr 2006
Posts: 5
Reputation: daycartes is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
daycartes daycartes is offline Offline
Newbie Poster

Re: Character/letter count

  #3  
Apr 24th, 2006
try the following, to count the number of letters in a particular line(0)

[procedure TForm1.Button1Click(Sender: TObject);
var
a:Integer;
begin
a:=length(Memo1.Lines[0]);
label1.Caption:=IntToStr(a);
end;]
 
or to count the number of total letters (in fact characters)
[procedure TForm1.Button1Click(Sender: TObject);
var
a,b,c:Integer;
begin
a:=length(Memo1.Lines[0]);
label1.Caption:= IntToStr(length(Memo1.Lines.Text)) ;
end;]
Last edited by cscgal : May 9th, 2006 at 11:11 pm.
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 3:54 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC