How to Loop in JS Same Way As database-2-web.vbs File Does

Discussions and Tech Support related to automating the iMacros Browser or Internet Explorer from any scripting and programming language, such as VBS (WSH), VBA, VB, Perl, Delphi, C# or C++.
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
Claudiu
Posts: 32
Joined: Fri Aug 07, 2009 10:16 am

How to Loop in JS Same Way As database-2-web.vbs File Does

Post by Claudiu » Wed May 15, 2013 8:47 pm

Later Edit: long story short ... if you read this you won't have to read the rest of this thread ...
i need to loop from csv file 5 lines (1 to 5), then do action1,
then loop again from csv file the next 5 rows (6 to 10), then do action1
and so on ...



Your help would be much appreciated ...
long story short i need to loop in javascript the following:

Code: Select all

loop 20 times the following 
{
	loop 25 times the following macros sequence 
	{
		play macro1
		play macro2 {(loop the macro 100 times)}
		play macro3
	}
	play macro4
}

note that on macro2 i have a .csv database from which i fill up forms. after each 100th lines are rolled up, i need the following 100 lines to be rolled (meaning line 1 to 100, then lines 101 to 200, etc)

the macros are setup and working fine .. i just need to setup the loop enviroment for them.
if needed i can provide the macros so that they can be played on personal computer ...

atm my loop code looks like this ...

Code: Select all

iimPlay(macro1);

for (i=1;i<=100;i++)
{
	iimSet("i",i);
	iimPlay(macro2);
}

iimPlay(macro3); 
iimPlay(macro4);

should you have any question, please let me know ...
Last edited by Claudiu on Sat May 18, 2013 12:09 pm, edited 4 times in total.
Veek
Posts: 11
Joined: Fri May 06, 2011 2:17 pm
Location: USA
Contact:

Re: Help needed for 3 Loops (one inside the other) in Javasc

Post by Veek » Fri May 17, 2013 8:46 am

Very Simple:

Code: Select all

 for(var n=0;n<20;n++)
     {
	   for(var m=0;m<25;m++)
	    {
	     iimPlay(macro1);
	         for(i=1;i<100;i++)
		   {
		    iimSet("i", i);
	       iimPlay(macro2);
		   }
	     iimPlay(macro3);
        }
 iimPlay(macro4);
    }
Claudiu
Posts: 32
Joined: Fri Aug 07, 2009 10:16 am

Re: Help needed for 3 Loops (one inside the other) in Javasc

Post by Claudiu » Fri May 17, 2013 3:42 pm

thank your for your input. the code seems to work fine ...
there's only one more glitch to solve ...

Later Edit: please read the 1st post where it says Later Edit .. also read the title please
Post Reply