|
-
Jan 14th, 2000, 10:22 AM
#1
Thread Starter
New Member
What is the code to count the total words and total letters from textbox1 then listing the number of times a particular word is displayed in listbox1? Now the totals must be displayed in some other box separate from the listbox. A command button (we'll call it "parse")will execute the whole action when clicked on.
thanks
-
Jan 14th, 2000, 06:01 PM
#2
So Unbanned
get the total number of characters use
Len{string as string)
to get number of words do this:
[code]
Dim CountWords As Integer
Dim NumOfWordsStr As String
NumOfWordsStr = Text1.Text
Do
CountWords = CountWords + 1
NumOfWordsStr = Mid$(NumOfWordsStr, InStr(NumOfWordsStr, " ") + 1, Len(Text1.Text))
Loop Until InStr(NumOfWordsStr, " ") = 0
Text2.Text = CountWords + 1
[code]
You may need a little editing if you want to include enters and other stuff but this is the basics about the parse you could find an enter or space and find each word and see if it's in there again like the space check above. Hope this helps!
------------------
DiGiTaIErRoR
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|