Hallo
How can I add only certain table types (for example normal (i.e. not linked) tables) to array variable from all opened tables. Script below does not work when TableInfo(i, TAB_INFO_TYPE) is used as condition. Not working indicator for me --- when choosing table from list (although popup menu list shows only "normal" tables as desired) the final variable value is missing (attachment "NotWorking"). When uncommenting out red lines in code below, then final variable value is not missing (correct) (attachment "Without_type_condition"), but popup menu list is showing all opened tables (not desired).
Include "mapbasic.def"
Include "IMapInfoPro.def"
Include "Enums.def"
Include "Menu.def"
Include "Icons.def"
Declare Sub main
Sub main
Dim Array1(), SelectedTable as String
Dim NumOfTables, i, j, SelectionFromArray1 as Integer
NumOfTables = NumTables()
ReDim Array1(NumOfTables)
For i=1 to NumOfTables
j=TableInfo(i, TAB_INFO_TYPE)
'**when this line is commented out the script will work, but I'd like to have only normal tables in array variable.If j=1 then
'**when this line is commented out the script will work, but I'd like to have only normal tables in array variable.Array1(i)=TableInfo(i, TAB_INFO_NAME)
End If
'**when this line is commented out the script will work, but I'd like to have only normal tables in array variable.Next
Dialog
Title "Dialog Title"
Control StaticText
Position 5,5
Title "Select table from list"
Control PopupMenu
ID 1
Position 5,15 Width 250 Height 100
Title from variable Array1
into SelectionFromArray1
Control OKButton
Control CancelButton
If CommandInfo(CMD_INFO_DLG_OK) Then
' table_to_update=Loend1(NrLoendist1)
SelectedTable=Array1(SelectionFromArray1)
Note SelectedTable
End If
End Sub
------------------------------
Asko Poder
Knowledge Community Shared Account
------------------------------