> > Hi,
> >
> > In my quest for doing away with public variables, I have created a form which has properties created where local variables are stored. I have created a method called getvar, which retrieves variables from the properties like
> >
> >
gddate=thisform.gddate
> > gnmonth=thisform.gnmonth
> >
> > etc.
> >
> > Whenever required I need to retrieve the variables from this method by calling thisform.getvar()
> >
> > However, the variables are not retrieved, with errors obtained like "gddate not found" after issuing this command
> >
> >
> > What, could I have done wrong?
> >
> > Regards,
> >
> > Steve
>
> Hi Steve,
>
> This response is my opinion only.
>
> I can have 1000 Public variable, or declare all the variable in my application as public and finish my application with no single error if you know how to handle them.
>
> so, i did not understand why you are not using public variable when needed since they exist as in vfp
>
Public variables make your code inflexible, and fragile. When you write code, you need to think about not just writing it now, but maintaining over time. And as soon as you start to think about maintenance, you have to face the possibility that someone other than you is going to have to maintain it. For that reason alone, it's a good idea to follow best practices. And avoiding public variables is absolutely a best practice.
Tamar