RPGILE, How can i refresh thefields of display file without moving *blanks to every field....
how can i Do it?
Looking for relevant AS/400 Whitepapers? Visit the Search400.com Research Library.
Kevleemor | Feb 19 2008 3:51PM GMT
Rashif, if you want to make sure that every field is set to *blanks/*zero you should use the CLEAR opcode. If you want to set every field to its “Initialization Value” ie *INZSR subroutine values, or INZ data description values you should use the RESET opcode.
Kevin
Sloopy | Feb 20 2008 9:12AM GMT
Create a data structure to contain all the fields from the screen. Then use a single CLEAR operation to the data structure name. This will clear character fields to blanks and numeric fields to zero.
Also, when we have a screen that contains fields which map to a single database record (e.g. D#CUST in the display file comes from CSCUST from the Customer file, etc.), we create a named externally-described data structure for the Customer record, and another exactly the same for the screen, except with a prefix of D# replacing the first 2 characters of each field. Then to load the screen we just EVAL the display structure from the Customer record.