Can I set a tab the width of a given string?


Question

Can I set a tab the width of a given string? Right now I print the string, measure it, then set the tab based on the measurement of the string.

Answer

  Measure a string dynamically, put the width in a symbol, then use that
  symbol containing the width on the tab definition:

       .ti ^ 05
       .cm set a symbol for a text string
       .cm  and a trailing blank
       .se str = NAME:&$rb.
       .cm calc the width in pels of the string
       .se wid = &dh'&w'&str.
       .cm set a tab stop dynamically
       .tp 0 &wid.dh
       ^&str.^Katie

Last updated: 93/08/04 14:01:06

Previous Contents Next