× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



> Anyway, does anyone have a good way of parsing out the descriptions so
> that I can have the columns look good?  I thought I had an idea about an
>  hour ago, but I'm not getting anywhere now.  The max for a column in
> the  DDS is 20 per line, plus I'd like to use the blanks as the line
> separation  point.  Drawing a blank now, and I quit smoking over the
> weekend so I'm  not concentrating like I could I'm sure.  Any help would
> be appreciated.

Actually, what you need is technically called (at least in the world of
compiler construction) a "scanner," not a "parser." And it seems to me
that the path of least resistance is to do something like:

1. Determine the width of the field.
2. Let W = the minimum of the field width or 20 characters
3. Let Q$ = the field description
4. Find the last space in Q$ before or at W+1
5. Let H1 = the portion of Q$ before that space
6. Let Q$ = the portion of Q$ after that space
7. Find the last space in Q$ before or at W+1
8. Let H2 = the portion of Q$ before that space
9. Let H3 = the portion of Q$ after that space.

If H3 is more than W characters wide, or no space is found before W+2,
then add 1 to W, and go back to #3

If you are unable to find a space before W > 20, simply split the field
into 2 or 3 more-or-less equal parts.

That's just a rough sketch, and RPG isn't exactly the best language to
implement it in, but it should do the job.

--
JHHL



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-2024 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.