• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Restart auto numbering when n=x

Explorer ,
Nov 23, 2024 Nov 23, 2024

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

Views

123

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 24, 2024 Nov 24, 2024

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 24, 2024 Nov 24, 2024

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 24, 2024 Nov 24, 2024

Copy link to clipboard

Copied

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

image.png

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)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 24, 2024 Nov 24, 2024

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 25, 2024 Nov 25, 2024

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).

 

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 25, 2024 Nov 25, 2024

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 25, 2024 Nov 25, 2024

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. 

 

 

 

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 25, 2024 Nov 25, 2024

Copy link to clipboard

Copied

LATEST

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

QuintinSeegers_Personal_0-1732570935817.png

 

instead of expanded

QuintinSeegers_Personal_1-1732570960267.png

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 24, 2024 Nov 24, 2024

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 24, 2024 Nov 24, 2024

Copy link to clipboard

Copied

All good, @Bob_Niland . I thought I'd clarify as I've learned not to assume :-).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines