Skip to main content
1-Visitor
Dec 22, 2011 2:08 AM UTC
Question

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

    1-Visitor
    Dec 22, 2011 2:18 AM UTC
    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.
    >
    >      
    > ----------     
    Translate
    1-Visitor
    Dec 22, 2011 2:50 AM UTC
    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!"




    Translate
    cleccese1-VisitorAuthor
    1-Visitor
    Dec 22, 2011 4:33 AM UTC

    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"/">


    Translate
    cleccese1-VisitorAuthor
    1-Visitor
    Dec 22, 2011 5:33 AM UTC

    I'm doing something wrong...


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


    Page 10/(11 blank)


    hmmm

    Translate
    1-Visitor
    Dec 22, 2011 5:40 AM UTC
    Be sure to increment nextpageblankct in every page model where folioct is incremented, including blank pages.


    Translate
    cleccese1-VisitorAuthor
    1-Visitor
    Dec 22, 2011 6:56 AM UTC

    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

    Translate
    1-Visitor
    Dec 22, 2011 7:00 PM UTC
    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

    Translate
    cleccese1-VisitorAuthor
    1-Visitor
    Dec 23, 2011 6:37 PM UTC

    Thanks again, Suzanne! Very much appreciated.

    Translate