nach ausführung dieses Cods ist p.y immer 451408.
Code: Alles auswählen
var i: byte; p: tpoint;
...
randomize;
i:=random(4)+1;
if i=1 then begin p.x:=784 div 2; p.x:=8 end; //oben
if i=2 then begin p.x:=8; p.x:=579 div 2; end;//links
if i=3 then begin p.x:=784-8; p.x:=579 div 2; end;//rechts
if i=4 then begin p.x:=784 div 2; p.x:=579-8; end;//unten
form1.Caption:='X: '+inttostr(p.x)+'_Y: '+inttostr(p.y);
