VFPX / HelpFile

Community maintained VFP 9 SP2 Help file (corrected and enhanced)
21 stars 6 forks source link

SYS(2014) - File search #13

Open lscheffler opened 3 years ago

lscheffler commented 3 years ago

The SYS(2014) is sensible to VFP's method to search a file.

Example:

clear
Mkdir  C:\MyDir1
Mkdir  C:\MyDir2

Set Path To C:\MyDir1
Cd C:\MyDir2

Strtofile('','C:\MyDir1\Text1.txt')

Strtofile('','C:\MyDir2\A.txt')
Strtofile('','C:\MyDir2\Text2.txt')

*file does exist: 
?Sys(2014,'Text2.txt','C:\MyDir2\A.txt')    && Output: TEXT2.TXT
*file does not exist: 
?Sys(2014,'Text3.txt','C:\MyDir2\A.txt')    && Output: TEXT3.TXT
*will find Text1.txt along the path
?Sys(2014,'Text1.txt','C:\MyDir2\A.txt')    && Output: ..\MYDIR1\X\TEXT1.TXT