How to restart CSV - Infinite loop?

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
Legalien
Posts: 66
Joined: Mon Feb 15, 2016 6:47 pm
Contact:

How to restart CSV - Infinite loop?

Post by Legalien » Mon Jul 22, 2019 11:54 pm

iMacros for Firefox version 8.9.7
Firefox version 55.0.2
Operating System Windows 10

I have a csv or text file with 10 rows. I have the script set to loop through them, and it works. But when it reaches row 10, it just keeps inputting row 10 over and over again instead of restarting from row 1 again.

I tried with csv and txt file, and the same behavior occurs.

I'm sure it's a simple solution, something I need to SET in the script, some line of code, but I just can't find it.

Can anyone help?

Thanks
Buy Social Media Services - https://Socialesale.com
chivracq
Posts: 8703
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to restart CSV - Infinite loop?

Post by chivracq » Tue Jul 23, 2019 1:55 am

Legalien wrote:
Mon Jul 22, 2019 11:54 pm

Code: Select all

iMacros for Firefox version 8.9.7
Firefox version 55.0.2
Operating System Windows 10
I have a csv or text file with 10 rows. I have the script set to loop through them, and it works. But when it reaches row 10, it just keeps inputting row 10 over and over again instead of restarting from row 1 again.

I tried with csv and txt file, and the same behavior occurs.

I'm sure it's a simple solution, something I need to SET in the script, some line of code, but I just can't find it.

Can anyone help?

Thanks
Could be done from a '.js' Script as you are using v8.9.7 for FF but if you already know the Nb of Rows in your '.CSV' and that Nb is fixed, then it's fairly easy to implement in pure '.iim'... (And your Script will still work in all Browsers/iMacros Versions...) 8)

=> Search the Forum on "nested+loop+modulo" (=> 'Modulo[10]' for you...) :idea:
(=> To apply to '!DATASOURCE_LINE' instead of using the raw '!LOOP'...)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
chivracq
Posts: 8703
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to restart CSV - Infinite loop?

Post by chivracq » Tue Jul 23, 2019 2:17 am

Oh..., never mind, takes me 3 Sec to write it and you'll probably be struggling with the 10/20/30/etc Loops otherwise...: 8)

Code: Select all

VERSION BUILD=8820413 RECORDER=FX
TAB T=1

SET Modulo_10 EVAL("var n='{{!LOOP}}'; var x,y,z; x=n%10; if(x==0){z=10;} else{z=x;}; z;")
PROMPT LOOP:<SP>_{{!LOOP}}_<BR>Modulo_10:<SP>_{{Modulo_10}}_
'SET !DATASOURCE_LINE {{Modulo_10}}
(Tested on iMacros for FF v8.8.2, PM v26.3.3, Win10_x64.)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
chivracq
Posts: 8703
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to restart CSV - Infinite loop?

Post by chivracq » Tue Jul 23, 2019 2:44 am

+ Parallel Thread on SOF (with more Info in the OP actually, and with a Script posted...):
- How to restart CSV with iMacros - Infinite loop?

=> I've posted a Quote of the 2 Posts I posted on our Forum, => as an Answer, I guess I'll be "happy" there with the few Rep_Points, ah-ah...! 8)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Legalien
Posts: 66
Joined: Mon Feb 15, 2016 6:47 pm
Contact:

Re: How to restart CSV - Infinite loop?

Post by Legalien » Tue Jul 23, 2019 3:43 am

Hey man,

Thank you, that actually works, but for 2 things. I'm testing this now:

Code: Select all

SET !ERRORIGNORE YES
SET !TIMEOUT_PAGE 15

SET !DATASOURCE C:\Users\Me\Documents\iMacros\Datasources\L4L1.txt

SET !DATASOURCE_COLUMNS 2
SET !DATASOURCE_LINE {{Modulo_10}}
SET Modulo_10 EVAL("var n='{{!LOOP}}'; var x,y,z; x=n%10; if(x==0){z=10;} else{z=x;}; z;")
PROMPT LOOP:<SP>_{{!LOOP}}_<BR>Modulo_10:<SP>_{{Modulo_10}}_

