Q&A

  • 간만의 델파이 result 안되는 질문 임다
function TForm.Is_Screen_Over(area: TRect; dir: integer):Boolean;
var
    shape_rect: TRect;
begin

    shape_rect.Top := Select_shape.Top;
    shape_rect.Left := Select_shape.Left;
    shape_rect.Bottom := (Select_shape.Top+Select_shape.Height);
    shape_rect.Right := (Select_shape.Left+Select_shape.Width);

   (* case dir of
        LEFTKEY    :
         if shape_rect.Left >= area.Left then begin
            Result := FALSE;
         end;
        UPKEY     :
         if shape_rect.Top >= area.Top then
            Result := FALSE;
         RIGHTKEY   :
         if shape_rect.Right >= area.Right then
            Result := FALSE;
        DOWNKEY  :
         if shape_rect.Bottom >= area.Bottom then
            Result := FALSE;
    end;
    Result := TRUE;*)

    if dir = LEFTKEY then begin<<<<<<<<<
        if shape_rect.Left >= area.Left then result := FALSE;
       end else if dir = UPKEY then begin
        if shape_rect.Top >= area.Top then result := FALSE;
        end else if dir = RIGHTKEY then begin
         if shape_rect.Right >= area.Right then result := FALSE
            end else if dir = DOWNKEY then begin
                if shape_rect.Bottom >= area.Bottom then result := FALSE;
                end else result := TRUE;

end;
으음... 표시한 부분에 브레이크 포인트를 걸어보니 ...
리절트가 안대는군요 ...것참..
위의 케이스문 막아놓은것도 리절트가 안되어서 그랬다는 쿨럭~~ 아아정녕 나는 허접이었던가 ㅡㅡ;;;;;
일년만에 만져보는 델파이는 왜이리 나를 거부하는지 나는 볼랜드가 좋은데
1  COMMENTS
  • Profile
    이추형 2002.09.20 00:09


        case dir of
            LEFTKEY    :
             begin
               if shape_rect.Left >= area.Left then Result := FALSE;
             end;
            
            UPKEY     :
             begin
               if shape_rect.Top >= area.Top then Result := FALSE;
             end;

             RIGHTKEY   :
             begin
               if shape_rect.Right >= area.Right then Result := FALSE;
             end;

            DOWNKEY  :
             begin        
               if shape_rect.Bottom >= area.Bottom then Result := FALSE;
             end;

        end;
        Result := TRUE;