Cicode Programming Reference > Cicode Function Categories > Device Functions Introduction > DevFind


Searches a device for a record that contains specified data in a specified field. The search starts at the current record and continues forward until the matched data is found or the end of the database is reached. If the file has a keyed index, an indexed search is used.


DevFind(hDev, sFind, sField)


The device handle, returned from the DevOpen() function. The device handle identifies the table where all data on the associated device is stored.


The data to find in sField, as a string.

For SQL devices: The DevFind() function can distinguish between numbers, strings, and dates, so you do not need to enclose the data in quote marks. Dates and times need to be in the correct format:


The field name to match.

Return Value

0 (zero) if successful, otherwise an error is returned.

Related Functions

DevOpen, DevSeek


! Find the Ice cream recipe.
DevNotFount=DevFind(hDev,"Ice cream","Recipe");
IF DevNotFount=0 THEN
! Get the recipe values.
Prompt("Ice cream not found");

See Also

Device Functions