ReReadVRecord Reread variable-length ISAM data record. Short Name REDVREC() Type ISAM variable-length record function Declaration COUNT ReReadVRecord(COUNT datno,pVOID recptr, VRLEN varlen) Description ReReadVRecord() reads the current variable-length ISAM record for data file datno into the buffer area pointed to by recptr. If varlen, the size of the buffer pointed to by recptr, is not large enough for the variable-length record, ReReadVRecord() returns an error. ReReadVRecord() is used to read the entire variable-length record after the fixed-length portion is read via one of the fixed-length ISAM search routines (e.g., FirstInSet() instead of FirstInVSet()). To ensure varlen is large enough, call VRecordLength() before calling ReReadVRecord(). VRecordLength() returns the actual length of the record. If the existing buffer is not large enough, allocate a new, larger buffer before calling ReReadVRecord(). Note: No check is actually made to be sure that the region pointed to by recptr is in fact as large as varlen indicates. It is up to the application to ensure that varlen accurately specifies the size of the area pointed to by recptr. As of c-tree Plus V8.14, c-tree sets the current ISAM position after a record is added such that the next or previous record can be read without having to re-read the record just added. Prior to V8.14, the current ISAM position was not set to a newly-added record and an INOT_ERR (101) error would result if you tried to read either the next of previous record. Return
See c-tree Plus Error Codes for a complete listing of valid c-tree Plus error values. Example COUNT datno, keyno; VRLEN cur_bufsiz = 128, varlen; pTEXT recptr; LONG part_number;
if (FirstRecord(keyno, recptr)) == NO_ERROR) {
if ((varlen = VRecordLength(datno)) > cur_bufsiz) {
free(recptr); recptr = calloc(1,varlen)); cur_bufsiz = varlen; } if (ReReadVRecord(datno,recptr,varlen)) printf>("\nCould not reread record (%d).", isam_err);
} See also ReadVData(), ReReadRecord(), VRecordLength(), WriteVData() |
||||||||||||||||||||||||||||||||||||