Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MD command 3

Status
Not open for further replies.

FoxWing

Programmer
Dec 20, 2004
44
GB
Hi,

I came across an error when i try to create a directory which contain a space.


Example
w_path = "c:\Program Files\ABC"

MD &w_path <-- this will only create a folder called PROGRAM

Does anyone has a clue why ?

Thanks







 
Foxwing,

Yep, this is a familiar problem. The fault lies not in the use of MD, but in the macro expansion. The "&" operator will see the space as the end of the string which it is expanding. The solution is to either use parens:

MD (w_path)

or (better) avoid spaces in path names altogether (they can cause lots of irritating problems).

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
And for completeness, you can also use:
Code:
w_path = "c:\Program Files\ABC"
MD "&w_path"
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top