• Subject: Re: subfile processing: SFLSIZ=SFLPAG (was: readc & sflnxtchg)
  • From: david.kahn@xxxxxxxxxxxxxxxxxx
  • Date: Tue, 16 Feb 1999 10:00:27 +0000

"Simon Coulter" <shc@flybynight.com.au> wrote:

>SFLSIZ=SLFPAG used when an unknown number of records may
>be requested by the user.  The programmer handles
>scrolling backwards and forwards.

I've always avoided this because of the difficulty of handling the case
where the user keys some selections and then scrolls backwards and forwards
through the subfile without pressing enter.

>SFLSIZ=SFLPAG*n where 'n' is the expected usual number of records.
>The programmer fills the subfile with the 'normal' number of records.
>Scrolling backward is handled by the OS.  Scrolling forward is handled
>by the OS until there are no more records in the SFL whereupon the
>program gets control and can add more records to the SFL.
>Useful when the total number of records requested is less than 9999

Hmm... maybe I'm making more work for myself than strictly necessary, but I
usually code to handle scrolling in both directions with the
SFLSIZ=SFLPAG*n method and including a position to and refresh using the
following logic.

Roll up is conditioned by the same indicator as SFLEND so that it is
enabled if SFLEND is off and disabled if it's on.

On first presentation load 1 or 2 pages with rolldown disabled and display
1st page.

On roll up load 1 or 2 further pages and display at the first record newly
loaded.

On position to, clear the subfile and reload from the first record matching
the request. If no exact match then position to the highest record less
than the request so the user can clearly see that there is no match. If the
lowest record in the file is shown disable roll down, otherwise enable roll
down.

On roll down, determine the first record to be displayed and treat as
position to.

On refresh, determine current record displayed and treat as position to.

If there's a possibility of the 9999 record count being exceeded, determine
an arbitrary number of pages to be loaded before treating the next roll up
request as a position to.

This works reasonably well for me in nearly all cases. Make one and test it
to destruction, and thereafter clone it. The only situatution it does not
handle well is, again, where the user makes selections and scrolls down
past the current beginning of the subfile, causing a reload; but it's not
nearly as evident as with SFLSIZ=SLFPAG. I notice that BRMS/400 also
suffers from this deficiency (it was originally written by a 3rd party)
whereas all true IBM programs handle this properly, but then they don't use
true subfile processing, I believe.

Some programmers cop out of this (including J.D. Edwards whose subfile
handling is not at all to my liking) by not allowing rolldown past the
record positioned to. The user must explicitly reposition - IMO this is
tacky.

The disappearing selections problem can be solved using arrays of "off the
subfile" active options and keys but it's messy. If anyone has a more
elegant solution I'd be enthusiastic to hear it.

Dave Kahn, ABB Steward Ltd.


+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.