only 1st letters uppercase

Discuss RoboTask here
Post Reply
marcolobaido
Posts: 70
Joined: Thu Jul 02, 2015 3:54 pm

only 1st letters uppercase

Post by marcolobaido »

Hi, I need to transform:

example phrase word one two three ------> Example Phrase Word One Two Three

Can I do it in a simple way like using variables similar to upper and lowercase?
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: only 1st letters uppercase

Post by Oleg »

It's possible to do with RoboTask. But algorithm is complex a little bit.
See the example below:

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1360203151
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task175"
Hide=INTEGER|0
ID=INTEGER|1124106416
LogOnAsUser=INTEGER|1
Name=STRING|"First letter uppercase"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action10=FOLDER
Action11=FOLDER
Action12=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""SOUR"" with value ""example phrase word one two three"""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"SOUR"
varvalue=STRING|"example phrase word one two three"

[Actions\Action10]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"

[Actions\Action11]
ActionID=STRING|"A_STR_TRIM"
Enabled=INTEGER|-1
Name=STRING|"STR Trim"
Params=FOLDER

[Actions\Action11\Params]
custom=STRING|"0"
eol=STRING|"0"
lead=STRING|"1"
source=STRING|"{dest}"
spaces=STRING|"1"
tabs=STRING|"1"
trailing=STRING|"1"
variable=STRING|"dest"

[Actions\Action12]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""{Sour}"""
Params=FOLDER

[Actions\Action12\Params]
icon=STRING|"1"
msg0=STRING|"{Sour}"
msg1=STRING|"{Dest}"
msgcount=STRING|"2"
playsound=STRING|"0"
showmessage=STRING|"1"

[Actions\Action2]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""DEST"" with value """""
Params=FOLDER

[Actions\Action2\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"DEST"

[Actions\Action3]
ActionID=STRING|"A_TXT_COOMATEXT"
Enabled=INTEGER|-1
Name=STRING|"Comma-separated string -> text"
Params=FOLDER

[Actions\Action3\Params]
kind=STRING|"0"
line00000000=STRING|"{sour}"
lines=STRING|"1"
variable=STRING|"txt"

[Actions\Action4]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|0
Name=STRING|"Show ""{txt}"""
Params=FOLDER

[Actions\Action4\Params]
icon=STRING|"1"
msg0=STRING|"{txt}"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"

[Actions\Action5]
ActionID=STRING|"A_LOOP_TEXT"
Enabled=INTEGER|-1
Name=STRING|"Text Loop"
Params=FOLDER

[Actions\Action5\Params]
destvar=STRING|"WORD"
line0=STRING|"{txt}"
linecount=STRING|"1"
sourcetext=STRING|"1"

[Actions\Action6]
ActionID=STRING|"A_STR_EXTRACT"
Enabled=INTEGER|-1
Name=STRING|"STR Extract"
Params=FOLDER

[Actions\Action6\Params]
amount=STRING|"1"
from=STRING|"1"
source=STRING|"{word}"
variable=STRING|"symbol"

[Actions\Action7]
ActionID=STRING|"A_STR_DELETE"
Enabled=INTEGER|-1
Name=STRING|"STR Delete"
Params=FOLDER

[Actions\Action7\Params]
amount=STRING|"1"
from=STRING|"1"
source=STRING|"{word}"
variable=STRING|"word"

[Actions\Action8]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""WORD"" with value ""{UpperCase({Symbol})}{Word}"""
Params=FOLDER

[Actions\Action8\Params]
expand=STRING|"1"
varname=STRING|"WORD"
varvalue=STRING|"{UpperCase({Symbol})}{Word}"

[Actions\Action9]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""DEST"" with value ""{Dest}{Word}{chr(32)}"""
Params=FOLDER

[Actions\Action9\Params]
expand=STRING|"1"
varname=STRING|"DEST"
varvalue=STRING|"{Dest}{Word}{chr(32)}"


Probably it's necessary to make the corresponding action.
Oleg Yershov
marcolobaido
Posts: 70
Joined: Thu Jul 02, 2015 3:54 pm

Re: only 1st letters uppercase

Post by marcolobaido »

Thanks!!!
Post Reply