Jump to content

Some software help...


Recommended Posts

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!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...