UPDATE (UPDATE A RECORD)


In Example 11.7, the subfile DISPLIST is read with the READC operation (lines 4 and 11). The subfile records are processed (lines 6 to 8), and then the subfile record is updated with the UPDATE operation (line 9). The logic of this example is as follows:

  1. Display the subfile control record and the subfile.

  2. Read the first changed subfile record.

  3. If there are changed records, process the first record.

  4. Update the record (line 9).

  5. Read the next changed subfile record (line 10).

  6. Branch to the top of the DO loop (line 12 branch to line 5).

Example 11.7: Update subfile record.

start example
 .....FFileName++IFEASFRlen+LKeylnKFDevice+.Functions++++++++++++++++++++++++++++ 0001 FCUSTINQ   CF   E             WORKSTN SFile(DispList : rrn) .....CSRn01Factor1+++++++OpCode(ex)Factor2+++++++Result++++++++Len++DcHiLoEq.... 0002 C                   EXFMT     SFLCTL 0003 C                   ReadC     DispList                               75 0004 C                   Eval      EndOfSFL = *IN75 0005 C                   Dow       EndOfSFL = *OFF 0006 C     Option        casEQ     '1'           Select 0007 C     Option        casEQ     '9'           Delete 0008 C                   ENDcs 0009 C                   Update    DispList 0010 C                   ReadC     DispList                               75 0011 C                   Eval      EndOfSFL = *IN75 0012 C                   endDo 
end example




The Modern RPG IV Language
The Modern RPG IV Language
ISBN: 1583470646
EAN: 2147483647
Year: 2003
Pages: 156
Authors: Robert Cozzi

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net