Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. articles. downloads. faq. members. files. rss.
 From: Fernando Bozzo
  Where is Fernando Bozzo?
 Madrid
 Spain
 Fernando Bozzo
 To: Gene Wirchenko
  Where is Gene Wirchenko?
 Kamloops, BC
 Canada
 Gene Wirchenko
Subject: RE: if file() on windows 10 error
Thread ID: 434795 Message ID: 434903 # Views: 50 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Operating Systems
Date: Monday, March 14, 2016 7:11:45 PM         
   



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.
>
     &macro.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

ENTIRE THREAD

if file() on windows 10 error Posted by Jorge Matheus @ 3/10/2016 11:35:24 PM
RE: if file() on windows 10 error Posted by Koen Piller @ 3/10/2016 11:46:27 PM
RE: if file() on windows 10 error Posted by Rahul Moudgill @ 3/11/2016 3:42:24 AM
RE: if file() on windows 10 error Posted by Tore Bleken @ 3/11/2016 8:18:52 AM
RE: if file() on windows 10 error Posted by Nadeem Shah @ 3/12/2016 5:35:22 AM
RE: if file() on windows 10 error Posted by Mike Yearwood @ 3/13/2016 7:06:36 PM
RE: if file() on windows 10 error Posted by Nadeem Shah @ 3/14/2016 1:10:52 PM
RE: if file() on windows 10 error Posted by Mike Yearwood @ 3/14/2016 2:22:47 PM
RE: if file() on windows 10 error Posted by Nadeem Shah @ 3/14/2016 4:38:15 PM
RE: if file() on windows 10 error Posted by Fernando Bozzo @ 3/14/2016 4:54:01 PM
RE: if file() on windows 10 error Posted by Gene Wirchenko @ 3/14/2016 6:02:54 PM
RE: if file() on windows 10 error Posted by Fernando Bozzo @ 3/14/2016 7:11:45 PM
RE: if file() on windows 10 error Posted by Gene Wirchenko @ 3/16/2016 6:17:44 PM
RE: if file() on windows 10 error Posted by Mike Yearwood @ 3/16/2016 10:04:30 PM
RE: if file() on windows 10 error Posted by Gene Wirchenko @ 3/20/2016 8:26:58 AM
RE: if file() on windows 10 error Posted by Tore Bleken @ 3/14/2016 5:19:36 PM
RE: if file() on windows 10 error Posted by Nadeem Shah @ 3/14/2016 7:39:38 PM
RE: if file() on windows 10 error Posted by Victor Espina @ 3/12/2016 4:09:52 PM
RE: if file() on windows 10 error Posted by Jorge Matheus @ 3/14/2016 3:54:28 PM
RE: if file() on windows 10 error Posted by Victor Espina @ 3/14/2016 5:52:09 PM