You are not logged in.
Pages: 1
var
LineArray,LineJson:TDocVariantData;
VarJson:Variant;
......
LineArray.Init;
LineJson.Init;
......
{
TDocVariantData(VarJson).InitJSON(LineJson.ToJSON()); //watch "VarJson":Access violation at 40021120 accessing 40021120
LineArray.AddItem(VarJson);
VarClear(VarJson);
}
LineArray.AddItem(Variant(LineJson)); //convert to Variant watch "LineArray": (275, [dvoIsArray], (), (Access violation at 40021120 accessing 40021120, Access violation at 40021120 accessing 40021120, Unassigned, Unassigned), 2)
LineJson.Clear;
......
IDE:Build with runtime packages
Last edited by guxinglei (2023-02-09 04:13:37)
Offline
Your code is not enough to reproduce the issue.
First try without runtime packages.
Then see what is inside VarJson.
TDocVariantData(VarJson) is not correct to initialize a variant: you need to use VarJson := _Json Fast(LineJson.ToJson));
Offline
without runtime packages is ok,why!
Offline
Pages: 1