WAIT SECONDS={{!VAR1}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:login ATTR=ID:username CONTENT={{!COL1}}
WAIT SECONDS={{!VAR1}}
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ID:login ATTR=ID:password CONTENT={{!COL2}}
WAIT SECONDS={{!VAR3}}

1) It does row 1, and then on loop it does row 1 again. Then it continues normally and even after going through 10 loops and starting from row 1 again it doesn't repeat it anymore. But on first run it does row 1 twice. Any idea why?

p.s I restarted the browser but the same behavior persists

p.s I'm using a txt file for the test, not a csv file. Could that be the problem?


2) This popup appears on every loop:

Image

Any way to make it stop?
Buy Social Media Services - https://Socialesale.com
chivracq
Posts: 8703
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to restart CSV - Infinite loop?

Post by chivracq » Tue Jul 23, 2019 3:52 am

Legalien wrote:
Tue Jul 23, 2019 3:43 am
Hey man,

Thank you, that actually works, but for 2 things. I'm testing this now:

Code: Select all

SET !ERRORIGNORE YES
SET !TIMEOUT_PAGE 15

SET !DATASOURCE C:\Users\Me\Documents\iMacros\Datasources\L4L1.txt

SET !DATASOURCE_COLUMNS 2
SET !DATASOURCE_LINE {{Modulo_10}}
SET Modulo_10 EVAL("var n='{{!LOOP}}'; var x,y,z; x=n%10; if(x==0){z=10;} else{z=x;}; z;")
PROMPT LOOP:<SP>_{{!LOOP}}_<BR>Modulo_10:<SP>_{{Modulo_10}}_

WAIT SECONDS={{!VAR1}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:login ATTR=ID:username CONTENT={{!COL1}}
WAIT SECONDS={{!VAR1}}
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ID:login ATTR=ID:password CONTENT={{!COL2}}
WAIT SECONDS={{!VAR3}}

1) It does row 1, and then on loop it does row 1 again. Then it continues normally and even after going through 10 loops and starting from row 1 again it doesn't repeat it anymore. But on first run it does row 1 twice. Any idea why?

p.s I restarted the browser but the same behavior persists

p.s I'm using a txt file for the test, not a csv file. Could that be the problem?

2) This popup appears on every loop:

Image

Any way to make it stop?
Yep, normal if you try to use a Var even before it has been defined, ah-ah...! :shock:
(Just like with your '!VAR1' btw...)

Those 4 Lines:

Code: Select all

SET !DATASOURCE_COLUMNS 2
SET !DATASOURCE_LINE {{Modulo_10}}
SET Modulo_10 EVAL("var n='{{!LOOP}}'; var x,y,z; x=n%10; if(x==0){z=10;} else{z=x;}; z;")
PROMPT LOOP:<SP>_{{!LOOP}}_<BR>Modulo_10:<SP>_{{Modulo_10}}_
... should become, in the right Order, like it was in my Code, I don't know why you changed the Order...: :o

Code: Select all

SET !DATASOURCE_COLUMNS 2
SET Modulo_10 EVAL("var n='{{!LOOP}}'; var x,y,z; x=n%10; if(x==0){z=10;} else{z=x;}; z;")
'PROMPT LOOP:<SP>_{{!LOOP}}_<BR>Modulo_10:<SP>_{{Modulo_10}}_
SET !DATASOURCE_LINE {{Modulo_10}}
+ Simply commenting out the 'PROMPT' in your "real" Script, I included it for Debug/Proof...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
chivracq
Posts: 8703
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to restart CSV - Infinite loop?

Post by chivracq » Tue Jul 23, 2019 4:22 am

Oh...!, and I see you've already accepted my Answer on SOF, Thanks for that, ah-ah...! :D

Would the Nb of Rows change in your DataSource, you will of course have to edit the 'EVAL()' where the "10" is hard-coded twice... :!:
If you "regularly" have to change that Nb, you might want to declare it as a Var at the beginning of your Script... :idea:

