products affected: MapInfo Pro™, MapBasic™
Issue
Open table function within a new menu does not open the request table file. The code compiles without errors and adds the menus however it does not open the request table file.
Cause
The requested file did not open because a Menu command can only call a subroutine and not execute a function or statement.
--- Problem Example ---
Alter Menu bar Add "Geophysics"
Alter Menu bar Add "Geophysics"
Alter Menu "Geophysics" Add
"(-",
"Gravity"
Alter Menu "Geophysics" Add
"Tile Loader" Open Table "\\consminerals.com.au\wdw_air\WDW_RGL\WDW_RGL_Tile_Index.TAB" As "tile_Index"
Resolution
UPDATED: September 6, 2017Menu command calling a subroutine and the sub routine executing the function or statement.
-- Example ---
-- Example ---
Create Menu "Geophysics" As
"Tileloader" Calling Open_Table...
Then a separate routine:
Sub Open_Table
Open Table "\\consminerals.com.au\wdw_air\WDW_RGL\WDW_RGL_Tile_Index.TAB" As "tile_Index"
End Sub