Sign in to follow this  
Followers 0
Thatsgreat2345

Count How Many Words

7 posts in this topic

#1 ·  Posted (edited)

well im working on some homework and i have to have atleast 100 words and since im typing it all on one document i cant check to see how many for each i have so is there any way to make like a GUI with an edit box , i can just paste the text in press go and it will tell me how many words i have, dont have autoit installed so i cant look at the help file :lmao:

Edited by thatsgreat2345

Share this post


Link to post
Share on other sites



maybe try to do it with stringsplit, an then check the arry oO

[font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

THANKS SMOKEN :lmao: just IMed him and he helped me

Edited by thatsgreat2345

Share this post


Link to post
Share on other sites

maybe try to do it with stringsplit, an then check the arry oO

If you did a StringSplit() why would you check the array?

Func FindWords($s_Text)
    Return Ubound(StringSplit(StringStripWS($s_Text, 7), ' ') - 1
EndFunc

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

|

v yes thanks SMOKEN

$MainGui = GuiCreate('Test GUI', 215, 160)

$edit = GUICtrlCreateEdit('', 10, 10, 195, 110)

$start = GUICtrlCreateButton('Convert', 80, 120, 60, 30)
$sclear = GUICtrlCreateButton('clear', 80, 150, 60, 30)
GUISetState()

While 1

    $MainMsg = GUIGetMsg()

    Select

        Case $MainMsg = - 3

            Exit

        Case $MainMsg = $start

            $TotalWords = CountWords(GUICtrlRead($edit))

            MsgBox(0, '', $TotalWords)
    EndSelect

WEnd

 Func CountWords($s_All_Text)

    Local $SplitSpaces = StringSplit(StringStripWS($s_All_Text, 7), ' ')

    Return UBound($SplitSpaces) - 1

EndFunc
Edited by thatsgreat2345

Share this post


Link to post
Share on other sites

If you did a StringSplit() why would you check the array?

Func FindWords($s_Text)
    Return Ubound(StringSplit(StringStripWS($s_Text, 7), ' ') - 1
EndFunc
i meant it that way ^.^'

[font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0