Page 1 of 2

Robotask "If then" with boolean selection

Posted: Tue Apr 14, 2009 2:10 am
by Migg
Hi there,I want to use RT to start some additional programms, but not with the start of Windows. I want to create a boolean variable, but I don't know how to do it.I use RT3.1 from the german "PC Praxis".Maybe someone can help me here.thank you

Robotask "If then" with boolean selection

Posted: Tue Apr 14, 2009 3:17 am
by Oleg
All variables in RoboTask are strings
Just set True or False to your variable and you can use it in "If..Then" condition with "as boolean" option
Also you can use Yes/No pair

Robotask "If then" with boolean selection

Posted: Tue Apr 14, 2009 5:01 am
by Migg
Must I take a new variable?In some trys I set True to the variable but RT brings an error back.
Oleg wrote:All variables in RoboTask are strings
Just set True or False to your variable and you can use it in "If..Then" condition with "as boolean" option
Also you can use Yes/No pair

Robotask "If then" with boolean selection

Posted: Tue Apr 14, 2009 5:54 am
by Oleg
What error?
"True" or "False" is a same string as another srtings.
also publish here your task. I want to look it.

Robotask "If then" with boolean selection

Posted: Tue Apr 14, 2009 6:09 am
by Migg
Oleg wrote:What error?
"True" or "False" is a same string as another srtings.
also publish here your task. I want to look it.
This is my task (RT says:E: 14.04.2009 16:09:16: Value "Test1" is not compatible with boolean expression):;*****************************;* RoboTask Task file         ;* Do not edit in text editor!;***************************** [Root]ActionAfterRun=INTEGER|0Actions=FOLDERAutomat=INTEGER|-1CatID=INTEGER|1320534252ContinueOnError=INTEGER|0ExternalName=STRING|"Task19"Hide=INTEGER|0ID=INTEGER|812578977Name=STRING|"Create variable ""TEST1"" with value """"..."Priority=INTEGER|3RunOnClose=INTEGER|0RunOnStartup=INTEGER|0ToLog=INTEGER|3WriteGeneralLog=INTEGER|0[Actions]Action1=FOLDERAction2=FOLDERAction3=FOLDERAction4=FOLDERAction5=FOLDERAction6=FOLDER[Actions\Action1]ActionID=STRING|"A_DIALOG_QUESTION"Enabled=INTEGER|-1Name=STRING|"Question Dialog"Params=FOLDER[Actions\Action1\Params]abortif=STRING|"0"action=STRING|"1"autotime=STRING|"0"buttons=STRING|"1"message=STRING|"""Do you want to continue?"""time=STRING|"60"variable=STRING|"TEST1"[Actions\Action2]ActionID=STRING|"A_FLOW_IF"Enabled=INTEGER|-1Name=STRING|"If Then"Params=FOLDER[Actions\Action2\Params]case=STRING|"1"operator=STRING|"0"type=STRING|"3"value1=STRING|"Test1"value2=STRING|"""True"""[Actions\Action3]ActionID=STRING|"A_DIALOG_MESSAGE"Enabled=INTEGER|-1Name=STRING|"Show ""{TEST1}"""Params=FOLDER[Actions\Action3\Params]icon=STRING|"1"msg0=STRING|"{TEST1}"msgcount=STRING|"1"playsound=STRING|"0"showmessage=STRING|"1"[Actions\Action4]ActionID=STRING|"A_FLOW_ELSE"Enabled=INTEGER|-1Name=STRING|"Else"[Actions\Action5]ActionID=STRING|"A_DIALOG_MESSAGE"Enabled=INTEGER|-1Name=STRING|"Show ""Es wurde Nein gewählt"""Params=FOLDER[Actions\Action5\Params]icon=STRING|"1"msg0=STRING|"Es wurde Nein gewählt"msg2=STRING|"{Test1}"msgcount=STRING|"3"playsound=STRING|"0"showmessage=STRING|"1"[Actions\Action6]ActionID=STRING|"A_FLOW_ENDIF"Enabled=INTEGER|-1Name=STRING|"End If"

Robotask "If then" with boolean selection

Posted: Tue Apr 14, 2009 6:36 am
by Oleg
Use the string {Test1} instead of Test1

You may use any expression with (or without) variables. Therefore you have to write all variable names between {}. Otherwise RoboTask use this string "as is". The string "Test1" is not a boolean expression.

Robotask "If then" with boolean selection

Posted: Tue Apr 14, 2009 6:40 am
by Migg
Outsch Now it works, thank you.Thanks also for your fast replies.
Oleg wrote:Use the string {Test1} instead of Test1

You may use any expression with (or without) variables. Therefore you have to write all variable names between {}. Otherwise RoboTask use this string "as is". The string "Test1" is not a boolean expression.

Robotask "If then" with boolean selection

Posted: Tue Apr 14, 2009 7:05 am
by Oleg
Also you may to use integer values:
0 = False
any other values = True

This is undocumented but this is working

Robotask "If then" with boolean selection

Posted: Tue Apr 14, 2009 7:40 am
by Migg
Now I have the next problem:How can I declare number-values?Must I say (number) or <number>?
Oleg wrote:Also you may to use integer values:
0 = False
any other values = True

This is undocumented but this is working

Robotask "If then" with boolean selection

Posted: Tue Apr 14, 2009 7:52 am
by Oleg
Just set 0 or 1 or 2, etc

You can't declare the typed variables. You must set the numeric value only