The 4D stack stores a current record and lasts until the method ends. The purpose of the stack is to keep the current record while performning query-related commands. Use the 4D stack commands POP RECORD and PUSH RECORD to place a current record on the stack.
Common usage of the stack commands looks like this:
PUSH RECORD ([table]) ` Places the current record on the stack
` Execute several queries with [table]
POP RECORD ([table]) ` Restores the current record from the stack
The stack can hold more than one record, where the record that was placed last will be recalled first (LIFO stack).