How to capitalize input string in string / editor Gadget
Posted: Mon Mar 05, 2012 2:57 pm
Hello,
I wish there was a Capitalize function for strings. Please can someone help me solve these problems?
Is there a way to force capitalization of a string text even if the user has typed in lower case?
For example if the user types this
I want this as he types.
I have tried building this procedure
..which I called inside the #PB_Event_Gadget event in Event loop but it doesn't work
(I'm a newbie to this wonderful language so please don't laugh
)
Also I want another function to capitalize a string of text, as long as it comes after a
full stop. For example if a user types in the following in a string or editor gadget
I want that to be changed dynamically (as he types) to:
Can anyone put me through?
Thanks for your help
I wish there was a Capitalize function for strings. Please can someone help me solve these problems?
Is there a way to force capitalization of a string text even if the user has typed in lower case?
For example if the user types this
Code: Select all
harry genks
Code: Select all
Harry Genks
I have tried building this procedure
Code: Select all
Procedure Capitalize_Input(GadgetID.i)
Protected CurrentText.s = GetGadgetText(GadgetID)
Static Text.s
Static Left.s
Left = UCase(LTrim(Left(CurrentText,1)))
Text = Left+Mid(Text,2)
SetGadgetText(GadgetID,Text)
EndProcedure

(I'm a newbie to this wonderful language so please don't laugh

Also I want another function to capitalize a string of text, as long as it comes after a
full stop. For example if a user types in the following in a string or editor gadget
Code: Select all
hello and welcome to pure programming. i am a newbie willing to learn. please teach me
Code: Select all
Hello and welcome to pure programming. I am a newbie willing to learn. Please teach me
Thanks for your help