[Hint] BillSaelUnitInput.pas(966): Value assigned to 'boardHeight' never used
出现这个错误有什么原因,如何解决
小弟试过换变量名,
将语句调换位置

  doorheightDe:=dm.ADOQueryCommon.Fieldbyname('高度总减量').AsInteger;
改为
 doorheightDe:=dm.ADOQueryCommon.Fields[4].AsInteger;

 DoorCOLA:=这样的语句也不能执行
为避免全角字符之误,重打一遍,也有问题
为什么?请大侠救我

解决方案 »

  1.   

    这个……从程序的角度来说并不是错误,它只是提醒你,你把数值赋给了变量doorherghtDe,但是并没有在其他的地方引用这个变量。
    如果你的程序出错的话,应该是其他地方的问题。
      

  2.   

    没所谓的
    你用的变量没有使用的需要而已http://lysoft.7u7.net
      

  3.   

    procedure TFrmItemInput.GetBoardSize(UnitHeight, UnitWidth, BoardNo,
      BoardNumer: integer; DoorStyle: string; var boardwidth: integer;
      boardHeight: integer);
    var
      BdRow:integer;
      Bdcol:integer;
      DoorRowA:integer;
      DoorColA:integer;
      DoorWidthWord:string;
      DoorHeightWord:string;
      DoorRowWord:string;
      DoorColWord:string;
      DoorWidthDelta:integer;
      DoorHeightDe:integer;
      i:integer;
      startchar:integer;
      LSWord:string;begin
       dm.ADOQueryCommon.Active :=false;
       dm.adoquerycommon.SQL.clear;
       dm.ADOQueryCommon.SQL.Add('select [开门方式对应尺寸表].* from 开门方式对应尺寸表 where 柜体高度='+inttostr(UnitHeight)+' and 门开方式='''+DoorStyle+'''');
       dm.ADOQueryCommon.Active :=true;
       DoorWidthWord:=dm.adoquerycommon.fieldbyname('宽度相对量').AsString ;
       DoorHeightWord:=dm.adoquerycommon.fieldbyname('高度绝对量').AsString ;
       DoorcolWord:=dm.adoquerycommon.fieldbyname('宽度对应数量').AsString ;
       DoorrowWord:=dm.adoquerycommon.fieldbyname('高度对应数量').AsString ;
       DoorWidthDelta:=dm.adoquerycommon.fieldbyname('宽度总减量').AsInteger;
       doorheightDe:=dm.ADOQueryCommon.Fieldbyname('高度总减量').AsInteger;   if  BoardNumer=1 then
         begin
           boardHeight:=UnitHeight-DoorHeightDe;
           boardwidth:=unitwidth-DoorWidthDelta;
         end
    以上的boardHeight:=UnitHeight-DoorHeightDe;无法执行,被跳过,为什么?如果不执行,就错了
      

  4.   

    参数列表中,boardHeight: integer 的定义改为 var  boardHeight: integer 呢?
      

  5.   

    var boardwidth, boardHeight: integer);这样看看
      

  6.   

    你肯定不对了
    procedure TFrmItemInput.GetBoardSize(UnitHeight, UnitWidth, BoardNo,
      BoardNumer: integer; DoorStyle: string; var boardwidth: integer;
      boardHeight: integer);--->这里改为var boardHeight: integer)
    -----------------------
      boardheight是值传递,你在过程内修改,但不在过程内使用,过程外肯定也不会用。肯定出hint
    试着在boardHeight前面加上var 试一试
      

  7.   

    这是delphi的优化导致的 没什么大不了的事情的。。
      

  8.   

    谢谢各位朋友
      今天也在朋友的提醒下找到方法了
      我原以为只要写在VAR后面的就可以
      但要写成 var boardwidth,boardheight:integer
       而不是原来的形式
      向各位朋友表示感谢,给分,并请以后多帮小弟