Do While NOT iret< 0, not working??

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++.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:


Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Do While NOT iret< 0, not working??

by mts on Thu Nov 24, 2011 11:30 am

after running the script to the bottom of the page, I get this extracted...

I assumed this Do While Not, would of taken care of this and stopped when it encountered the first #EANF#, but the script continues in an endless loop. Am I not using Do While NOT iret< 0 correctly?

Posts: 12
Joined: Thu Oct 27, 2011 11:36 am

Re: Do While NOT iret< 0, not working??

by timurcat99 on Fri Nov 25, 2011 1:44 pm

having the same problem, hope someone responds...
Posts: 4
Joined: Wed Nov 23, 2011 4:14 am

Re: Do While NOT iret< 0, not working??

by Tom, Tech Support on Wed Nov 30, 2011 3:53 am


When an extraction fails because the element could not be found on the page, then iMacros simply adds "#EANF#" to the extraction buffer (which stands for "Extraction Anchor Not Found"). It does not, however, generate a macro error in this case, so iret < 0 will be false.

You can either add an additional TAG command (without the EXTRACT parameter) just prior to the extraction so that the macro will abort with an error if the element does not exist, or you will have to inspect the value of the extraction using iimGetLastExtract to determine if #EANF# was returned and then break out of your loop.

Tom, iMacros Support
Tom, Tech Support
Posts: 3298
Joined: Mon May 31, 2010 9:59 am

Re: Do While NOT iret< 0, not working??

by lahey&randy on Wed Feb 24, 2016 9:19 am


Posts: 5
Joined: Fri Sep 18, 2015 5:10 am

Re: Do While NOT iret< 0, not working??

by thecoder2012 on Mon Feb 29, 2016 7:23 pm

Small line for set "#EANF#" to nothing:
SET anyvariable EVAL("if (\"{{!EXTRACT}}\" == \"#EANF#\") {var x = \"\";} else {var x = \"{{!EXTRACT}}\";} x;")

#EANF# is not always helpful. :wink:
Join Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me!
User avatar
Posts: 109
Joined: Sat Aug 15, 2015 10:14 am
Location: Internet

Return to Scripting and Command Line Interface

Who is online

Users browsing this forum: No registered users and 4 guests