Too long text loop

Discuss RoboTask here
Post Reply
steph@vds
Posts: 46
Joined: Tue Nov 29, 2005 11:27 pm
Location: France

Too long text loop

Post by steph@vds »

Hi,
Is there a way to accelerate a text loop task ?
Thanks by advance.

Here is my task :


;*******************************
;* RoboTask Task file         &n bsp;*
;* Do not edit in text editor! *
;*******************************

[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|0
CatID=INTEGER|253659922
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task9"
Hide=INTEGER|0
ID=INTEGER|1580846813
LogOnAsUser=INTEGER|1
Name=STRING|"Family Movie : 042_Log Import"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

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

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

[Actions\Action1\Params]
destvar=STRING|"LINELOGTOTAL"
file=STRING|"{DOSSIERLOG}\Log_Total.txt"
linecount=STRING|"0"
sourcetext=STRING|"0"

[Actions\Action2]
ActionID=STRING|"A_STR_POS"
Enabled=INTEGER|-1
Name=STRING|"STR Pos Nom Projet"
Params=FOLDER

[Actions\Action2\Params]
case=STRING|"1"
from=STRING|"1"
search=STRING|"{PROJET}"
source=STRING|"{LINELOGTOTAL}"
variable=STRING|"PROJETMATCH"

[Actions\Action3]
ActionID=STRING|"A_STR_POS"
Enabled=INTEGER|-1
Name=STRING|"STR Pos Etat Import"
Params=FOLDER

[Actions\Action3\Params]
case=STRING|"0"
from=STRING|"1"
search=STRING|"IMPORTED_"
source=STRING|"{LINELOGTOTAL}"
variable=STRING|"ETATIMPORT"

[Actions\Action4]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"Si le projet matche"
Params=FOLDER

[Actions\Action4\Params]
case=STRING|"0"
operator=STRING|"0"
type=STRING|"3"
value1=STRING|"{PROJETMATCH}"

[Actions\Action5]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"Et si jamais importé"
Params=FOLDER

[Actions\Action5\Params]
case=STRING|"0"
operator=STRING|"1"
type=STRING|"3"
value1=STRING|"{ETATIMPORT}"

[Actions\Action6]
ActionID=STRING|"A_FILE_TEXTWRITE"
Enabled=INTEGER|-1
Name=STRING|"Create text file
{DOSSIERLOG}\Log_Import.txt"
Params=FOLDER

[Actions\Action6\Params]
fileexists=STRING|"1"
filname=STRING|"{DOSSIERLOG}\Log_Import.txt"
line0=STRING|"{LINELOGTOTAL}"
linecount=STRING|"1"
suppress=STRING|"0"

[Actions\Action7]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"

[Actions\Action8]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"

[Actions\Action9]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Too long text loop

Post by Oleg »

How many lines in the text?
How much time it takes to process this file?

Try to insert into beginning of the task the action "Minimize RoboTask". The task will be executed faster, when main window is hidden.
steph@vds
Posts: 46
Joined: Tue Nov 29, 2005 11:27 pm
Location: France

Too long text loop

Post by steph@vds »

Hi Oleg,
I've made a test with a 3300 lines text file and it takes
about 1min40sec to complete. When I minimise Robotask, it
takes only about 30sec. It's great.
Is there another way to do such a loop ?
In other words, is there a way to help RT to do is his job
faster ?

Thanks for you help.
Steph@vds
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Too long text loop

Post by Oleg »

Also you can save some time if you write text file only ones at the end of the task.
You can form your text in memory in the loop and write it to file after the loop.

Algorithm is simple:

Set variable MyText with ""
Text Loop
   ...
   if then
      Set variable MyText with {MyText}{LINELOGTOTAL}{EOL}
      //with expanding of Variable value
   end if
   ...
end loop
Write Text File with {MyText}
Last edited by Oleg on Fri Feb 18, 2011 5:38 am, edited 1 time in total.
Post Reply