Subject |
Re: Getting Just the File Name from Getfile() |
From |
Akshat Kapoor <akshat.kapoor@kapoorsons.in> |
Date |
Wed, 23 May 2018 08:48:45 +0530 |
Newsgroups |
dbase.getting-started |
On 23/05/2018 07:50, Louis James wrote:
> Firstly assume that I am in the folder F:\Data\2018\03-2018
>
> if I use getfile(), in the following example:
>
> f = GETFILE("*Z*.xml","Select a File",.T.,"XML Files (*.xml)")
>
> I will get on the return something like:
>
> f = F:\Data\2018\03-2018\04-23-2018 The Long FileName.xml
use RAT() to locate the position of the rightmost '\'
Lets say you get a value x
then use right(f,len(f)-x) to get your file name
You may have to add or subtract 1 to x to get the exact length.
Since I have never use getfile hence did not test this before posting.
If you have any problem send me an exact string as you get from the
function and I will test my theory.
Regards
Akshat
|
|