>In the world of FoxPro 2.6 for DOS I could memvars in my main startup prg and they would be avalable in all parts of my app. I am having trouble understanding how vars work in VFP. Is there any simple rule(s) or can anyone tell me of a good reference source? I would like to create them in the main prg and then change them in forms. I can't understand what I am doing wrong.
>
>ps. Thanks all the people who have been helping an old DOS programmer come out of the stone age.
John,
If you declare a variable public in your main prg it will be available in all forms - but of course changing it in one form will change it in all others.
If you want a variable to be available for every method of a form, add a form property and put the information into this property. Any changes will last the lifetime of the form.
Any variable not explicitly declared public in a form will be local - and will go out of scope when you leave the method where it is declared.
HTH
Barbara