Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SCOPE of PARAMETER in FORM
Message
 
 
To
03/06/2001 12:37:16
Ing. T.R.M. Pluym
Pluym Elektronics Bv
Hulst, Netherlands
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00514328
Message ID:
00514344
Views:
17
This message has been marked as the solution to the initial question of the thread.
First, I would not use the same name of the variable as the Init parm. I would also use LPARAMETER in the INIT:

LPARAMETER tcParm1

Next, I would store the value of the parameter, tuParm1, in a property of the form for later use. After the Init method runs, the tuParm1 value loses scope [is removed from memory].
if not PEMStatus(This, 'cParm1', 5)
   This.AddProperty('cParm1', '')
endif
This.cParm1 = alltrim(tcParm1)
In the click of your button, you can get the value of the passed parameter from the ThisForm.cParm1 property.

>When I call a form like:
>
>DO FORM frmMyForm WITH m.nMyParameter
>
>I wrote:
>
>PARAMETER m.nMyParameter
>
>in the INIT event of frmMyForm
>
>When I use:
>
>? m.nMyParameter
>
>in the INIT event it works, but the same code in the CLICK
>event of a BUTTON on frmMyForm doesn't.
>
>The problem is the SCOPE of the parameter, witch is LOCAL (I guess).
>
>My question is:
>
>1. how do I pass a parameter when I want to be PRIVATE ?
>2. how do I pass a parameter to the CLICK event of the button ?
>3. is there an other way to do this, whithout using an extra variable...
>
>
>Thank's in advance...
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform