The renewal maintenance has officially ended for Progress iMacros effective November 30, 2023.
This Wiki site will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely, The Progress Team
Difference between revisions of "!ENDOFPAGE"
(2 intermediate revisions by 2 users not shown) | |||
Line 14: | Line 14: | ||
=== Examples === | === Examples === | ||
+ | ==== Sample usage ==== | ||
[[Image:Endofpage.png]] | [[Image:Endofpage.png]] | ||
Line 31: | Line 32: | ||
Why use endofpage? Without defining the end of page, iMacros would not know when the first table is ended and the new table (new day) starts as the number of entries per day changes. | Why use endofpage? Without defining the end of page, iMacros would not know when the first table is ended and the new table (new day) starts as the number of entries per day changes. | ||
− | In order to use !ENDOFPAGE again for the next table, one needs to reset it to a larger value before tagging the new !ENDOFPAGE | + | ==== Sample macro ==== |
+ | VERSION BUILD=6600525 | ||
+ | TAB T=1 | ||
+ | TAB CLOSEALLOTHERS | ||
+ | URL GOTO=http://www.iopus.com/imacros/demo/v6/extract2/ | ||
+ | 'first extraction without !ENDOFPAGE set, does extract fine | ||
+ | TAG POS=1 TYPE=A ATTR=TXT:HREF<SP>extracts<SP>links EXTRACT=TXT | ||
+ | 'get the "stopword's" TAGSOURCEINDEX | ||
+ | TAG POS=1 TYPE=STRONG ATTR=TXT:Account<SP>Executive | ||
+ | SET !ENDOFPAGE <nowiki>{{!TAGSOURCEINDEX}}</nowiki> | ||
+ | 'now run the extraction again: it will fail as the corresponding HTML element comes *after* the "stopword" | ||
+ | TAG POS=1 TYPE=A ATTR=TXT:HREF<SP>extracts<SP>links EXTRACT=TXT | ||
+ | |||
+ | === Notes === | ||
+ | |||
+ | * In order to use !ENDOFPAGE again for the next table, one needs to reset it to a larger value before tagging the new !ENDOFPAGE | ||
SET !ENDOFPAGE 99999 | SET !ENDOFPAGE 99999 | ||
Line 37: | Line 53: | ||
SET !ENDOFPAGE <nowiki>{{!TAGSOURCEINDEX}}</nowiki> | SET !ENDOFPAGE <nowiki>{{!TAGSOURCEINDEX}}</nowiki> | ||
− | If you want to use a button or a link as !ENDOFPAGE, you should tag it with TAG ... EXTRACT=TXT, to avoid following the link or "pushing" the button. In that case, do not forget to use SET !EXTRACT NULL, to clear the extract variable '''before''' the real extract. | + | * If you want to use a button or a link as !ENDOFPAGE, you should tag it with TAG ... EXTRACT=TXT, to avoid following the link or "pushing" the button. In that case, do not forget to use SET !EXTRACT NULL, to clear the extract variable '''before''' the real extract. |
=== See Also === | === See Also === | ||
[[!TAGSOURCEINDEX]] | [[!TAGSOURCEINDEX]] |
Revision as of 10:04, 20 July 2010
Uses the !TAGSOURCEINDEX variable to define the end of page for iMacros. A search for a TAG element does not go below this limit.
Value
Integer value, e. g. from {{!TAGSOURCEINDEX}}
Set By
[ ] Internal
[X] SET
Internal means that the iMacros program itself sets the value of the variable during program run. SET means that the user can set this value via the SET command inside a macro.
Examples
Sample usage
Macro code snippet
'First, define END of the data range TAG POS=1 TYPE=TD ATTR=TXT:Do.<SP>05.02.09 SET !ENDOFPAGE {{!TAGSOURCEINDEX}} 'Extraction anchor TAG POS=1 TYPE=TD ATTR=TXT:Mi.<SP>04.02.09 'Extraction 'We increase the myloop var until we hit "end of page" TAG POS=R{{myloop}} TYPE=TD ATTR=CLASS:planline* EXTRACT=TXT
Why use endofpage? Without defining the end of page, iMacros would not know when the first table is ended and the new table (new day) starts as the number of entries per day changes.
Sample macro
VERSION BUILD=6600525 TAB T=1 TAB CLOSEALLOTHERS URL GOTO=http://www.iopus.com/imacros/demo/v6/extract2/ 'first extraction without !ENDOFPAGE set, does extract fine TAG POS=1 TYPE=A ATTR=TXT:HREF<SP>extracts<SP>links EXTRACT=TXT 'get the "stopword's" TAGSOURCEINDEX TAG POS=1 TYPE=STRONG ATTR=TXT:Account<SP>Executive SET !ENDOFPAGE {{!TAGSOURCEINDEX}} 'now run the extraction again: it will fail as the corresponding HTML element comes *after* the "stopword" TAG POS=1 TYPE=A ATTR=TXT:HREF<SP>extracts<SP>links EXTRACT=TXT
Notes
- In order to use !ENDOFPAGE again for the next table, one needs to reset it to a larger value before tagging the new !ENDOFPAGE
SET !ENDOFPAGE 99999 TAG POS=1 TYPE=TD ATTR=TXT:Fr.<SP>06.02.09 SET !ENDOFPAGE {{!TAGSOURCEINDEX}}
- If you want to use a button or a link as !ENDOFPAGE, you should tag it with TAG ... EXTRACT=TXT, to avoid following the link or "pushing" the button. In that case, do not forget to use SET !EXTRACT NULL, to clear the extract variable before the real extract.