Toggles automatic opening of a structural index file
SET AUTOPEN ON | off | (<lOnOff>)
ON | off | (<lOnOff>) The option toggles if a structural index file is automatically opened with the USE command. With ON or .T. (true), an index file is automatically opened. OFF or .F. (false) switch this mode off.
Some replaceable database drivers support automatic opening of index files with the USE command when the index file has the same file name as the database file (without extension). An example is the DBFCDX driver. SET AUTOPEN toggles this behavior.
When SET AUTOPEN is set to ON, which is the default, the USE command automatically opens an index file having the same name as the database file and the file extension returned from OrdBagExt().
If an index file is automatically opened, a controlling index is not activated. The default index order is zero, i.e. records are accessible in physical order in the work area. To select a controlling index, call OrdSetFocus() or use SET AUTORDER for a default controlling index
// The example demonstrates the effect of SET AUTOPEN with the // DBFCDX driver. REQUEST DBFCDX PROCEDURE Main RddSetDefault( "DBFCDX" ) SET AUTOPEN OFF USE Customer INDEX ON CustID TAG ID TO Customer INDEX ON Upper(LastName+FirstName) TAG Name TO Customer USE Customer ? OrdCount(), OrdKey() // result: 0 "" SET AUTOPEN ON USE Customer ? OrdCount(), OrdKey() // result: 2 "" SET AUTORDER TO 1 USE Customer ? OrdCount(), OrdKey() // result: 2 CUSTID ? Ordkey( 2 ) // result: Upper(LastName+FirstName) USE RETURN
OrdListAdd(), OrdSetFocus(), Set(), SET AUTORDER, SET AUTOSHARE, USE