String PlugIn addition

Post comments and suggestions for RoboTask here
Post Reply
OldGeek
Posts: 35
Joined: Thu Jun 01, 2023 2:50 pm
Location: Upstate NY

String PlugIn addition

Post by OldGeek »

I would like to add the following function:

Space(x): Space is used to return a string containing the required number of spaces as specified inside the parenthesis.

The syntax would be: Space(number of spaces)
Windows 11 Pro, RoboTask v10.0.2
Oleg
Site Admin
Posts: 3132
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: String PlugIn addition

Post by Oleg »

You can use Space function from VB script language (see VB Evaluate action)
Look at my example below. Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.
Also you can simply copy task text and paste it into the task list.

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|327819672
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DisableOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task1527"
Hide=INTEGER|0
ID=INTEGER|796618866
LogOnAsUser=INTEGER|1
Name=STRING|"Space function"
OnErrorTaskID=INTEGER|0
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
StepPause=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""num"" with value ""20"""
Params=FOLDER

[Actions\Action1\Params]
_rt_variables_produced=STRING|"num"
expand=STRING|"0"
linecount=STRING|"1"
varname=STRING|"num"
varvalue=STRING|"20"

[Actions\Action2]
ActionID=STRING|"A_SCRIPT_VBEVALUATE"
Enabled=INTEGER|-1
Name=STRING|"VB Evaluate"
Params=FOLDER

[Actions\Action2\Params]
_rt_variables_produced=STRING|"space"
expression=STRING|"space({num})"
linecount=STRING|"0"
loadfromfile=STRING|"1"
variable=STRING|"space"

[Actions\Action3]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""{num} spaces between quotation marks:"""
Params=FOLDER

[Actions\Action3\Params]
icon=STRING|"1"
msg0=STRING|"{num} spaces between quotation marks:"
msg1=STRING|"""{space}"""
msgcount=STRING|"2"
playsound=STRING|"0"
showmessage=STRING|"1"

Oleg Yershov
OldGeek
Posts: 35
Joined: Thu Jun 01, 2023 2:50 pm
Location: Upstate NY

Re: String PlugIn addition

Post by OldGeek »

Thank You
Windows 11 Pro, RoboTask v10.0.2
Post Reply