Pop.Select subroutine

Restores a previously active select list, saved by the Push.Select subroutine, into Cursor 0.

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

The Pop.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
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
 
 
  • guides/programming/programmers_reference_manual/pop_select.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1