Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

As a rule, MFS programmers do not need to concern themselves with these esoteric aspects of select list processing. In some cases -- for instance, in SI.MFS -- the MFS deliberately assumes control over specific tasks (in this case, returning sorted key lists). However, an MFS that does not concern the return of a sorted or reduced key list does not need to include logic for these tasks.

Simple (Latent) Select

In BASIC+, a simple SELECT statement  (not an extended SELECT ... BY statement) does not directly produce a list of record keys for processing. Instead, the SELECT statement simply initializes variables in the system, indicating that a select condition is active.

In addition, the SELECT is passed to the filing system so it can perform any filing system-specific activity to initialize a select condition.  A filing system SELECT call returns a select mode with three possible values in the RECORD argument:

Select Mode

Meaning

0

No select list is active (disable the select)

1

Latent file select

2

Latent index select

...

 If a select condition is active, subsequent BASIC+ READNEXT statements will return record keys until the file has been exhausted. If no select list is active, a subsequent BASIC+ READNEXT statement will fall through its ELSE branch.

...

READNEXT Direction

When a filing system READNEXT call is made, the status argument is used to pass to the filing system the direction of the READNEXT operation (ascending or descending). The filing system uses this direction in maintaining the select pointer. If the BASIC+ READNEXT operation designates the select list as descending, the select pointer is decremented with each filing system READNEXT operation, rather than being incremented for an ascending READNEXT.