See Also: Find, Found global indicator
To provide find commands in programs whose parameters can be changed by users at run time. This command is usually not used when working with Data Dictionaries.
vfind table_number index_number mode
table_number The number of the table to find records from.
Index_number The number of the index to use to find records.
Mode The find mode. It may be any of the following names or numbers: lt (0), le (1), eq (2), ge (3), or gt (4).
The vfind command is useful for programs that need to perform finds where the table, index and mode are to be defined at runtime. Often, this information is provided through parameters passed to a procedure or function.
The found predefined indicator is set to return the result of the find operation.
Procedure WriteRecords Handle hTable Integer iIndex Integer iCount
Integer iCount
for iCounter from 1 to iCount
vfind hTable iIndex GT
// found indicator can be evaluated within parentheses
If not (Found) ;
Procedure_Return
Send WriteData
Loop
End_Procedure
This example shows how a procedure is passed a file and index to be used for record finding. It also shows how the found indicator is tested after each find to determine if the find was successful.
Like the other database commands, vfind requires the database table it addresses to be open.
Records found using the vfind command do not affect records or information within a Data Dictionary Object (DDO). If you want your DDO to "know" about a record found with the vfind command you must send the message request_assign to the DDO.