Hi Todd McNeil,

          The problem in this code mainly lies in the line that has been
coloured blue below.The problem persists because you are trying to insert
the values of  oObj, rArea and the rPerim but in the columns to which these
value have to be assigned are not speciifed (Insert Into gsIntTable (Obj)
).When ever you have to insert valuse into a table by specific column wise
then both the insert statement and the values clause in the statement
should have the respective columns specified. This would be as follows in
your statements case:

Insert Into gsIntTable (Obj,(name of the area column), (the name of the
perimeter column))  Values (oObj, rArea, rPerim)

Software Engineer
Risk Management Software India Pvt. Ltd.

TMCNEIL <[EMAIL PROTECTED]> on 07/01/99 09:16:00 PM

cc:    (bcc: Tech Notes/RMSI)
Subject:  MI MapBasic

     I am trying to manipulate some code where the intersections of
     overlapping polygons are drawn as a table.  Here's the code:

     Sub MakeReg
       Dim brushStyle As Brush
        Dim penStyle As Pen
       Dim oObj As Object
       Dim rArea As Integer
       Dim rPerimeter As Integer

        If TableInfo(TempHold,TAB_INFO_NROWS) < 2 Then
         Note "At Least 2 Region Objects Must Have Been Selected."
                Dialog Title "Choose Parameters"
                        Control StaticText   Position 10,10    Title "File
                        Control EditText     Position 15,20    Into
     gsIntTable Value gsIntTable Width 100 ID 1
                        Control StaticText   Position 10,40    Title "Fill
                        Control BrushPicker  Position 15,50    Value
     CurrentBrush() Width 20 Height 20 Into brushStyle
                        Control StaticText   Position 60,40    Title "Line
                        Control PenPicker    Position 65,50    Value
     CurrentPen() Width 20 Height 20 Into penStyle
                        Control OKButton     Calling ChkFile
                        Control CancelButton
                If CommandInfo(CMD_INFO_DLG_OK) Then
                        Set Event Processing Off
                        Create Table gsIntTable (ID Integer, AREA Integer,
     Perimeter Integer)
                        Create Map For gsIntTable
                        Set Style Brush brushStyle
                        Set Style Pen penStyle
                        Create Object As Intersect From TempHold Into
     Variable oObj
                        rArea = Area(oObj, "sq mi")
                        rPerim = Perimeter(oObj, "nmi")
           If ObjectInfo(oObj,OBJ_INFO_NPNTS) = 0 Then
                                Note "No Common Intersection Found."
                                Drop Table gsIntTable
             Alter Object oObj Info OBJ_INFO_BRUSH, brushStyle
             Alter Object oObj Info OBJ_INFO_PEN, penStyle
             Insert Into gsIntTable (Obj) Values (oObj, rArea, rPerim)
                                Run Menu Command M_ANALYZE_UNSELECT
                                Commit Table gsIntTable
                                Add Map Auto Layer gsIntTable
             Set Map Layer gsIntTable Editable On
                        End If                  'was int found
                        gbStartProc = False
                        Alter Menu Item MakeReg Disable
                        Alter Menu Item BeginAccum text "&Begin
                        Drop Table TempHold
                End If                          'ok hit
        End If                                  'more than 1 obj selected
     End Sub

     Basically what I am trying to do is Find out what the Area and
     Perimeter is of the new Object created by an intersection and write it
     to the new table created called TempHold.  I can make the table with
     the correct columns but I keep getting a message that says:  "Number
     of columns in selection must be equal to the number of columns being

     Any ideas?  I think I may be close.

     Todd McNeil
     GIS Specialist
     Annapolis, Maryland
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

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