Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detecting the value of a listbox
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00521620
Message ID:
00521664
Vues:
18
>>>George --
>>>
>>>That one sounds ripe for an access method %)
>>
>>Jay,
>>
>>Not a bad idea for single selection list box. Probably have to return a delimited string for mult-select.
>
>George --
>
>It's one of those things that I only write once for a control, but always have to think about... It would be simple to test for the type of the parameter, and pass back a delimited string if a DS of numbers were passed in.

Jay,

Sure something like this:
PROCEDURE SelectedItems_Access
  LOCAL lcresult, lni
  lcresult = ""
  WITH This
    IF .MultiSelect
      FOR lni = 1 TO .ListCount
        IF .Selected(lni)
          lcresult = lcresult + .List(lni) + ","
        ENDIF
      NEXT
      IF NOT EMPTY(lcresult)
        lcresult = LEFT(lcresult, LEN(lcresult) - 1)
      ENDIF
    ELSE
      IF .ListIndex > 0
        lcresult = .List(.ListIndex)
      ENDIF
    ENDIF
  ENDWITH
ENDPROC
? _SCREEN.ActiveForm.List1.SelectedItems
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform