谢谢大家,代码大致是这样的
type
TSpace = class(TObject)
public
Sl,Sw,Sh :double;
SFlag : boolean;
SDirect:string;
public function xUnitSpace(Sp1:TSpace;Sp2:TSpace):TSpace;
public function yUnitSpace(Sp1:TSpace;Sp2:TSpace):TSpace;
public function zUnitSpace(Sp1:TSpace;Sp2:TSpace):TSpace;
end;
type
Tgoodsinfo = class(TObject)
public
gtype:string;
id:string;
name:string;
len:double;
wid:double;
hei:double;
weight:double;
end;
function TForm1.isLS(ExitGoods:Tgoodsinfo;currSpace:TSpace):bool;
var
lengthB,widthB,heightB,j:integer;
begin
lengthB := round(currSpace.SL / ExitGoods.len) ;
widthB := round(currSpace.Sw / ExitGoods.wid) ;
heightB := round(currSpace.Sh / ExitGoods.hei) ;
......................
end;
出问题的是 lengthB := round(currSpace.SL / ExitGoods.len) 这句
这两句都是正常的
widthB := round(currSpace.Sw / ExitGoods.wid) ;
heightB := round(currSpace.Sh / ExitGoods.hei) ;