Things couldn't have worked better on both of these questions. Thanks to
all who responded to each, only one person had a suggestion for thematic
shading but it was enough to lead me in the right direction.
Issue #1: OVERFLOW ERRORS
Indeed the problem was that the FrontWindow() command returns a large
integer value that has nothing to do with how many tables are open. So I
was really just using the wrong numbers. I was able to circumnavigate this
problem by using the SearchPoint and SearchInfo commands. The improved code
is listed below:
Sub Neighbor
Dim win_id As Integer
Dim foundobj, objtype, i, j, numlayers, numthemes As SmallInt
Dim x, y As Float
Dim t_name, cstring, commandstring As String
win_id = FrontWindow()
If WindowInfo(win_id, WIN_INFO_TYPE) <> WIN_MAPPER Then
Note "This tool only works on Map windows."
Exit Sub
End If
x = CommandInfo(CMD_INFO_X) 'x coordinate of users click
y = CommandInfo(CMD_INFO_Y) 'y coordinate of users click
foundobj = SearchPoint(win_id, x, y)
If foundobj = 0 Then
exit sub
End If
t_name = SearchInfo(foundObj, SEARCH_INFO_TABLE)
The select was rather straightforward with an obj within type statement
Issue #2: AUTOMATIC THEMATIC SHADING
This was a little trickier, but since nobody really suggested many things
I'll just paste the code in case anybody is interested. Per John
Schlosser's suggestion, I used the unique values within one of the table
columns to give the shade command an idea of how to shade the map. I ran a
for...next loop to create a long string containing all the individual values
in the column and then utilized Run Command to convert the string into a
shade command.
fetch first from neighbors
cstring = """" + neighbors.Sector_name + ""","
for i = 1 to tableinfo(neighbors, TAB_INFO_NROWS)-2
fetch next from neighbors
cstring = cstring + """" + Neighbors.Sector_name + ""","
next
fetch next from neighbors
cstring = cstring + """" + Neighbors.Sector_name + """"
Run Command "Shade window " +win_id+ " selection with Sector_Name values " +
cstring
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]