Vfind

See Also: Find, Found global indicator

Purpose

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.

Syntax

vfind table_number index_number mode

Argument Explanation

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).

What It Does

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.

Notes