if (px,py) in [(173,88),(224,141)] then label1.Caption:=label1.Caption+'1';
//(px,py)为一座标值

解决方案 »

  1.   

    这样做是不行的,in 用来判断元素是否在集合中,还是老老实实的写代码吧。
    if ((px = 173) and (py = 88)) or ((px = 224) and (py = 141)) then
      Label1.Caption := Label1.Caption + 'l';
      

  2.   

    if (px in [173, 224]) and (py in [88, 141]) then //....
      

  3.   

    if ((px >= 173) and (px <= 224) and (py >= 88) and (py <= 141)) then
      Label1.Caption := Label1.Caption + 'l';