I want to run number of loops according to column 2 of datasource file
This doesn't work.
I know it's wrong but don't know how to pass the value ({{!COL2}}.
var n={{!COL2}};
for(var i=0;i<n;i++)
{
var macro = "";
macro += "CODE:" + "\n";
macro += "SET !DATASOURCE keywords.txt" + "\n";
macro += "SET !DATASOURCE_COLUMNS 2" + "\n";
macro += "WAIT SECONDS=15" + "\n";
iimPlay(macro);
}
Run Number of Loop in javascript based on txt file
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
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
Run Number of Loop in javascript based on txt file
Available for custom iim, javascript iMacros scripts
Re: Run Number of Loop in javascript based on txt file
Or I can use IF statement
let run loop for 1000 and column 2 value is 20
if i = 20 then exit for.
How to achieve this?
let run loop for 1000 and column 2 value is 20
if i = 20 then exit for.
How to achieve this?
Available for custom iim, javascript iMacros scripts
Re: Run Number of Loop in javascript based on txt file
I tried this but not working.
I am new to Javascript.
var n=100
for(var i=0;i<n;i++)
{
var macro = "";
macro += "CODE:" + "\n";
macro += "SET !DATASOURCE keywords.txt" + "\n";
macro += "SET !DATASOURCE_COLUMNS 2" + "\n";
macro += "WAIT SECONDS=1" + "\n";
macro += "SET !EXTRACT {{!col2}}" + "\n";
LoopNumber = iimGetLastExtract(0);
if (LoopNumber = i) {
var macro2 = "";
macro2 += "CODE:" + "\n";
macro2 += "prompt \"yes\"" + "\n";
}
iimPlay(macro);
iimPlay(macro2);
}
I am new to Javascript.
var n=100
for(var i=0;i<n;i++)
{
var macro = "";
macro += "CODE:" + "\n";
macro += "SET !DATASOURCE keywords.txt" + "\n";
macro += "SET !DATASOURCE_COLUMNS 2" + "\n";
macro += "WAIT SECONDS=1" + "\n";
macro += "SET !EXTRACT {{!col2}}" + "\n";
LoopNumber = iimGetLastExtract(0);
if (LoopNumber = i) {
var macro2 = "";
macro2 += "CODE:" + "\n";
macro2 += "prompt \"yes\"" + "\n";
}
iimPlay(macro);
iimPlay(macro2);
}
Available for custom iim, javascript iMacros scripts