In Unit2 of my program i have the following code:
TValue = Record
NewValue,
OldValue,
SavedValue : Double;
end;
TData = Class(TObject)
Public
EconomicGrowth : TValue;
Inflation : TValue;
Unemployment : TValue;
CurrentAccountPosition : TValue;
AggregateSupply : TValue;
AggregateDemand : TValue;
ADGovernmentSpending : TValue;
ADConsumption : TValue;
ADInvestment : TValue;
ADNetExports : TValue;
OverallTaxation : TValue;
GovernmentSpending : TValue;
InterestRates : TValue;
IncomeTax : TValue;
Benefits : TValue;
TrainingEducationSpending : TValue;
End;
I then declare Data : TData in the Var.
when i try to do the following however in Unit1:
ShowMessage(FloatToStr(Unit2.Data.Inflation.SavedValue));
I get an EAccessViolation message. Is there any way to access the data stored in 'Data' from Unit1 without getting errors?