Sign in to follow this  
Followers 0
magician13134

Some software help...

4 posts in this topic

Ok, I'm working on a program somewhere between Notepad and Word, it'll probably end up similar to Wordpad, but I need some help.

I'm stuck on a few things. First is 'Fix captilization' it corrects your capital letters, but when it replaces them, the only way I could think of was to have it select that letter and then send the keystroke of the correct letter. So the problem with that is, it may leave your cursor in an odd place on the page... Here's that code:

Func CapCheck()
    $SentenceStart = 1
    $text = StringSplit(ControlGetText($mainWnd, "", $TextBox), "")
    For $i = 1 to $text[0]
        If $text[$i] = '.' or $text[$i] = '!' or $text[$i] = '?' Then $SentenceStart = 1
        If $text[$i] <> " " and $text[$i] <> "." and $text[$i] <> "!" and $text[$i] <> "?" Then
            If $SentenceStart = 1 Then
                $SentenceStart = 0
                If StringIsLower($text[$i]) Then
                    _GUICtrlEditSetSel($TextBox, $i-1, $i)
                    Send(StringUpper($text[$i]))
                EndIf
            EndIf
        EndIf
    Next
EndFunc

I can't use the replace function or else things like:

"well, crap, this isn't working well"

would correct both 'well's, not just one (or correct the wrong one).

Any ideas?

That's all I'll ask for now, I'll try to fix the other minor issues until someone helps me with this. Thanks!

Share this post


Link to post
Share on other sites



That's not exactly what I had in mind. I hoped to write this all myself. I just wondered if there was a function to replace a specified character without moving the cursor.

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