Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get file name only
Message
 
 
À
23/05/2014 11:36:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01600582
Message ID:
01600592
Vues:
55
>>>>>>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?
"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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform