Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why cannot use & with Thisform.SomeProperty
Message
From
06/05/2009 14:37:00
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01397844
Message ID:
01398198
Views:
77
> >>Greg,
> >>
> >>Sorry to disappoint you, but in your case you should have been using name expression instead.
> >>
> >>E.g.
> >>
> >>replace (lcFiledName) with lcValue in (lcAlias) && this is much better and safer syntax
> >
> >Actually this is very unsafe syntax. It should be:
> >
> replace (m.lcFieldName) with m.lcValue in (m.lcAlias) && this is much better and safer syntax
> >to be safe. However, majority use the unsafe way. My .02 cents.
> >
> >Cetin
>
> Great point, Cetin. I used to always use m. notation, but later had to drop this habit to adhere to other programmers' style.

I generally use m. whenever there can be an ambiguity of whether or not it's a variable or field name. In cases where it can only be a variable I don't use the prefix. For example:

i = m.i + 1

I had adopted this convention from having to deal with one of the quirks of QuickSilver (a dBASE compiler) back in the DOS days. Had I used the "m." prefix on the left-hand-side of the assignment statement, it would've created a variable with "m." as part of the name -- meaning that I'd have to use "m.m.i" to access the contents of that variable.

Ugh... just had nasty flashback of dealing with dBASE III+ code using "pseudoarrays" based around macro expansions... (combined with 10-character limit on identifiers and maximum number of variables it could get ugly. At least back in those days applications were relatively simple)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform