In a VCL application in Delphi 10.1.2, I use a TJvFormStorage
component to persistently store and restore data.
So in JvFormStorage1 at design-time I have created a StoredValue to hold an Integer
value:
Then at runtime, I try to assign an Integer
value to this StoredValue:
JvFormStorage1.StoredValue['ToolbarLabelFontSize'].Value := 8;
This causes an Invalid variant operation error!
But as you can see from the screenshot above, the Value Type of the StoredValue is explicitly defined as Integer
type!
So how can I assign an Integer
value to this StoredValue?
The StoredValue[]
property provides access to the variant values directly, so the correct way to set the value of one of these values would be:
JvFormStorage1.StoredValue['ToolbarLabelFontSize'] := 8;