General information
Title:
101 VFP7 Things, Part 20 - DisplayPath()
If you've ever had a tough time displaying a short enough path to your users but show them the right parts of a long path name, VFP7's DisplayPath() might be able to help. It automatically strips out folder names to try and make a file name fit in the specified number of spaces.
?DISPLAYPATH(HOME() + 'vfp.exe', 5) && Error
?DISPLAYPATH(HOME() + 'vfp.exe', 10) && "vfp.exe"
?DISPLAYPATH(HOME() + 'vfp.exe', 20) && "c:\..\vfp7\vfp.exe"
?DISPLAYPATH(HOME() + 'vfp.exe', 40) && "c:\..\vfp7\vfp.exe"
?DISPLAYPATH(HOME() + 'vfp.exe', 50) && "c:\..\microsoft visual studio 7\vfp7\vfp.exe"
?DISPLAYPATH(HOME() + 'vfp.exe', 60) && "c:\program files\microsoft visual studio 7\vfp7\vfp.exe"
The first one gives you an error, I guess cause the file can't be reduced to that small of a string, but it kindof sucks. It would be nice if it returned a blank string, or .NULL. or something.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only