On Mon, Jan 6, 2020 at 7:52 PM James H. H. Lampert
<jamesl@xxxxxxxxxxxxxxxxx> wrote:

if it's showing up on generated source, then the source
generator is flawed, and needs to be corrected. But if I don't know
where the bad sequence number is, then I don't know where to put the
correction.

If you need to know where the bad sequence number is, then I would
suggest that maybe you should be changing your approach to source
generation. How is it that you need to know "where to put" the
correction? Why isn't every single line being generated either

1. Always just incrementing from the sequence number of the previous line, or

2. Always just zero, and then some postprocessing routine reassigns
all the sequence numbers in one go

???

If your answer is that you're trying to use approach 1, but "missed a
spot" somewhere (forgot to increment the sequence number at some
point), then you'd do well to look into writing a single routine which
handles ALL your writing to disk (i.e. if the line of code you're
generating doesn't use this routine, then that line simply never gets
written). I use "routine" here in the general sense; not recommending
RPG subroutines. (Though subroutines would still be better than having
a `seqno += 1;` sprinkled throughout the mainline.)

If you have a lot of generators out there already, and don't want to
retrofit all of them to use this new routine, then go with approach 2.
It's very straightforward (it's arguably even simpler than following
Rob's already-simple outline for *finding* the error(s) in the first
place) and can be tacked on without having to futz internally with any
existing generator code.

John Y.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.