How about something like this?
Define a 72-column output-only subfile field.
if the data is 72 characters or less, fine, just populate your subfile record.
If the data is longer than 72 characters, then scan backwards from column 68, looking for a blank column. Substring a subfile record up to that blank and cat an ellipsis. Then substring the rest of the field onto the next subfile record.
Perhaps right adjust that second record and non-display the selection field, as visual signals to the user?
For this application you might want to add a scroll bar, in case the record splits across two panels, thus allowing a user to easily pop up or down a line or so.

As a side note, if there is only one selection option available to the user then you can leave off the selection field and:
SFLSNGCHC allows picking with a mouse click or arrow key-space bar and no selection field, thus saving 2 or 3 columns.
SFLSNGCHC(*SLTIND) puts a radio button in place of the Selection field.****
Here is a screen shot.

On 9/12/2013 3:58 PM, James H. H. Lampert wrote:
I've got a situation where I'm using a subfile on an 80-column screen as
a table/schema selection prompt in my JDBCR4 project, where I'm listing
perhaps hundreds of items that will usually have names that will easily
fit in one line, but could theoretically have names up to 128 characters

Displaying the records all folded gives a funny-looking screen display
with lots of wasted space, but displaying them all truncated could leave
long names cut off.

Obviously, I could simply let the user switch between SFLFOLD and
SFLDROP for the entire screen, but I was wondering if there was an easy
way to selectively fold the records with long names, and drop the ones
with short names.

One thought that occurred to me would be to display the excess length on
a second subfile record with the selection column field suppressed. Has
anybody done anything like that? Is there an easier way to accomplish
the desired goal?


Return to Archive home page | Return to MIDRANGE.COM home page