Thank for all the responses.
My aim is to call the external dll depending on the value of the
popup menu when the button is clicked on the dialog. Using global
variable is quite satisfactory for me.
Because I am not so experienced in the mapbasic coding, these staff
are sometimes difficult for me.
Many many thanks
On Nov 9, 10:15 am, Peter Horsbøll Møller <mapinf...@horsboll-
> > ------------------------------
> > *From:*
mapi...@googlegroups.com [mailto:
mapi...@googlegroups.com] *On
> > Behalf Of *Peter Horsbøll Møller
> > *Sent:* Monday, November 09, 2009 8:12 AM
> > *To:*
mapi...@googlegroups.com
> > *Subject:* [MI-L] Re: calling handler with parameters [SEC=UNCLASSIFIED]
>
> > Why would you want to send parameters to your sub from a button?
>
> > You can read the current selected value using the ReadControlValue()
> > function.
> > And if you use a modular array to hold the values of the control you can
> > easily look up the selected value.
>
> > declare sub main
> > declare sub mysub (ByVal str as String)
> > *Dim arrValues() As String*
>
> > sub main
> > Dim varbl1 as string
> > * Redim arrValues(3)*
> > * arrValues(1) = "-"*
> > * arrValues(2) = "String 1"*
> > * arrValues(3) = "String 2"*
>
> > dialog title "MyDialog"
> > Control PopupMenu Title *From Variable marrValues*
> > Value 1 ID 1
> > into varbl1
> > Control Button Title "&Button Trial"
> > calling myButtonHandler
> > end sub
> > sub mysub
> > * Dim nItem As Integer*
> > * nItem = ReadControlValue(1)*
> > * note marrValues(nItem)
> > *end sub
>
> > Peter Horsbøll Møller
> > Pitney Bowes Business Insight - MapInfo
>
> > 2009/11/8 Steve Smith <
steve.sm...@abs.gov.au>
>
> >> I do not think there is a way in MapBasic to pass parameters in dialog
> >> code or button pad code as shown in your code sample below. I could be
> >> wrong. Using Global variables are probably the simplest MapBasic work
> >> around.
>
> >> Regards
>
> >> Steve Smith
> >> Australian Bureau of Statistics (ABS)
> >> Post: Locked Bag 10 Belconnen ACT 2616
> >> Location: ABS House, 45 Benjamin Way, Belconnen ACT 2617
> >> Geography / Spatial Data Management and Research
> >> ABS Level 2 South 228 , Wk: (02) 6252-6824
> >> Last ABS day = 3/Dec/09, moving to Deewr.
>
> >> [image: Inactive hide details for Kralizec ---09/11/2009 08:49:45
> >> AM---Hello, I wonder if there is a way to call a subprocedure with pa]Kralizec
> >> ---09/11/2009 08:49:45 AM---Hello, I wonder if there is a way to call a
> >> subprocedure with parameters by a
>
> >> Sent by:
> >>
mapi...@googlegroups.com
> >> ------------------------------
>
> >> Hello,
>
> >> I wonder if there is a way to call a subprocedure with parameters by a
> >> button handler.
>
> >> For example consider the little application below. I am trying to code
> >> something like that.
> >> I want to learn that is it possible. If not is there an other way to
> >> do that.
>
> >> Many Thanks
>
> >> declare sub main
> >> declare sub mysub (ByVal str as String)
>
> >> sub main
> >> dim varbl1 as string
> >> dialog title "MyDialog"
> >> Control PopupMenu Title "-;String 1;String 2" Value 1 ID 1 into
> >> varbl1
> >> Control Button Title "&Button Trial" calling mysub (varbl1)
> >> end sub
>
> >> sub mysub(ByVal str as String)
> >> note str
> >> end sub
>
>
>
> ecblank.gif
> < 1KViewDownload
>
> graycol.gif
> < 1KViewDownload