BACK

Display window records in reverse sequence

Source

 

CALL BACK USING Window-id
CALL BACKOFF
CALL BACKON

Parameters

Window-id

The two character id of the window to be displayed with index directions reversed.

Copybooks

None

 

Other Requirements

None

Purpose

This call is used in place of a normal ENTER WINDOW statement, where the window is required to display records in reverse sequence, starting from the top of the window. e.g. a window that has a record indexed on order number, may want to start with the most recent order at the top of the screen and for the orders to get older as you page down the list.

If further windows need to be called from within the routines section, then calls to BACKOFF and BACKON need to be called to suppress and reactivate the index inversion, e.g. for UF1 Pop-Ups.

BACK itself should NEVER be called recursively, otherwise the link to the real data access method will get lost and you will not be able to read the database again until $BASVC is re-loaded. In such cases, use a flag to prevent the re-entrant call, and use a normal enter window statement; by omitting BACKON/OFF calls, it should naturally behave as required.

Exceptions

As per standard speedbase ENTER window command.

Example

CALL BACK USING W1

The W1 window will be displayed and the records displayed in reverse sequence to the standard index, i.e. it has the same effect as doing <F6> followed by <Page Up>, except that rather displaying the records from the bottom of the window upwards, it displays them from the top downwards.

You MUST have a CALL BACKOFF before invoking any new windows from the routines section of the window invoked via the call to BACK (i.e. from within window W1), followed by a CALL BACKON when the new window has terminated.

Global 3000 Example

This routine is used in PM420B (SOP Order Enquiry) to display the sales orders in latest first sequence. The routine is called indirectly by specifying "B" as the direction parameter of a call to UFUN.