Where I GRALLY initialized?
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of dale janus
Sent: Tuesday, June 25, 2013 6:37 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: problem with hidden field in subfile
I am missing something with a hidden field in a subfile. This in an enhancement to an old program, so it is fixed format with a mix of coding styles.
The application displays a subfile screen with about 15 records. The user chooses one by cursor position and presses enter.
Initially, all the program needed was the field GRDESC. Now I need a second field, GRALLY.
I added GRALLY , a hidden field, as seen in the A specs. The field will be either blank or Y.
When I read the subfile, the last record in GRDREC has the Y in GRALLY.
My rpg code chains to the subfile (in this case record #1). It retrieves the correct GRDESC and the corresponding field GRALLY should be blank.
Instead it is keeping the value Y from the last record read from GRDREC when I filled the subfile.
When debugging, each read of GRDREC that loads the subfile shows the correct value for each record. It's on the subsequent read of the subfile control I have a problem. Somehow my read only gets the first field, not the hidden field.
A R SFDRM3 SFL
A TEXT('subfile for quote')
A*
A GRDESC R O 1 2REFFLD(GRDREC/GRDESC SPC5LI
A GRALLY R H REFFLD(GRDREC/GRALLY SPC5LI
C EXFMT SFDRMCT3
C*
C WINCUR IFGT 0
C WINCUR CHAIN SFDRM3 99
C MOVE GRDESC QTDESC
C eval wkaloy = GRALLY
I don't think the problem is in the control record, but here it is:
A R SFDRMCT3 SFLCTL(SFDRM3)
A TEXT('subfile control quote
A N89 ROLLUP(86 'roll up')
A N88 ROLLDOWN(87 'roll down')
A INDTXT(80 'subfile display'
A INDTXT(81 'subfile control
A INDTXT(82 'initialize subfi
A INDTXT(83 'delete subfile')
A INDTXT(84 'clear subfile')
A INDTXT(85 'subfile end')
A OVERLAY
A SFLCSRRRN(&WINCUR)
A 80 SFLDSP
A 81 SFLDSPCTL
A 82 SFLINZ
A 83 SFLDLT
A 84 SFLCLR
A SFLSIZ(0040)
A SFLPAG(0010)
A 88 SFLMSG('Beginning of file h
A reached. Press reset.' 88)
A 89 SFLMSG('End of file has bee
A d. Press reset.' 89)
A WINDOW(10 3 13 40)
A WDWTITLE((*TEXT 'GRADE. PAG
A WINCUR 5S 0H
--
This is the RPG programming on the IBM i (AS/400 and 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.