Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get file name only
Message
From
23/05/2014 15:42:35
 
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:
01600601
Views:
60
>>>>>>>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().
>>>>
>>>>I was just kidding :)
>>>>
>>>>An other way would be to use ctl32 with the newer style dialogs. This will return filename only in some of its properties.
>>>
>>>I understand it is Friday evening in Europe so you are allowed to kid. We, in the USA, will be allowed to understand the humor around 6 pm too.
>>
>>4.30 pm here
>
>Are the laws of humor more liberal in the UK?

There are no rules :-]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform