Use x = MapperInfo(WindowID,Mapper_Info_Layers) to get the number of layers,
then loop from 1 to x through the layers. Use
LayerInfo(MapID,Layer_Info_Name) = "Your table of interest" to find which
layer is the one your interested in and that x will be your tables layer
number.
-Original Messa
Here is a bit of code I use to solve this problem:
No warranties, of course !
' **
' A couple of utility functions to make MapBasic Life easier.
' dcOpenTable( Path, Name ) -- opens a table if it's not already ope