3D Clipboard

A place to discuss 3D Clipboard

tOGGLE cASE

Share actions you've created here.
Bill
Posts: 4
Joined: Tue Mar 19, 2013 4:52 pm

tOGGLE cASE

Postby Bill » Mon Mar 10, 2014 3:19 pm

How many times have you inadvertently hit the "Caps Lock" key and happily typed a lot of text with the case inverted? If you happen to be a touch typist, it can be a couple of paragraphs before you decide to look at the screen. All the solutions I've heard are pretty tedious and it often just seems easier to retype everything. That is no longer true. Copy the offending text, use the Action "tOGGLE cASE" and paste the corrected text back into your document.

Code: Select all

' Action: tOGGLE cASE
' Author: Bill King
' Date: 03-10-14
'
' This works for Ascii characters
' lower case letters have an ascii value from 97 to 122
' Upper case letters have an ascii value from 65 to 90
'
Tcase1 = ""
strCBI = clipboard.value
intlencbi = len(strCBI)
For Indx = 1 To intlencbi
   ch = Asc(Mid(strCBI, Indx, 1))
   If ((ch > 96) and (ch < 123)) Then            ' letter is lower case
      ch = ch - 32                               ' change ascii value to upper case
   Else If ((ch > 64) and (ch < 91)) Then        ' letter is upper case
      ch = ch + 32                               ' change letter to lower case
      End If
   End If
   Tcase1 = Tcase1 & Chr(ch)                     ' Add to the new string with changed cases
Next
'
clipboard.value = TCase1

Return to “Actions”

 

 

cron