Scintilla has built-in UPPERCASE and LOWERCASE function:
Code:
If OpenWindow(0, 0, 0, 330, 90, "ScintillaGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If InitScintilla()
ScintillaGadget(0, 10, 10, 320, 70, 0)
*Text=UTF8("Hello World")
ScintillaSendMessage(0, #SCI_SETTEXT, 0, *Text)
FreeMemory(*Text)
ScintillaSendMessage(0, #SCI_SETSEL, 0, 5)
ScintillaSendMessage(0, #SCI_UPPERCASE)
ScintillaSendMessage(0, #SCI_SETSEL, 6, 11)
ScintillaSendMessage(0, #SCI_LOWERCASE)
ScintillaSendMessage(0, #SCI_SETSEL, 0, 0)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
EndIf
For invert case, you mean "Hello" --> "hELLO" ? That would be easy too:
Code:
Procedure.s InvertCase(Text.s)
Protected *C.CHARACTER = @Text
While (*C\c)
If (*C\c = Asc(LCase(Chr(*C\c))))
*C\c = Asc(UCase(Chr(*C\c)))
Else
*C\c = Asc(LCase(Chr(*C\c)))
EndIf
*C + SizeOf(CHARACTER)
Wend
ProcedureReturn Text
EndProcedure
Debug InvertCase("123 Hello!")
Debug InvertCase(InvertCase("123 Hello!"))