Skip to main content
Inspiring
November 24, 2024
Question

Restart auto numbering when n=x

  • November 24, 2024
  • 1 reply
  • 703 views

Is it possible to have a context rule that resets the auto numbering after a certain value, e.g. if n=31, reset n=1. 

 

*Structured FM17

It can happen that several subsequent instances of the same Element uses the same number, e.g. 5. I use an Attribute (Counter) to specify whether the counter remains the same or is incremented. I don't now when the counter will reach 31, so I need to have it automatically restart at 1 if the next <n> value is 32.

 

*Edited to add additional information/context

    This topic has been closed for replies.

    1 reply

    Bob_Niland
    Community Expert
    Community Expert
    November 25, 2024

    In unstructured FM, this is typically done by having two different ¶formats available, perhaps named:
    Ordered[1]
    and
    Ordered[2+]

    Manually, the author would look for the first instance where the latter results in a display of:
    31. …content…
    then apply Ordered[2+], then look for the next instance of 31.

    Assuming a script has access to rendered content, it would be important to to this in order of document appearance, do the equivalent of an Apply, then start over, until no instances are found.

    Whether done manually or via script, any ordered content added or deleted later requires the whole process to be run all over again, or there is going to be disrupted list numbering. Whether that could also be automated isn't something I have a guess on.

    Inspiring
    November 25, 2024

    @Bob_Niland , I should have specified. This is Structured FM. Basically I have a Element that numbers the paragraphs from 1 onwards, but I need the numbering to restart at 1 once the counter <n> reaches 31, i.e. the next instance of the Element should start the numbering at 1 again. I might have to play around with Attributes to find a way to 'fundge' it - I'm not familiar with script and don't really want to delve into that at this point.

    Dave Creamer of IDEAS
    Community Expert
    Community Expert
    November 25, 2024

    This is part of an EDD that I did a while ago:

    I've never tried it but you could see if you can use an Else, if level is: 32 statement.

     

     

    David Creamer: Community Expert (ACI and ACE 1995-2023)