cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

increment counter or variable?

cleccese
10-Marble

increment counter or variable?

I was wondering if it is possible to increment a variable myself in a footer or header.


A footer looks likes this:


Page 10/(11 blank)


So I was hoping I could increment a counter variable myself in the footer or save the content of a counter variable to a text variable and add 1. I have a feeling this is not possible. I did create a second page counter to keep track of the blank pages but my numbers are off so I wanted to check for a shortcut before I tweak it.


folioct,\/(\,pageno1-ct+1,\ blank)\ obviously doesn't work.

8 REPLIES 8

Caroline,

I really think the answer will depend on which styling engine you are using. FOSI, yes you can. XSL, maybe, but most likely no. Styler, I really have not worked with, so I'll leave that to an expert.

So if you could let us know which you are using.

Lynn

---- Caroline Leccese <caroline@thecodesource.net> wrote:
> I was wondering if it is possible to increment a variable myself in a footer or header.
> A footer looks likes this:
> Page 10/(11 blank)
> So I was hoping I could increment a counter variable myself in the footer or save the content of a counter variable to a text variable and add 1. I have a feeling this is not possible. I did create a second page counter to keep track of the blank pages but my numbers are off so I wanted to check for a shortcut before I tweak it.
> folioct,\/(\,pageno1-ct+1,\ blank)\ obviously doesn't work.
>
>      
> ----------     

Caroline,

If you are using FOSI, you need two counters for this. Initialize folioct to zero and nextpageblankct to one. Increment them both in pageres. Output them as counters (folioct/nextpageblankct) or strings (folioct.txt[BO]/nextpageblankct.txt[BO]) on a rectobb page model.

I've attached PDF from my book in progress.

Good luck!
Suzanne Napoleon
www.FOSIexpert.com
"WYSIWYG is last-century technology!"




Thanks, Suzanne!


I am using Styler 5.3 with FOSI edits.


If I want to reset nextpgblankct for each chapter, is this the proper form? I need to reset it before I can set the value to 1?


<reset resetlist="nextpgblankct"/">


<enumerat enumid="nextpgblankct" setvalue="1"/">


I'm doing something wrong...


I'm getting Page 10/(8 blank) instead of


Page 10/(11 blank)


hmmm

Be sure to increment nextpageblankct in every page model where folioct is incremented, including blank pages.


Can I ignore this error? I'm reseting nextpgblankct in some of the elements because the page numbers restart in each chapter.


Pagedesc counter variable "nextpgblankct" is modified in the styldesc

You can code the FOSI to reset the page number in the pageres for each page model. I've attached relevant PDF from my book.
Suzanne

Thanks again, Suzanne! Very much appreciated.

Announcements

Top Tags