This prevents updating an index if appending new records that are in sorted order. This may not be what is wanted, but at the moment adding a new record will not fail because LastRecord is 0. Either set it to the maximum int value (prevent addition) or set it to the maximum record seen during the read (allow addition of valid records).
This prevents updating an index if appending new records that are in sorted order. This may not be what is wanted, but at the moment adding a new record will not fail because LastRecord is 0. Either set it to the maximum int value (prevent addition) or set it to the maximum record seen during the read (allow addition of valid records).