Hi Gene:
> > 2) "&tablename" is not correct. Surely will not cause an error, but is not ended with ".", so this should be "&tablename.". But because macros should not be used for "any" need, this part of the code really should be writen as "(tablename)", no macro needed.
>
> Well, no. The period is not required almost all of the time. The only times it is needed that I can think of are:
You are right, is not "incorrect" to use it, but it is a "bad programming practice", because those practices that can incur in errors are bad, and this is the case.
Why do you use a macro-expansion without period when you know that in certain cases does not work? It is safer to always add the dot and forget about it!
I know well the special cases of this, but that's why everybody should use the final dot, because nobody should care thinking about when to use it or when don't. It's a waste of time.
>
> 1) The character after the macro substitution is a period. e.g.
>
&someobj..property=0
> Without the second period, if someobj had the value "objname", the result would be
>
objnameproperty=0
>
> 2) The character after the macro substitution is a character valid in a variable name. e.g.
>
¯o.text
> to get the value of macro followed by "text". Without the period, VFP will try to do & on the variable macrotext which probably does not exist.
>
> Any other time, the next character will not be legal as part of a variable name, so the variable name will be delimited.
>
> Sincerely,
>
> Gene Wirchenko
Fernando D. Bozzo