Index.Open subroutine

The Index.Open subroutine is an alternative to the Open statement to open an OpenInsight table. In spite of its name, Index.Open can open any OpenInsight table.

Index.Open(OI_table_name, filevar)

The Index.Open subroutine has the following parameters:

ParameterDescription
OI_table_nameThe name of the OpenInsight table to be open.
filevarThe 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 unassigned.

If successful, filevar will contain the file variable corresponding to OI_table_name. Use the assigned() function to test for success or failure of Index.Open. See example below. See also

Open statement

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