Robotask "If then" with boolean selection

Discuss RoboTask here
Migg
Posts: 10
Joined: Tue Apr 07, 2009 5:36 am

Robotask "If then" with boolean selection

Post 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
Oleg
Site Admin
Posts: 3201
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Robotask "If then" with boolean selection

Post 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
Migg
Posts: 10
Joined: Tue Apr 07, 2009 5:36 am

Robotask "If then" with boolean selection

Post 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
Oleg
Site Admin
Posts: 3201
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Robotask "If then" with boolean selection

Post by Oleg »

What error?
"True" or "False" is a same string as another srtings.
also publish here your task. I want to look it.
Migg
Posts: 10
Joined: Tue Apr 07, 2009 5:36 am

Robotask "If then" with boolean selection

Post 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"
Oleg
Site Admin
Posts: 3201
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Robotask "If then" with boolean selection

Post 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.
Migg
Posts: 10
Joined: Tue Apr 07, 2009 5:36 am

Robotask "If then" with boolean selection

Post 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.
Oleg
Site Admin
Posts: 3201
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Robotask "If then" with boolean selection

Post by Oleg »

Also you may to use integer values:
0 = False
any other values = True

This is undocumented but this is working
Migg
Posts: 10
Joined: Tue Apr 07, 2009 5:36 am

Robotask "If then" with boolean selection

Post 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
Oleg
Site Admin
Posts: 3201
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Robotask "If then" with boolean selection

Post by Oleg »

Just set 0 or 1 or 2, etc

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