Set default to &saveDef

Won't work if the directory path name contains spaces so better to do:

Set default to (saveDef)

Dave


-----Original Message-----
From: ProFox [mailto:profox-boun...@leafe.com] On Behalf Of Richard Kaye
Sent: 20 July 2016 21:29
To: profox@leafe.com
Subject: RE: GETFILE and SET DEFAULT

I've always fund that when macro expanding a memvar you don't want the m. so 

Set default to &saveDef

--

rk
-----Original Message-----
From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of rafael 
copquin
Sent: Wednesday, July 20, 2016 3:57 PM
To: profoxt...@leafe.com
Subject: Re: GETFILE and SET DEFAULT

Try this:

m.SaveDef = set('DEFAULT')

set default to .......

do your thing

then get back with

set default to &m.SaveDef

or

set default to (m.SaveDef)

Rafael Copquin

On 20/07/2016 16:50, Joe Yoder wrote:
> I need to have a user choose a file with a specific extension from a 
> specific folder.  I assumed I could simply pass a file skeleton to 
> GETFILE like one does to ADIR.  When I try that FoxPro seems to 
> navigate to the proper folder but does not show any contents in the folder.
>
> I looked up the docs on GETFILE and it appears that specifying the 
> path to a specific folder is not a valid use.  One needs to "SET 
> DEFAULT TO" the desired path in a separate operation and then call 
> GETFILE with the desired extension.  This appears to work but when I 
> tried to save and restore the setting of DEFAULT before and after this 
> use I discovered that no matter what I do,
> ?SET('DEFAULT') always returns 'C:'.  Since "SET DEFAULT TO" (invalid 
> path) gives an error  and GETFILE respects the setting - apparently 
> the default value is being set but just not reported.  My conclusion 
> is that the recommended "m.SaveDef = SET('DEFAULT')" before and "SET 
> DEFAULT TO m.SaveDef) after really do nothing.
>
> Am I missing something?
>
> Thanks in advance,
>
> Joe
>
>
> --- StripMime Report -- processed MIME parts --- multipart/alternative
>    text/plain (text body -- kept)
>    text/html
> ---
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/18725b8cd2d5d247873a2baf401d4ab29021b...@ex2010-a-fpl.fpl.LOCAL
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to