keep = indexID(#bid) DEFindex #bid,iid FINDxxx #bid,... DEFindeb #bid,keepfor any given indexid iid, and bufferid bid. Of course you don't hve to specify the bufferid in all commands. When a matching record is found, it will be in the buffer. If no such record is found, then the last record will be in the buffer (or the first when searching backwards). These commands also need a "compare" value which determines how they search and where they start to search. Here are the possible values. You just have to add the values together to get combinations, or combine the characters in a string (Sbasic only). \begin{tabular}{|l|r|r|c|l|} \hline name & bit & value & char & meaning \hline \hline agai & 0 & 1 & aAmM & start searching from next/prevous record & & & & instead of first/last record \hline case & 4 & 16 & cC & compare case dependant (find string only) \hline rvrs & 5 & 32 & -rR & reverse order (search backwards) \hline \end{tabular}
Sbasic FINDstring #bufferid, field, compare, value$, rfield, rplace value$ : string rfield : [short], updated if passed rplace : [short], updated if passed Assembler FNDS indexid field short compare string value to find update short fieldid where found update short place in field where found C long DDfindstring(long indexid, short field, short cmp, char *value, short *rfield, short *rplace); errors, code, meaning itnf -7 invalid bufferid or indexid or not found ipar -15 invalid fieldid (wrong type or doesn't exist) imem -3 insufficient memory for FRST/LAST/NEXT/PREV
Sbasic FINDinteger #bufferid, field, compare, value, rfield, rplace value : short rfield : [short], updated if passed rplace : [short], updated if passed Assembler FNDI indexid field short compare long value to find long 0 (unused) update short fieldid where found update short place in field where found C long DDfindinteger(long indexid, short field, short cmp, long value, short *rfield, short *rplace); errors, code, meaning itnf -7 invalid bufferid or indexid or not found ipar -15 invalid fieldid (wrong type or doesn't exist) imem -3 insufficient memory for FRST/LAST/NEXT/PREV
Sbasic FINDfloat #bufferid, field, compare, value, rfield, rplace value : float rfield : [short], updated if passed rplace : [short], updated if passed Assembler FNDD indexid field short compare double value to find update short fieldid where found update short place in field where found C long DDfinddouble(long indexid, short field, short cmp, double value, short *rfield, short *rplace); errors, code, meaning itnf -7 invalid bufferid or indexid or not found ipar -15 invalid fieldid (wrong type or doesn't exist) imem -3 insufficient memory for FRST/LAST/NEXT/PREV
dd_err= 0 FINDinteger ,,10,f,p REPeat loop IF dd_err THEN EXIT loop IF fieldTYPE(f)=3 THEN SETshort 100,f,p ELSE SETlong 100,f,p END IF FINDinteger ,1,10,f,p : REMark or FINDinteger ,'a',10,f,p END REPeat loop
When replacing strings you may also need to use the REMOVEel or INSERTel commands when the length of the two strings is different. Note that the string will probably have to be set character by character.
PROGS, Professional & Graphical Software