Skip to main content
QuintinSeegers
Legend
Nov 6, 2022 10:49 PM UTC
Answered

Limit Element to first or last (FM2022)

In one of our elements, CELLTEXT, we have the following General Rule (<TEXT> | Emphasis | BulletList | NumList | Action | Highlight)*. Another element, SLIDE, can appear only appear once, either as the first element within CELLTEXT before those in the General Rule, or the last element after those in the General Rule.

 

I can change the General Rule to be Slide?,  (<TEXT> | Emphasis | BulletList | NumList | Action | Highlight)* so it can appear first, or  (<TEXT> | Emphasis | BulletList | NumList | Action | Highlight)*, Slide? so it can appears last. Is there a way to combine these into a single General Rule?

    This topic is closed to new replies. Start a new post to keep the conversation going.
    QuintinSeegers
    QuintinSeegersCorrect answer
    Legend
    Nov 7, 2022 12:39 AM UTC

    I've managed to solve it - I'd forgotten about using &, meaning the elements can appear in any order. By having the General Rule as Slide? & (<TEXT> | Emphasis | BulletList | NumList | Action | Highlight)*, the Slide element can either preceed or follow those elements in parenthesis.

    1 reply

    QuintinSeegers
    QuintinSeegersAuthorCorrect answer
    Legend
    Nov 7, 2022 12:39 AM UTC

    I've managed to solve it - I'd forgotten about using &, meaning the elements can appear in any order. By having the General Rule as Slide? & (<TEXT> | Emphasis | BulletList | NumList | Action | Highlight)*, the Slide element can either preceed or follow those elements in parenthesis.

    Translate