My application in MapBasic 4.5 is driving me crazy, and 
I would really appreciate some help. I am reasonably 
certain the problem is with getting the correct 
CoordSys, but after many hours, I still can't figure it 
out.

The concept is that the user selects a point from the 
SurveyedTrails table. I want to grab the XY coordinates 
of the selected point, and create a new point in the 
KnownLocations table using the same XY coordinates. The 
new point is created when the user clicks a button in a 
dialog box that Calls FixedPoint().


I have tried saving a Global oPoint object, saving the 
XY coordinates in Global variables, and every other 
combination that I can think of.

At first, the points were created at the wrong location, 
now I can't find them at all.

Please help!


***********************
  global fEasting as float
  global fNorthing as float     
  global iHour as Integer
  global iMinute as Integer
  global iSecond as Integer
  global iNodeID as Integer
  global hWnd as Integer
  global oPoint as Object



sub FixedPoint
dim oNewPoint as object
        set coordsys window hWnd
        oNewPoint = 
createPoint(centroidx(oPoint),centroidy(oPoint))
        Insert into KnownPositions (Obj, SampleSetID, 
NodeID, Hour, Minute, Second) 
                values (oNewPoint, iSampleSetID, iNodeID, 
iHour, iMinute, iSecond)
end sub


sub SelChangedHandler
dim sTableName as string
dim iRow as Integer

        iRow = SelectionInfo(SEL_INFO_NROWS)
        If iRow <> 1 then
'               note "Wrong number of objects selected"
                exit sub
        end if
        sTableName = SelectionInfo(SEL_INFO_TABLENAME)  

        do case sTableName
          case "GPSSample"
                iHour = selection.hour
                iMinute = selection.minute
                iSecond = selection.second
                close table tableinfo(0,TAB_INFO_NAME)

          case "SurveyedTrails" 
                hWnd = frontwindow()
                set coordsys window hWnd
                oPoint = selection.obj

                fNorthing = selection.northing
                fEasting = selection.easting
                iNodeID = selection.nodeID      
                close table tableinfo(0,TAB_INFO_NAME)
                call CreateGPSTrailsDialog
          case else 
'               print "neither of the two target tables"
        end case

end sub


         Jack MacDonald, Senior Researcher, Harvesting Operations
             Forest Engineering Research Institute of Canada
        Vancouver, BC Canada   (604) 228-1555   FAX (604) 228-0999
                     
                 
                   
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to