Thanks to everyone who responded.  Without the responses I would not have
been able to solve the problem.  Below are the solutions and after that
appears the original code:

Solutions:

>From Peter Lauland:
Select * from PointTab where obj within any (Select obj from RegionTab)
into Results

>From Dmitry Bogdanov:
Select * from TableA where obj within any (select obj from TableB) Into
Results

>From David Hansen:
"Cut" the points out.  Instead of the "Delete
from Results" line, you would use "Run Menu Command 202", then "Commit
Table TableA" on the next line (if you wanted to save the changes)

Original Code:

'*This application deletes all the objects that fall within a table of
polygons.  It asks the user to open two tables.

'* Include
Include "G:\MapInfo\MapBasic\mapbasic.def"

'*Declares
Declare Sub main
Declare Sub Query1

'*Funcion: main
'*Purpose: main control
Sub main

Dim Table1 as String
Dim Table2 as String
Dim Results as String
Table1 = "TableA"
Table2 = "TableB"

Note "Please, select a point table."

'*Open tables and create map window
Table1 = FileOpenDlg("","","TAB","Open Table")

If (Table1 <> "") Then
     Open Table Table1 As TableA
Else
     Note "No table selected."
End If

Note "Please, select a polygon table."

Table2 = FileOpenDlg("","","TAB","Open Table")
If (Table2 <> "") Then
     Open Table Table2 As TableB
Else
     Note "Second table not selected.  Exiting program."
End If

Map From TableB, TableA

Set Map Zoom Entire

Call Query1()

End Sub

'*Function: Select all points that fall within the polygons.
Sub Query1

Select * from TableA, TableB where TableB.obj contains TableA.obj into
Results
Browse * from Results

Delete from Results

End Sub

Michael Goldberg
City of San Antonio Planning Department
Data Management & CAD
[EMAIL PROTECTED]
(210) 207-6533

----------------------------------------------------------------------
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