Thank you for your response! I will try your suggestion and get back to you as soon as I can.

Thanks again!
Garrett

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Booth Martin
Sent: Wednesday, September 30, 2015 4:02 PM
To: RPG programming on the IBM i (AS/400 and iSeries) <rpg400-l@xxxxxxxxxxxx>
Subject: Re: Subfile not working correctly after deletion of record

When you fill the subfile after a delete you would need to re-set the marker for the data file at the first record of the subfile.

In other words, I believe you will want to save the file's key for RRN
#1 and then use that SavedKey as:
setll SavedKey FILE;
at the end of your delete routine. This will reset your reads to begin at the same place and should refresh your display, minus the deleted record(s).



On 9/30/2015 3:09 PM, Garrett Rutherford wrote:
Hello, I am a real Noobie! I have been spending my spare time trying to learn how to program on the AS/400. I have purchased several books, printed tons of IBM Redbook documents, and now, I am hoping someone here at this forum can point out my error.

I have been writing and rewriting an example from one of the books I purchased, "Subfiles in Free-Format RPG" BY Kevin Vandever. specifically example sfl006rg, sfl006df. I have been modifying it for my purposes and once i have a working copy, I would delete it and rewrite it taking a different approach hoping the repetition would sink in. This is a simple program that, when completed, would allow you to add display, delete, and edit records. Each approach I would take in rewriting it would be to get the basic view up and going and then add 1 function at a time. My last approach was adding the delete function and for the life of my I cant figure out why its not working. I have printed the sample code out and my own code and have looked at them step by step but because of some of the name changes, I have become completely lost. So, hopefully someone her will have a laugh and show me what I am missing.

Problem: After I delete a record, the subfile doesn't show all the records in the file, minus the one deleted, only a few of them and the subfile will not load any records by pressing page-up or page-down. But, if I add a new record, the subfile will start working again, showing all records.

My mind is jumbled and I need someone to point me in the right direction, Thanks for your time!

Garrett


This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 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.