And as a "Bonus", would that Nb change "very often", it is even possible to compute it dynamically... :twisted:
I've provided an easy Solution in 3 Lines in the following Thread: 8)
- Re: Get number of lines from CSV and use as variable?
... even if you would need to add some Mechanism for your Script to be able to "communicate" with itself using some mini-Temp File or your OS Clipboard to compute that Nb only once on the very first Loop... :wink:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Legalien
Posts: 66
Joined: Mon Feb 15, 2016 6:47 pm
Contact:

Re: How to restart CSV - Infinite loop?

Post by Legalien » Tue Jul 23, 2019 10:15 am

chivracq wrote:
Tue Jul 23, 2019 3:52 am
Legalien wrote:
Tue Jul 23, 2019 3:43 am
Hey man,

Thank you, that actually works, but for 2 things. I'm testing this now:

Code: Select all

SET !ERRORIGNORE YES
SET !TIMEOUT_PAGE 15

SET !DATASOURCE C:\Users\Me\Documents\iMacros\Datasources\L4L1.txt

SET !DATASOURCE_COLUMNS 2
SET !DATASOURCE_LINE {{Modulo_10}}
SET Modulo_10 EVAL("var n='{{!LOOP}}'; var x,y,z; x=n%10; if(x==0){z=10;} else{z=x;}; z;")
PROMPT LOOP:<SP>_{{!LOOP}}_<BR>Modulo_10:<SP>_{{Modulo_10}}_

WAIT SECONDS={{!VAR1}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:login ATTR=ID:username CONTENT={{!COL1}}
WAIT SECONDS={{!VAR1}}
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ID:login ATTR=ID:password CONTENT={{!COL2}}
WAIT SECONDS={{!VAR3}}

1) It does row 1, and then on loop it does row 1 again. Then it continues normally and even after going through 10 loops and starting from row 1 again it doesn't repeat it anymore. But on first run it does row 1 twice. Any idea why?

p.s I restarted the browser but the same behavior persists

p.s I'm using a txt file for the test, not a csv file. Could that be the problem?

2) This popup appears on every loop:

Image

Any way to make it stop?
Yep, normal if you try to use a Var even before it has been defined, ah-ah...! :shock:
(Just like with your '!VAR1' btw...)

Those 4 Lines:

Code: Select all

SET !DATASOURCE_COLUMNS 2
SET !DATASOURCE_LINE {{Modulo_10}}
SET Modulo_10 EVAL("var n='{{!LOOP}}'; var x,y,z; x=n%10; if(x==0){z=10;} else{z=x;}; z;")
PROMPT LOOP:<SP>_{{!LOOP}}_<BR>Modulo_10:<SP>_{{Modulo_10}}_
... should become, in the right Order, like it was in my Code, I don't know why you changed the Order...: :o

Code: Select all

SET !DATASOURCE_COLUMNS 2
SET Modulo_10 EVAL("var n='{{!LOOP}}'; var x,y,z; x=n%10; if(x==0){z=10;} else{z=x;}; z;")
'PROMPT LOOP:<SP>_{{!LOOP}}_<BR>Modulo_10:<SP>_{{Modulo_10}}_
SET !DATASOURCE_LINE {{Modulo_10}}
+ Simply commenting out the 'PROMPT' in your "real" Script, I included it for Debug/Proof...
haha oh the VAR I just forgot to change it to seconds. In my actual script there is more code and the VAR are defined, but I shortened the code and removed what's irrelevant to make it simpler to ask for help :)

haha omg yes I changed the positioning of your code. I made it... look at how I made it! Pleasing on the eye. Shortest line, then medium line, then longest line. Mmm eye candyyy :D

Well okay, positioning the code the way you said fixed the problem. Wonderful.

But that still leaves me with that popup that pops up in the middle of the screen. It just breaks my heart. So close to the final solution, yet so far away :| :P

sooo... any way to stop that popup from appearing?
Buy Social Media Services - https://Socialesale.com
Legalien
Posts: 66
Joined: Mon Feb 15, 2016 6:47 pm
Contact:

Re: How to restart CSV - Infinite loop?

Post by Legalien » Tue Jul 23, 2019 10:18 am

chivracq wrote:
Tue Jul 23, 2019 4:22 am
Oh...!, and I see you've already accepted my Answer on SOF, Thanks for that, ah-ah...! :D

Would the Nb of Rows change in your DataSource, you will of course have to edit the 'EVAL()' where the "10" is hard-coded twice... :!:
If you "regularly" have to change that Nb, you might want to declare it as a Var at the beginning of your Script... :idea:

And as a "Bonus", would that Nb change "very often", it is even possible to compute it dynamically... :twisted:
I've provided an easy Solution in 3 Lines in the following Thread: 8)
- Re: Get number of lines from CSV and use as variable?
... even if you would need to add some Mechanism for your Script to be able to "communicate" with itself using some mini-Temp File or your OS Clipboard to compute that Nb only once on the very first Loop... :wink:
Yes of course I accepted. I could see that what you gave me works, I just didn't know how to "position" (the code) it correctly. And the popup of course, what to do with that...?

I doubt I'll change the number of rows, but thanks for the info. Who knows what happens, maybe I change it later for whatever reason and then I'll need to know how to edit the code too to keep it functional.

So everything is right with the world now :p but that popup, what to do, what to do? :)
Buy Social Media Services - https://Socialesale.com
chivracq
Posts: 8703
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to restart CSV - Infinite loop?

Post by chivracq » Tue Jul 23, 2019 11:49 am

Legalien wrote:
Tue Jul 23, 2019 10:15 am
haha oh the VAR I just forgot to change it to seconds. In my actual script there is more code and the VAR are defined, but I shortened the code and removed what's irrelevant to make it simpler to ask for help :)

haha omg yes I changed the positioning of your code. I made it... look at how I made it! Pleasing on the eye. Shortest line, then medium line, then longest line. Mmm eye candyyy :D

Well okay, positioning the code the way you said fixed the problem. Wonderful.

But that still leaves me with that popup that pops up in the middle of the screen. It just breaks my heart. So close to the final solution, yet so far away :| :P

sooo... any way to stop that popup from appearing?
Yeah, that's what I thought indeed about your '!VAR1'..., and always disable '!ERRORIGNORE' when "stg" is not working (like expected) and you try to debug your Script, the RuntimeErrors you then get are "your best Friend" to guide you... Direct Syntax Error on iMacros Commands still get caught when you try to run your Script as it will not pass the Parsing Check, but Undefined Params or Vars only get evaluated when the Script is really running and any Error(s) will be ignored and kept "silent" if you have enabled '!ERRORIGNORE'...

'PROMPT' to follow your Vars and to debug your Script is also "your best Friend" and THE Way to process, like I did in my first mini-Script, but you then disable those 'PROMPT' Statements when your Script then works like you expect, like I later did about the 4 Lines you had "esthetically" changed the Order of... :idea:
You comment out a Line by putting a Single Quote at the beginning of the Line. This should be the first Command you've ever learnt about iMacros, (and any Programming Language), ah-ah...! :o

Legalien wrote:
Tue Jul 23, 2019 10:18 am
Yes of course I accepted. I could see that what you gave me works, I just didn't know how to "position" (the code) it correctly. And the popup of course, what to do with that...?

I doubt I'll change the number of rows, but thanks for the info. Who knows what happens, maybe I change it later for whatever reason and then I'll need to know how to edit the code too to keep it functional.

So everything is right with the world now :p but that popup, what to do, what to do? :)
Yeah well, editing the Script is not complicated, the 'Modulo[n]' is "Modulo[10]" because you have 10 Rows in your DataSource, so everywhere in the Script (=> in the 'EVAL()') where there is a "10", you need to change it to the new Value, or you can add some "Easy Access Vars" Section at the beginning of your Script for easy Access like...:

Code: Select all

VERSION BUILD=8820413 RECORDER=FX
SET !ERRORIGNORE YES
SET !TIMEOUT_PAGE 15
TAB T=1

'Purpose of this Script: xxxx...!
'Creation Date: [2019-07-23]

'Easy Access Vars:
'******************
'DataSource:
SET DS_File C:\Users\Me\Documents\iMacros\Datasources\L4L1.txt
SET Nb_of_Cols 2
SET Nb_of_Header_Rows 0
SET Nb_of_Data_Rows 10


'SET !DATASOURCE C:\Users\Me\Documents\iMacros\Datasources\L4L1.txt
SET !DATASOURCE {{DS_File}}
'>
'SET !DATASOURCE_COLUMNS 2
SET !DATASOURCE_COLUMNS {{Nb_of_Cols}}

'Modulo[10]: (For 10 Rows (of Data) in the DataSource)
'SET Modulo_10 EVAL("var n='{{!LOOP}}'; var x,y,z; x=n%10; if(x==0){z=10;} else{z=x;}; z;")
'PROMPT LOOP:<SP>_{{!LOOP}}_<BR>Modulo_10:<SP>_{{Modulo_10}}_
'SET !DATASOURCE_LINE {{Modulo_10}}
'>
'Modulo[m]:
'(=> with 'm' declared in 'Easy Access Vars' Section (=> 'Nb_of_Data_Rows' Var))
SET Modulo_m EVAL("var n='{{!LOOP}}', m='{{Nb_of_Data_Rows}}', h='{{Nb_of_Header_Rows}}'; var x,y,z; x=n%m; if(x==0){z=m+h;} else{z=x+h;}; z;")
'PROMPT LOOP:<SP>_{{!LOOP}}_<BR>Nb_of_Rows:<SP>_{{Nb_of_Rows}}_<BR>Modulo_m:<SP>_{{Modulo_m}}_
SET !DATASOURCE_LINE {{Modulo_m}}
(Not tested...)

That makes a Script a bit longer "in the beginning", but much easier "in the long run" to edit/extend/reuse... :idea:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Legalien
Posts: 66
Joined: Mon Feb 15, 2016 6:47 pm
Contact:

Re: How to restart CSV - Infinite loop?

Post by Legalien » Tue Jul 23, 2019 7:44 pm

chivracq wrote:
Tue Jul 23, 2019 11:49 am
Legalien wrote:
Tue Jul 23, 2019 10:15 am
haha oh the VAR I just forgot to change it to seconds. In my actual script there is more code and the VAR are defined, but I shortened the code and removed what's irrelevant to make it simpler to ask for help :)

haha omg yes I changed the positioning of your code. I made it... look at how I made it! Pleasing on the eye. Shortest line, then medium line, then longest line. Mmm eye candyyy :D

Well okay, positioning the code the way you said fixed the problem. Wonderful.

But that still leaves me with that popup that pops up in the middle of the screen. It just breaks my heart. So close to the final solution, yet so far away :| :P

sooo... any way to stop that popup from appearing?
Yeah, that's what I thought indeed about your '!VAR1'..., and always disable '!ERRORIGNORE' when "stg" is not working (like expected) and you try to debug your Script, the RuntimeErrors you then get are "your best Friend" to guide you... Direct Syntax Error on iMacros Commands still get caught when you try to run your Script as it will not pass the Parsing Check, but Undefined Params or Vars only get evaluated when the Script is really running and any Error(s) will be ignored and kept "silent" if you have enabled '!ERRORIGNORE'...

'PROMPT' to follow your Vars and to debug your Script is also "your best Friend" and THE Way to process, like I did in my first mini-Script, but you then disable those 'PROMPT' Statements when your Script then works like you expect, like I later did about the 4 Lines you had "esthetically" changed the Order of... :idea:
You comment out a Line by putting a Single Quote at the beginning of the Line. This should be the first Command you've ever learnt about iMacros, (and any Programming Language), ah-ah...! :o

Legalien wrote:
Tue Jul 23, 2019 10:18 am
Yes of course I accepted. I could see that what you gave me works, I just didn't know how to "position" (the code) it correctly. And the popup of course, what to do with that...?

I doubt I'll change the number of rows, but thanks for the info. Who knows what happens, maybe I change it later for whatever reason and then I'll need to know how to edit the code too to keep it functional.

So everything is right with the world now :p but that popup, what to do, what to do? :)
Yeah well, editing the Script is not complicated, the 'Modulo[n]' is "Modulo[10]" because you have 10 Rows in your DataSource, so everywhere in the Script (=> in the 'EVAL()') where there is a "10", you need to change it to the new Value, or you can add some "Easy Access Vars" Section at the beginning of your Script for easy Access like...:

Code: Select all

VERSION BUILD=8820413 RECORDER=FX
SET !ERRORIGNORE YES
SET !TIMEOUT_PAGE 15
TAB T=1

'Purpose of this Script: xxxx...!
'Creation Date: [2019-07-23]

'Easy Access Vars:
'******************
'DataSource:
SET DS_File C:\Users\Me\Documents\iMacros\Datasources\L4L1.txt
SET Nb_of_Cols 2
SET Nb_of_Header_Rows 0
SET Nb_of_Data_Rows 10


'SET !DATASOURCE C:\Users\Me\Documents\iMacros\Datasources\L4L1.txt
SET !DATASOURCE {{DS_File}}
'>
'SET !DATASOURCE_COLUMNS 2
SET !DATASOURCE_COLUMNS {{Nb_of_Cols}}

'Modulo[10]: (For 10 Rows (of Data) in the DataSource)
'SET Modulo_10 EVAL("var n='{{!LOOP}}'; var x,y,z; x=n%10; if(x==0){z=10;} else{z=x;}; z;")
'PROMPT LOOP:<SP>_{{!LOOP}}_<BR>Modulo_10:<SP>_{{Modulo_10}}_
'SET !DATASOURCE_LINE {{Modulo_10}}
'>
'Modulo[m]:
'(=> with 'm' declared in 'Easy Access Vars' Section (=> 'Nb_of_Data_Rows' Var))
SET Modulo_m EVAL("var n='{{!LOOP}}', m='{{Nb_of_Data_Rows}}', h='{{Nb_of_Header_Rows}}'; var x,y,z; x=n%m; if(x==0){z=m+h;} else{z=x+h;}; z;")
'PROMPT LOOP:<SP>_{{!LOOP}}_<BR>Nb_of_Rows:<SP>_{{Nb_of_Rows}}_<BR>Modulo_m:<SP>_{{Modulo_m}}_
SET !DATASOURCE_LINE {{Modulo_m}}
(Not tested...)

That makes a Script a bit longer "in the beginning", but much easier "in the long run" to edit/extend/reuse... :idea:
Good point on disabling ERRORIGNORE when debugging. Although I'm a total iMacroBossPro, I can smell an error before it even happens :mrgreen:

Yeah actually the code you gave me there is quite "foreign" to me, and I guess my brain refused to completely look at it and process it, you know. So i just put it in and did my primitive aesthetic rearranging, and I was set ahhahahahaha.... but yeah now that the code is positioned correctly and the PROMPT is removed things are working splendidly. Good job and many thanks man :)

Let me run another one by you now that I have you here. This one may not be possible perhaps of how the iMacro extension is coded, but here goes...

I insert 100 in Max field and click "Play (Loop)," and the script loops 100 times, it loops through the csv or text file perfectly, all good.

BUT!!! :mrgreen:

I put this at the bottom of my script:
URL GOTO=the script's bookmark link
And now we have an infinite loop of the script itself, but the csv/txt file is not looping.

How about that one?
Buy Social Media Services - https://Socialesale.com
chivracq
Posts: 8703
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to restart CSV - Infinite loop?

Post by chivracq » Tue Jul 23, 2019 10:23 pm

Legalien wrote:
Tue Jul 23, 2019 7:44 pm
Good point on disabling ERRORIGNORE when debugging. Although I'm a total iMacroBossPro, I can smell an error before it even happens :mrgreen:

Yeah actually the code you gave me there is quite "foreign" to me, and I guess my brain refused to completely look at it and process it, you know. So i just put it in and did my primitive aesthetic rearranging, and I was set ahhahahahaha.... but yeah now that the code is positioned correctly and the PROMPT is removed things are working splendidly. Good job and many thanks man :)

Let me run another one by you now that I have you here. This one may not be possible perhaps of how the iMacro extension is coded, but here goes...

I insert 100 in Max field and click "Play (Loop)," and the script loops 100 times, it loops through the csv or text file perfectly, all good.

BUT!!! :mrgreen:

I put this at the bottom of my script:

Code: Select all

URL GOTO=the script's bookmark link
And now we have an infinite loop of the script itself, but the csv/txt file is not looping.

How about that one?
Ouf..., take it "easy" with Quoting (yourself again), that doesn't really help for Readability of the Thread, and you don't really need to quote me either, unless several Users had replied at the same time in your Thread or if you reply to a specific part of my (last) Reply... :idea:
I do quote systematically for myself though because many Users tend to delete/mutilate their Posts once they've got their Script working/final Solution (and don't want to "help" the "Competition", or keep editing their OP/Posts as they "progress", which renders such Threads useless to follow for other Users), but I don't delete my Posts..., or only correct a Typo sometimes if I notice it only later...
(And I add an 'EDIT' Section otherwise if I "really" add/remove/edit some part, content-wise...)

>>>

But yep indeed, calling a Script itself at its end is a "Trick" for some infinite Looping, but it only does the same like 'Play' from the iMacros Side-Panel, and 'Play' = 'Play ONCE'...!
Looping a Script is done from the 'Repeat Macro' Button, and only then the Built-in Mechanism with the '!LOOP' Var (and a DataSource) can be used, but not if you play your Macro only once, or you can only access the Data from 'Row_1'... And..., pfff..., yep, I would have 1 and maybe 2 Workarounds, but..., re-pfff...!, that's pretty cumbersome and using Trick on Trick and "misusing" Bugs, none supported of course, so the Behaviour can sometimes be a little bit "unexpected", ah-ah...!

But, re-re-pfff...! :P , you are in the "Luxury" Position that you are using v8.9.7 for FF, simply loop your Script 99999 times, that's Infinite enough already I would think...! :shock:

If you ever have/need to update to v10.0.2 for FF, especially the 'Free' Version (limited to 100 Loops, oops...!), then yep, at that time, and only at that time, you'll be "allowed" to do some "Thinking" about bypassing that Limitation if you don't want to pay for the 'PE' Version..., but for the time being, enjoy your 99999 Loops, ah-ah...! 8)

(And yep, I've already done that "Thinking", even if I don't use any of the (limited) 'Free' Versions, and I already have several Workarounds, oops...! :twisted: , but I won't post them, Policy from Ipswitch/Progress is now to offer a limited 'Free' Version or have Users pay for a 'PE' License, OK, fair enough, I respect that of course, even if I maybe don't agree "completely"... :| )
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Legalien
Posts: 66
Joined: Mon Feb 15, 2016 6:47 pm
Contact:

Re: How to restart CSV - Infinite loop?

Post by Legalien » Wed Jul 24, 2019 12:24 am

Yeah haha I don't know why I kept quoting you. Maybe because every time I visit here it's all quoting on quoting on quoting so I decided to follow along.

Yeah actually now that I got my solution I'm gonna delete all my posts. In fact I'm gonna use my badass script to hack the forum and shut it down forever. I don't want the competition getting their hands on MY solution... that you have me... ermmm :mrgreen:

Yes 9999 loop is more than enough, but it's about the process of doing it. Let me explain something very complex......

Doing it the regular way I have to click in he Max field, then I have to press keyboards on the keyboard, then I have to click the Play (Loop) button

Versus

Click play

I mean you can see clearly how time management time is saved and less effort and energy is expended on the whole process. haha... im laughing but im literally serious :D it saves a second here and a second there, and those seconds add up. I'm not gonna become a billionaire... well a millionaire... well a ten thousaner xD by wasting them precious seconds my friend. I'm sure you understand.

....

Oh oh, so you have the solution but you don't wanna help a brother out. Sharing is caring man, don't you know. Sharing is caring bro. So you don't care. Well you do care, but not all the way hahahhahaha :mrgreen:

Just kidding, you solved the problem I came here to solve. The infinite looping by clicking the Play button and also having the csv/txt rows loop too isn't a big deal, I can take out an hour or two per day to do the process of Play (Loop) :evil:
Buy Social Media Services - https://Socialesale.com
Post Reply