Heres some code for the Directions Mag site /tool/code
Given to us by Author Gajendra Salunkhe
Uses a lookup table to give the user predefined choices for fields
Great if you are after consistent data entry
If you want to add more choices then add in more rows to the lookup table
'****************************************************************
'* Program Name: Table_Popupmenu
'*
'* Description: To have the Table Data into PopupMenu Control
'*
'* Created By: Gajendra Salunkhe
'*
'* Date: 08-09-2001
'*
'* email : [EMAIL PROTECTED] , [EMAIL PROTECTED]
'****************************************************************
'** If application says workspace not found than change the code and have your
own workspace or table name.
Include "MapBasic.Def"
Declare Sub Main
Sub Main
Dim i As Integer
'***** Array to have the Stored Data Maximium 1000 rows is possilbe in this
array
Dim p_str, p_string(1000)As String
i = 0
'** Insted of workspace you can also use table
Run Application "C:\Program Files\MapInfo\Professional\Data\WORKSPCS\world.wor"
'*** Change the Name of Table and Column to include different Table
Fetch First From countries
Do While Not EOT(countries)
i = i + 1
p_string(i) = countries.Country
Fetch Next From countries
Loop
Dialog
Title "Table Data"
Width 139
Height 63
Control PopupMenu
Title From Variable p_string
Width 81
Height 14
Position 54, 17
Control StaticText
Title "Table"
Width 32
Height 8
Position 3, 19
Control OkButton
Width 58
Height 12
Position 5, 43
Control CancelButton
Width 64
Height 13
Position 72, 41
End Sub
Regards,
Andrew Hare
GIS Officer
Waimate District Council
New Zealand
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Gosbell
Sent: Wednesday, 30 November 2005 3:46 p.m.
To: [email protected]
Subject: [MI-L] Setting Up Pick Lists for Attribute Editing within MI Pro
Howdy,
Can anyone provide me with some example Map Basic code illustrating how to
set up data entry via a predefined Picklist within MapInfo Pro?
Eg. when entering attributes, instead of having to type in the values,
the user is presented with a dropdown list of all the available options
(eg for Footpath Type have the options of "Blockpaved", "Asphalt",
"Concrete", "Gravel")
Cheers and Thanks
John Gosbell
GIS Administrator
City of Burnside
pH 088 366 4130
fax 088 366 4299
This Email is personal correspondence from the sender. It is not an
official document from the City of Burnside.
_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.10/188 - Release Date: 29/11/2005
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.10/188 - Release Date: 29/11/2005
_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l