how to set seed value for ordered list items


Question

I tried to change the first item number in my ordered list and it began numbering very strangely. I tried to run a trace, but it didn't happen when I did a .IT ALL. What happened.

Answer

  Your coding was:

      :OL.
      .se @item# = &@item#. + 1
      :LI.I expect this to be Number 2.
      :LI.I expect this to be Number 3.
      :EOL.

  Your output was:

      6. I expect this to be Number 2.
      7. I expect this to be Number 3.

  The problem is that the :OL scans for residual text.  When it finds the .SE
  on the next line, it actually executes it more than once, which produces
  the strange numbers.  When you execute the trace it actually interprets
  each line independently and places comments between the :OL and the .SE, so
  the .SE only executes once.

  You can accomplish the same output by:

  1.  Adding a comment between the :OL. and the .SE

  2.  Explicitly setting the item number instead of incrementing it

Last updated: 93/08/24 16:25:23

Previous Contents Next