网上看的不知道case scl and (WS_HSCROLL or WS_VSCROLL) of
怎么解呢?在这里有and 和 or 跟 if语句一样吗? 
请各位指点.
case scl and (WS_HSCROLL or WS_VSCROLL) of
      //  0:  // showmessage('ssNone');
      WS_HSCROLL: //   showmessage('ssHorz');
      WS_VSCROLL: 
 else begin   // showmessage('ssBoth');
end;

解决方案 »

  1.   

    and 应该是取交集的意思``
      

  2.   

    case scl and (WS_HSCROLL or WS_VSCROLL) of 意思是
    当scl是WS_HSCROLL或者WS_VSCROLL时
      

  3.   

    case scl and (WS_HSCROLL or WS_VSCROLL) of 
    等价于
    A:=scl and (WS_HSCROLL or WS_VSCROLL)case A ofA不是0就是1
      

  4.   

    WS_HSCROLL = $100000;
    WS_VSCROLL = $200000;
    化为二进制计算
        0001 0000 0000 0000 0000 0000 
    or  0010 0000 0000 0000 0000 0000 
    -----------
        0011 0000 0000 0000 0000 0000 
    再化为16进制 $300000 
    然后再 AND scl
    计算出一个16进制数, 然后有对应的参数  然后就是普通的CASE OF了
      

  5.   

    这里的And是整数与运算。case scl and (WS_HSCROLL or WS_VSCROLL) of 
          //  0:  // showmessage('ssNone'); 
          WS_HSCROLL: //  showmessage('ssHorz'); 
          WS_VSCROLL: 
    else begin  // showmessage('ssBoth'); 
    end; 
    BTW,代码中的这个And运算是画蛇添足的多此一举。
      

  6.   

    六楼正解,大家不要误导人啊.看来真理不一定在多数人手中啊。是不是Delphi越来越没落了