Re: First attempt of printing barcodes with groff

"Alexis (surryhill)" <[email protected]>
Newsgroups gmane.comp.printing.groff.general
Message-ID <72h2l757aotr5q7xuwfc7xeusgrw4cfucpmv33m2y4qqcepd6z@wqv7i5eklaz5>
Hello Oliver,

regarding your question 2. to avoid linebreaks I believe
the main issues are within the while loop:

  - leading blank space before \n+[mynum]
  - missing \c after \n+[mynum]
  - missing leading . before the \}

The following achieves what I think you are looking for:

.while (\n[mynum] < \n[@count]) \{
.       barcode 9876543210 \n[mynum]
\n+[mynum]\c
.\}

In addition I'd like to recommend the following minor
improvements—although not strictly necessary I think
they are good practice—as they have helped me avoid
pitfalls in the past:

  - adding a \ for line continuation to the opening curly brace
    on the while line
  - using nop to indent the \n+[mynum] line
  - decrementing the while loop counter in the while condition

.nr mynum \n[@count] 1
.while (\n-[mynum] > 0) \{\
.       barcode 9876543210 \n[mynum]
.       nop \n[mynum]\c
.\}

Hope this helps, and please do share your progress on barcodes,
I'm curious!


Best
Alexis


P.S.: I'm using groff built from latest the commit f42d6c6d2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.