Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to count words in a memo Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
21-Jan-03
Category
Reporting /Printing
Language
Delphi 2.x
Views
80
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: William Gerbert

Count words in a memo

Answer:

Insert 1 label, 1 button and 1 memo.
1   
2   procedure TForm1.Button1Click(Sender: TObject);
3   
4     function Palabras(Link: string): integer;
5     var
6       n: integer;
7       befspace: boolean;
8     begin
9       befspace := FALSE;
10      if Link = '' then
11        Result := 0
12      else
13        Result := 1;
14      for n := 1 to Length(Link) do
15      begin
16        if befspace and
17          (Link[n] <> ' ') and
18          (Link[n] <> #13) and
19          (Link[n] <> #10) then
20          Inc(Result);
21  
22        befspace := (Link[n] = ' ') or
23          (Link[n] = #13) or
24          (Link[n] = #10);
25      end;
26    end;
27  
28  begin
29    Label1.caption := IntToStr(Palabras(Memo1.Text));
30  end;
31  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC