Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
No macro expansion in COPY FILE ???
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00212150
Message ID:
00212155
Views:
24
Try this: COPY FILE (lcFile) TO (lcDestDir). Using parenthises instead of macro expansion is much faster and it will generally work any time VFP is expecting a file name or directory.

>Hello everyone,
>
>I'm implementing a batch download program in VFP 6 so I can store, delete, and update the files to be downloaded in a table. I'm having difficulty with the COPY FILE command within a SCAN...ENDSCAN loop.
>
>lcDestDir = "D:\MyDir\"
>SCAN
> lcFile = File_Name && from the table

>ENDSCAN
>
>No dice. I get the error: "File [current directory]\&lcFile does not exist." I tried enclosing the variables in parentheses as well, with the same error. Am I missing something, or does macro expansion simply not work with COPY FILE? (The docs are mum on the subject).
>
>TIA,
>-Bernie Falor
>Database Analyst
>Library Video Co.
Previous
Reply
Map
View

Click here to load this message in the networking platform