× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Depending on what you want the program to be able to do, I.e. Is the user able to delete more than one line at a time? ...

If the user "deletes" the last line of the subfile, clear all the fields and update the subfile.

If the "deleted" line isn't the last line of the subfield:

Assuming the first deleted line is at line N, the option field is named option and you have a constant defined and named DELETE:
- starting at line N+1, read the subfile to the end of data and if option <> DELETE, copy the data to an array data structure.
- for the number of records written; chain to subfile starting at line N, move values from array data structure to subfile, and update subfile.
- after there is no more data in the array data structure; starting at the next line of the subfile, chain, clear fields, and update.
- repeat for the number of lines that were deleted.


-----Original Message-----
From: Booth Martin <booth@xxxxxxxxxxxx>
Sender: "RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx>Date: Sun, 6 Sep 2015 20:05:12
To: RPG programming on the IBM i (AS/400 and iSeries)<rpg400-l@xxxxxxxxxxxx>
Reply-To: "RPG programming on the IBM i \(AS/400 and iSeries\)"
<rpg400-l@xxxxxxxxxxxx>
Subject: Re: Delete a record of SFL using the operation code DELETE

SFLSIZ(12) = SFLPAG(12). Do you really mean you want to delete line #
12 of the subfile? or do you intend to allow users to delete line(s) 1
thru 12?

I wonder if it would be easier to load the data into a 12-element array
and then load the subfile from the array? Then, when a user deletes or
changes a line of the subfile, you have the program clear or change the
corresponding line in the array. Then, just clear the subfile and
reload the subfile from the newer information in the array.

On 9/6/2015 6:22 AM, Mustapha Alhiane wrote:
Hello,

How to delete the last record of SFL using the operation code DELETE .

More details (if there is a need):

*DDS Format :*
* ------------------------------------------------------------- *
* Format of SFL * *
------------------------------------------------------------- *
A R £1SFL SFL A £1OPT
1A B 9 2DSPATR(UL) A
VALUES(' ' '1' '2' '3' '4' '5') A £1CODA 3A O
9 4TEXT('Type de contrôle') A £1CODB 3A O
9 8TEXT('Code
anomalie') A £1B7NB 2Y 0O 9 12TEXT('Numéro
de séquence') A £1G3TX 40A O 9 15TEXT('Libellé de
l''anomalie') A £1L8ST 1A O 9 56TEXT('Indicateur
de présence') A £1MZST 1A O 9 60TEXT('Présence de
commentaire') A £1L7ST 1A O 9 64TEXT('Indicateur
de blocage') A £1M0ST 1A O 9 68TEXT('Indicateur
de saisie') A £1Z2TX 3A O 9 71TEXT('Code écran
programme')
A* ------------------------------------------------------------- *
A* Format CTL of SFL * A*
------------------------------------------------------------- *
A R £1CTL SFLCTL(£1SFL)
A SFLSIZ(0012)
A SFLPAG(0012)
A ROLLUP(95)
A ROLLDOWN(96)
A CA03(03 'Fin de travail')
A OVERLAY
A 92
SFLDSP
A N01 SFLDSPCTL
A 01 SFLCLR





*RPG => Déclaration FILE*
FMAINT01£CF E WORKSTN
* NUMREC = position cursor
F
NUMRECKSFILE £1SFL


Sincerlly,
Stéphane.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.