David
Haven't done
it and haven't the time to do it for you but it's quite
simple:
Use
NUMTABLES() to get the number of tables open.
lnNumTables = NUMTABLES()
Then, in a
loop:
For
lnTableNo = 1 to lnNumTables
build up an array of all the table names:
gaTablesArray( lnTableNo) = TABLEINFO( lnTableNo,
TAB_INFO_NAME)
...
and, of course, use this array
as the source for your pop-up.
To get the columns for a
selected table, first find how many columns in selected
table:
lnNumCols =
TABLEINFO( gaTablesArray( gnDlogSelectID),
TAB_INFO_NCOLS)
Then build up your array of
column names as source to your column names listbox (Make this a function, with
table array index as param, then you can do this with param 1, for 1st table, as
default value):
For lnColNo = 1 to
lnNumCols
lcCol =
"COL" + RTrim$( Str$( lnColNo)
gaColNamesArray( lnColNo) = COLUMNINFO( tnDlogSelectID, lcCol,
COL_INFO_NAME)
...
As I recall, you're pretty hot
at building dialogues by now.
HTH. Any questions, I'm
here
Terry
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Llewellyn, David
Sent: 30 May 2006 11:16
To: Terry McDonnell
Subject: [MI-L] Populating Dialog Controls
Dear all,
Does anyone have some MapBasic code to populate a couple of MapBasic Dialog controls as follows?:
- A
PopUpMenu containing the names of open tables in Mapinfo,
- A ListBox that
will be updated with the column names of the table chosen in the above
PopUpMenu
(on opening would default to the column names in the first open
table).
Thanks in advance.
_______________________________________________ MapInfo-L mailing list [email protected] http://www.directionsmag.com/mailman/listinfo/mapinfo-l
