<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1498" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2><FONT size=2>
<P>Hi all,</P>
<P>Can anyone tell me if there is a way to catch the error that getShape throws 
if you request a shape that is out of range? </P>
<P>Reason is I'm trying to iterate through a layer. At this stage, I need to use 
an object count to make the loop stop. Getting an object count either requires 
me to use the shpfileobj-&gt;numshapes variable (which obviously only works on 
shapefiles), or doing a query (which would only work on layers with templates, 
which would need a reprojected rectangle, uses overhead, etc….).</P>
<P>Would it be possible to make getShape return MS_FAILURE if the object is out 
of range, or throw a warning that can be caught using '@' error suppression? 
That way one could iterate through a whole layer without needing a layer 
count.</P>
<P>Regards,</P>
<P>Jacob</P>
<P></FONT></FONT><FONT face=Arial size=2></FONT>&nbsp;</P><FONT face=Arial 
size=2><B><FONT color=#009500>
<P>J</FONT><FONT color=#009500 size=1>ACOB </FONT><FONT 
color=#009500>D</FONT><FONT color=#009500 size=1>ELFOS<BR></FONT><FONT 
color=#009500>S</FONT><FONT color=#009500 size=1>PATIAL </FONT><FONT 
color=#009500>I</FONT><FONT color=#009500 size=1>NFORMATION </FONT><FONT 
color=#009500>A</FONT><FONT color=#009500 size=1>NALYST</FONT><FONT 
color=#0033cc size=2><BR></B></FONT><FONT size=2>Maunsell Australia Pty 
Ltd<BR>629 Newcastle Street, Leederville, WA 6007</P>
<P>PO Box 81, Leederville, WA 6902</P>
<P>Western Australia</P>
<P>ABN 20 093 846 925<BR><BR>Tel &nbsp;&nbsp;&nbsp;&nbsp;+ 61 8 9281 
6185<BR>Fax&nbsp;&nbsp;&nbsp; + 61 8 9281 6297<BR></FONT><U><FONT color=#009c21 
size=2>jacob.delfos@maunsell.com</P></U></FONT></FONT></DIV></BODY></HTML>