jamesp0tter
Programmer
I have defined a custom class:
and the following code
When I execute this code, caption changes to 'firstsecond' as expected, but when I exit the application it panics with an Access Violation!
I tried only with
where caption will only become 'first' (asking only one of the variables of TWhtv), and the caption changes accordingly and NO access violation!
So, Delphi panics when I ask for more than one var of the returned class? Or am I doing something wrong?
Thanks!
PS: using Delphi 7
jamesp0tter
Code:
type
TWhtv = class
one: string;
two: string;
end;
and the following code
Code:
function abc: TWhtv;
var
u: TWhtv;
begin
u.one := 'first';
u.two := 'second';
result := u;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
o: TWhtv;
s: string;
begin
o := abc;
s := o.one + o.two;
caption := s;
end;
When I execute this code, caption changes to 'firstsecond' as expected, but when I exit the application it panics with an Access Violation!
I tried only with
Code:
procedure TForm1.Button1Click(Sender: TObject);
var
o: TWhtv;
s: string;
begin
o := abc;
s := o.one;
caption := s;
end;
where caption will only become 'first' (asking only one of the variables of TWhtv), and the caption changes accordingly and NO access violation!
So, Delphi panics when I ask for more than one var of the returned class? Or am I doing something wrong?
Thanks!
PS: using Delphi 7
jamesp0tter