Quantcast
Channel: Adobe Community: Message List - FrameMaker Scripting
Viewing all articles
Browse latest Browse all 3715

Re: iterate all tables in framemaker

$
0
0

No it is not looping infinitely. It is working its way through all the paragraphs in all the cells in ALL the tables, and there are a LOT of tables in the reference pages of your document.

 

Instead of using alert(pgf) you should use something more informative, such as alert( pgf.Unique ) - which gives you the unique internatl number of the paragraph in the document. That is how you would have seen that it is NOT an infinite loop, just a very long one. In general, putting alerts everywhere is a very slow method. If you do want to prevent an infinite loop, add a counter and make your while loops stop when the counter reaches a high number.

 

Now about the real problem you are having:

 

I told you before you need to determine the table format and then decide if you want to iterate through all its cells. The tables on your body pages have a table format that is probably different from the table formats used on the reference pages. You need to check the table format tag of the table you find and then skip the inner loop if it is not one of the formats used on your body pages. Something like this:

 

while( table.ObjectValid( ) )

{

     if( table.TblTag == "Format A" || table.TblTag == "Format B" )

     {

          /* insert the existing code here for looping through the rows, cells, pgfs.

     }

     table = table.NextTblInDoc;

}

 

Most of the tables on the reference pages have the table format tag "Mapping Table", so you can also reverse the logic and replace the if statement with this:

 

if( table.TblTag != "Mapping Table" )


Viewing all articles
Browse latest Browse all 3715

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>