>>>How difficult ? Why would I need the local declaration ? You mean it's sufficient to declare a memvar to make it available after method/event routine ends ??? If so how ?
>>>
>>>scatter memvar memo
>>>
>>>It's this simple since fox2.x (not seen fox1x).
>>>Cetin
>>
>>No, I don't want to have the variable available after the method ends (this could be done by declaring the variable PUBLIC).
>>
>>What I
do try to do is to avoid variables from other procedures from being overwritten. In this sense, LOCAL is similar to PRIVATE. Imagine the following scenario:
>>
>>Procedure_A declares a variable "Client_Code"
>>Procedure_A calls Procedure_B
>>Procedure_B issues a SCATTER, and changes the value of variable "Client_Code"
>>Procedure_B finishes
>>Procedure_A produces hard-to-debug errors, because the value of "Client_Code" changed.
>>
>>This can be solved by issuing one of the following in Procedure_B:
>>
>>local Client_Code
>> or
>>private Client_Code
>>
>>
>>This way, Procedure_B uses its own copy of the variable, and doesn't overwrite the variable of Procedure_A.
>>
>>Of course, it is quite possible you never encounter this situation, so "take it or leave it". However, I find it better to program "defensively": it is often better to avoid an error in the first place, than to debug it later.
>>
>>And, since you would have to declare several LOCAL or PRIVATE variables, a single variable (SCATTER ... NAME) is much easier.
>>
>>Regards, Hilmar.
>
>OK got your point. How about :
>
>private all
>scatter memvar memo
>
>Cetin
We don't want to just beat a dead horse, but for one more swing:
"PRIVATE ALL" works and is the same number of commands as a "LOCAL loRecord", however it also hides EVERYTHING else, that may have been useful or needed in this routine somewhere. It's kinda like saying a sledgehammer works as well as the door handle... for opening the door. Sure, but maybe we wanted some of that door to still be there after we walked through!