Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Read file from disk, not from exe
Message
From
31/07/2009 00:43:43
Neil Mc Donald
Cencom Systems P/L
The Sun, Australia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Miscellaneous
Thread ID:
01414757
Message ID:
01415594
Views:
74
After having thought about it for a while, what you need to do is use WSH to open the file and extract whatever the contents are and pass it back VFP, thus bypassing VFP.

See http://www.microsoft.com/technet/scriptcenter/guide/sas_wsh_qlcc.mspx?mfr=true
>Hi Neil,
>
>What I need is to read the file as I would any other file from disk, and not use it as a config file per se.
>I have a couple of options at this point; either EXECSCRIPT, or use Windows API or ActiverX controls like Chuck suggested. All seem like soultions too complicated for such a trivial problem, but it looks like there's no other way.
>
>>Hi,
>>
>>Look in VFP help for the ALLOWEXTERNAL ON
>>
>>Specifies whether settings from an external configuration file as specified by the -C command-line switch (or located in path) are read in after those from an internal one. The ALLOWEXTERNAL term is ignored unless it is bound inside of an application.
>>
>>Default: OFF
>>
>>>I have a config.fpw included with the exe as a text file in the project/other section. In the exe I have a function that needs to read the content of another disk file, in a different folder. The disk file happens to be named config.fpw as well, yet VFP functions (FILE(), FREAD(), etc) keep reading the content of the config.fpw file from the exe, even though I pass the file name with the complete path.
>>>There must be a way to force VFP to read the file from disk, right? TIA
Regards N Mc Donald
Previous
Reply
Map
View

Click here to load this message in the networking platform