--
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en
---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapinfo-l+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapinfo-l/089f29b5-c88b-459d-bf6b-b709ddcd073dn%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapinfo-l/e4ad7e0f-2736-e4e6-dea4-80e6248ce89e%40routeware.dk.
This message originated Externally. Use proper judgement and caution with attachments, links, or responses. |
Try this instead:
dim oSymbol as object
dim nRow, nTab as integer
dim arrTables() As String
'Creating a list of tables
nTab = nTab + 1
Redim arrTables(nTab)
arrTables(nTab) = "SYMBOLSTABLE"
nTab = nTab + 1
Redim arrTables(nTab)
arrTables(nTab) = "SYMBOLSTABLE2"
'Looping through the list of tables
For nTab = 1 To Ubound(arrTables)
Select * From arrTables(nTab)
Where OBJ
Into __HAS__OBJECTS NoSelect
Select * From __HAS__OBJECTS
Where Str$(ObjectInfo(OBJ, 1)) = "5" 'OBJ_TYPE_POINT
Into __HAS__POINTS NoSelect
Fetch first from __HAS__POINTS
Do Until EOT(__HAS__POINTS)
oSymbol = __HAS__POINTS.obj
nRow = __HAS__POINTS.ROWID
Alter Object oSymbol Info 2, MakeSymbol(40, 16711680, 12)
Update __HAS__POINTS set obj = oSymbol where rowid = nRow
fetch next from __HAS__POINTS
Loop
Close Table __HAS__POINTS
Close Table __HAS__ OBJECTS
Next 'Table
This should create a list of tables using an array and then loop over these tables.
I have added a few checks (via Select statements) at first to make sure the records has objects and that the objects are points.
If you want the symbol to very across the tables, you can add another array to holds the symbols for each table and use these in the Alter Object statement:
dim arrTables() As String
dim arrSymbols() As Symbol
'Creating a list of tables
nTab = nTab + 1
Redim arrTables(nTab)
arrTables(nTab) = "SYMBOLSTABLE"
Redim arrSymbols(nTab)
arrSymbols(nTab) = MakeSymbol(40, 16711680, 12)
nTab = nTab + 1
Redim arrTables(nTab)
arrTables(nTab) = "SYMBOLSTABLE2"
Redim arrSymbols(nTab)
arrSymbols(nTab) = MakeSymbol(40, 16711680, 16)
…
Alter Object oSymbol Info 2, arrSymbols(nTab)
To view this discussion on the web visit https://groups.google.com/d/msgid/mapinfo-l/f5ee4cec-a23c-4329-baf7-dabf0aee3223n%40googlegroups.com.
Ah, sorry, it seems I had an extra space in the last table name:
Close Table __HAS__ OBJECTS
Remove the space before OBJECTS and recompile and you are good.
Yeah, the Where command needs to be changed to work with linear objects in stead.
Here are a list of object types from MapBasic.def.
Define OBJ_TYPE_ARC 1
Define OBJ_TYPE_ELLIPSE 2
Define OBJ_TYPE_LINE 3
Define OBJ_TYPE_PLINE 4
Define OBJ_TYPE_POINT 5
Define OBJ_TYPE_FRAME 6
Define OBJ_TYPE_REGION 7
Define OBJ_TYPE_RECT 8
Define OBJ_TYPE_ROUNDRECT 9
Define OBJ_TYPE_TEXT 10
Define OBJ_TYPE_MPOINT 11
Define OBJ_TYPE_COLLECTION 12
So for linear objects, change the Where command to:
Where Str$(ObjectInfo(OBJ, 1)) In ("1", "3", "4") 'OBJ_TYPE_ARC, OBJ_TYPE_LINE, OBJ_TYPE_PLINE
HTH
To view this discussion on the web visit https://groups.google.com/d/msgid/mapinfo-l/cb91464b-1fa5-4e23-b7f3-57aa3698454bn%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapinfo-l/MN2PR16MB3117CC53953B99A0B152D3DD961C9%40MN2PR16MB3117.namprd16.prod.outlook.com.