John

You need to set up all the values in an array first.
Unlike other languages you can't set up a combo/listbox/pop-up from a
table or cursor.
So, if your options ARE in a table you need to get THEM into the array
first of all

Below is an example of how I get my routes into an array.  In your case
you get your descriptions.

'________________________________________________
Sub GET_ROUTES_ARRAY
'___________________
 Dim    lnNoRows        as SmallInt, 
        lcRoute         as String

 Select * from Route 
   into csrRoute  
   order by Route NoSelect      ' Gets the table in Route No. order,
ready for the pop-up
 lnNoRows                                 = TABLEINFO( "csrRoute",
TAB_INFO_NROWS)
 Fetch First From csrRoute  
 ReDim gaSerRouteNames( lnNoRows)       ' array enough elements for the
num. or rows in cursor  
 Do While Not EOT( csrRoute)            ' build array of Route nums
        lcRoute                    = RTRIM$( csrRoute.Route) 
        gaSerRouteNames( lnNoRows) = lcRoute    ' Global array
   Fetch Next From csrRoute 
 Loop 
 Close Table csrRoute
End Sub

Later when the user needs to select a route I call the dialog GET_ROUTE:

Sub GET_ROUTE
' ______________________________
' Get a Route from gaSerRouteNames global array
' ______
  DIALOG
        Title "Select Route"
        Control StaticText
                Title "Existing Route:          "
        Control PopUpMenu 
                Title from Variable gaSerRouteNames 
                Value 1
                Into  gnSelID
   Control OKButton
   Control CancelButton

   If CommandInfo( CMD_INFO_DLG_OK) Then
        gcRoute = RTRIM$( gaSerRouteNames( gnSelID))    ' Global
variable
   End If 

End Sub
____________________

HTH

Best wishes

Terry McDonnell

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of John
Gosbell
Sent: 30 November 2005 17:31
To: Terry McDonnell
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

_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l

Reply via email to