943,654 Members | Top Members by Rank

Ad:
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Feb 27th, 2007
0

Re: Word Count Help !!

Hi,

Sorry, Little bit of Modification in my previous post :
Just Change For Loop this way :

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1.  
  2.  
  3. For i = 10 To 2 Step -1
  4. MyStr = Replace(MyStr, Space(i), Space(1))
  5. Next
  6. MyCntArray = Split(MyStr, " ")
  7. MsgBox UBound(MyCntArray)


Regards
Veena
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006
Feb 27th, 2007
0

Re: Word Count Help !!

Click to Expand / Collapse  Quote originally posted by QVeen72 ...
Hi,

Sorry, Little bit of Modification in my previous post :
Just Change For Loop this way :

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1.  
  2.  
  3. For i = 10 To 2 Step -1
  4. MyStr = Replace(MyStr, Space(i), Space(1))
  5. Next
  6. MyCntArray = Split(MyStr, " ")
  7. MsgBox UBound(MyCntArray)

Regards
Veena
Veena, you must be joking! :lol:
Don't you? :-|

Try this with your code "Hello world" and please post how many words your program find.
Reputation Points: 18
Solved Threads: 7
Junior Poster in Training
dmf1978 is offline Offline
51 posts
since Aug 2006
Feb 27th, 2007
0

Re: Word Count Help !!

Click to Expand / Collapse  Quote originally posted by dmf1978 ...
Veena, you must be joking! :lol:
Don't you? :-|

Try this with your code "Hello world" and please post how many words your program find.
i got 1
Reputation Points: 9
Solved Threads: 1
Newbie Poster
Kcin is offline Offline
16 posts
since Feb 2007
Feb 28th, 2007
0

Re: Word Count Help !!

Hi,

Did u look into my last post???? I have corrected there.

MsgBox UBound(MyCntArray)


Remove "-1"

Regards

Veena
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006
Feb 28th, 2007
0

Re: Word Count Help !!

Hi

This is My Complete. Code.

Private Sub CmdCount_Click()
    Dim MyCntArray
    Dim MyStr As String
    Dim i As Integer
    '
    MyStr = TextBox1.Text
    '
    For i = 10 To 2 Step -1
        MyStr = Replace(MyStr, Space(i), Space(1))
    Next
    ' Replace All the multiple Spaces with single spaces 
    ' here i have given for max 10 spaces, 
    ' u can change it to a higher value
    '
    MyCntArray = Split(MyStr, " ")
    MsgBox "Number Of Words : " & UBound(MyCntArray) 
    '
End Sub


I hope at least now, it is Clear.

Regards
Veena
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006
Feb 28th, 2007
0

Re: Word Count Help !!

Thx Guys, I got it to work.
Thank you for all your help.

Love You all.
Reputation Points: 9
Solved Threads: 1
Newbie Poster
Kcin is offline Offline
16 posts
since Feb 2007
Aug 17th, 2008
0

Re: Word Count Help !!

Click to Expand / Collapse  Quote originally posted by dmf1978 ...
I have uploaded a sample VB6 project to demonstrate the use of this function.
excellent code.
worked first time for me and is better than heaps of other examples.
Thanx 4 da code
Reputation Points: 10
Solved Threads: 0
Newbie Poster
arty56 is offline Offline
9 posts
since Apr 2007
Aug 17th, 2008
0

Re: Word Count Help !!

Click to Expand / Collapse  Quote originally posted by arty56 ...
excellent code.
worked first time for me and is better than heaps of other examples.
Thanx 4 da code
Hey, thanks
Reputation Points: 18
Solved Threads: 7
Junior Poster in Training
dmf1978 is offline Offline
51 posts
since Aug 2006
Aug 17th, 2008
0

Re: Word Count Help !!

Click to Expand / Collapse  Quote originally posted by dmf1978 ...
Hey, thanks
perhaps you have an answer for reading the total characters in a text box
and a way of limiting the number.

I've spent 93 mins so far and can not find a suitable answer.
Regards
Arty
Reputation Points: 10
Solved Threads: 0
Newbie Poster
arty56 is offline Offline
9 posts
since Apr 2007
Aug 18th, 2008
0

Re: Word Count Help !!

Click to Expand / Collapse  Quote originally posted by arty56 ...
perhaps you have an answer for reading the total characters in a text box
and a way of limiting the number.

I've spent 93 mins so far and can not find a suitable answer.
Regards
Arty
Yes,
This gives you length of Characters in the TextBox..
MsgBox Len(Text1.Text)

You can Limit the TextBox Setting its MaxLength
Text1.maxLength =10

Regards
Veena
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Saving Excel Worksheet
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Questions Unsolvable





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC