Registriert seit: 6. Apr 2011
Ort: Berlin
3.070 Beiträge
Delphi 10.4 Sydney
|
AW: Access Violation bei Compiler-Option $O+
18. Dez 2012, 16:59
Delphi-Quellcode:
function Calc(AclsPart : TObject; dblX1, dblX2 : double; blnParam : boolean) : boolean;
var
MyClsPart : TclsPart;
MyClsData : TclsData;
function Equal(dblX1, dblX2 : double) : boolean;
begin
Result := Abs(dblX1 - dblX2) < 0.00001;
end;
begin
MyClsPart := nil;
MyClsData := nil;
Result := False;
if Assigned(AclsPart) and (AclsPart is TclsPart) then
begin
MyClsPart := TclsPart(AclsPart);
if Assigned(MyClsPart.Data) and (MyClsPart.Data is TclsData) then
begin
MyClsData := TclsData(MyClsPart.Data);
MyClsData.MyField := blnParam;
if Equal(dblX1, dblX2) then
Result := MyClsData.CalcSomething1x(dblX1)
else
Result := MyClsData.CalcSomething2x(dblX1, dblX2); // <-- geht jetzt!
end;
end;
end;
Geändert von TiGü (18. Dez 2012 um 17:02 Uhr)
|