Table of Contents

Push.Select subroutine

Description

Saves the currently active select list in Cursor 0 into four (4) variables. Cursor 0 is then available for program use. The select list can be restored using the Pop.Select subroutine.

Syntax

Push.Select(f1, f2, f3, f4)

Parameters

The Push.Select subroutine has the following parameters:

ParameterDescription
f1Reserved.
f2Contains the list of record keys in the active select list
f3Contains the file variable for the table referenced in the active select list.
f4Reserved

See Also

Pop.Select subroutine

Example

declare function Set_FSError

declare subroutine push.select, pop.select

 

open "CUSTOMERS" To customers_table else

  status = Set_FSError()

  return

end

 

open 'INVOICES' to invoices_table else

  status = Set_FSError()

  return

end

select customers_table

  

Done = 0

loop

ReadNext @ID else Done = 1

Until Done Do

read @RECORD From customers_table, @ID else

status = Set_FSError()

return

end

* processing logic here ...

GoSub PROCESS_CUSTOMER

Repeat

return 0

 

PROCESS_CUSTOMER:

   /* process the customer row */

   call push.select(f1, f2, f3, f4)

   gosub PROCESS_CUSTOMER_INVOICES

   call pop.select (f1, f2, f3, f4)

return

 

PROCESS_CUSTOMER_INVOICES:

   /* process the invoices for a customer   */

   /* can use cursor 0 to do SELECT and READNEXT */     

   /* for example, the SELECT below will not destroy the SELECT */

   /* on the CUSTOMERS table */

   select invoices_table

return