Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GETFILE() change my path?
Message
De
26/08/2005 02:04:01
 
 
À
26/08/2005 01:53:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01043785
Message ID:
01044193
Vues:
22
>Hi Peter,
>I saw it but I had to leave last night :)
>Wrapper sets start path but also, even if you don't specify
>start path will always starts from the same point (what ever was current path).
>
>Essentially, for some reason getfile() if file is selected
>will start next time from that position. You can try this from command window. Wrapper before doing anything, saves that startpoint path so even if you specify/start search from some other start path, will at the end reset it back to original one.
>
>Now, only command I found being able to accomplish that with getfile() is
>'set default to'. Do you know any other ?

My 'framework' permits the use of SET DEFAULT within a function that restores the default path before returning. If yours does too, then I see no problem using that command.

Pity for Fabio. :)

>Anyways, since Fabio *forbid* himself using this command in thread u mentioned - he will not be able to take advantage of this simple fix :)
>
>Rgds++
>Sergio
>
>
>
>
>
>
>
>
>
>>Fabio Lunardon today started a thread: ISSUE: set getfile/getpict/putfile start directory Thread #1043828 Message #1043828
>>Your function has obviously been built to do exactly what he wants: To let getfile() start in a directory that is chosen by the developer.
>>
>>You want a nap too? Go ahead. :)
>>
>>
>>>Hi Peter,
>>>Actually nothing changes - except start point of consecutive getfile()
>>>if file in some other directory is selected.
>>>
>>>Try ;
>>>
>>>? set('default')
>>>? set('path')
>>>? allt(sys(5)) + allt(sys(2003))
>>>
>>>cFile=getfile()  && select some file in some other folder
>>>
>>>? set('default')
>>>? set('path')
>>>? allt(sys(5)) + allt(sys(2003))
>>>
>>>**and then again
>>>
>>>=getfile()
>>>
>>>
>>>
>>>Well, my wrapper fixes nothing then :)) , just ensures that getfile()
>>>always starts from the same point.
>>>
>>>If this is NOT Brenda's problem then I need a nap as well :)
>>>
>>>Rgds++
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>>I also tried it in vfp6sp5 and there too, no change of current path. Please re-check.
>>>>
>>>>>Hi Peter,
>>>>>I don't know, I still with VFP6 SP5 .
>>>>>I use this wrapper for years now because of this particular
>>>>>reason. If getfile() is fixed in later versions then voila!
>>>>>All chilldren happy :)
>>>>>
>>>>>Rgds++
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>
>>>>>>Huh? Getfile() does not change directory in my versions of vfp: 7 and 9.
>>>>>>So, IMO, no wrapper is required.
>>>>>>
>>>>>>>Here is my wrapper function handling this isuue.
>>>>>>>Next to saving current folder it also lets u start search starting from particular path.
>>>>>>>
>>>>>>>
>>>>>>>function svgetfile
>>>>>>>    lparameters cPath,cExt
>>>>>>>    local  sv_path,aa
>>>>>>>    sv_path=allt(sys(5)) + allt(sys(2003))
>>>>>>>    if directory(cPath)
>>>>>>>        set default to (cPath)
>>>>>>>    endif
>>>>>>>    aa=getfile(iif(empty(cExt),'',cExt))
>>>>>>>    set default to (sv_path)
>>>>>>>    return aa
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>Rgds++
>>>>>>>Sergio
>>>>>>>
>>>>>>>>When I issue a GETFILE() and the client navigates to a new folder, does that have any affect on my VFP application? Do I need to save something prior to the GETFILE() and then reset it?
>>>>>>>>
>>>>>>>>Brenda
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform