Loop is not Continue

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
Tamilselvan
Posts: 80
Joined: Mon Mar 07, 2016 10:49 am

Loop is not Continue

Post by Tamilselvan » Sat May 11, 2019 10:42 am

Firefox for Windows Ver 53.0.3 (32 bit)
iMacros for FF Ver 9.0.3
OS Windows 10

I have recorded following code and execute in loop. It's shows error message
mm is undefined, line: 10 (Error code: -1001)
TAG POS={{!COL1}} TYPE=INPUT:BUTTON FORM=ID:vhform ATTR=ID:check_status

Code: Select all

VERSION BUILD=9030808 RECORDER=FX
TAB T=1

SET !TIMEOUT_STEP 0
SET !DATASOURCE Mandays-TNRD.csv
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}

'URL GOTO=https://www.tnrd.gov.in/project/village_wise_hab_attendence_new.php
TAG POS={{!COL1}} TYPE=INPUT:BUTTON FORM=ID:vhform ATTR=ID:check_status
TAB T=2
TAG POS=1 TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work11 CONTENT=%3
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery11 CONTENT=
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode11 CONTENT={{!COL4}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode11 CONTENT={{!COL5}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:hab11 CONTENT=98
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker11 CONTENT={{!COL6}}

TAG POS=1 TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work41 CONTENT=%3
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery41 CONTENT=
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode41 CONTENT={{!COL8}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode41 CONTENT={{!COL9}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:hab41 CONTENT=101
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker41 CONTENT={{!COL10}}
ONDIALOG POS=1 BUTTON=OK CONTENT=
TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:add_habitation_form ATTR=ID:save_hab_entry
TAB T=1
WAIT SECONDS=2
i want to click Button in loop based on csv file in Colunm1 (Which is contain Position Value)
Click Button.jpg
Click Button-2.jpg
CSV File
Mandays-TNRD.jpg
Kindly help me.
Thanks & Regards,
Tamilselvan S
chivracq
Posts: 8716
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Loop is not Continue

Post by chivracq » Sat May 11, 2019 2:28 pm

Tamilselvan wrote:
Sat May 11, 2019 10:42 am
Firefox for Windows Ver 53.0.3 (32 bit)
iMacros for FF Ver 9.0.3
OS Windows 10

I have recorded following code and execute in loop. It's shows error message
mm is undefined, line: 10 (Error code: -1001)
TAG POS={{!COL1}} TYPE=INPUT:BUTTON FORM=ID:vhform ATTR=ID:check_status

Code: Select all

VERSION BUILD=9030808 RECORDER=FX
TAB T=1

SET !TIMEOUT_STEP 0
SET !DATASOURCE Mandays-TNRD.csv
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}

'URL GOTO=https://www.tnrd.gov.in/project/village_wise_hab_attendence_new.php
TAG POS={{!COL1}} TYPE=INPUT:BUTTON FORM=ID:vhform ATTR=ID:check_status
TAB T=2
TAG POS=1 TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work11 CONTENT=%3
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery11 CONTENT=
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode11 CONTENT={{!COL4}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode11 CONTENT={{!COL5}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:hab11 CONTENT=98
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker11 CONTENT={{!COL6}}

TAG POS=1 TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work41 CONTENT=%3
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery41 CONTENT=
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode41 CONTENT={{!COL8}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode41 CONTENT={{!COL9}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:hab41 CONTENT=101
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker41 CONTENT={{!COL10}}
ONDIALOG POS=1 BUTTON=OK CONTENT=
TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:add_habitation_form ATTR=ID:save_hab_entry
TAB T=1
WAIT SECONDS=2
i want to click Button in loop based on csv file in Colunm1 (Which is contain Position Value)
Click Button.jpg
Click Button-2.jpg

CSV File
Mandays-TNRD.jpg

Kindly help me.
Thanks & Regards,
Tamilselvan S
Hum..., most "probable" Cause I would think, will be that your '.CSV' is also already open in 'Excel' when you are trying to run your Script as 'Excel' puts a Lock on the File that prevents iMacros from opening it...

iMacros for FF v9.0.3 indeed encountered quite a few of those "mm" or "mms" or whatever Errors..., you could try with '!ERRORIGNORE' if that helps, and otherwise I would advise you anyway to rather use v8.9.7 for FF which is much more "stable" than v9.0.3, and also works on your FF53. (Both Versions work until FF56, recommended is FF v55.0.3, but FF53 is fine also...)

Hum..., and when saving your '.CSV' from 'Excel', also make sure that your File is being saved in 'UTF-8 (with BOM)' Encoding, and not in 'ANSI' for example which is often the Default and was causing some Pb's around FF49-FF53...
- (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...
Tamilselvan
Posts: 80
Joined: Mon Mar 07, 2016 10:49 am

Re: Loop is not Continue

Post by Tamilselvan » Tue May 14, 2019 9:00 am

Yes. I have changed all the things as you mentioned . Right now its working thanks a lot !!! :D
chivracq
Posts: 8716
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Loop is not Continue

Post by chivracq » Tue May 14, 2019 9:13 am

Tamilselvan wrote:
Tue May 14, 2019 9:00 am
Yes. I have changed all the things as you mentioned . Right now its working thanks a lot !!! :D
OK..., good to hear... :D
- (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...
Tamilselvan
Posts: 80
Joined: Mon Mar 07, 2016 10:49 am

Re: Loop is not Continue

Post by Tamilselvan » Tue May 14, 2019 9:33 am

One more request
In coding after column 6 execute depends on csv file column 3

if no.of cluster greater than 1 the 2nd part code will be execute i.e Column 8,9,10.

Is it right choice to use EVAL Function. ?

Could you please guide me !!!

Code: Select all

VERSION BUILD=9030808 RECORDER=FX
TAB T=1

SET !TIMEOUT_STEP 0
SET !DATASOURCE Mandays-TNRD.csv
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}

'URL GOTO=https://www.tnrd.gov.in/project/village_wise_hab_attendence_new.php
TAG POS={{!COL1}} TYPE=INPUT:BUTTON FORM=ID:vhform ATTR=ID:check_status
TAB T=2
TAG POS=1 TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work11 CONTENT=%3
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery11 CONTENT=
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode11 CONTENT={{!COL4}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode11 CONTENT={{!COL5}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:hab11 CONTENT=98
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker11 CONTENT={{!COL6}}

TAG POS=1 TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work41 CONTENT=%3
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery41 CONTENT=
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode41 CONTENT={{!COL8}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode41 CONTENT={{!COL9}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:hab41 CONTENT=101
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker41 CONTENT={{!COL10}}

ONDIALOG POS=1 BUTTON=OK CONTENT=
TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:add_habitation_form ATTR=ID:save_hab_entry
TAB T=1
WAIT SECONDS=2
CSV File
Mandays-TNRD.jpg
2nd part

Code: Select all

TAG POS=1 TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work41 CONTENT=%3
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery41 CONTENT=
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode41 CONTENT={{!COL8}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode41 CONTENT={{!COL9}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:hab41 CONTENT=101
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker41 CONTENT={{!COL10}
chivracq
Posts: 8716
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Loop is not Continue

Post by chivracq » Tue May 14, 2019 9:48 am

Tamilselvan wrote:
Tue May 14, 2019 9:33 am
One more request
In coding after column 6 execute depends on csv file column 3

if no.of cluster greater than 1 the 2nd part code will be execute i.e Column 8,9,10.

Is it right choice to use EVAL Function. ?

Could you please guide me !!!

Code: Select all

VERSION BUILD=9030808 RECORDER=FX
TAB T=1

SET !TIMEOUT_STEP 0
SET !DATASOURCE Mandays-TNRD.csv
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}

'URL GOTO=https://www.tnrd.gov.in/project/village_wise_hab_attendence_new.php
TAG POS={{!COL1}} TYPE=INPUT:BUTTON FORM=ID:vhform ATTR=ID:check_status
TAB T=2
TAG POS=1 TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work11 CONTENT=%3
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery11 CONTENT=
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode11 CONTENT={{!COL4}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode11 CONTENT={{!COL5}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:hab11 CONTENT=98
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker11 CONTENT={{!COL6}}

TAG POS=1 TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work41 CONTENT=%3
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery41 CONTENT=
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode41 CONTENT={{!COL8}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode41 CONTENT={{!COL9}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:hab41 CONTENT=101
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker41 CONTENT={{!COL10}}

ONDIALOG POS=1 BUTTON=OK CONTENT=
TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:add_habitation_form ATTR=ID:save_hab_entry
TAB T=1
WAIT SECONDS=2
CSV File
Mandays-TNRD.jpg

2nd part

Code: Select all

TAG POS=1 TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work41 CONTENT=%3
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery41 CONTENT=
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode41 CONTENT={{!COL8}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode41 CONTENT={{!COL9}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:hab41 CONTENT=101
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker41 CONTENT={{!COL10}
Yep, that's correct...

If '{{!COL3}}' is >1, use 'EVAL()' to spit out a "1"/"0" to reuse for the 6x 'TAG' Statements for the 2nd part on 'POS=n'.
'POS=1' will execute those 6x Statements like you currently already have them, and 'POS=0' won't do anything... 8)
(+ '!ERRORIGNORE' and a short '!TIMEOUT_STEP' for the 'POS=0' Case when you only have 1 Cluster...)
- (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...
Tamilselvan
Posts: 80
Joined: Mon Mar 07, 2016 10:49 am

Re: Loop is not Continue

Post by Tamilselvan » Tue May 14, 2019 1:17 pm

I have tried and its working.

Code: Select all

VERSION BUILD=9030808 RECORDER=FX
TAB T=1

SET !TIMEOUT_STEP 0
SET !DATASOURCE Mandays-TNRD.csv
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}


'URL GOTO=https://www.tnrd.gov.in/project/village_wise_hab_attendence_new.php
TAG POS={{!COL1}} TYPE=INPUT:BUTTON FORM=ID:vhform ATTR=ID:check_status
TAB T=2
TAG POS=1 TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work11 CONTENT=%3
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery11 CONTENT=
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode11 CONTENT={{!COL4}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode11 CONTENT={{!COL5}}
'TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:hab11 CONTENT=98
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker11 CONTENT={{!COL6}}

SET !VAR1 EVAL("var z; if('{{!COL3}}'>1){z=1;} else{z=0;}; z;")
SET !ERRORIGNORE YES
TAG POS={{!VAR1}} TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work41 CONTENT=%3
TAG POS={!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery41 CONTENT=
TAG POS={!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode41 CONTENT={{!COL8}}
TAG POS={!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode41 CONTENT={{!COL9}}
'TAG POS={!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:hab41 CONTENT=101
TAG POS={!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker41 CONTENT={{!COL10}}

ONDIALOG POS=1 BUTTON=OK CONTENT=
TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:add_habitation_form ATTR=ID:save_hab_entry
TAB T=1
WAIT SECONDS=2

Thank You Very Much !!!
chivracq
Posts: 8716
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Loop is not Continue

Post by chivracq » Tue May 14, 2019 1:45 pm

Tamilselvan wrote:
Tue May 14, 2019 1:17 pm
I have tried and its working.

Code: Select all

VERSION BUILD=9030808 RECORDER=FX
TAB T=1

SET !TIMEOUT_STEP 0
SET !DATASOURCE Mandays-TNRD.csv
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}

'URL GOTO=https://www.tnrd.gov.in/project/village_wise_hab_attendence_new.php
TAG POS={{!COL1}} TYPE=INPUT:BUTTON FORM=ID:vhform ATTR=ID:check_status
TAB T=2
TAG POS=1 TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work11 CONTENT=%3
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery11 CONTENT=
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode11 CONTENT={{!COL4}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode11 CONTENT={{!COL5}}
'TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:hab11 CONTENT=98
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker11 CONTENT={{!COL6}}

SET !VAR1 EVAL("var z; if('{{!COL3}}'>1){z=1;} else{z=0;}; z;")
SET !ERRORIGNORE YES
TAG POS={{!VAR1}} TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work41 CONTENT=%3
TAG POS={!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery41 CONTENT=
TAG POS={!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode41 CONTENT={{!COL8}}
TAG POS={!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode41 CONTENT={{!COL9}}
'TAG POS={!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:hab41 CONTENT=101
TAG POS={!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker41 CONTENT={{!COL10}}

ONDIALOG POS=1 BUTTON=OK CONTENT=
TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:add_habitation_form ATTR=ID:save_hab_entry
TAB T=1
WAIT SECONDS=2

Thank You Very Much !!!
Yep, very-very good...! :D

I use myself some slightly different Syntax, which I find easier to use and to extend in much more complex Expressions, but yours is perfectly fine in this "simple" Case...:

Code: Select all

SET !VAR1 EVAL("var c3='{{!COL3}}'; var z; if(c3>1){z=1;} else{z=0;}; z;")
And actually I would use this one:

Code: Select all

SET !VAR1 EVAL("var c3='{{!COL3}}'; var z; if(c3*1>1){z=1;} else{z=0;}; z;")
The "c3*1" is to make sure to convert your '!COL3' to a Number (similar to the 'toNumber()' JS Method), as iMacros often treats Vars from an 'EXTRACT' or from a DataSource as Strings and not as Numbers. It wouldn't play a role in your Case with ">1" which will always be TRUE with any Numbers, but if you were doing a "c3>2", you might encounter the Case that "11>2" would return FALSE, because "alphabetically" when comparing Strings, the "1" comes before the "2". :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...
Tamilselvan
Posts: 80
Joined: Mon Mar 07, 2016 10:49 am

Re: Loop is not Continue

Post by Tamilselvan » Fri May 17, 2019 10:11 am

Thank You for valuable Reply !!!

I need one more help ... In csv file Col3 has maximum number is 3 (i,e.,) 3 Conditions.
How to use EVAL function ...
Mandays-TNRD.jpg
If Col3=1 then 1st part to be executed remaining 2nd part and 3rd part will not

If Col3=2 then 1st part & 2nd part to be executed, 3rd part will not

If Col3=3 then all part code to be executed.

Kindly help me...

Code: Select all

TAG POS=1 TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work11 CONTENT=%3
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery11 CONTENT=
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode11 CONTENT={{!COL4}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode11 CONTENT={{!COL5}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker11 CONTENT={{!COL6}}

SET !VAR1 EVAL("var z; if('{{!COL3}}'>1){z=1;} else{z=0;}; z;")

SET !ERRORIGNORE YES

TAG POS={{!VAR1}} TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work41 CONTENT=%3
TAG POS={!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery41 CONTENT=
TAG POS={!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode41 CONTENT={{!COL7}}
TAG POS={!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode41 CONTENT={{!COL8}}
TAG POS={!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker41 CONTENT={{!COL9}}

TAG POS={{!VAR1}} TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work41 CONTENT=%3
TAG POS={!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery41 CONTENT=
TAG POS={!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode41 CONTENT={{!COL10}}
TAG POS={!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode41 CONTENT={{!COL11}}
TAG POS={!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker41 CONTENT={{!COL12}}


ONDIALOG POS=1 BUTTON=OK CONTENT=
TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:add_habitation_form ATTR=ID:save_hab_entry
TAB T=1
WAIT SECONDS=2
Thanks & Regards
S.Tamilselvan
chivracq
Posts: 8716
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Loop is not Continue

Post by chivracq » Fri May 17, 2019 2:35 pm

Your current '!VAR1' is good for part 2, and you then need to re-compute it for the 3rd part, with ">2" instead of ">1".
- (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...
Tamilselvan
Posts: 80
Joined: Mon Mar 07, 2016 10:49 am

Re: Loop is not Continue

Post by Tamilselvan » Sat May 18, 2019 5:44 am

Code: Select all

TAG POS=1 TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work11 CONTENT=%3
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery11 CONTENT=
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode11 CONTENT={{!COL4}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode11 CONTENT={{!COL5}}
'TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:hab11 CONTENT=98
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker11 CONTENT={{!COL6}}

SET !VAR1 EVAL("var z; if('{{!COL3}}'>1){z=1;} else{z=0;}; z;")
SET !ERRORIGNORE YES
TAG POS={{!VAR1}} TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work41 CONTENT=%3
TAG POS={{!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery41 CONTENT=
TAG POS={{!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode41 CONTENT={{!COL7}}
TAG POS={{!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode41 CONTENT={{!COL8}}
'TAG POS={!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:hab41 CONTENT=101
TAG POS={{!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker41 CONTENT={{!COL9}}

SET !VAR2 EVAL("var y; if('{{!COL3}}'>2){y=1;} else{y=0;}; y;")
SET !ERRORIGNORE YES
TAG POS={{!VAR2}} TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work41 CONTENT=%3
TAG POS={!VAR2}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery41 CONTENT=
TAG POS={!VAR2}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode41 CONTENT={{!COL10}}
TAG POS={!VAR2}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode41 CONTENT={{!COL11}}
TAG POS={!VAR2}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker41 CONTENT={{!COL12}}


ONDIALOG POS=1 BUTTON=OK CONTENT=
TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:add_habitation_form ATTR=ID:save_hab_entry
TAB T=1
WAIT SECONDS=2
Is it right :?:
SET !VAR2 EVAL("var y; if('{{!COL3}}'>2){y=1;} else{y=0;}; y;")

I tried its working !!!
Thank U...
Last edited by Tamilselvan on Sat May 18, 2019 6:24 am, edited 1 time in total.
chivracq
Posts: 8716
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Loop is not Continue

Post by chivracq » Sat May 18, 2019 6:18 am

Tamilselvan wrote:
Sat May 18, 2019 5:44 am

Code: Select all

TAG POS=1 TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work11 CONTENT=%3
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery11 CONTENT=
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode11 CONTENT={{!COL4}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode11 CONTENT={{!COL5}}
'TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:hab11 CONTENT=98
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker11 CONTENT={{!COL6}}

SET !VAR1 EVAL("var z; if('{{!COL3}}'>1){z=1;} else{z=0;}; z;")
SET !ERRORIGNORE YES
TAG POS={{!VAR1}} TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work41 CONTENT=%3
TAG POS={{!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery41 CONTENT=
TAG POS={{!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode41 CONTENT={{!COL7}}
TAG POS={{!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode41 CONTENT={{!COL8}}
'TAG POS={!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:hab41 CONTENT=101
TAG POS={{!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker41 CONTENT={{!COL9}}

SET !VAR2 EVAL("var y; if('{{!COL3}}'>2){y=1;} else{y=0;}; y;")
SET !ERRORIGNORE YES
TAG POS={{!VAR2}} TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work41 CONTENT=%3
TAG POS={!VAR2}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery41 CONTENT=
TAG POS={!VAR2}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode41 CONTENT={{!COL10}}
TAG POS={!VAR2}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode41 CONTENT={{!COL11}}
TAG POS={!VAR2}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker41 CONTENT={{!COL12}}


ONDIALOG POS=1 BUTTON=OK CONTENT=
TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:add_habitation_form ATTR=ID:save_hab_entry
TAB T=1
WAIT SECONDS=2
Is it right :?:
SET !VAR2 EVAL("var y; if('{{!COL3}}'>2){y=1;} else{y=0;}; y;")
Grrrhhhrrr, euh..., beeeh, yep, I think so..., I don't know...!, not difficult to replace a ">1" by ">2", so yep, looks OK to me... :roll:
And simply try if it works, I can't do any Testing for you... :roll:

But again, already mentioned, you are going for some ">2" now, will still work apparently if you only expect [1-2-3] Values in your '!COL3', but you might experience some "unexpected" Results if '!COL3' could contain some "10"/"11"/etc Value like I've already mentioned, then "my" Syntax would be more "reliable"... :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...
Tamilselvan
Posts: 80
Joined: Mon Mar 07, 2016 10:49 am

Re: Loop is not Continue

Post by Tamilselvan » Sat May 18, 2019 6:39 am

Could i change ATTR number depend upon csv column or combine ATTR:ID number and Column 12
Change ATTR ID.jpg

Code: Select all

TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode11 CONTENT={{!COL4}}
TAG POS=1 TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work11 CONTENT=%3
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery11 CONTENT=
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode11 CONTENT={{!COL4}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode11 CONTENT={{!COL5}}
'TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:hab11 CONTENT=98
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker11 CONTENT={{!COL6}}
chivracq
Posts: 8716
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Loop is not Continue

Post by chivracq » Sat May 18, 2019 6:56 am

Tamilselvan wrote:
Sat May 18, 2019 6:39 am
Could i change ATTR number depend upon csv column or combine ATTR:ID number and Column 12
Change Number by Column.jpg

Code: Select all

TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode11 CONTENT={{!COL4}}
TAG POS=1 TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work11 CONTENT=%3
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery11 CONTENT=
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode11 CONTENT={{!COL4}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode11 CONTENT={{!COL5}}
'TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:hab11 CONTENT=98
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker11 CONTENT={{!COL6}}
Beeeh, yep of course..., Col_12 is Col_L from your '.csv' if I'm correct, I only see a '54" for Row_4, and no '{{!COL12}}' in your last Post/Script...
=> 11/41/61, beeh yep, simply use 'EVAL()' with 'if +else'...

Nothing complicated, just try to make the Statement and see if it works.... You've now been using iMacros for more than 3 years, you are not a Newbie anymore, you don't need to ask me "Permission" to pee or to eat or to sleep for every Action you want to take...! :roll:

=> "Could I change?" + "depend" + "combine" => then yep, Answer is YES...! :D

Yeah, to "Is it possible...?" / "Can I do this...?", my "Standard" Bullshit Marketing Reply without Thinking is always YES, and turns out statistically to be correct by more than 99%..., (yeah well, unless sbd like a few hours ago asks if they can use iMacros in 'Outlook', ah-ah...!, then oops..., my Answer was NO, ah-ah...!), but I only start Thinking after some "I tried this, here is my Code/Script, it's not working, then I tried that and that, and it's still not working..., I'm a bit stuck now..."
Last edited by chivracq on Sat May 18, 2019 7:31 am, edited 1 time in total.
- (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...
Tamilselvan
Posts: 80
Joined: Mon Mar 07, 2016 10:49 am

Re: Loop is not Continue

Post by Tamilselvan » Sat May 18, 2019 7:30 am

I have changed as you guided. And its worked. Here it is... Even i have been using more than 3 years i need your guide please...

Code: Select all

VERSION BUILD=9030808 RECORDER=FX
TAB T=1

SET !TIMEOUT_STEP 0
SET !DATASOURCE Mandays-TNRD.csv
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}

SET !ERRORIGNORE YES
'URL GOTO=https://www.tnrd.gov.in/project/village_wise_hab_attendence_new.php
TAG POS={{!COL1}} TYPE=INPUT:BUTTON FORM=ID:vhform ATTR=ID:check_status
TAB T=2
TAG POS=1 TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work11 CONTENT=%3
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery11 CONTENT=
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode11 CONTENT={{!COL4}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode11 CONTENT={{!COL5}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker11 CONTENT={{!COL6}}

SET !VAR1 EVAL("var c3='{{!COL3}}'; var z; if(c3>1){z=1;} else{z=0;}; z;")
SET !ERRORIGNORE YES
TAG POS={{!VAR1}} TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work{{!COL14}} CONTENT=%3
TAG POS={{!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery{{!COL14}} CONTENT=
TAG POS={{!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode{{!COL14}} CONTENT={{!COL7}}
TAG POS={{!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode{{!COL14}} CONTENT={{!COL8}}
TAG POS={{!VAR1}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker{{!COL14}} CONTENT={{!COL9}}

SET !VAR2 EVAL("var c3='{{!COL3}}'; var y; if(c3>2){y=1;} else{y=0;}; y;")
SET !ERRORIGNORE YES
TAG POS={{!VAR2}} TYPE=SELECT FORM=ID:add_habitation_form ATTR=ID:cmb_work{{!COL14}} CONTENT=%3
TAG POS={{!VAR2}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:noofworkcategery{{!COL14}} CONTENT=
TAG POS={{!VAR2}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:menhapcode{{!COL14}} CONTENT={{!COL10}}
TAG POS={{!VAR2}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:womenhapcode{{!COL14}} CONTENT={{!COL11}}
TAG POS={{!VAR2}} TYPE=INPUT:TEXT FORM=ID:add_habitation_form ATTR=ID:attend_worker{{!COL14}} CONTENT={{!COL12}}

ONDIALOG POS=1 BUTTON=OK CONTENT=
TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:add_habitation_form ATTR=ID:save_hab_entry
TAB T=1
WAIT SECONDS=2
Thank so much. :D
Post Reply