Instead of Tableinfo use LAYERINFO
I am attaching the code which is working perfect
as per your requirement
Sub Neighbor
Dim win_id As Integer
Dim fx, fy As Float
Dim t_name As String
win_id = FrontWindow()
note win_id
t_name = Layerinfo(win_id,1, LAYER_INFO_NAME)
note t_name
fx = CommandInfo(CMD_INFO_X)
fy = CommandInfo(CMD_INFO_Y)
Select * From t_name Where obj Contains CreatePoint(fx, fy) into selection
Select * from t_name where obj intersects any (select obj from selection)
End Sub
From: "Humphrey, Ben" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: MI Overflow error on custom select tool
Date: Thu, 16 Sep 1999 11:45:43 -0700
Howdy-
I am getting an Overflow error withing mapinfo when I use my tool at this
line:
t_name = TableInfo(win_id,TAB_INFO_NAME)
The point is to be able to click anywhere on the active window, have the
event handler select the polygon underneath the layer and then select all
polygons which intersect that polygon. Suggestions, remedies?
Thanks in advance to the code crackers out there
-Ben
Here's the code:
Include "mapbasic.def"
Include "icons.def"
Declare Sub Main
Declare Sub Neighbor
Sub Main
Alter ButtonPad "Tools"
Add Separator
Add ToolButton
Drawmode DM_CUSTOM_POINT
HelpMsg "Thematically shade all region neighbors"
Calling Neighbor
Icon MI_ICON_COMMUNICATION_6
Cursor MI_CURSOR_CROSSHAIR
Show
End Sub
Sub Neighbor
Dim win_id As Integer
Dim fx, fy As Float
Dim t_name As String
win_id = FrontWindow()
t_name = TableInfo(win_id,TAB_INFO_NAME)
fx = CommandInfo(CMD_INFO_X)
fy = CommandInfo(CMD_INFO_Y)
Select * From t_name
Where obj Contains CreatePoint(fx, fy) into selection
Select * from t_name where obj intersects any (select obj from selection)
End Sub
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
===================================================
Aditya
Executive (Systems)
Information Systems Department
GCMMF, Anand
E-mail me at :[EMAIL PROTECTED]
Web Site: http://www.amul.com
===================================================
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]