Jump to content
Sign in to follow this  

Possible bug?

Recommended Posts


I downloaded the most recent Autoit version at the church computer and started to write a little lyrics helper. I think I came across a problem when I got the point of replacing LineFeeds. Here's the code:

; Easy Worship Slides Helper

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <String.au3>
#include <Array.au3>

Global $CorrectCaseArray[12] = ["I", "You", "God", "Savior", "Saviour", "Lord", "Almighty", "Father", "Son", "Holy", "Spirit", "Jehovah"]
; Jehovah

$hGUIMain = GUICreate("Form1", 433, 364, 192, 124)
$EditMain = GUICtrlCreateEdit("", 8, 40, 409, 257)
GUICtrlSetData(-1, "EditMain")
$btnCorrectCapital = GUICtrlCreateButton("Correct Capitalization", 8, 312, 113, 33, $WS_GROUP)
$btnSpelling = GUICtrlCreateButton("Spelling", 128, 312, 121, 33, $WS_GROUP)
$inputLyric = GUICtrlCreateInput("Input1", 320, 312, 97, 21)
$btnLyric = GUICtrlCreateButton("Lyric Find", 320, 336, 97, 21, $WS_GROUP)
$lblInfo = GUICtrlCreateLabel("Use to help enter worship slides!!", 16, 8, 388, 25)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
        Case $btnCorrectCapital


func CorrectCapital($StringText)

        ; lower case it all
        $StringText = StringLower($StringText)

        ; Double linefeeds/ double spaces

        $StringText = StringRegExpReplace($StringText, "\n\s?\n\s?", @CRLF)

        ; correct single words
        $WordsArray = StringRegExp($StringText, "(\w*)\s?", 3)
        For $I = 0 to UBound($WordsArray) - 1
            if $WordsArray[$I] <> "" and $WordsArray <> " " Then

                $index = _ArraySearch($CorrectCaseArray, StringStripWS($WordsArray[$I], 8))
                if not @error Then
                    $WordsArray[$I] = _StringProper($WordsArray[$I])
                    $StringText = StringReplace($StringText, $WordsArray[$I] & " ", $CorrectCaseArray[$index] & " ")
                    $StringText = StringReplace($StringText, " " & $WordsArray[$I], " " & $CorrectCaseArray[$index])
                    $WordsArray[$I] = StringLower($WordsArray[$I])



    ; bad characters
    for $I = 128 to 255
        $StringText = StringRegExpReplace($StringText, Chr($I), "")
    for $I = 0 to 31
        If $I <> 10 and $I <> 13 Then
            $StringText = StringRegExpReplace($StringText, Chr($I), "")
            ;MsgBox(0, $I, $StringText)

    return $StringText


func WriteDataToUser($String)
    GUICtrlSetData($EditMain, $String)

Enter anything in the edit control, put a few lines, and press the 'correct capitalization' button. You'll notice in the newest version of Autoit it doesn't display LF's right(ASCII 13), It displays them as '[]' boxes.

I think it has to do with StringRegEx, because my regex tester on the church computer was returning a garbage-load of those 'unprintable' characters too.

Before I submit a bug request, could I get someone to check this and make sure I'm not going insane?(MUST have the newest AU3). I would update here on my main computer to try, but I'd like to finish this up without hitting bugs.

Thanks for the help!

EDIT: To clarify, I am NOT having this issue under Autoit

Edited by Szhlopp

Share this post

Link to post
Share on other sites

I downloaded the most recent Autoit version ...


EDIT: To clarify, I am NOT having this issue under Autoit

Huh? :)

The most recent version is, so if you have the most recent version, and you are NOT having this issue under that version, then... what was the question again?


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post

Link to post
Share on other sites

Unless he is either using a beta, or maybe a bad download from another site? in any case, I would remove autoit and redownload from this site



My Android cat and mouse game

We're gonna need another Timmy!

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