Jump to content

Recommended Posts

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
Link to post
Share on other sites
  • Moderators

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

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.

Link to post
Share on other sites


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)

While 1

    $MainMsg = GUIGetMsg()


        Case $MainMsg = - 3


        Case $MainMsg = $start

            $TotalWords = CountWords(GUICtrlRead($edit))

            MsgBox(0, '', $TotalWords)


 Func CountWords($s_All_Text)

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

    Return UBound($SplitSpaces) - 1

Edited by thatsgreat2345
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...