I think you need to be passing an object variable into the function, not an alias which is just a column reference.
Function IsObjectRegion(selObj As Object) As Logical
Dim ObjectType As SmallInt
ObjectType = ObjectInfo(selObj, OBJ_INFO_TYPE)
Do Case ObjectType
...
If you wanted to test this out with the currently selected object, you could call the function like this:
Dim test As Logical
Dim testObject As Object
testObject = Selection.Obj
test = IsObjectRegion(testObject)
Note test
This should return True/False.
James
How about running an SQL join:
select tab1.attr1, tab1.attr2
from tab2, tab1
where Tab1.Site_ref = Tab2.Site_ref
into q_ToSave
commit table q_ToSave as "C:\NewTable.tab"
This works.
If Tab1 doesn't have objects in it then the order of the tables in the from clause is not important, but if there are objects in tab1 to be replaced, then specifying tab2 first in the list will ensure that the tab2 objects are saved in NewTable
An alternative using undocumented behaviour (including a second object column in a query) is to do the following. This requires that Tab1 is already mappable, and Tab1 must be first in the from clause list:
select tab2.obj "Tab2Obj"
from tab1, tab2
where Tab1.Site_ref = Tab2.Site_ref
into q_ToSave
update q_ToSave set obj = Tab2Obj
This should directly overwrite the objects in Tab1 where the join is true.
Best Answer
Search for "duplicates" here: http://groups.google.com/group/mapinfo-l?hl=en
The question has been asked many times.