Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Index.Open subroutine ====== ==== Description ==== The Index.Open subroutine is an alternative to the [[open|Open statement]] to open an OpenInsight table. In spite of its name, Index.Open can open any OpenInsight table. ==== Syntax ==== **Index.Open**(//OI_table_name, filevar//) ==== Parameters ==== The Index.Open subroutine has the following parameters: ^Parameter^Description^ |//OI_table_name//|The name of the OpenInsight table to be open.| |//filevar//|The variable to contain the file variable information for the opened table, after a successful Index.Open. If Index.Open is not able to open the table, filevar will be [[assigned|unassigned]].|| ==== Returns ==== If successful, filevar will contain the file variable corresponding to OI_table_name. Use the [[assigned|assigned() function]] to test for success or failure of Index.Open. See example below. See also [[open|Open statement]] ==== Example ==== <code> /* reads rows in CUSTOMERS table, displaying the last name of each customer */ declare subroutine index.open declare function msg index.open ( 'CUSTOMERS', customer_filevar) if assigned(customer_filevar) then index.open ('DICT.CUSTOMERS', @dict) if assigned(@dict) then select customer_filevar done = 0 loop readnext @id else done = 1 until done read @record from customer_filevar, @ID then /* process record - can use {} */ retval = msg (@window , 'Last name = ' : {LNAME}) end repeat end end </code> guides/programming/programmers_reference_manual/index.open.txt Last modified: 2024/06/19 20:20by 127.0.0.1