Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A Revisit of & versus ()
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00746640
Message ID:
00746673
Views:
20
This message has been marked as a message which has helped to the initial question of the thread.
Bret,

There's no reason to use macro substitution in cases when name expression can be used, because name expression is faster and it doesn't blow up when name has spaces in it.
You may find following threads about macro substitution interesting
- Re: Macro substitution Thread #735756
- Re: Macro Substitution - Epilogue Thread #736706

The macro substitution blows up in your case because EXPORT TO &lctmp TYPE XL5 is expanded to EXPORT TO C:\DOCUMENTS AND SETTINGS\JAMES.FOX\MY DOCUMENTS\VF DATA\PSS\TEMP\0VE0HHCJB.XLS TYPE XL5.

>For several years now I have had an application that has used the sytax:
>
>EXPORT TO &lctmp TYPE XL5
>
>Which has worked as expected. But since we are now under the NMCI transition. (If you don't know what NMCI is then consider yourself lucky). I have had a user call me and tell me that my application is generating an error on his NMCI machine. When I viewed the error log I found that the above error occurred on the line above and that the lcTmp was set to:
>
>"C:\DOCUMENTS AND SETTINGS\JAMES.FOX\MY DOCUMENTS\VF DATA\PSS\TEMP\0VE0HHCJB.XLS"
>
>This is a Windows 2000 machine that he is running the app on.
>
>Well I changed the code to:
>
>EXPORT TO (lctmp) TYPE XL5
>
>And all worked fine. But my memory of exactly why I went with & versus () is fuzzy and the difference between the 2 is also a little fuzzy. I seem to remember that one is faster than the other, but that is about all.
>
>So after all this can someone give me the reason () worked and & did not for the above case. And could someone give me any warnings of where () may not work in the furture that & took care of. As I also have to decide if I need to change my code for commands such as ERASE and REPORT FORM in regard to the & and ().
>
>TIA
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform