You are not logged in.
Pages: 1
mORMot.core.variants set length to 16 (although real number of fields in json is lower e.g. 11).
Is it an error when Length(TDocVariantData.Names)-1 or High(TDocVariantData.Names) gives 15 or isn't it allowed to access Names/Values with mORMot2?
Last edited by danielkuettner (2021-07-24 14:17:55)
Offline
This length is the capacity.
/// direct acces to the low-level internal array of values
// - note that length(Values)=Capacity and not Count, so copy(Values, 0, Count)
// or use FieldValues iterator if you want the exact count
....
/// direct acces to the low-level internal array of names
// - is void (nil) if Kind is not dvObject
// - note that length(Names)=Capacity and not Count, so copy(Names, 0, Count)
// or use FieldNames iterator if you want the exact count
Use the Count property for the number of values.
Offline
Pages: 1