<div dir="ltr"><div>I have a Procedure as follows.</div><div><br></div><div><div><br></div><div>procedure TForm_DB.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,</div><div> Y: Integer);</div><div>var</div><div> xr,yr: Real;</div>
<div> dx,dy: integer;</div><div> SrcRect,DestRect: TRect;</div><div>begin</div><div> if iScale=0 then exit;<- External SigFPE occurs here.</div><div> mousePos.x:=X;</div><div> mousePos.y:=Y;</div><div> xr:=trunc(x/iScale+PanVect.x);</div>
<div> yr:=trunc(y/iScale+PanVect.y);</div><div> if middleDown=1 then</div><div> begin</div><div> SrcRect:=Rect(0,0,ImageWidth,ImageHeight);</div><div> dx:=X-MouseClkDn.x;</div><div> dy:=Y-MouseClkDn.y;</div><div>
DestRect:=Rect(dx,dy,ImageWidth+dx,ImageHeight+dy);</div><div> Image1.Canvas.CopyRect(DestRect,ImageBuffer.Canvas,SrcRect);</div><div> end;</div><div>end; </div></div><div><br></div><div style>Mostly it works as expected.</div>
<div style><br></div><div style>However, after some reasonably complex computing, mostly involving TStringLists, it throws up an error:</div><div style><br></div><div style>"Project project1 raised exception class 'External SigFPE'</div>
<div style>in file 'unit5.pas' at line 435:</div><div style> if iScale=0 then exit;"<br></div><div style><br></div><div style>The iScale variable at this point is 1.1394385252832742, so clearly the debugger is not actually indicating the correct cause of the exception.</div>
<div style><br></div><div style>Can anyone offer a way to try to seek out the cause?</div><div style><br></div><div style>Many thanks,</div><div style><br></div><div style>Dave Coventry</div><div style><br></div><div style>
<br></div><div><br></div><div><br></div></div>