Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How good is your memory?
Message
 
 
To
11/10/2001 17:55:10
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00567276
Message ID:
00567371
Views:
11
Doug,

The first dot indicates, that macro finishes right here, then you can use other dots, if needed as in your examples. My colleague uses macros a lot and always put a dot at the end (old habit, I presume). However, in both cases you really don't need macros. You can use evaluate function in the first example and name expression in the second, like this:

>cDBF = alias() && cResults
>cField = "cXML" + alltrim(str(nLoop)) && 1, 2 & 3
>
>and then do this:
>
>? evaluate(cDBF+"."+cField) && and you'd get the proper field.

and this:

store 5 to ("THISFORM."+cTextbox+".value")

Look at David Fluker (?) FAQ #7841 here, it explains all this stuff pretty good.

>Hi all,
>
>Hey everyone... We were having a discussion with a junior programmer about macro expansion and the topic of usung double dots came up. Actually discovered this quite by accident and I had to admit that while using double dots has been around for ages I couldn't remember all of the reasons and justifications for its implementation.
>
>For example:
>
>Temporary cursor named "cResults" containing fields named "cXML1", "cXML2" & "cXML3".
>
>Well, I pointed out to Jeff that you could do something like this:
>
>cDBF = alias() && cResults
>cField = "cXML" + alltrim(str(nLoop)) && 1, 2 & 3
>
>and then do this:
>
>? &cDBF..&cField and you'd get the proper field.
>
>For the life of me I can't remember the reason we needed to use double dots but after talking to Craig Berntson he suggested that one might indicate the end of a macro expansion and the second dot was interpreted as the 'normal' dot used when referring to a table plus field.
>
>This seems the most accurate but I was wondering if any of you old timers <g> might remember anything additional to this.
>
>This also works for situations like "THISFORM.&cTextbox..value" which would also make sense, given the presumption above.
>
>Thoughts??
>
>Best,
>
>DD
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform