hi
at school we use delphi6pe but at home i use lazarus because kylix is outdated. at the moment we try to program a traffic simulator.
now there is a thing which i dont understand why it doesn't work.
i have created a pointer with an element:
type Talz = ^Tale;
Tale = record
auto: Tauto;
naechstes: Talz;
end;
in the class TStrasse i use a private variable:
autoliste: Talz;
in the create method of TStrasse i do:
constructor TStrasse.create;
begin
inherited create;
new(autoliste);
autoliste^.naechstes:= nil;
end;
which works fine
but when i try to copy autoliste to another it gives me just an error message "Acces Violation".
the code for copying is this:
procedure TStrasse.autoerzeugen(b,vmax:single);
var backup, nA: Talz;
begin
new(backup);
backup:= autoliste;
...
...
end;
the problem is, that i do this in uFachklassen and not in the formunit, where it works, but i need it in ufachklassen.
i do not understand why it doesn't work maybe one of you could help me.