Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FPD25: IF FILE() will it work or not
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00589099
Message ID:
00589284
Views:
22
>Dear All
>
>This is urgent and driving me crazy. The following code
>
>
>	SELECT (m.zsavesele1)
>
>	SCAN FOR &ztransfld. = &zourfield.
>		IF FILE("sprs\" + m.zscrname + ".spr")
>			DO deleteothers IN (m.zscrname + ".spr")
>		ENDIF
>		
>		
>		SELECT (m.zsavesele1)
>		
>		DELETE
>	ENDSCAN
>
>
>
>The IF FILE() works on a PIII 550 W2K Machine and fails
>on a 486 12MB RAM W98 machine. I tried relative path
>as specified above as well as IF FILE(m.zscrname + ".spr")
>but none of them work on the W98 machine

I find it best to provide a full path to a file -- it eliminates ambiguity.

In particular, the setting of SET PATH can provide VFP with alternate paths to find the file -- sometimes where you don't want them!

I'd do the following sandwich around the code and hopefully this will provide consistent results between the two environments:
LOCAL   lcOldPath
lcOldPath = SET ("PATH")
SET PATH TO

&&    Code

SET PATH TO &lcOldPath
Jay
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform