> > 4 LOCAL - The LOCAL declaration creates the variable and assigns it a value of .F. The lifetime of a LOCAL variable is the same as that of a PRIVATE variable although the visibility is limited to only the routine that declared the variable.
> >
>
> Hi Jim,
>
> I am not agree with your local variable scope because I don't think if local variables in VFP are working in a way its definition says.
> I have declared m.ddate variable as local in this program file and assigned a value to this variable,
> then on my form modal1 i have a textbox and its controlSource is m.dDate.
> when I call this form it is showing the value of m.dDate variable whose scope is limited to my calling program module.
> And when I update value in textbox then its showing me the updated value in the calling program where this variable is declared as LOCAL.
>
> if this is the case then what about security of my LOCAL m.ddate variable?
>
>
> LOCAL m.ddate as Date
> m.ddate = DATE() - 5
> DO FORM modal1 && have a textbox with controlsource m.ddate, change date on this form.
> WAIT WINDOW m.ddate && showing updated value from form's textbox
> RETURN
>
Your command DO FORM is creating an object in memory and that object's scope is to the procedure that created it which is the same scoping level as the LOCAL variable.
JimB
www.JamesBooth.comMVP 1993-2003
Microsoft Certified Professional in VFP