GotoXY: Cannot reach location!
Posted: 21.09.2009 13:06
				
				Вот кусочек макроса на мининг. Выбивает ошибку GotoXY: Cannot reach location!. Что это за LDC не шарю (( Подскажите, будьте добры..
			Code: Select all
procedure GotoXY(x,y,prec : integer; runflag : boolean); 
   var ld, ldc, dx, dy, mx, my, tmpdir : Integer; 
   begin 
      ld := 0; ldc := 0; 
      while true do 
      begin 
         waitconnection(3000); 
         DropOre; 
         dx := GetX(self) - x; if dx < 0 then dx := 0 - dx; 
         dy := GetY(self) - y; if dy < 0 then dy := 0 - dy; 
         if dy > dx then dx := dy; 
         if dx <= prec then exit; 
         mx := GetX(self); my := GetY(self); 
         dx := mx - x; if dx < 0 then dx := 0 - dx; 
         dy := my - y; if dy < 0 then dy := 0 - dy; 
         if dy > dx then dx := dy; 
         if dx <= prec then exit; 
         if ld = dx then begin 
            ldc := ldc + 1; 
            if ldc > 10 then 
           begin 
             tmpdir := Random(8); 
             DropOre; 
             Raw_Move(tmpdir,runflag); 
             DropOre; 
             Raw_Move(tmpdir,runflag); 
             DropOre; 
             Raw_Move(tmpdir,runflag); 
           end; 
            if ldc > 200 then begin addtosystemjournal( 'GotoXY: Cannot reach location!' ); { exit; } end; 
         end 
         else ld := dx; 
         waitconnection(5000); 
         if mx = x then begin 
            if my = y then exit; 
            // North 
            if my > y then begin Raw_Move(0,runflag); continue; end; 
            // South 
            DropOre; 
            Raw_Move(4,runflag); continue; 
         end; 
         if mx < x then begin 
            // Northeast 
            if my > y then begin DropOre; Raw_Move(1,runflag); continue; end; 
            // East 
            if my = y then begin DropOre; Raw_Move(2,runflag); continue; 
            end; 
            // Southeast 
            DropOre; Raw_Move(3,runflag); continue; 
         end; 
         // Southwest 
         if my < y then begin DropOre; Raw_Move(5,runflag); continue; end; 
         // West 
         if my = y then begin DropOre; Raw_Move(6,runflag); continue; end; 
         // Nortwest 
         DropOre; Raw_Move(7,runflag); continue; 
      end; 
   end;