You are not logged in.
Pages: 1
function CsvToIntegerDynArray(Csv: PUtf8Char; var List: TIntegerDynArray)
If csv is empty string , list will contain a [0].
Is this a bug? or That should be it
Last edited by lfyey121 (2023-03-11 06:49:38)
Offline
What do you call an "empty string"?
IMHO CsvToIntegerDynArray(nil, List) won't add any item.
But CsvToIntegerDynArray(#0, List) would add a [0]. It is as expected: it is handled as a single item with no text, i.e. converted as 0.
The idea is to compute Csv from pointer(SomeRawUtf8Variable), i.e. '' will return nil, never #0.
But perhaps https://github.com/synopse/mORMot2/commit/a7e6ac51 make it more easy to understand.
Your expectations do make sense.
Note that it ADDs/APPENDs items to the list. If the list is not void, it is kept as it is.
Offline
Thank you, that's what I hope, I don't have to check again if it's an empty string
Offline
Pages: 1