I would only add a couple things to what Donald said:

You should set on the SFLNXTCHG attribute between every READC and UPDATE of
the subfile.  This ensures that if there are errors, and you re-display the
subfile for corrections, that all records keyed into before and after will
be retrieved again on the next READC loop.

Also, are you loading the subfile with empty records yourself with the
WRITE opcode?  or are you using the SFLINZ and SFLRNA keywords?

If it's WRITE, you might investigate the SFLINZ and SFLRNA keywords.
Using thesem, the OS will initialize your subfile with empty, non-active
records (number of records specified by SFLSIZE).   as the user keys into
them, they become 'active' for the READC opcode.

If your program needs any hidden fields with values in the subfile at
intialization time, it would't work, but if not, it's a quick and clean way
of getting empty records out to the subfile.



----original message-----
I have lots of code that uses SFLNXTCHG and READC.  I can send you an
example program if you like.

In answer to your other questions, yes, you would probably leave SFLNXTCHG
off when loading an initial page of empty subfile records.  Any changes to
those records will be automatically detected by READC.

Regarding MDT, no, you don't need it if you're using SFLNXTCHG.  In fact,
MDT has a limitation that the record with the MDT attribute must be
displayed on the screen for READC to detect the record.  SFLNXTCHG does not
have this limitation.

Hope that helps.

Donald R. Fisher, III
Project Manager
The Roomstore Furniture Company
(804) 784-7600 extension 2124

Does anyone have example code or code for a short working demonstration
utilizing READC & SFLNXTCHG? <clip>
when I write out the initial first page of empty subfile records, would I
set the indicator for SFLNXTCHG off?
Do I have to specify an MDT attribute for the subfile?  Or does READC
changed subfile records without MDT attributes?

This thread ...


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