Difference: PUSHPOPILFStatements (17 vs. 18)

Revision 182008-10-06 - SteveFrizzell

Line: 1 to 1
 
META TOPICPARENT name="APPX500Features"

PUSH & POP ILF Statements

Line: 58 to 58
 (2) Application ID (3) File Name, field name, or predefined field (4) Occurrence (constant/index)
Changed:
<
<
(5) Data item type (FIELD, RECORD, DEFAULT FIELD, DEFAULT RECORD, ORIGINAL FIELD, ORIGINAL RECORD)
>
>
(5) Data item type (FIELD, RECORD)
 

The POP statement is used to pop (retrieve) a value that was saved with a PUSH statement.

Line: 67 to 67
  The stack has the internal structure of a LIFO list, i.e. the last value pushed onto the stack for a field or record is the first value popped from the stack. There is no predefined limit as to how many field or record values may be pushed onto a stack.
Changed:
<
<
You may execute a POP statement for a specific field or file more than once.  Each time that you execute a POP statement, the value from the "top" of the stack of the referenced field or record is saved as the current value of the referenced field or record, the value is removed from the stack, and the True/False indicator is set.

The POP statement sets the True/False indicator.  If the stack for the referenced field or file contains a value, then the stack is popped and the next level of the true/false statsu indicator is set to T (true).  If the stack is empty, then the referenced field is set to its default value and the next level of the true/false indicator is set to F (false).

>
>
You may execute a POP statement for a specific field or file more than once.  Each time that you execute a POP statement, the value from the "top" of the stack of the referenced field or record is saved as the current value of the referenced field or record and the value is removed from the stack.  The POP statement also sets the True/False indicator.  If the stack for the referenced field or file contains a value, then the stack is popped and the next level of the true/false statsu indicator is set to T (true).  If the stack is empty, then the referenced field is set to its default value and the next level of the true/false indicator is set to F (false).
  Predefined fields may be referenced by a PUSH or POP statement. However, it is invalid to use the PUSH or POP statement for predefined fields that are non-modifiable.

The scope of a stack is the same as the scope of the associated field or file.  For example, if the scope of the referenced field is RELATED, then the scope of the associated stack will also be RELATED.

Deleted:
<
<
The Data Item Type specification is used to specify either FIELD or RECORD, and load/retrieve accordingly. Scanning on the TYPE field displays six possible values (FIELD, DEFAULT FIELD, ORIGINAL FIELD, RECORD, DEFAULT RECORD, ORIGINAL RECORD), apparently because the structure of the statement was taken from the STORE/RESTORE statements. However, it is important to note that there is only one stack for each FIELD, and one for each RECORD; therefore specifying DEFAULT FIELD or ORIGINAL FIELD is no different than specifying FIELD. Note, though, that an error will occur if you specify ORIGINAL FIELD on something other than the Process Control File.

The POP statement retrieves values in the reverse order that they were PUSHED, i.e. a LIFO function, and returns a TRUE flag if a value was successfully POPped, and a FALSE flag if the stack was empty. There is no automatic way to empty a stack, other than to repeat the POP statement in a loop until it returns a FALSE.

 When a POP statement references a field with an occurrence, the next value from the stack is popped into the specified occurrence of the reference field.

A sub-string field and a synonym field will each have their own stack since they have field names that are distinct from the field that they are derived from.

Line: 94 to 88
 

One use for PUSH and POP is to load virtual keystrokes (user options) into a stack, and have them executed automatically and sequentially. See the section on SELECT below for an example of this usage.

Added:
>
>

Issues:

  1. The Data Item Type specification of the POP statement should only allow two options,  FIELD and RECORD.  The currently implementation of the statement also allows DEFAULT FIELD and ORIGINAL FIELD to be specified.  Both are treated the same as if FIELD was specified.  DEFAULT RECORD and ORIGINAL RECORD are also allowed and are treated as if RECORD was specified.  Application designers should always specifiy either FIELD or RECORD on a POP statement.  Do not specify DEFAULT FIELD, ORIGINAL FIELD, DEFAULT RECORD, or ORIGINAL RECORD on the POP statement.   These options may not be supported in a future release.
 

Comments:

Read what other users have said about this page or add your own comments.
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback