Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
@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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
@Dave Creamer of IDEAS The Element content is all on the same level, not sub-levels, so the Level will always = 1.
Copy link to clipboard
Copied
Sorry, I meant you could use an if/else statement to restart the list via attributes. My arrow was in the wrong place--it should have pointed to the first line (and second to last line).
Copy link to clipboard
Copied
That means I would need to create an attribute to manually reset the counter. As Attributes are not always visible in the Structure View, I've opted for a 'dummy' element that resets the counter to 1. It's not the ideal solution I was hoping for, as it still means I have to manually insert this 'dummy' element, and if any of the preceding numbering changes, I'd have to move this 'dummy' element to the correct place.
Copy link to clipboard
Copied
The Structure View has an indicator to show attributes. I would think all users would be familiar with it, or at least trained to recognize it. Also, if it is a required attribute, the setting can make the dialog box open upon inserting the element. I'm not following on the "dummy" element. The attribute could be on regular Item element.
Copy link to clipboard
Copied
When adding the element, yes the dialogue pops up for the attributes, so they can be set when the element is inserted. However, I usually have the elements collapsed
instead of expanded
unless I'm specifically changing the attributes for that element.
What I mean by a 'dummy' element, is an element with <EMPTY> as its General Rule that is only used to apply EDD Rules but don't contain any content itself.
Copy link to clipboard
Copied
QS: I should have specified. This is Structured FM.
Actually, that was implicit from the "context rule".
I was just considering how the unstruc considerations might inform challenges in struct (or script). Complexities lurk, particularly as content is added and deleted.
Copy link to clipboard
Copied
All good, @Bob_Niland . I thought I'd clarify as I've learned not to assume :-).