"if then" not working

Discuss RoboTask here
Post Reply
wildrems
Posts: 16
Joined: Thu Jun 01, 2006 12:29 pm
Location: Canada

"if then" not working

Post by wildrems »

hi everyone,
i've got an other bug. i want to compare two variable. i use if then...
i tell him to compare variable A and B. if it's equal then....
but it doesn't work. robotask always act like the two variable are not equal, even if they are.
anyone have an idea?
by the way, if this software is capable of doing want my boss want, i'll buy it, so please help me out.
wildrems
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

"if then" not working

Post by Oleg »

Try to compare values {Variable_A} and {Variable_B}.

"If ... then" action compares the expressions and you can use variables with curly brackets "{}". In other actions too.
wildrems
Posts: 16
Joined: Thu Jun 01, 2006 12:29 pm
Location: Canada

"if then" not working

Post by wildrems »

hi oleg,
here's the task. i don't know if it will work but if you can, please tell me why it is not working, because i don't know. the two variable are the same and it's robotask act like they are not the same.
 
;**********************
;* RoboTask Task file *
;* Do not edit!       *
;**********************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|355777872
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task21"
Hide=INTEGER|0
ID=INTEGER|85879857
Name=STRING|"loop name 2"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
[Actions]
Action1=FOLDER
Action10=FOLDER
Action11=FOLDER
Action12=FOLDER
Action13=FOLDER
Action14=FOLDER
Action15=FOLDER
Action16=FOLDER
Action17=FOLDER
Action18=FOLDER
Action19=FOLDER
Action2=FOLDER
Action20=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER
[Actions\Action1]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 1000 ms"
Params=FOLDER
[Actions\Action1\Params]
delay=STRING|"10"
[Actions\Action10]
ActionID=STRING|"A_CLIPBOARD_CLEAR"
Enabled=INTEGER|-1
Name=STRING|"Clear Clipboard"
[Actions\Action11]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 1000 ms"
Params=FOLDER
[Actions\Action11\Params]
delay=STRING|"10"
[Actions\Action12]
ActionID=STRING|"A_CLIPBOARD_COPY"
Enabled=INTEGER|-1
Name=STRING|"Copy"
Params=FOLDER
[Actions\Action12\Params]
mode=STRING|"1"
[Actions\Action13]
ActionID=STRING|"A_CLIPBOARD_GET"
Enabled=INTEGER|-1
Name=STRING|"Get Text"
Params=FOLDER
[Actions\Action13\Params]
variable=STRING|"NOM_2"
[Actions\Action14]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 1000 ms"
Params=FOLDER
[Actions\Action14\Params]
delay=STRING|"10"
[Actions\Action15]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER
[Actions\Action15\Params]
case=STRING|"0"
operator=STRING|"0"
type=STRING|"0"
value1=STRING|"{NOM_COMPLET}"
value2=STRING|"{NOM_2}"
[Actions\Action16]
ActionID=STRING|"A_TASKS_START"
Enabled=INTEGER|-1
Name=STRING|"Start Task ""group"""
Params=FOLDER
[Actions\Action16\Params]
taskid=STRING|"285223270"
wait=STRING|"0"
[Actions\Action17]
ActionID=STRING|"A_FLOW_ELSE"
Enabled=INTEGER|-1
Name=STRING|"Else"
[Actions\Action18]
ActionID=STRING|"A_INET_SENDMAIL"
Enabled=INTEGER|0
Name=STRING|"Send Email"
Params=FOLDER
[Actions\Action18\Params]
attachcount=STRING|"0"
auth=STRING|"0"
from=STRING|"user@host.com"
host=STRING|"10.33.66.116"
html=STRING|"0"
msg0=STRING|"utilisateur mal creer, echec de la tache"
msgcount=STRING|"1"
password=STRING|"2514526222254532647313473"
port=STRING|"25"
subject=STRING|"erreur creation utilisateur"
[Actions\Action19]
ActionID=STRING|"A_GENERAL_RUN_PROG"
Enabled=INTEGER|-1
Name=STRING|"Run ""WINWORD.EXE"""
Params=FOLDER
[Actions\Action19\Params]
program=STRING|"C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE"
runas=STRING|"0"
wait=STRING|"1"
[Actions\Action2]
ActionID=STRING|"A_CLIPBOARD_CLEAR"
Enabled=INTEGER|-1
Name=STRING|"Clear Clipboard"
[Actions\Action20]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"
[Actions\Action3]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 2000 ms"
Params=FOLDER
[Actions\Action3\Params]
delay=STRING|"20"
[Actions\Action4]
ActionID=STRING|"A_WINDOW_COMMAND"
Enabled=INTEGER|-1
Name=STRING|"Focus window ""Computer Management"""
Params=FOLDER
[Actions\Action4\Params]
action=STRING|"0"
caption=STRING|"1"
child=STRING|"0"
class=STRING|"0"
classexact=STRING|"0"
exact=STRING|"0"
findmode=STRING|"0"
hidden=STRING|"0"
processall=STRING|"0"
wincaption=STRING|"Computer Management"
[Actions\Action5]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 1000 ms"
Params=FOLDER
[Actions\Action5\Params]
delay=STRING|"10"
[Actions\Action6]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 1000 ms"
Params=FOLDER
[Actions\Action6\Params]
delay=STRING|"10"
[Actions\Action7]
ActionID=STRING|"A_GENERAL_SENDKEYS"
Enabled=INTEGER|-1
Name=STRING|"Send keys to active window"
Params=FOLDER
[Actions\Action7\Params]
currentwindow=STRING|"1"
fixedwindow=STRING|"1"
keylayout=STRING|"0"
keys=STRING|"{nom}"
sendkind=STRING|"0"
wincaption=STRING|"Notepad"
[Actions\Action8]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 1000 ms"
Params=FOLDER
[Actions\Action8\Params]
delay=STRING|"10"
[Actions\Action9]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 1000 ms"
Params=FOLDER
[Actions\Action9\Params]
delay=STRING|"10"
 
i don't know if it's the right way to use the if and then, but any help is welcome.
by the way, by boss like your soft and he will surely buy it before the next year.
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

"if then" not working

Post by Oleg »

the two variable are the same and it's robotask act like they are not the same
Are you sure?

Insert "Show message" action before "If..then" with text:
NOM_COMPLET = {NOM_COMPLET}
NOM_2 = {NOM_2}

and, maybe, you will see an error.

BTW: where did you assign variable NOM_COMPLET?
Last edited by Oleg on Wed Jun 28, 2006 3:17 am, edited 1 time in total.
wildrems
Posts: 16
Joined: Thu Jun 01, 2006 12:29 pm
Location: Canada

"if then" not working

Post by wildrems »

hi oleg,
i assign the variable from a other task that run before this task. i tell RT to go in the excel file then take the first field copy and assign the content of the clipboard to the variable NOM_COMPLET.
i insert the show message and the two variable are the same. and the RT act like it's not the same. i compare two full name, maybe it doesn't like the space between the first and the last name?
but if you don't have this probleme, it's okay. my boss told me it wasn't a probleme. so thanks for your help.
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

"if then" not working

Post by Oleg »

i compare two full name, maybe it doesn't like the space between the first and the last name?
Most likely. Robotask doesn't use a "smart" comparison of strings.
Post Reply