Topic complex |
Table functions |
Function |
findrec() |
Short |
Searches a record via an index |
Syntax |
FindRec(db : INTEGER; SearchStr : STRING [;Index[;Mode : INTEGER]]) : INTEGER |
Parameter |
db : table handle from OpenDB
SearchStr : searched information
index : index name or index number(>=0)
Mode : 0 (default) -> search for entry >= SearchStr; 1 -> search for entry = SearchStr
|
Return |
0 -> no record found, else recno(db)
|
See also: |
|
Description |
SearchStr has to be build adequate to the index description. Includes the component a comma it has to be clasped.
Examples:
index-desciption ="Name,Forename,Town"
SearchStr = "Schwalm,Till,Munich", "Lichtenberg,Franz,(Munich,Moosach)"
Are all information fetched by the user a parenthesis of all components is useful:
SearchStr:='('+s_Name+'),('+s_Forename+'),('+s_Town+')'
Is no index specified it is searched in the actual (via access justified) index . Points the access not to an index (but to a a number or mark) the error message "Illegal access" happens.
With mode 0 the smallest entry (with reference to the index order) is searched which is equal or bigger than the searched one. Is there no entry the biggest entry is searched which is equal or smaller than the searched one. Thus in this mode 0 is only returned if the table is completely empty.
However in mode 1 a value unequal 0 is only returned if an entry is found which accords in all components with the search.
|