====== Simple (Latent) Select ====== In BASIC+, a simple [[select|SELECT statement]] (not an extended [[select_by|SELECT ... BY statement]]) does not directly produce a list of record keys for processing. Instead, the [[select_|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|READNEXT statements]] will return record keys until the file has been exhausted. If no select list is active, a subsequent BASIC+ [[readnext|READNEXT statement]] will fall through its ELSE branch. The select mode value is available to a BASIC+ program in the system variable [[cursors_and_select_lists|@LIST.ACTIVE]]. If the SELECT call fails for any reason, the RECORD argument is passed back false, indicating to the system that no select list is active. [[cursors_and_select_lists|@LIST.ACTIVE]] will also be set to false. This BASIC+ program fragment illustrates the typical flow of a simple SELECT: SELECT FILE ; * establish "latent" select DONE = 0 LOOP READNEXT @ID ELSE DONE = 1 UNTIL DONE DO /* process the row */ REPEAT