Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem in directory name with space
Message
From
03/06/1999 20:53:48
 
 
To
03/06/1999 20:49:01
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00226341
Message ID:
00226342
Views:
24
>Hello All,
>
>I'd like to append one text file into a table but when I put that text file into directory name which is contain space in it, VFP will give an error message "Unrecognized command..."
>
>eg.
>directory name= "h:\project finance\" failed.
> change to = "h:\project_finance\" success
>
>used syntax:
>m_file=getfile()
>appe from &m_file sdf
>
>
>is there any specific command to handle this problem.

Yep - don't use macro expansion if you can avoid it; you create your own problems for the command line parser in the example above, because the space in the macro-expanded line is seen as a peparator. You could encapsulate the macro expansion in quotes, but using name resolution instead would avoid the problem neatly, and is faster as well! For the example above, try:

m_file = GETFILE()
APPEND FROM (m_file) SDF

or if you didn't need to save the file name at all beyond the APPEND:

APPEND FROM (GETFILE()) SDF
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform