Why not just keep a running total inside the loop, as I thought I was demonstrating? Having never worked with ActivPDF, maybe I'm missing something, but why wouldn't you simply keep track of how many characters you've already added, rather than trying to re-calculate it each time?
-- Ben Doom Programmer & General Lackey Moonbow Software, Inc : -----Original Message----- : From: Janine Jakim [mailto:[EMAIL PROTECTED] : Sent: Wednesday, March 12, 2003 11:06 AM : To: CF-Talk : Subject: RE: Character count on record count??/ : : : Well the page part was easy enough to do. : It's the setting of the variable that I can't seem to get. I can set and : send the variable to a regular html page fine. It's the setting in : activePDF, which pulls the only the last : #NarrativeGet.EduLeveNarrative[i]# : (looks like each reiteration of the loop it resets it to the newest [i]) : I'm wondering how I can dynamically concatenate : #NarrativeGet.EduLeveNarrative[1]#+#NarrativeGet.EduLeveNarrative[2]# : +#NarrativeGet.EduLeveNarrative[3]# for activepdf...argh : Thanks for all the insight.... : j : -----Original Message----- : From: Ben Doom [mailto:[EMAIL PROTECTED] : Sent: Wednesday, March 12, 2003 9:48 AM : To: CF-Talk : Subject: RE: Character count on record count??/ : : : : <!---Here is my test output of the data- it shows correctly the : length of : : each narrative- : : So the question is how do I get a sum or/do narrative + narrative : : +narrative : : to get blocks of 5000?---> : : <CFOUTPUT>#(Len(NarrativeGet.EduLevelNarrative[I])# : : </CFOUTPUT> : : Initialize a temp variable to 0. Let's call it "totalLen". : Also, you need : a counter to tell you what page you're on. Each time you are about to try : to add a page, do something like : : if (totalLen + len(NarrativeGet.EduLevelNarrative[i]) gt 5000) : { : totalLen = 0; : pageRef = pageRef + 1; : } : totalLen = totalLen + len(NarrativeGet.EduLevelNarrative[i]); : addToPage(pageRef, NarrativeGet.EduLeveNarrative[i]); : : where addToPage() represents whatever has to be done to add the thing to a : page. : : Please note that this is thrown together off the top of my head. But it : seems to me to be in the right direction. : : HTH. : : : -- Benjamin C. Doom : Programmer [EMAIL PROTECTED] : Moonbow Software, Inc. 606.864.0041x4 : : : : : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4