- May
- 609
- 4
Joe,
(I couldn't find your email address either here or on your website. If I had been able to find it, I would have written you privately.)
It would be useful to have a new function in the DBF plugin, for returning the record number in which a file byte offset resides.
Example:
I want to find the record containing the word FOOBAR.
Now, in order to read the record containing the target word, I need the record number.
The computation is %@eval[(%xx% - (start address of record 1)) \ %@recsize[test.dbf]) + 1] .
How about %@recnum[dbffile,fileoffset] ? Let it return -1 if the address given precedes the start of record 1.
This would then allow this to follow the above code:
Alternatively, maybe you could supply the file byte offset of the start of record 1 and I could do the rest of the arithmetic myself.
(I couldn't find your email address either here or on your website. If I had been able to find it, I would have written you privately.)
It would be useful to have a new function in the DBF plugin, for returning the record number in which a file byte offset resides.
Example:
I want to find the record containing the word FOOBAR.
Code:
SET XX=%@EXECSTR[FFIND /K /M /T"FOOBAR" /X TEST.DBF]
SET XX=%@EVAL[%@WORD["()h",1,%XX]]
Now, in order to read the record containing the target word, I need the record number.
The computation is %@eval[(%xx% - (start address of record 1)) \ %@recsize[test.dbf]) + 1] .
How about %@recnum[dbffile,fileoffset] ? Let it return -1 if the address given precedes the start of record 1.
This would then allow this to follow the above code:
Code:
SET RN=%@RECNUM[TEST.DBF,%XX]
SET TARGET_RECORD=%@RECORD[TEST.DBF,%RN]
Alternatively, maybe you could supply the file byte offset of the start of record 1 and I could do the rest of the arithmetic myself.