Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Global variable dies when sent as a parameter??
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00179903
Message ID:
00180592
Views:
19
Whew - make a joke and get an essay :-) Rich, you've made some points we should all pay attention to - I know that after the aforementioned problem *I* am paying more attention to assigning identifiers!

Your point about self-documentation is one we should all pay attention to as well. Even if we're looking at our own year-old code it can be hard to remember what variables we assigned.

Thanks,
Barbara

>OK, I'll define possible ambiguity. Anywhere in a command where the position of the identifier doesn't force (V)FoxPro to interpret it as either a memvar or a field in the current table.
>
>For example, in:
>REPLACE ThisField WITH m.ThisVar
>ThisField is not ambiguous, because in that position in that command you can only have a field. ThisVar without the m. would be ambiguous, FoxPro would have to first check if there's a field named ThisVar in the currently selected table, then check for a memory variable.
>
>and in:
>ThisVar = ThisTable.ThisField
>ThisVar is not ambiguous, because in that position in that command you can only have a memory variable. ThisField without ThisTable. would be ambigous, FoxPro would first check for a field named ThisField in the currently selected table, then check for a memory variable with that name.
>
>I think that's a pretty clear black-and-white definition, and it's a hard/fast rule in my programming style to put the alias or m before any possibly ambiguous identifier. (Sometimes I also put the variable/table designator before non-ambiguous identifiers to be "self documenting".)
>
>FWIW!
Barbara Paltiel, Paltiel Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform