[Gambas-user] use a string to make a call

Dimitris Anogiatis dosida at ...626...
Thu Jul 23 06:20:20 CEST 2009


You're welcome JY :) Keep up the good work :)

On Wed, Jul 22, 2009 at 10:09 PM, Jean-Yves F. Barbier <12ukwn at ...626...>wrote:

> Dimitris Anogiatis a écrit :
> > JY, I don't know if there's a direct way but this workaround has worked
> for
> > me in the past
> >
> > PUBLIC SUB Form_Open()
> >     'populate the listview as an example.
> >     Listview1.Add("Blah","Hi there")
> >     Listview1.Add("Blah2","How are you")
> > END
> >
> > PUBLIC SUB chooseSub(choice as String)
> >
> >     SELECT CASE choice
> >        CASE "Blah"
> >                Message.Info("Key is Blah")
> >        CASE "Blah2"
> >                Message.Info("Key is Blah2")
> >        CASE ELSE
> >     END SELECT
> >
> > END
> >
> > PUBLIC SUB ListView1_Click()
> >     'give the key of the selected item as a parameter
> >     'to the chooseSub subroutine
> >     chooseSub(Listview1.Item.Key)
> > END
> >
> > Hope I helped,
>
> YES Dimitri: that's exactly what I wanted
> Thanks!
>
> JY
> --
> You can't underestimate the power of fear.
>                -- Tricia Nixon
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list