Try this simple set of MapBasic commands:

Include "MapBasic.def"

Declare Sub Main
Declare Function GetTableName$() As String

'***********************************************************
Sub Main

Dim  szTab As String

     szTab = GetTableName$()

     Note "You choose " & szTab

End Sub

'***********************************************************
Function GetTableName$() As String

Dim  arrTabs() As String,
     i, nTab, nNumTabs As Integer

OnError Goto ErrorOccured

'**Returns "" if anything fails
GetTableName$ = ""

     nNumTabs = NumTables()
     If nNumTabs = 0 Then
          Note "No open tables!"
          Exit Function
     End If

     ReDim arrTabs(nNumTabs)
     For i = 1 To nNumTabs
          arrTabs(i) = TableInfo(i, TAB_INFO_NAME)
     Next

     Dialog
          Title "Select table"

          Control ListBox     Position 5,5    Width 120      Height 80
               Title From Variable arrTabs
               Value 1
               Into nTab
          Control OKButton
          Control CancelButton
     If not CommandInfo(CMD_INFO_DLG_OK) Then
          '**The user choose to cancel this dialog
          Exit Function
     End If

     If nTab > 0 Then
          GetTableName$ = arrTabs(nTab)
     End If

     Exit Function
'----------------
ErrorOccured:
     Note "Error: " & Error$()

End Function

HTH,
Peter
------------------------------------------------------------------------------------------------
Peter Horsb�ll M�ller, GIS Udviklingskonsulent / GIS-Developer
Kampsax A/S - GIS Software & Solutions
Rugaardsvej 55, 5000 Odense, DK
tel: +45 6313 5013,  dir:+45 6313 5008,  fax: +45 6313 5090
mailto:[EMAIL PROTECTED]
www.kampsax-gis.dk and www.kampsax.dk
Authorized MapInfo Partner & Distributor in Denmark and Norway.
------------------------------------------------------------------------------------------------
Klik ind p� http://www.kortal.dk og se det hele lidt fra oven!
Check http://www.kortal.dk and have a look at Denmark from above!
----- Videresendt af Peter M�ller/Kampsax - 13-05-2002 15:25 -----
                                                                                       
                                  
                    "Norman, Malcolm"                                                  
                                  
                    <MNorman@portsmouth        Til:    "'Mapinfo-L (E-mail)" 
<[EMAIL PROTECTED]>         
                    cc.gov.uk>                 cc:                                     
                                  
                                               Vedr.:  MI-L Command to select a table  
                                  
                    13-05-2002 14:33                                                   
                                  
                                                                                       
                                  
                                                                                       
                                  



Hi Listers,
           Quick question, what command do I use to enable a user to select
one
table to process from all that are open in a mapinfo session, via a
dialogue
box?

Malcolm Norman
GIS Development
GIS Services
Engineering & Design Service
Portsmouth City Council
Portsmouth
UK
Tel: (44) 023 9284 1603
Fax (44) 023 9287 6414



**********************************************************************
This footnote confirms that this email message has been swept
for the presence of computer viruses and none were found.

Portsmouth City Council. IT Services
(New Rich incoming )
**********************************************************************


---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to