ReLoop File when end is reached

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

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
Co0oDe
Posts: 12
Joined: Tue Jul 21, 2015 4:17 pm

ReLoop File when end is reached

Post by Co0oDe » Fri Aug 14, 2015 10:23 pm

VERSION BUILD=8920312 RECORDER=FX
firefox 39.0
WIN: 8.1
------------------------------------------------
Example Code

Code: Select all

VERSION BUILD=8920312 RECORDER=FX
TAB T=1
SET !DATASOURCE test.csv
SET !DATASOURCE_COLUMNS 1
SET !DATASOURCE_LINE {{!LOOP}}
PROMPT {{!COL1}}
test.csv file
Test1
Test2
i want imacros when reach (test2) reloop again from (test1)...
but i got that error

Code: Select all

RuntimeError: Invalid DATASOURCE_LINE value: 3, line 5 (Error code: -951)
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: ReLoop File when end is reached

Post by chivracq » Sat Aug 15, 2015 8:14 am

Co0oDe wrote:VERSION BUILD=8920312 RECORDER=FX
firefox 39.0
WIN: 8.1
------------------------------------------------
Example Code

Code: Select all

VERSION BUILD=8920312 RECORDER=FX
TAB T=1
SET !DATASOURCE test.csv
SET !DATASOURCE_COLUMNS 1
SET !DATASOURCE_LINE {{!LOOP}}
PROMPT {{!COL1}}
test.csv file
Test1
Test2
i want imacros when reach (test2) reloop again from (test1)...
but i got that error

Code: Select all

RuntimeError: Invalid DATASOURCE_LINE value: 3, line 5 (Error code: -951)
Yep then I guess your DataSource only has 2 Rows of Data, or you have 2 empty Lines at Row 3 & 4...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Co0oDe
Posts: 12
Joined: Tue Jul 21, 2015 4:17 pm

Re: ReLoop File when end is reached

Post by Co0oDe » Sat Aug 15, 2015 5:15 pm

Yep then I guess your DataSource only has 2 Rows of Data, or you have 2 empty Lines at Row 3 & 4...
:arrow: my datasource file has only 2 Rows, no more!!
i want to reloop from row 1 if the row2 is reached...
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: ReLoop File when end is reached

Post by chivracq » Sat Aug 15, 2015 5:27 pm

Co0oDe wrote:
Yep then I guess your DataSource only has 2 Rows of Data, or you have 2 empty Lines at Row 3 & 4...
:arrow: my datasource file has only 2 Rows, no more!!
i want to reloop from row 1 if the row2 is reached...
Yep, then don't use '{{!LOOP}}' for '!DATASOURCE_LINE'...!
Either you use 'EVAL()' to compute 1-2 based on '!LOOP' Modulo_2, or you copy your whole Script, once for Row_1 and once for Row_2...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Co0oDe
Posts: 12
Joined: Tue Jul 21, 2015 4:17 pm

Re: ReLoop File when end is reached

Post by Co0oDe » Sun Aug 16, 2015 8:18 pm

thank you...

can you give me any example for eval code to do that?
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: ReLoop File when end is reached

Post by chivracq » Sun Aug 16, 2015 9:15 pm

Co0oDe wrote:thank you...

can you give me any example for eval code to do that?
The 'EVAL()' Solution is a very simple Maths Problem:
1-3-5-7-9-11-13-... etc => 1
2-4-6-8-10-12-... etc => 2

If you can't solve it, or if you don't know how to use 'EVAL()' (and the Wiki has several Examples and the Forum is full of Examples), I give you 2 Solutions, then you use the other Solution which consists in copying your Block of Code... :idea:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Co0oDe
Posts: 12
Joined: Tue Jul 21, 2015 4:17 pm

Re: ReLoop File when end is reached

Post by Co0oDe » Thu Sep 03, 2015 9:29 pm

i can't find any thing like that in the forum or google :|
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: ReLoop File when end is reached

Post by chivracq » Thu Sep 03, 2015 10:34 pm

Co0oDe wrote:i can't find any thing like that in the forum or google :|
You don't need Google..., only on this Forum, I must have produced more than 100 'EVAL()' Statements, I don't know how you search the Forum if you are not able to find a few Examples, the Maths Problem is then just an easy Maths Pb that a child of 10 years can solve... If that's too complicated for you, you use the other Solution I gave you which consists of just copying your Macro and you just have to change 'SET !DATASOURCE_LINE 1' to 'SET !DATASOURCE_LINE 2'... That's even more simple... :roll:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Post Reply