You are not logged in.
FPC 3.2.2 lazarus2.2.6
Use the class IkeyValue in mormot.core.collections
The following code keeps getting errors: Fatal: Syntax error, ";" expected but "," found.
vparams:specialize IkeyValue<RawUtf8,variant>;
vParams:=Collections.NewPlainKeyValue<RawUtf8, variant>(); //There are errors in this line
Offline
I never use the FPC syntax for generics.
Try to enable the Delphi mode for the unit instead.
Then use the Delphi syntax for generics: it is more readable, and works.
My wild guess is that your syntax is not correct.
Please try something like
vParams:=Collections.specialize NewPlainKeyValue<RawUtf8, variant>();
As I wrote, FPC syntax is so much verbose...
Offline
Thank you. Yes, you're right. It's up and running.
I want to sort the elements of IKeyValue by Key, and I don't know any good way to do that.
Offline
I want to sort the elements of IKeyValue by Key, and I don't know any good way to do that.
IKeyValue is a replacement for TDictionary to search and get fast a Value instance. I do not think you should use it if you want to have a list of instances sorted.
If you want a list of instances you can sort in multiple ways you can use ilist<> and assigned a compare method
Last edited by dcoun (2023-07-31 17:22:49)
Offline