Hi Tim

Try using this function:

where index is your list index,  and BasisStreng is your string
'******************************************************************
Declare Function PopUpHandler(ByVal Index as Integer,
                              ByVal BasisStreng as string,
                              ByVal SkilleTegn as string) as string

'this is the call to the function
SubString = PopUpHandler(iPopUpIndex, sgPopUpTitle, ";")

Function PopUpHandler(ByVal Index as Integer,
                      ByVal BasisStreng as string,
                      ByVal SkilleTegn as string) as string
    Dim sUdtr�k as string,
        Pos1, Pos2, L�ngde, i as SmallInt

    L�ngde = Len(BasisStreng)
    Pos2 = 0
    i = 0
    Do
       i = i + 1
       Pos1 = Pos2 + 1
       Pos2 = Instr(Pos1,BasisStreng,SkilleTegn)
    Loop Until i = Index

    If Pos2 <> 0 Then
       PopUpHandler_2 = Mid$(BasisStreng, Pos1, Pos2-Pos1)
    Else
       PopUpHandler_2 = Right$(BasisStreng, L�ngde-Pos1+1)
    End If
End Function
'******************************************************************


Peter Laulund
National Survey and Cadastre, Denmark




[EMAIL PROTECTED] - 21-01-99 18:26:03

Til:    [EMAIL PROTECTED]
cc:      (bcc: Peter Laulund/MI/KMS)
Vedr�rende:    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]


Reply via email to