> > What i like most in vfp is the
macro substitution (
&).
> >
> > e.g.
> >
> > ViewMe = "browse"
> > Select <tablename>
> > &ViewMe;
> > or...
> > SqlSelect = "Select * from Customer"
> > execute it....
> > &SqlSelect
> > or...
> > lcWhere = [lName = "Foxy"]
> > Select * from Customer &lcWhere
> >
> > Amazing right? that's the power of vfp!!!
> >
> > Christian M. Tabligan
> >
> > Visual FoxPro is like a game...need to explore until you reach your goal to success!!!
>
> I wouldn't give the & such a high praise, not anymore. It worked great in FPD and early versions of VFP, but lately I switched to using ( ) instead. For instance, you need to append certain records from some table to the currently selected one:
>
>
&& The old way:
> LOCAL lcDBF
>
> lcDBF = DBF("SourceTableAlias")
> APPEND FROM &lcDBF FOR RECNO(("SourceTableAlias") >= 1000
>
> && The new way:
> APPEND FROM (DBF("SourceTableAlias")) FOR RECNO(("SourceTableAlias") >= 1000
>
> That is not mentioning that, when you have long path/file names with spaces in the middle (notoriously - C:\Documents And Settings\Christian\My Documents, and everything else off the Docs&Sets directory) - ( ) works better, IMHO, than & .
> So, I reserved the & for complex, built-on-the-fly SELECT statements, and use ( ) everywhere else.
>
> Regards,
>
> Ilya
Hi,
There's a lot of
alternative techniques in VFP. And that's what the so-called "
flexibility". I also tried to used your given example.
lcAppend = [APPEND FROM (DBF("SourceTableAlias")) FOR RECNO(("SourceTableAlias") >= 1000]
&lcAppend
... =)
Christian M. Tabligan
Visual FoxPro is like a game...need to explore until you reach your goal to success!!!