Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Public variables become Private
Message
From
21/02/1997 10:06:16
Narendra Lilaramani
Gentech Business Machines Ltd
Ahmedabad, India
 
 
To
20/02/1997 14:48:35
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00021278
Message ID:
00021526
Views:
45
>>>>>
>>>>> >I created one form in which I used scatter memvar command. Now these
>>>>> variables were public & so available
>>>>> >throughout the form.
>>>>> >Now I call this form from a program. This time scatter
>>>>> >memvar does not created public variables but they were
>>>>> >private.
>>>>> >What is this??Can anybody help me so that if I call the
>>>>> >form from a program and these varibles remain public.
>>>>> >Otherwise I have to go into each of my forms & change
>>>>> >handling of some parts.
>>>>> >
>>>>> >Thanks
>>>>> >Narendra
>>>>>
>>>>> i'd recommend against using public variables. if you issue 'scatter
>>>>> memvar' command from command window, the variables are public. if issued
>>>>> from within form, the variables are (by default, i think) private to that
>>>>> form.
>>>>
>>>>I'd say they are private to the method that issued the scatter memvar
>>>>statement, making it perfectly unusable...
>>>>
>>>>Marc
>>>
>>>if issued in a method, yes. this looked like a 2.6 question (to me, anyhow), so i gave a 2.6 answer. hope i didn't cause too much trouble.
>>
>>
>>The variables are PUBLIC if they are issued from the "form". I
>>do this in form's load event. But if I say "DO form form_name"
>>from a program (.prg file) variables become private.
>>
>>Narendra
>
>Narenda
>
>Sounds like you are getting bit by the same thing that bit me in my first VFP projects. Remember....the LOAD event is equivalent to a procedure. Therefore, unless you declare ALL of the memory fields PUBLIC, they will be considered private at the form level.
>
>This was one of the hardest things I had to get used to..."OmyGod!! you mean I gotta let them work IN the .dbf???"

No, I have tried the form from outside the program (Issued Do Form command from the command Window). Which works perfectly & all memory variables are public.But as soon as I issue Do Form command from within a Program memory variables are Private

Narendra
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform