Hi

Just as a side to the thread.

If you send an empty Array to a Sub you can fill it in the sub and use it in
the dialog.

Eg

Sub Diag
        Dim MyArray() as string
        Dim MyValue as String
        Dim MyIndex as Integer

        Call LoadArray(MyArray)
        Dialog
                .....
                Contol ListBox
                        Title From Variable MyArray
                        Into MyIndex
                ....
        if CommandINfo(....)
                MyValue = Myarray(MyIndex)
        end if
End Sub

Sub LoadArray(DiagArray() as String)
        Dim i as Integer

        For i = 1 to ...
                Redim DiagArray(i)
                daigArray(i) = ....
                Load Array Here

        Next

End sub


Hope This helps, it a method I use alot

Yours

Anton de Gruchy
----------------------
MapIT
29 Tecoma Crescent
Thornton
Cape Town
7460, South Africa
Tel: 27+21+548998
email: [EMAIL PROTECTED]
cell: 082 855 9747

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
[EMAIL PROTECTED]
Sent: 21 January 1999 19:26
To: [EMAIL PROTECTED]
Subject: MI MB: Listbox help



Hi.  I'm writing an application that has a listbox control.  This listbox is
populated by a semicolon-delimited string.  After the user picks one of the
items, I want to capture the name of the item they select.  I tried using
the
Into clause in the control, and also ReadControlValue, but they both simply
return the index position of the item in the list.

Example - My string is "USA;Canada;Mexico".  If the user chooses Mexico, I
want to put the word "Mexico" into a string variable.  Using the "into"
clause, I get a 3.  ReadControlValue returns a 3.

I can't use an array because the string is returned from a call to a custom
function, and arrays are not valid return types.  Since the number and
content of the values will change every time it's run, I can't use a Do Case
type of thing.

I'm starting to think I'll need to parse all of the values out of the
delimited string and populate an array with them (yuk).  There has to be a
better way.  What am I missing here?


Thanks -

  Tim Nuteson
  Dayton Hudson Corp.
  [EMAIL PROTECTED]
  612.370.6763
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to