In this action based approach, notes look upward for seeding section numbering.
Code
if($IsTop) {
$Section="";
} else {
$Section = $Section(parent);
if ($Section) {$Section+=". ";}
$Section += $SiblingOrder;
};
Logic
- If you are the top, you do not have a $Section number.
- Otherwise:
- Start by getting the parent’s $Section value
- If that value is not empty, add a period
- Then add your sibling number and set as $Section
Pros and Cons
- GOOD:
- Stays up to date as the TBX is reorganised
- Simple
- Individual notes can choose to behave differently
- BAD:
- Can fall a few seconds behind setting $Section in big/complex TBXs.
- Might be a bad choice for huge outlines (thousands of elements)
- If individual notes behave differently today, that might not be wanted tomorrow.