Dataset.Locate |
Top Previous Next |
Syntax function Dataset.Locate(ADataset: pointer; KeyFields: string; KeyValues: array; Options: integer): boolean
Alternative Names
Description Attempts to locate a row in dataset ADataset, returns TRUE if successful, FALSE otherwise. KeyFields holds a semicolon-separated list of field names to use, while KeyValues is an array with the values that will be matched against. You can also pass a single value instead of an array.
See also
Example execute udsblock() as declare variable resultbool boolean; begin /* create the data set */ select employeeid, emp_name, salary, bonus_perc from test_data order by employeeid as dataset mydata; try /* attempt to locate specific employee */ resultbool = Dataset.Locate(mydata, 'employeeid', 539999, 0);
/* attempt to locate employees with name and bonus percentage */ valarray = Array.Create('Harry', 11); resultbool = Dataset.Locate(mydata, 'emp_name;bonus_perc', valarray, 0); finally Dataset.Close(mydata); end end |