Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get file name only
Message
 
 
To
23/05/2014 11:20:15
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01600582
Message ID:
01600586
Views:
59
>>Hi,
>>
>>How do you find the file name only, returned by GetFile() function; without the path to the file?
>>
>>TIA
>not direct but
>
>?justfname(getfile())
>/pre>
>should do the work
>
>if you insist on GetFile the following will work
><pre>
>#DEFINE GETFILE MyGetFile
>
>?GETFILE()
>
>FUNCTION MyGetFile
> LPARAMETERS;
>  cFileExtensions,;
>  cText,;
>  cOpenButtonCaption,;
>  nButtonType,;
>  cTitleBarCaption
>
> #UNDEFINE GETFILE
>
> lvTemp = PCOUNT()
> DO CASE
>  CASE lvTemp=0
>   lvTemp = JUSTFNAME(GETFILE())
>  CASE lvTemp=1
>   lvTemp = JUSTFNAME(GETFILE(cFileExtensions)
>  CASE lvTemp=2
>   lvTemp = JUSTFNAME(GETFILE(cFileExtensions,cText))
>  CASE lvTemp=3
>   lvTemp = JUSTFNAME(GETFILE(cFileExtensions,cText,cOpenButtonCaption))
>  CASE lvTemp=4
>   lvTemp = JUSTFNAME(GETFILE(cFileExtensions,cText,cOpenButtonCaption, nButtonType))
>  CASE lvTemp=5
>   lvTemp = JUSTFNAME(GETFILE(cFileExtensions,cText,cOpenButtonCaption, nButtonType,cTitleBarCaption))
>  OTHERWISE
> ENDCASE
>
> RETURN lvTemp
>ENDFUNC &&MyGetFile
>
Thank you. But with all due respect; seems like over-kill. I can get the file with GetFile() and then simply get the file name by applying justfname().
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform