Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Opening a file
Message
From
04/12/2001 08:09:18
 
 
To
03/12/2001 08:44:21
John Marrone
Bloodstock Research Inc.
Lexington, Kentucky, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00588662
Message ID:
00589165
Views:
24
>I open a file with this code.
>cFileName = GETFILE('MCP', 'Data files:', 'Open', 1, 'Select a Data File')
>nHandle = FOPEN(cFileName)
>
>and cFileName will hold C:\AMCP2\DOWNLOAD\APX0912.MCP but I will get a -1
>return to nHandle which indicates it failed. But how could this be. I pass it the path and all. I notice foxpro returns path commands with a backslash on
>the end of the string. Like CURDIR() and so forth. Is there something I should
>know about foxpro's ways in dealing with directory commands. Thanks for any help.

As to the issue of the extra backslash, use the ADDBS() function when concatenating pasths, and the problem gets solved - if no "\" is there, it adds one, and then you omit leading "\" references to the suffix.
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