We need you!

We're working hard on the next version of Developer Fusion. Let us know what you think we should be up to!

Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

This resource has not currently been approved, and is not currently linked to from our directory of resources. It is being displayed here for preview by the author and moderators only.
Rated
Read 1,017 times

Related Categories

Another Word Counter - Introduction

Random`

Introduction

Introduction:

Just Another word counter coming right out of the oven, my gramma can make a word counter but that doesn't stop me from doing one my self. This little puppy can count up to 4066 words before my it freezes of overflow. It's easy and simple yet effective sometimes.

Knock your self out:

• Remember that I used the Do before the While statement so i had to add +1

 

Dim words As Long
Dim char As String
Dim i As Integer
i = 1
If Text1.Text <> n Then 'If text box is not empty do
Text1.Text = Trim(Text1.Text) 'Remove the spaces for the left and right edge of the text
Do While i < Len(Text1.Text) 'Loop
char = Mid$(Text1.Text, i, 1)
If char <> " " Then  'If the letter is different then a space, increase i
i = i + 1
ElseIf char = " " And Mid$(Text1.Text, i + 1, 1) <> " " Then 'if the letter is a space and it's not the end of the sentence do
words = words + 1
i = i + 1
Else
i = i + 1
End If
If i = Len(Text1.Text) Then
Text2.Text = words + 1 'stop the counting and post the results
Exit Do
End If
Loop
End If
End Sub

Bassem also known over the web as XNeo``` or Random` has been programming since the age of 13, he first started with some simple languages such as mIRC Scripting, then over the years he learned VB, C/C++, HTML, Assembly, he's learning ASP, php, and some .NET languages. He's a beginner in web designing but he's kinda good: www.cyberhurricane.premium.ws ; He's 17 now and can't wait to get to college where he can really show his talent...

Comments