|
Part of the problem of the changes is the issue of change and then rechange back to the original, and the need to refresh.. I still prefer the original values of a subfile row being saved as a hidden field/data structure in the subfile itself. Its just so much easier for so many needs, from refreshing to preventing long record locks, to data changed at another work station. --------------------------------- Booth Martin http://www.martinvt.com --------------------------------- -------Original Message------- From: RPG programming on the AS400 / iSeries Date: 08/12/05 16:53:36 To: RPG programming on the AS400 / iSeries Subject: RE: Force EOF in a Subfile > I'm not an expert, but my personal opinion is that READC and its > associated keywords are somwhere between an abomination and a crime > against nature. That's a little strong :) > In 12 years of RPG I think I've used READC four or five times for very > simple data entry, never in "real" apps. I use it to determine if the user has made any changes to the subfile, but I don't use it for actually reading records for validation or saving to a file. Since most of my subfile programs involve allowing the user to change a whole list of items, I don't typically want ENTER to advance to the next screen of the program. That would make it impossible to put updated totals on the screen or warning messages, since the program would advance and you wouldn't see them. Instead, I typically have the user make changes, and then it displays the screen again. Only when the user doesn't make any changes does it advance to the next screen. And the only way that I know of to determine if any subfile records have changed is by using the READC opcode. When I validate the records before updating the file or whatever I'm intending to do, I always chain to every record. (If I used SFLNXTCHG it would prevent me from detecting if something has changed, and if I only used READC, I'd only get the records that changed since the LAST time someone hit enter instead of all of the changes since the subfile was loaded... so reading every single record works the best for me.) > However....it's in the language and if you use it correctly, it works. > I still think it's a waste of time learning how to do it. Is there another way to determine if something has changed in a subfile? For some reason (and I can't remember why at this point, I've been doing things this way forever) I don't think the CHANGE keyword works with a subfile. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. .
As an Amazon Associate we earn from qualifying purchases.
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.