You are right; the allocation and deallocation of these handles should be encapsulated in a try/finally block! I suppose I forgot about this because I wanted to duplicate the structure of the sample application in c (which ships with C/Front) as closely as possible.
var
FieldValue: array[0..250] of char;
First: string = '-';
[...]
DBL_Allow(DBL_Err_RecordNotFound);
if not DBL_FindRec(hTable, hRec, PDBL_U8(First)) then;
DBL_Field_2_Str(@FieldValue, 250, hTable, hRec, 5);
WriteLn(FieldValue);
[...]
Delphi or C/Front clearly did not like the fact that I was passing a const as a parameter to DBL_FindRec. This only shows that I don't know an awful lot about memory allocation etc. in Delphi... With the parameter replaced, the code run beautifully and shows the value of field #5 of the first record.
Comments
Will keep looking.
Delphi or C/Front clearly did not like the fact that I was passing a const as a parameter to DBL_FindRec. This only shows that I don't know an awful lot about memory allocation etc. in Delphi... With the parameter replaced, the code run beautifully and shows the value of field #5 of the first record.