I have wrote a little tool, that given a list of numbers selects corresponding column in a table, and zooms to selected object (it does other stuff too but this is the problem bit). Selection is in a loop - and it works properly the first time, then all distance functions start returning garbage, namely that MinX=MaxX=MinY etc. all of which are for some reason equal to -694444.44 (I am using state plane coordinate system). I have checked the selection - it works properly throughout, no problems on second iteration. Please help!
My code:
Dim CurPage, NumPages as integer, other definitions
i=1 Fetch first from TempPages CurPage=TempPages.PageNum Do Print "Printing page "+CurPage+" ("+ i +" of "+NumPages+")"
Select * From GridName Where Page_Num=CurPage into Now_Printing
MyObjType = ObjectInfo(Now_Printing.obj, OBJ_INFO_TYPE)
If MyObjType <> OBJ_TYPE_REGION Then 'Print error message
Print "Error: grid must be made up of region objects"
exit sub
End If
'find the center
MyMinX = ObjectGeography(Now_Printing.obj, OBJ_GEO_MINX)
MyMinY = ObjectGeography(Now_Printing.obj, OBJ_GEO_MINY)
MyMaxX = ObjectGeography(Now_Printing.obj, OBJ_GEO_MAXX)
MyMaxY = ObjectGeography(Now_Printing.obj, OBJ_GEO_MAXY)
Print " MyMinX="+MyMinX+" MyMinY="+MyMinY CenterX = MyMinX+(MyMaxX-MyMinX)/2
CenterY = MyMinY+(MyMaxY-MyMinY)/2
'and other actions Fetch Next from TempPages CurPage=TempPages.PageNum Loop while i<=NumPages
-- Sofia Nikolsky
JCH GeoInfo Solutions (919) 493-9339 www.jchgis.com
--------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 10040
