Discussion:
GetFile() issue
Dave Crozier
2018-11-07 10:56:53 UTC
Permalink
Hi folks,
Just had an issue that has been bugging me for a while and I now why but I haven’t got a solution to hand… so maybe you can help.

In lots of places we allow users to export their reports and spreadsheet results onto their own personal “C” drives. And to do this I implement

… default folder set in prior coding

cOld_Folder = SYS(5) + SYS(2003)
set default to <suggested destination folder>
cFile = Getfile(……..)
set default to (cOld_Folder)

This code allows the user to be programmatically placed in the suggested folder to save/open files.

Unknown to me after all these years, the set default to command has an effect on the whole of the VFP thread not just the DataSession you are in. Unfortunately for me I have a number of regular timers running that check whether any particular file or process is locked, or the system is available for use i.e. it can sometimes auto log out the user to allow system maintenance for example. The timers open tables and expect to be in the base folder of the application but issuing the above coding changes the base folder for ALL the application, hence throwing errors as the tables (all held relative to the application folder) cannot be found in the new location.

So, if you action the Getfile() command and stay in the dialogue for a period of time during which the timers fire, then the timer coding cannot open it’s tables as you are no longer where it expects you to be.

Looking at the help file ( OK, I should have looked at it years ago!!) it states:
“The SET DEFAULT command is not supported in either single or multithreaded DLL servers. This command changes the default directory of the entire process, so all threads which are part of the process are affected. Use the mk:@MSITStore:c:\program%20files%20(x86)\microsoft%20visual%20foxpro%209\dv_foxhelp.chm::/html/047f2e74-3552-43b7-a18d-ee2c7dd2db6e.htm in DLL servers, in place of CD and CHDIR.”
The pertinent fact being: This command changes the default directory of the entire process, so all threads which are part of the process are affected. The same thing goes for CD and Chdir so using those as replacements is not an option unfortunately.

Has anyone any ideas as to how to produce a dialogue for saving/opening a file which doesn’t require the “set default to ” instruction?

I can modify all the timers to open tables based upon absolute paths but this would be a mega change which I am trying to avoid. Of course I could roll my own Getfile() unless anyone has one available!!!

All suggestions accepted, thanks in anticipation.

Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.

﴾⚆ᨎ⚆﴿



Flexipol® Packaging Ltd
T 01706 222 792
E ***@flexipol.co.uk
W https://www.flexipol.co.uk/
Follow us:
Unit 14 Bentwood Road, Carrs Industrial Estate, Haslingden, Lancashire, BB4 5HH

​This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.

Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.

It is the responsibility of the recipient to ensure that they have adequate virus protection.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
​​
​Terms & Conditions:
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time


--- StripMime Report -- processed MIME parts ---
multipart/related
multipart/alternative
text/plain (text body -- kept)
text/html
image/jpeg
image/jpeg
image/png
image/png
image/png
image/png
---

_______________________________________________
Post Messages to: ***@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/***@CWLP265MB0852.GBRP265.PROD.OUTLOOK.COM
** 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
Thierry Nivelet
2018-11-07 11:14:28 UTC
Permalink
use locfile() instead?

Thierry Nivelet
FoxInCloud
Give your VFP app a second life in the cloud
http://foxincloud.com/

VisitFoxInCloud Blog <http://foxincloud.com/blog/>
WatchFoxInCloud Marketing Videos
<https://www.youtube.com/channel/UCUzzqO5375-fA7dLDds-wOQ>
WatchFoxInCloud Technical Videos
<https://www.youtube.com/channel/UCrEohAtbuf3uOXBH2pjp5Vw>
Stay tuned onFoxInCloud Roadmap <http://foxincloud.com/roadmap.php>
Learnhow to use FoxInCloud <http://foxincloud.com/how-to.php>
DownloadFoxInCloud Adaptation Assistant <http://foxincloud.com/download.php> for free
Post by Dave Crozier
Hi folks,
Just had an issue that has been bugging me for a while and I now why but I haven’t got a solution to hand… so maybe you can help.
In lots of places we allow users to export their reports and spreadsheet results onto their own personal “C” drives. And to do this I implement
… default folder set in prior coding
cOld_Folder = SYS(5) + SYS(2003)
set default to <suggested destination folder>
cFile = Getfile(……..)
set default to (cOld_Folder)
This code allows the user to be programmatically placed in the suggested folder to save/open files.
Unknown to me after all these years, the set default to command has an effect on the whole of the VFP thread not just the DataSession you are in. Unfortunately for me I have a number of regular timers running that check whether any particular file or process is locked, or the system is available for use i.e. it can sometimes auto log out the user to allow system maintenance for example. The timers open tables and expect to be in the base folder of the application but issuing the above coding changes the base folder for ALL the application, hence throwing errors as the tables (all held relative to the application folder) cannot be found in the new location.
So, if you action the Getfile() command and stay in the dialogue for a period of time during which the timers fire, then the timer coding cannot open it’s tables as you are no longer where it expects you to be.
The pertinent fact being: This command changes the default directory of the entire process, so all threads which are part of the process are affected. The same thing goes for CD and Chdir so using those as replacements is not an option unfortunately.
Has anyone any ideas as to how to produce a dialogue for saving/opening a file which doesn’t require the “set default to ” instruction?
I can modify all the timers to open tables based upon absolute paths but this would be a mega change which I am trying to avoid. Of course I could roll my own Getfile() unless anyone has one available!!!
All suggestions accepted, thanks in anticipation.
Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.
﴾⚆ᨎ⚆﴿
Flexipol® Packaging Ltd
T 01706 222 792
W https://www.flexipol.co.uk/
Unit 14 Bentwood Road, Carrs Industrial Estate, Haslingden, Lancashire, BB4 5HH
​This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
​​
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time
--- StripMime Report -- processed MIME parts ---
multipart/related
multipart/alternative
text/plain (text body -- kept)
text/html
image/jpeg
image/jpeg
image/png
image/png
image/png
image/png
---
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@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/84e99b46-3ba5-c76a-0c49-***@foxincloud.com
** 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 th
Dave Crozier
2018-11-08 15:16:56 UTC
Permalink
Thiery,
Problem with Locfile is you can't search outside the VFP default folder or the path as defined in the "set path ..." command.

We want to allow the user to put/get the files from anywhere on the network, but start them off with a preferred starting point.

Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.

﴾⚆ᨎ⚆﴿


-----Original Message-----
From: ProfoxTech <profoxtech-***@leafe.com> On Behalf Of Thierry Nivelet
Sent: 07 November 2018 11:14
To: ***@leafe.com
Subject: Re: GetFile() issue

use locfile() instead?

Thierry Nivelet
FoxInCloud
Give your VFP app a second life in the cloud http://foxincloud.com/

VisitFoxInCloud Blog <http://foxincloud.com/blog/> WatchFoxInCloud Marketing Videos <https://www.youtube.com/channel/UCUzzqO5375-fA7dLDds-wOQ>
WatchFoxInCloud Technical Videos
<https://www.youtube.com/channel/UCrEohAtbuf3uOXBH2pjp5Vw>
Stay tuned onFoxInCloud Roadmap <http://foxincloud.com/roadmap.php>
Learnhow to use FoxInCloud <http://foxincloud.com/how-to.php>
DownloadFoxInCloud Adaptation Assistant <http://foxincloud.com/download.php> for free
Post by Dave Crozier
Hi folks,
Just had an issue that has been bugging me for a while and I now why but I haven’t got a solution to hand… so maybe you can help.
In lots of places we allow users to export their reports and
spreadsheet results onto their own personal “C” drives. And to do this
I implement
… default folder set in prior coding
cOld_Folder = SYS(5) + SYS(2003)
set default to <suggested destination folder> cFile = Getfile(……..)
set default to (cOld_Folder)
This code allows the user to be programmatically placed in the suggested folder to save/open files.
Unknown to me after all these years, the set default to command has an effect on the whole of the VFP thread not just the DataSession you are in. Unfortunately for me I have a number of regular timers running that check whether any particular file or process is locked, or the system is available for use i.e. it can sometimes auto log out the user to allow system maintenance for example. The timers open tables and expect to be in the base folder of the application but issuing the above coding changes the base folder for ALL the application, hence throwing errors as the tables (all held relative to the application folder) cannot be found in the new location.
So, if you action the Getfile() command and stay in the dialogue for a period of time during which the timers fire, then the timer coding cannot open it’s tables as you are no longer where it expects you to be.
The pertinent fact being: This command changes the default directory of the entire process, so all threads which are part of the process are affected. The same thing goes for CD and Chdir so using those as replacements is not an option unfortunately.
Has anyone any ideas as to how to produce a dialogue for saving/opening a file which doesn’t require the “set default to ” instruction?
I can modify all the timers to open tables based upon absolute paths but this would be a mega change which I am trying to avoid. Of course I could roll my own Getfile() unless anyone has one available!!!
All suggestions accepted, thanks in anticipation.
Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.
﴾⚆ᨎ⚆﴿
Flexipol® Packaging Ltd
T 01706 222 792
W https://www.flexipol.co.uk/
Unit 14 Bentwood Road, Carrs Industrial Estate, Haslingden,
Lancashire, BB4 5HH
​This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
----------------------------------------------------------------------
----------------------------------------------------------------------
----------------------------------------------------------------------
----------------------------------------------------------------------
-------------------------
​​
Notwithstanding delivery and the passing of risk in the goods, the
property in the goods shall not pass to the buyer until the seller
Flexipol Packaging Ltd. ("The Company") has received in cash or
cleared funds payment in full of the price of the goods and all other
goods agreed to be sold by the seller to the buyer for which payment
is then due. Until such time as the property in the goods passes to
the buyer, the buyer shall hold the goods as the seller's fiduciary
agent and bailee and keep the goods separate from those of the buyer
and third parties and properly stored protected and insured and
identified as the seller's property but shall be entitled to resell or
use the goods in the ordinary course of its business. Until such time
as the property in the goods passes to the buyer the seller shall be
entitled at any time
--- StripMime Report -- processed MIME parts --- multipart/related
multipart/alternative
text/plain (text body -- kept)
text/html
image/jpeg
image/jpeg
image/png
image/png
image/png
image/png
---
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@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/84e99b46-3ba5-c76a-0c49-***@foxincloud.com
** 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.
Report [OT] Abuse: http://leafe.com/reportAbuse/84e99b46-3ba5-c76a-0c49-***@foxincloud.com
_______________________________________________
Post Messages to: ***@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/***@CWLP265MB0852.GBRP265.PROD.OUTLOOK.COM
** 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 lawyer
Thierry Nivelet
2018-11-08 16:01:24 UTC
Permalink
You can provide a 'full path' and a file skeleton without changing cd:

? LocFile("C:\<any path>\*.prg")

Thierry Nivelet
FoxInCloud
Give your VFP app a second life in the cloud
http://foxincloud.com/

VisitFoxInCloud Blog <http://foxincloud.com/blog/>
WatchFoxInCloud Marketing Videos
<https://www.youtube.com/channel/UCUzzqO5375-fA7dLDds-wOQ>
WatchFoxInCloud Technical Videos
<https://www.youtube.com/channel/UCrEohAtbuf3uOXBH2pjp5Vw>
Stay tuned onFoxInCloud Roadmap <http://foxincloud.com/roadmap.php>
Learnhow to use FoxInCloud <http://foxincloud.com/how-to.php>
DownloadFoxInCloud Adaptation Assistant <http://foxincloud.com/download.php> for free
Post by Dave Crozier
Thiery,
Problem with Locfile is you can't search outside the VFP default folder or the path as defined in the "set path ..." command.
We want to allow the user to put/get the files from anywhere on the network, but start them off with a preferred starting point.
Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.
﴾⚆ᨎ⚆﴿
-----Original Message-----
Sent: 07 November 2018 11:14
Subject: Re: GetFile() issue
use locfile() instead?
Thierry Nivelet
FoxInCloud
Give your VFP app a second life in the cloud http://foxincloud.com/
VisitFoxInCloud Blog <http://foxincloud.com/blog/> WatchFoxInCloud Marketing Videos <https://www.youtube.com/channel/UCUzzqO5375-fA7dLDds-wOQ>
WatchFoxInCloud Technical Videos
<https://www.youtube.com/channel/UCrEohAtbuf3uOXBH2pjp5Vw>
Stay tuned onFoxInCloud Roadmap <http://foxincloud.com/roadmap.php>
Learnhow to use FoxInCloud <http://foxincloud.com/how-to.php>
DownloadFoxInCloud Adaptation Assistant <http://foxincloud.com/download.php> for free
Post by Dave Crozier
Hi folks,
Just had an issue that has been bugging me for a while and I now why but I haven’t got a solution to hand… so maybe you can help.
In lots of places we allow users to export their reports and
spreadsheet results onto their own personal “C” drives. And to do this
I implement
… default folder set in prior coding
cOld_Folder = SYS(5) + SYS(2003)
set default to <suggested destination folder> cFile = Getfile(……..)
set default to (cOld_Folder)
This code allows the user to be programmatically placed in the suggested folder to save/open files.
Unknown to me after all these years, the set default to command has an effect on the whole of the VFP thread not just the DataSession you are in. Unfortunately for me I have a number of regular timers running that check whether any particular file or process is locked, or the system is available for use i.e. it can sometimes auto log out the user to allow system maintenance for example. The timers open tables and expect to be in the base folder of the application but issuing the above coding changes the base folder for ALL the application, hence throwing errors as the tables (all held relative to the application folder) cannot be found in the new location.
So, if you action the Getfile() command and stay in the dialogue for a period of time during which the timers fire, then the timer coding cannot open it’s tables as you are no longer where it expects you to be.
The pertinent fact being: This command changes the default directory of the entire process, so all threads which are part of the process are affected. The same thing goes for CD and Chdir so using those as replacements is not an option unfortunately.
Has anyone any ideas as to how to produce a dialogue for saving/opening a file which doesn’t require the “set default to ” instruction?
I can modify all the timers to open tables based upon absolute paths but this would be a mega change which I am trying to avoid. Of course I could roll my own Getfile() unless anyone has one available!!!
All suggestions accepted, thanks in anticipation.
Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.
﴾⚆ᨎ⚆﴿
Flexipol® Packaging Ltd
T 01706 222 792
W https://www.flexipol.co.uk/
Unit 14 Bentwood Road, Carrs Industrial Estate, Haslingden,
Lancashire, BB4 5HH
​This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
----------------------------------------------------------------------
----------------------------------------------------------------------
----------------------------------------------------------------------
----------------------------------------------------------------------
-------------------------
​​
Notwithstanding delivery and the passing of risk in the goods, the
property in the goods shall not pass to the buyer until the seller
Flexipol Packaging Ltd. ("The Company") has received in cash or
cleared funds payment in full of the price of the goods and all other
goods agreed to be sold by the seller to the buyer for which payment
is then due. Until such time as the property in the goods passes to
the buyer, the buyer shall hold the goods as the seller's fiduciary
agent and bailee and keep the goods separate from those of the buyer
and third parties and properly stored protected and insured and
identified as the seller's property but shall be entitled to resell or
use the goods in the ordinary course of its business. Until such time
as the property in the goods passes to the buyer the seller shall be
entitled at any time
--- StripMime Report -- processed MIME parts --- multipart/related
multipart/alternative
text/plain (text body -- kept)
text/html
image/jpeg
image/jpeg
image/png
image/png
image/png
image/png
---
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@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/ad1e98bf-7f1c-cf6f-d8c5-***@foxincloud.com
** 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
Dave Crozier
2018-11-08 16:12:48 UTC
Permalink
Thiery,
Great spot... I hadn't noticed that in the help file. Makes the job even easier, put inside a try.. catch... endtry to catch the error if no file chosen and return back empty string makes it perform in exactly the same way as GetFile().

Thanks a million!

Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.

﴾⚆ᨎ⚆﴿


-----Original Message-----
From: ProfoxTech <profoxtech-***@leafe.com> On Behalf Of Thierry Nivelet
Sent: 08 November 2018 16:01
To: ***@leafe.com
Subject: Re: GetFile() issue

You can provide a 'full path' and a file skeleton without changing cd:

? LocFile("C:\<any path>\*.prg")

Thierry Nivelet
FoxInCloud
Give your VFP app a second life in the cloud http://foxincloud.com/

VisitFoxInCloud Blog <http://foxincloud.com/blog/> WatchFoxInCloud Marketing Videos <https://www.youtube.com/channel/UCUzzqO5375-fA7dLDds-wOQ>
WatchFoxInCloud Technical Videos
<https://www.youtube.com/channel/UCrEohAtbuf3uOXBH2pjp5Vw>
Stay tuned onFoxInCloud Roadmap <http://foxincloud.com/roadmap.php>
Learnhow to use FoxInCloud <http://foxincloud.com/how-to.php>
DownloadFoxInCloud Adaptation Assistant <http://foxincloud.com/download.php> for free
Post by Dave Crozier
Thiery,
Problem with Locfile is you can't search outside the VFP default folder or the path as defined in the "set path ..." command.
We want to allow the user to put/get the files from anywhere on the network, but start them off with a preferred starting point.
Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.
﴾⚆ᨎ⚆﴿
-----Original Message-----
Sent: 07 November 2018 11:14
Subject: Re: GetFile() issue
use locfile() instead?
Thierry Nivelet
FoxInCloud
Give your VFP app a second life in the cloud http://foxincloud.com/
VisitFoxInCloud Blog <http://foxincloud.com/blog/> WatchFoxInCloud
Marketing Videos
<https://www.youtube.com/channel/UCUzzqO5375-fA7dLDds-wOQ>
WatchFoxInCloud Technical Videos
<https://www.youtube.com/channel/UCrEohAtbuf3uOXBH2pjp5Vw>
Stay tuned onFoxInCloud Roadmap <http://foxincloud.com/roadmap.php>
Learnhow to use FoxInCloud <http://foxincloud.com/how-to.php>
DownloadFoxInCloud Adaptation Assistant
<http://foxincloud.com/download.php> for free
Post by Dave Crozier
Hi folks,
Just had an issue that has been bugging me for a while and I now why but I haven’t got a solution to hand… so maybe you can help.
In lots of places we allow users to export their reports and
spreadsheet results onto their own personal “C” drives. And to do
this I implement
… default folder set in prior coding
cOld_Folder = SYS(5) + SYS(2003)
set default to <suggested destination folder> cFile = Getfile(……..)
set default to (cOld_Folder)
This code allows the user to be programmatically placed in the suggested folder to save/open files.
Unknown to me after all these years, the set default to command has an effect on the whole of the VFP thread not just the DataSession you are in. Unfortunately for me I have a number of regular timers running that check whether any particular file or process is locked, or the system is available for use i.e. it can sometimes auto log out the user to allow system maintenance for example. The timers open tables and expect to be in the base folder of the application but issuing the above coding changes the base folder for ALL the application, hence throwing errors as the tables (all held relative to the application folder) cannot be found in the new location.
So, if you action the Getfile() command and stay in the dialogue for a period of time during which the timers fire, then the timer coding cannot open it’s tables as you are no longer where it expects you to be.
The pertinent fact being: This command changes the default directory of the entire process, so all threads which are part of the process are affected. The same thing goes for CD and Chdir so using those as replacements is not an option unfortunately.
Has anyone any ideas as to how to produce a dialogue for saving/opening a file which doesn’t require the “set default to ” instruction?
I can modify all the timers to open tables based upon absolute paths but this would be a mega change which I am trying to avoid. Of course I could roll my own Getfile() unless anyone has one available!!!
All suggestions accepted, thanks in anticipation.
Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.
﴾⚆ᨎ⚆﴿
Flexipol® Packaging Ltd
T 01706 222 792
W https://www.flexipol.co.uk/
Unit 14 Bentwood Road, Carrs Industrial Estate, Haslingden,
Lancashire, BB4 5HH
​This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
---------------------------------------------------------------------
-
---------------------------------------------------------------------
-
---------------------------------------------------------------------
-
---------------------------------------------------------------------
-
-------------------------
​​
Notwithstanding delivery and the passing of risk in the goods, the
property in the goods shall not pass to the buyer until the seller
Flexipol Packaging Ltd. ("The Company") has received in cash or
cleared funds payment in full of the price of the goods and all other
goods agreed to be sold by the seller to the buyer for which payment
is then due. Until such time as the property in the goods passes to
the buyer, the buyer shall hold the goods as the seller's fiduciary
agent and bailee and keep the goods separate from those of the buyer
and third parties and properly stored protected and insured and
identified as the seller's property but shall be entitled to resell
or use the goods in the ordinary course of its business. Until such
time as the property in the goods passes to the buyer the seller
shall be entitled at any time
--- StripMime Report -- processed MIME parts --- multipart/related
multipart/alternative
text/plain (text body -- kept)
text/html
image/jpeg
image/jpeg
image/png
image/png
image/png
image/png
---
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@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/ad1e98bf-7f1c-cf6f-d8c5-***@foxincloud.com
** 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.
Report [OT] Abuse: http://leafe.com/reportAbuse/ad1e98bf-7f1c-cf6f-d8c5-***@foxincloud.com
_______________________________________________
Post Messages to: ***@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/***@CWLP265MB0852.GBRP265.PROD.OUTLOOK.COM
** 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 stu
Gianni Turri
2018-11-08 16:40:10 UTC
Permalink
Warning, it adds the selected folder to the VFP PATH!

Gianni

On Thu, 8 Nov 2018 16:12:48 +0000, Dave Crozier <***@flexipol.co.uk> wrote:

Thiery,
Great spot... I hadn't noticed that in the help file. Makes the job even easier, put inside a try.. catch... endtry to catch the error if no file chosen and return back empty string makes it perform in exactly the same way as GetFile().

Thanks a million!

Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.

?????


-----Original Message-----
From: ProfoxTech <profoxtech-***@leafe.com> On Behalf Of Thierry Nivelet
Sent: 08 November 2018 16:01
To: ***@leafe.com
Subject: Re: GetFile() issue

You can provide a 'full path' and a file skeleton without changing cd:

? LocFile("C:\<any path>\*.prg")

Thierry Nivelet
FoxInCloud
Give your VFP app a second life in the cloud http://foxincloud.com/

VisitFoxInCloud Blog <http://foxincloud.com/blog/> WatchFoxInCloud Marketing Videos <https://www.youtube.com/channel/UCUzzqO5375-fA7dLDds-wOQ>
WatchFoxInCloud Technical Videos
<https://www.youtube.com/channel/UCrEohAtbuf3uOXBH2pjp5Vw>
Stay tuned onFoxInCloud Roadmap <http://foxincloud.com/roadmap.php>
Learnhow to use FoxInCloud <http://foxincloud.com/how-to.php>
DownloadFoxInCloud Adaptation Assistant <http://foxincloud.com/download.php> for free
Post by Dave Crozier
Thiery,
Problem with Locfile is you can't search outside the VFP default folder or the path as defined in the "set path ..." command.
We want to allow the user to put/get the files from anywhere on the network, but start them off with a preferred starting point.
Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.
?????
-----Original Message-----
Sent: 07 November 2018 11:14
Subject: Re: GetFile() issue
use locfile() instead?
Thierry Nivelet
FoxInCloud
Give your VFP app a second life in the cloud http://foxincloud.com/
VisitFoxInCloud Blog <http://foxincloud.com/blog/> WatchFoxInCloud
Marketing Videos
<https://www.youtube.com/channel/UCUzzqO5375-fA7dLDds-wOQ>
WatchFoxInCloud Technical Videos
<https://www.youtube.com/channel/UCrEohAtbuf3uOXBH2pjp5Vw>
Stay tuned onFoxInCloud Roadmap <http://foxincloud.com/roadmap.php>
Learnhow to use FoxInCloud <http://foxincloud.com/how-to.php>
DownloadFoxInCloud Adaptation Assistant
<http://foxincloud.com/download.php> for free
Post by Dave Crozier
Hi folks,
Just had an issue that has been bugging me for a while and I now why but I haven’t got a solution to hand… so maybe you can help.
In lots of places we allow users to export their reports and
spreadsheet results onto their own personal “C” drives. And to do
this I implement
… default folder set in prior coding
cOld_Folder = SYS(5) + SYS(2003)
set default to <suggested destination folder> cFile = Getfile(……..)
set default to (cOld_Folder)
This code allows the user to be programmatically placed in the suggested folder to save/open files.
Unknown to me after all these years, the set default to command has an effect on the whole of the VFP thread not just the DataSession you are in. Unfortunately for me I have a number of regular timers running that check whether any particular file or process is locked, or the system is available for use i.e. it can sometimes auto log out the user to allow system maintenance for example. The timers open tables and expect to be in the base folder of the application but issuing the above coding changes the base folder for ALL the application, hence throwing errors as the tables (all held relative to the application folder) cannot be found in the new location.
So, if you action the Getfile() command and stay in the dialogue for a period of time during which the timers fire, then the timer coding cannot open it’s tables as you are no longer where it expects you to be.
The pertinent fact being: This command changes the default directory of the entire process, so all threads which are part of the process are affected. The same thing goes for CD and Chdir so using those as replacements is not an option unfortunately.
Has anyone any ideas as to how to produce a dialogue for saving/opening a file which doesn’t require the “set default to ” instruction?
I can modify all the timers to open tables based upon absolute paths but this would be a mega change which I am trying to avoid. Of course I could roll my own Getfile() unless anyone has one available!!!
All suggestions accepted, thanks in anticipation.
Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.
?????
Flexipol® Packaging Ltd
T 01706 222 792
W https://www.flexipol.co.uk/
Unit 14 Bentwood Road, Carrs Industrial Estate, Haslingden,
Lancashire, BB4 5HH
?This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
---------------------------------------------------------------------
-
---------------------------------------------------------------------
-
---------------------------------------------------------------------
-
---------------------------------------------------------------------
-
-------------------------
??
Notwithstanding delivery and the passing of risk in the goods, the
property in the goods shall not pass to the buyer until the seller
Flexipol Packaging Ltd. ("The Company") has received in cash or
cleared funds payment in full of the price of the goods and all other
goods agreed to be sold by the seller to the buyer for which payment
is then due. Until such time as the property in the goods passes to
the buyer, the buyer shall hold the goods as the seller's fiduciary
agent and bailee and keep the goods separate from those of the buyer
and third parties and properly stored protected and insured and
identified as the seller's property but shall be entitled to resell
or use the goods in the ordinary course of its business. Until such
time as the property in the goods passes to the buyer the seller
shall be entitled at any time
--- StripMime Report -- processed MIME parts --- multipart/related
multipart/alternative
text/plain (text body -- kept)
text/html
image/jpeg
image/jpeg
image/png
image/png
image/png
image/png
---
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@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/***@4ax.com
** 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.
Thierry Nivelet
2018-11-08 17:20:15 UTC
Permalink
slight difference with getFile(), however nothing a 'standard' user
would ever notice…

you're welcome

Thierry Nivelet
FoxInCloud
Give your VFP app a second life in the cloud
http://foxincloud.com/

VisitFoxInCloud Blog <http://foxincloud.com/blog/>
WatchFoxInCloud Marketing Videos
<https://www.youtube.com/channel/UCUzzqO5375-fA7dLDds-wOQ>
WatchFoxInCloud Technical Videos
<https://www.youtube.com/channel/UCrEohAtbuf3uOXBH2pjp5Vw>
Stay tuned onFoxInCloud Roadmap <http://foxincloud.com/roadmap.php>
Learnhow to use FoxInCloud <http://foxincloud.com/how-to.php>
DownloadFoxInCloud Adaptation Assistant <http://foxincloud.com/download.php> for free
Post by Dave Crozier
Thiery,
Great spot... I hadn't noticed that in the help file. Makes the job even easier, put inside a try.. catch... endtry to catch the error if no file chosen and return back empty string makes it perform in exactly the same way as GetFile().
Thanks a million!
Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.
﴾⚆ᨎ⚆﴿
-----Original Message-----
Sent: 08 November 2018 16:01
Subject: Re: GetFile() issue
? LocFile("C:\<any path>\*.prg")
Thierry Nivelet
FoxInCloud
Give your VFP app a second life in the cloud http://foxincloud.com/
VisitFoxInCloud Blog <http://foxincloud.com/blog/> WatchFoxInCloud Marketing Videos <https://www.youtube.com/channel/UCUzzqO5375-fA7dLDds-wOQ>
WatchFoxInCloud Technical Videos
<https://www.youtube.com/channel/UCrEohAtbuf3uOXBH2pjp5Vw>
Stay tuned onFoxInCloud Roadmap <http://foxincloud.com/roadmap.php>
Learnhow to use FoxInCloud <http://foxincloud.com/how-to.php>
DownloadFoxInCloud Adaptation Assistant <http://foxincloud.com/download.php> for free
Post by Dave Crozier
Thiery,
Problem with Locfile is you can't search outside the VFP default folder or the path as defined in the "set path ..." command.
We want to allow the user to put/get the files from anywhere on the network, but start them off with a preferred starting point.
Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.
﴾⚆ᨎ⚆﴿
-----Original Message-----
Sent: 07 November 2018 11:14
Subject: Re: GetFile() issue
use locfile() instead?
Thierry Nivelet
FoxInCloud
Give your VFP app a second life in the cloud http://foxincloud.com/
VisitFoxInCloud Blog <http://foxincloud.com/blog/> WatchFoxInCloud
Marketing Videos
<https://www.youtube.com/channel/UCUzzqO5375-fA7dLDds-wOQ>
WatchFoxInCloud Technical Videos
<https://www.youtube.com/channel/UCrEohAtbuf3uOXBH2pjp5Vw>
Stay tuned onFoxInCloud Roadmap <http://foxincloud.com/roadmap.php>
Learnhow to use FoxInCloud <http://foxincloud.com/how-to.php>
DownloadFoxInCloud Adaptation Assistant
<http://foxincloud.com/download.php> for free
Post by Dave Crozier
Hi folks,
Just had an issue that has been bugging me for a while and I now why but I haven’t got a solution to hand… so maybe you can help.
In lots of places we allow users to export their reports and
spreadsheet results onto their own personal “C” drives. And to do
this I implement
… default folder set in prior coding
cOld_Folder = SYS(5) + SYS(2003)
set default to <suggested destination folder> cFile = Getfile(……..)
set default to (cOld_Folder)
This code allows the user to be programmatically placed in the suggested folder to save/open files.
Unknown to me after all these years, the set default to command has an effect on the whole of the VFP thread not just the DataSession you are in. Unfortunately for me I have a number of regular timers running that check whether any particular file or process is locked, or the system is available for use i.e. it can sometimes auto log out the user to allow system maintenance for example. The timers open tables and expect to be in the base folder of the application but issuing the above coding changes the base folder for ALL the application, hence throwing errors as the tables (all held relative to the application folder) cannot be found in the new location.
So, if you action the Getfile() command and stay in the dialogue for a period of time during which the timers fire, then the timer coding cannot open it’s tables as you are no longer where it expects you to be.
The pertinent fact being: This command changes the default directory of the entire process, so all threads which are part of the process are affected. The same thing goes for CD and Chdir so using those as replacements is not an option unfortunately.
Has anyone any ideas as to how to produce a dialogue for saving/opening a file which doesn’t require the “set default to ” instruction?
I can modify all the timers to open tables based upon absolute paths but this would be a mega change which I am trying to avoid. Of course I could roll my own Getfile() unless anyone has one available!!!
All suggestions accepted, thanks in anticipation.
Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.
﴾⚆ᨎ⚆﴿
Flexipol® Packaging Ltd
T 01706 222 792
W https://www.flexipol.co.uk/
Unit 14 Bentwood Road, Carrs Industrial Estate, Haslingden,
Lancashire, BB4 5HH
​This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
---------------------------------------------------------------------
-
---------------------------------------------------------------------
-
---------------------------------------------------------------------
-
---------------------------------------------------------------------
-
-------------------------
​​
Notwithstanding delivery and the passing of risk in the goods, the
property in the goods shall not pass to the buyer until the seller
Flexipol Packaging Ltd. ("The Company") has received in cash or
cleared funds payment in full of the price of the goods and all other
goods agreed to be sold by the seller to the buyer for which payment
is then due. Until such time as the property in the goods passes to
the buyer, the buyer shall hold the goods as the seller's fiduciary
agent and bailee and keep the goods separate from those of the buyer
and third parties and properly stored protected and insured and
identified as the seller's property but shall be entitled to resell
or use the goods in the ordinary course of its business. Until such
time as the property in the goods passes to the buyer the seller
shall be entitled at any time
--- StripMime Report -- processed MIME parts --- multipart/related
multipart/alternative
text/plain (text body -- kept)
text/html
image/jpeg
image/jpeg
image/png
image/png
image/png
image/png
---
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@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/600d04bc-a2f9-417c-e227-***@foxincloud.com
** 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
Alan Bourke
2018-11-07 11:28:38 UTC
Permalink
maybe check out the GetSaveFileName() function in the Vfp2c32 library (Github)

"Creates a Save dialog box that lets the user specify the drive, directory, and name of a file to save.

GetSaveFileName([nFlags [, cFileFilters [, cFileName [, cInitialDirectory [, cDialogTitle [, nFlagsEx [, cCallbackFunc]]]]]]])"


Or maybe this which I got from the ApiViewer project on GitHub, which is a nice database of the old news2news site:

oShell = CREATEOBJECT("Shell.Application")
oFolder = oShell.Application.BrowseForFolder(_screen.HWnd,;
"Select Folder", 1, "c:\Program Files")

That would open the dialog with the 'c:\program files' folder selected.
--
Alan Bourke
alanpbourke (at) fastmail (dot) fm
Post by Dave Crozier
Hi folks,
Just had an issue that has been bugging me for a while and I now why but
I haven’t got a solution to hand… so maybe you can help.
In lots of places we allow users to export their reports and spreadsheet
results onto their own personal “C” drives. And to do this I implement
… default folder set in prior coding
cOld_Folder = SYS(5) + SYS(2003)
set default to <suggested destination folder>
cFile = Getfile(……..)
set default to (cOld_Folder)
This code allows the user to be programmatically placed in the suggested
folder to save/open files.
Unknown to me after all these years, the set default to command has an
effect on the whole of the VFP thread not just the DataSession you are
in. Unfortunately for me I have a number of regular timers running that
check whether any particular file or process is locked, or the system is
available for use i.e. it can sometimes auto log out the user to allow
system maintenance for example. The timers open tables and expect to be
in the base folder of the application but issuing the above coding
changes the base folder for ALL the application, hence throwing errors
as the tables (all held relative to the application folder) cannot be
found in the new location.
So, if you action the Getfile() command and stay in the dialogue for a
period of time during which the timers fire, then the timer coding
cannot open it’s tables as you are no longer where it expects you to be.
“The SET DEFAULT command is not supported in either single or
multithreaded DLL servers. This command changes the default directory of
the entire process, so all threads which are part of the process are
%20visual%20foxpro
%209\dv_foxhelp.chm::/html/047f2e74-3552-43b7-a18d-ee2c7dd2db6e.htm in
DLL servers, in place of CD and CHDIR.”
The pertinent fact being: This command changes the default directory of
the entire process, so all threads which are part of the process are
affected. The same thing goes for CD and Chdir so using those as
replacements is not an option unfortunately.
Has anyone any ideas as to how to produce a dialogue for saving/opening
a file which doesn’t require the “set default to ” instruction?
I can modify all the timers to open tables based upon absolute paths but
this would be a mega change which I am trying to avoid. Of course I
could roll my own Getfile() unless anyone has one available!!!
All suggestions accepted, thanks in anticipation.
Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.
﴾⚆ᨎ⚆﴿
Flexipol® Packaging Ltd
T 01706 222 792
W https://www.flexipol.co.uk/
Unit 14 Bentwood Road, Carrs Industrial Estate, Haslingden, Lancashire, BB4 5HH
​This communication and the information it contains is intended for the
person or organisation to whom it is addressed. Its contents are
confidential and may be protected in law. If you have received this e-
mail in error you must not copy, distribute or take any action in
reliance on it. Unauthorised use, copying or disclosure of any of it may
be unlawful. If you have received this message in error, please notify
us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to
minimise the risk of virus transmission through email and therefore any
files sent via e-mail will have been checked for known viruses. However,
you are advised to run your own virus check before opening any
attachments received as Flexipol Packaging Ltd will not in any event
accept any liability whatsoever once an e-mail and/or any attachment is
received.
It is the responsibility of the recipient to ensure that they have
adequate virus protection.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
​​
Notwithstanding delivery and the passing of risk in the goods, the
property in the goods shall not pass to the buyer until the seller
Flexipol Packaging Ltd. ("The Company") has received in cash or cleared
funds payment in full of the price of the goods and all other goods
agreed to be sold by the seller to the buyer for which payment is then
due. Until such time as the property in the goods passes to the buyer,
the buyer shall hold the goods as the seller's fiduciary agent and
bailee and keep the goods separate from those of the buyer and third
parties and properly stored protected and insured and identified as the
seller's property but shall be entitled to resell or use the goods in
the ordinary course of its business. Until such time as the property in
the goods passes to the buyer the seller shall be entitled at any time
--- StripMime Report -- processed MIME parts ---
multipart/related
multipart/alternative
text/plain (text body -- kept)
text/html
image/jpeg
image/jpeg
image/png
image/png
image/png
image/png
---
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@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/***@webmail.messagingengine.com
** 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 to
Frank Cazabon
2018-11-07 12:48:46 UTC
Permalink
Does the _commonfolder class in _system.vcx help you out?

I use it like this:

LOCAL loCommonFolder AS _commonfolder OF _system.vcx

m.loCommonFolder = CREATEOBJECT("_commonfolder")
#DEFINE CSIDL_PERSONAL                  0x0005        && My Documents
#DEFINE CSIDL_APPDATA                   0x001a        && <user
name>\Application Data

m.lcFolder = ADDBS(m.loCommonFolder.getfolder(CSIDL_PERSONAL))

Frank.

Frank Cazabon
Post by Dave Crozier
Hi folks,
Just had an issue that has been bugging me for a while and I now why but I haven’t got a solution to hand… so maybe you can help.
In lots of places we allow users to export their reports and spreadsheet results onto their own personal “C” drives. And to do this I implement
… default folder set in prior coding
cOld_Folder = SYS(5) + SYS(2003)
set default to <suggested destination folder>
cFile = Getfile(……..)
set default to (cOld_Folder)
This code allows the user to be programmatically placed in the suggested folder to save/open files.
Unknown to me after all these years, the set default to command has an effect on the whole of the VFP thread not just the DataSession you are in. Unfortunately for me I have a number of regular timers running that check whether any particular file or process is locked, or the system is available for use i.e. it can sometimes auto log out the user to allow system maintenance for example. The timers open tables and expect to be in the base folder of the application but issuing the above coding changes the base folder for ALL the application, hence throwing errors as the tables (all held relative to the application folder) cannot be found in the new location.
So, if you action the Getfile() command and stay in the dialogue for a period of time during which the timers fire, then the timer coding cannot open it’s tables as you are no longer where it expects you to be.
The pertinent fact being: This command changes the default directory of the entire process, so all threads which are part of the process are affected. The same thing goes for CD and Chdir so using those as replacements is not an option unfortunately.
Has anyone any ideas as to how to produce a dialogue for saving/opening a file which doesn’t require the “set default to ” instruction?
I can modify all the timers to open tables based upon absolute paths but this would be a mega change which I am trying to avoid. Of course I could roll my own Getfile() unless anyone has one available!!!
All suggestions accepted, thanks in anticipation.
Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.
﴾⚆ᨎ⚆﴿
Flexipol® Packaging Ltd
T 01706 222 792
W https://www.flexipol.co.uk/
Unit 14 Bentwood Road, Carrs Industrial Estate, Haslingden, Lancashire, BB4 5HH
​This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
​​
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time
--- StripMime Report -- processed MIME parts ---
multipart/related
multipart/alternative
text/plain (text body -- kept)
text/html
image/jpeg
image/jpeg
image/png
image/png
image/png
image/png
---
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@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/863167a5-d089-78aa-bd15-***@gmail.com
** 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
Ted Roche
2018-11-07 15:08:46 UTC
Permalink
Post by Dave Crozier
Unknown to me after all these years, the set default to command has an
effect on the whole of the VFP thread not just the DataSession you are in.
To quote my co-author, "Computer language purists object to SET commands
for a pretty straightforward reason: the formation of the infinite-state
machine. Although that sounds cool,..." (
https://www.tedroche.com/hackfox7/s4g126.html)

SETs often have global effects which make their local use frustrating.

Three things:

1. If you were rewriting the app, you'd store a "Data Directory" in your
global settings table and precede all your file open commands with that.
That makes it INCREDIBLY easy to have a test mode that just switches that
setting. But you're not re-writing your app, so...

2. Adding another GLOBAL to solve this issue is putting out fire with fire,
but if you had your data directory in your SET PATH, would that solve
the problem?

3. I think you can replace the GetFile() command locally with one from the
Common Dialog set, which gives you finer control. I believe Doug Hennig
wrote a white paper on this one. (
http://doughennig.com/Papers/Pub/ModernUI.pdf)


--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---

_______________________________________________
Post Messages to: ***@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/CACW6n4ty+M1k+pAT90g6QToL+zWAkyrnPG43d=o-***@mail.gmail.com
** 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.
Gene Wirchenko
2018-11-07 19:13:11 UTC
Permalink
Post by Ted Roche
Post by Dave Crozier
Unknown to me after all these years, the set default to command has an
effect on the whole of the VFP thread not just the DataSession you are in.
To quote my co-author, "Computer language purists object to SET commands
for a pretty straightforward reason: the formation of the infinite-state
machine. Although that sounds cool,..." (
https://www.tedroche.com/hackfox7/s4g126.html)
That URL was wrong in your post as it included the closing
paren. Oddly, Eudora excluded it in this reply.
Post by Ted Roche
SETs often have global effects which make their local use frustrating.
I have not found it so, but one must be careful.

If I change a global setting SET (as opposed, say, to a SET
ORDER), I either set the setting back as soon as I can or I have a
procedure for doing the modified function requiring the different SET
value. One must be careful about this stuff.
Post by Ted Roche
1. If you were rewriting the app, you'd store a "Data Directory" in your
global settings table and precede all your file open commands with that.
That makes it INCREDIBLY easy to have a test mode that just switches that
setting. But you're not re-writing your app, so...
I did that for a few programs where I needed to get to a
different set of data. I am glad that it was only a few.

[snip]

Sincerely,

Gene Wirchenko


_______________________________________________
Post Messages to: ***@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/***@mtlp000084
** 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.
Ted Roche
2018-11-07 19:41:10 UTC
Permalink
Post by Gene Wirchenko
That URL was wrong in your post as it included the closing
paren. Oddly, Eudora excluded it in this reply.
Mayhaps your email reader parsed it wrong, as I sent plain text and it
works fine on my end.
Post by Gene Wirchenko
Post by Ted Roche
SETs often have global effects which make their local use frustrating.
I have not found it so, but one must be careful.
Well, OP had a classic case, where the SET is saved, changed, and reset in
a very small snippet of code, but if other code runs in the meantime
(timers, in that case, or menu code or LostFocus events) that depend on the
global setting, confusion results.
--
Ted Roche
Ted Roche & Associates, LLC
http://www.tedroche.com


--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---

_______________________________________________
Post Messages to: ***@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/CACW6n4sAKsN3nVowksxP-Xk3zY6scN2=QvBkEmecyr=***@mail.gmail.com
** 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.
Dave Crozier
2018-11-08 14:38:07 UTC
Permalink
Gene,
The problem if you are using GetFile() is that if you use the set default then open the dialogue and then keep the dialogue open for a few seconds, any background process/thread will pick up the new default location before you set it back after you close the dialogue.

Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.

﴾⚆ᨎ⚆﴿



Flexipol® Packaging Ltd
T 01706 222 792
E ***@flexipol.co.uk
W https://www.flexipol.co.uk/
Follow us:
Unit 14 Bentwood Road, Carrs Industrial Estate, Haslingden, Lancashire, BB4 5HH

​This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.

Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.

It is the responsibility of the recipient to ensure that they have adequate virus protection.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
​​
​Terms & Conditions:
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time
-----Original Message-----
From: ProfoxTech <profoxtech-***@leafe.com> On Behalf Of Gene Wirchenko
Sent: 07 November 2018 19:13
To: ***@leafe.com
Subject: Re: GetFile() issue
Post by Ted Roche
Post by Dave Crozier
Unknown to me after all these years, the set default to command has
an effect on the whole of the VFP thread not just the DataSession you are in.
To quote my co-author, "Computer language purists object to SET
commands for a pretty straightforward reason: the formation of the
infinite-state machine. Although that sounds cool,..." (
https://www.tedroche.com/hackfox7/s4g126.html)
That URL was wrong in your post as it included the closing paren. Oddly, Eudora excluded it in this reply.
Post by Ted Roche
SETs often have global effects which make their local use frustrating.
I have not found it so, but one must be careful.

If I change a global setting SET (as opposed, say, to a SET ORDER), I either set the setting back as soon as I can or I have a procedure for doing the modified function requiring the different SET value. One must be careful about this stuff.
Post by Ted Roche
1. If you were rewriting the app, you'd store a "Data Directory" in
your global settings table and precede all your file open commands with that.
That makes it INCREDIBLY easy to have a test mode that just switches
that setting. But you're not re-writing your app, so...
I did that for a few programs where I needed to get to a different set of data. I am glad that it was only a few.

[snip]

Sincerely,

Gene Wirchenko


[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@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/***@CWLP265MB0852.GBRP265.PROD.OUTLOOK.COM
** 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 obviou
Fernando D. Bozzo
2018-11-08 14:56:40 UTC
Permalink
Hi Dave:

I think that have a simple solution for the GetFile() problem.
Try this:

oo = CreateObject("visualfoxpro.application")
oo.DoCmd("cd 'c:\desa'")
? oo.Eval("getfile()")
oo.Release()

Works ok and do not change main VFP default dir.
Post by Dave Crozier
Gene,
The problem if you are using GetFile() is that if you use the set default
then open the dialogue and then keep the dialogue open for a few seconds,
any background process/thread will pick up the new default location before
you set it back after you close the dialogue.
Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.
﴾⚆ᨎ⚆﴿
Flexipol® Packaging Ltd
T 01706 222 792
W https://www.flexipol.co.uk/
Unit 14 Bentwood Road, Carrs Industrial Estate, Haslingden, Lancashire, BB4 5HH
​This communication and the information it contains is intended for the
person or organisation to whom it is addressed. Its contents are
confidential and may be protected in law. If you have received this e-mail
in error you must not copy, distribute or take any action in reliance on
it. Unauthorised use, copying or disclosure of any of it may be unlawful.
If you have received this message in error, please notify us immediately by
telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise
the risk of virus transmission through email and therefore any files sent
via e-mail will have been checked for known viruses. However, you are
advised to run your own virus check before opening any attachments received
as Flexipol Packaging Ltd will not in any event accept any liability
whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have
adequate virus protection.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
​​
Notwithstanding delivery and the passing of risk in the goods, the
property in the goods shall not pass to the buyer until the seller Flexipol
Packaging Ltd. ("The Company") has received in cash or cleared funds
payment in full of the price of the goods and all other goods agreed to be
sold by the seller to the buyer for which payment is then due. Until such
time as the property in the goods passes to the buyer, the buyer shall hold
the goods as the seller's fiduciary agent and bailee and keep the goods
separate from those of the buyer and third parties and properly stored
protected and insured and identified as the seller's property but shall be
entitled to resell or use the goods in the ordinary course of its business.
Until such time as the property in the goods passes to the buyer the seller
shall be entitled at any time
-----Original Message-----
Sent: 07 November 2018 19:13
Subject: Re: GetFile() issue
Post by Ted Roche
Post by Dave Crozier
Unknown to me after all these years, the set default to command has
an effect on the whole of the VFP thread not just the DataSession you
are in.
Post by Ted Roche
To quote my co-author, "Computer language purists object to SET
commands for a pretty straightforward reason: the formation of the
infinite-state machine. Although that sounds cool,..." (
https://www.tedroche.com/hackfox7/s4g126.html)
That URL was wrong in your post as it included the closing paren.
Oddly, Eudora excluded it in this reply.
Post by Ted Roche
SETs often have global effects which make their local use frustrating.
I have not found it so, but one must be careful.
If I change a global setting SET (as opposed, say, to a SET ORDER),
I either set the setting back as soon as I can or I have a procedure for
doing the modified function requiring the different SET value. One must be
careful about this stuff.
Post by Ted Roche
1. If you were rewriting the app, you'd store a "Data Directory" in
your global settings table and precede all your file open commands with
that.
Post by Ted Roche
That makes it INCREDIBLY easy to have a test mode that just switches
that setting. But you're not re-writing your app, so...
I did that for a few programs where I needed to get to a different
set of data. I am glad that it was only a few.
[snip]
Sincerely,
Gene Wirchenko
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@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/CAGQ_Ju=vUuzqvHkvrMuSm-***@mail.gmail.com
** 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 thos
Gene Wirchenko
2018-11-09 01:16:45 UTC
Permalink
Post by Ted Roche
Post by Gene Wirchenko
Post by Ted Roche
SETs often have global effects which make their local use frustrating.
I have not found it so, but one must be careful.
Well, OP had a classic case, where the SET is saved, changed, and reset in
a very small snippet of code, but if other code runs in the meantime
(timers, in that case, or menu code or LostFocus events) that depend on the
global setting, confusion results.
I can see timers giving problems -- thankfully, I do not use
them -- but LostFocus? Isn't that just in the normal sequence of
events? Why would it give trouble?

Sincerely,

Gene Wirchenko


_______________________________________________
Post Messages to: ***@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/***@mtlp000085
** 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.
Peter Cushing
2018-11-08 13:21:08 UTC
Permalink
Hi Dave,

I never change my default folder when the app is running and for things
like output folders or getting data I usually just get the user to
select the folder with :

cImport = GETDIR('','Select upload folder')

You can then ask for every report or save this for their session and
keep outputting to this folder.

Not quite sure why you need to change the default folder?

Peter
Post by Dave Crozier
Hi folks,
Just had an issue that has been bugging me for a while and I now why but I haven’t got a solution to hand… so maybe you can help.
In lots of places we allow users to export their reports and spreadsheet results onto their own personal “C” drives. And to do this I implement
… default folder set in prior coding
cOld_Folder = SYS(5) + SYS(2003)
set default to <suggested destination folder>
cFile = Getfile(……..)
set default to (cOld_Folder)
This code allows the user to be programmatically placed in the suggested folder to save/open files.
Unknown to me after all these years, the set default to command has an effect on the whole of the VFP thread not just the DataSession you are in. Unfortunately for me I have a number of regular timers running that check whether any particular file or process is locked, or the system is available for use i.e. it can sometimes auto log out the user to allow system maintenance for example. The timers open tables and expect to be in the base folder of the application but issuing the above coding changes the base folder for ALL the application, hence throwing errors as the tables (all held relative to the application folder) cannot be found in the new location.
So, if you action the Getfile() command and stay in the dialogue for a period of time during which the timers fire, then the timer coding cannot open it’s tables as you are no longer where it expects you to be.
The pertinent fact being: This command changes the default directory of the entire process, so all threads which are part of the process are affected. The same thing goes for CD and Chdir so using those as replacements is not an option unfortunately.
Has anyone any ideas as to how to produce a dialogue for saving/opening a file which doesn’t require the “set default to ” instruction?
I can modify all the timers to open tables based upon absolute paths but this would be a mega change which I am trying to avoid. Of course I could roll my own Getfile() unless anyone has one available!!!
All suggestions accepted, thanks in anticipation.
Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.
﴾⚆ᨎ⚆﴿
Flexipol® Packaging Ltd
T 01706 222 792
W https://www.flexipol.co.uk/
Unit 14 Bentwood Road, Carrs Industrial Estate, Haslingden, Lancashire, BB4 5HH
​This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
​​
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time
--- StripMime Report -- processed MIME parts ---
multipart/related
multipart/alternative
text/plain (text body -- kept)
text/html
image/jpeg
image/jpeg
image/png
image/png
image/png
image/png
---
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@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/38338d5c-8ac6-f543-47cc-***@whisperingsmith.com
** 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
Fernando D. Bozzo
2018-11-08 13:39:39 UTC
Permalink
Changing default folder temporarily is an old trick to make getfile() start
at it by default because there is no other way to do it with getfile()

Normally it's encapsulated in a method (like select_dir or similar) with
code that save actual dir, select dest dir, prompts user with getfile,
restores actual_dir and returns selected file.

All this is normally to minimize user errors selecting through directories
Post by Peter Cushing
Hi Dave,
I never change my default folder when the app is running and for things
like output folders or getting data I usually just get the user to
cImport = GETDIR('','Select upload folder')
You can then ask for every report or save this for their session and
keep outputting to this folder.
Not quite sure why you need to change the default folder?
Peter
Post by Dave Crozier
Hi folks,
Just had an issue that has been bugging me for a while and I now why but
I haven’t got a solution to hand… so maybe you can help.
Post by Dave Crozier
In lots of places we allow users to export their reports and spreadsheet
results onto their own personal “C” drives. And to do this I implement
Post by Dave Crozier
… default folder set in prior coding
cOld_Folder = SYS(5) + SYS(2003)
set default to <suggested destination folder>
cFile = Getfile(……..)
set default to (cOld_Folder)
This code allows the user to be programmatically placed in the suggested
folder to save/open files.
Post by Dave Crozier
Unknown to me after all these years, the set default to command has an
effect on the whole of the VFP thread not just the DataSession you are in.
Unfortunately for me I have a number of regular timers running that check
whether any particular file or process is locked, or the system is
available for use i.e. it can sometimes auto log out the user to allow
system maintenance for example. The timers open tables and expect to be in
the base folder of the application but issuing the above coding changes the
base folder for ALL the application, hence throwing errors as the tables
(all held relative to the application folder) cannot be found in the new
location.
Post by Dave Crozier
So, if you action the Getfile() command and stay in the dialogue for a
period of time during which the timers fire, then the timer coding cannot
open it’s tables as you are no longer where it expects you to be.
Post by Dave Crozier
Looking at the help file ( OK, I should have looked at it years ago!!)
“The SET DEFAULT command is not supported in either single or
multithreaded DLL servers. This command changes the default directory of
the entire process, so all threads which are part of the process are
in DLL servers, in place of CD and CHDIR.”
Post by Dave Crozier
The pertinent fact being: This command changes the default directory of
the entire process, so all threads which are part of the process are
affected. The same thing goes for CD and Chdir so using those as
replacements is not an option unfortunately.
Post by Dave Crozier
Has anyone any ideas as to how to produce a dialogue for saving/opening
a file which doesn’t require the “set default to ” instruction?
Post by Dave Crozier
I can modify all the timers to open tables based upon absolute paths but
this would be a mega change which I am trying to avoid. Of course I could
roll my own Getfile() unless anyone has one available!!!
Post by Dave Crozier
All suggestions accepted, thanks in anticipation.
Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.
﴾⚆ᨎ⚆﴿
Flexipol® Packaging Ltd
T 01706 222 792
W https://www.flexipol.co.uk/
Unit 14 Bentwood Road, Carrs Industrial Estate, Haslingden, Lancashire,
BB4 5HH
Post by Dave Crozier
​This communication and the information it contains is intended for the
person or organisation to whom it is addressed. Its contents are
confidential and may be protected in law. If you have received this e-mail
in error you must not copy, distribute or take any action in reliance on
it. Unauthorised use, copying or disclosure of any of it may be unlawful.
If you have received this message in error, please notify us immediately by
telephone or email.
Post by Dave Crozier
Flexipol Packaging Ltd. has taken every reasonable precaution to
minimise the risk of virus transmission through email and therefore any
files sent via e-mail will have been checked for known viruses. However,
you are advised to run your own virus check before opening any attachments
received as Flexipol Packaging Ltd will not in any event accept any
liability whatsoever once an e-mail and/or any attachment is received.
Post by Dave Crozier
It is the responsibility of the recipient to ensure that they have
adequate virus protection.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Post by Dave Crozier
​​
Notwithstanding delivery and the passing of risk in the goods, the
property in the goods shall not pass to the buyer until the seller Flexipol
Packaging Ltd. ("The Company") has received in cash or cleared funds
payment in full of the price of the goods and all other goods agreed to be
sold by the seller to the buyer for which payment is then due. Until such
time as the property in the goods passes to the buyer, the buyer shall hold
the goods as the seller's fiduciary agent and bailee and keep the goods
separate from those of the buyer and third parties and properly stored
protected and insured and identified as the seller's property but shall be
entitled to resell or use the goods in the ordinary course of its business.
Until such time as the property in the goods passes to the buyer the seller
shall be entitled at any time
Post by Dave Crozier
--- StripMime Report -- processed MIME parts ---
multipart/related
multipart/alternative
text/plain (text body -- kept)
text/html
image/jpeg
image/jpeg
image/png
image/png
image/png
image/png
---
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@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/CAGQ_JukphA-0SRFHuq58S2GX8Wd=8ALvY2ZUYxtaffCq8xU-***@mail.gmail.com
** 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
Dave Crozier
2018-11-08 14:35:26 UTC
Permalink
Peter,
Mainly to place them into a folder where you preferably want them to put/get the file from rather than them being able to navigate around the PC & Network.

Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.

﴾⚆ᨎ⚆﴿


-----Original Message-----
From: ProFox <profox-***@leafe.com> On Behalf Of Peter Cushing
Sent: 08 November 2018 13:21
To: ***@leafe.com
Subject: Re: GetFile() issue

Hi Dave,

I never change my default folder when the app is running and for things like output folders or getting data I usually just get the user to select the folder with :

cImport = GETDIR('','Select upload folder')

You can then ask for every report or save this for their session and keep outputting to this folder.

Not quite sure why you need to change the default folder?

Peter
Post by Dave Crozier
Hi folks,
Just had an issue that has been bugging me for a while and I now why but I haven’t got a solution to hand… so maybe you can help.
In lots of places we allow users to export their reports and
spreadsheet results onto their own personal “C” drives. And to do this
I implement
… default folder set in prior coding
cOld_Folder = SYS(5) + SYS(2003)
set default to <suggested destination folder> cFile = Getfile(……..)
set default to (cOld_Folder)
This code allows the user to be programmatically placed in the suggested folder to save/open files.
Unknown to me after all these years, the set default to command has an effect on the whole of the VFP thread not just the DataSession you are in. Unfortunately for me I have a number of regular timers running that check whether any particular file or process is locked, or the system is available for use i.e. it can sometimes auto log out the user to allow system maintenance for example. The timers open tables and expect to be in the base folder of the application but issuing the above coding changes the base folder for ALL the application, hence throwing errors as the tables (all held relative to the application folder) cannot be found in the new location.
So, if you action the Getfile() command and stay in the dialogue for a period of time during which the timers fire, then the timer coding cannot open it’s tables as you are no longer where it expects you to be.
The pertinent fact being: This command changes the default directory of the entire process, so all threads which are part of the process are affected. The same thing goes for CD and Chdir so using those as replacements is not an option unfortunately.
Has anyone any ideas as to how to produce a dialogue for saving/opening a file which doesn’t require the “set default to ” instruction?
I can modify all the timers to open tables based upon absolute paths but this would be a mega change which I am trying to avoid. Of course I could roll my own Getfile() unless anyone has one available!!!
All suggestions accepted, thanks in anticipation.
Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.
﴾⚆ᨎ⚆﴿
Flexipol® Packaging Ltd
T 01706 222 792
W https://www.flexipol.co.uk/
Unit 14 Bentwood Road, Carrs Industrial Estate, Haslingden,
Lancashire, BB4 5HH
​This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
----------------------------------------------------------------------
----------------------------------------------------------------------
----------------------------------------------------------------------
----------------------------------------------------------------------
-------------------------
​​
Notwithstanding delivery and the passing of risk in the goods, the
property in the goods shall not pass to the buyer until the seller
Flexipol Packaging Ltd. ("The Company") has received in cash or
cleared funds payment in full of the price of the goods and all other
goods agreed to be sold by the seller to the buyer for which payment
is then due. Until such time as the property in the goods passes to
the buyer, the buyer shall hold the goods as the seller's fiduciary
agent and bailee and keep the goods separate from those of the buyer
and third parties and properly stored protected and insured and
identified as the seller's property but shall be entitled to resell or
use the goods in the ordinary course of its business. Until such time
as the property in the goods passes to the buyer the seller shall be
entitled at any time
--- StripMime Report -- processed MIME parts --- multipart/related
multipart/alternative
text/plain (text body -- kept)
text/html
image/jpeg
image/jpeg
image/png
image/png
image/png
image/png
---
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@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/38338d5c-8ac6-f543-47cc-***@whisperingsmith.com
** 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.
_______________________________________________
Post Messages to: ***@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/***@CWLP265MB0852.GBRP265.PROD.OUTLOOK.COM
** 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 ar
Peter Cushing
2018-11-08 14:54:45 UTC
Permalink
Post by Dave Crozier
Peter,
Mainly to place them into a folder where you preferably want them to put/get the file from rather than them being able to navigate around the PC & Network.
Hi Dave,

You are far too nice to your users!  We make them navigate the network
for stuff like that.
If you chose a standard name for the report name you could use
GETDIR('c:\somefolder','select input/output folder'), which does allow
you to specify where it starts.

Peter



This communication is intended for the person or organisation to whom it is addressed. The contents are confidential and may be protected in law. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.

www.whisperingsmith.com

Whispering Smith Ltd Head Office:61 Great Ducie Street, Manchester M3 1RR.
Tel:0161 831 3700
Fax:0161 831 3715

London Office: 101 St. Martin's Lane,London, WC2N 4AZ Tel:0207 299 7960




_______________________________________________
Post Messages to: ***@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/35dcd12f-c055-e58b-e430-***@whisperingsmith.com
** 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 obv
Dave Crozier
2018-11-08 15:10:42 UTC
Permalink
Peter,
Yes, we try to please!! The problem with doing it using GetDir is that they end up having two dialogue boxes as opposed to one (one for the folder, one for the name). Let's say we want our users to feel wanted and loved..... even though we DON'T love them sometimes!!!

Anyway I have solved the problem by using an API call to the M$ Common dialogue DLL which works fine so far.

Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.

﴾⚆ᨎ⚆﴿



Flexipol® Packaging Ltd
T 01706 222 792
E ***@flexipol.co.uk
W https://www.flexipol.co.uk/
Follow us:
Unit 14 Bentwood Road, Carrs Industrial Estate, Haslingden, Lancashire, BB4 5HH

​This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.

Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.

It is the responsibility of the recipient to ensure that they have adequate virus protection.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
​​
​Terms & Conditions:
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time
-----Original Message-----
From: ProFox <profox-***@leafe.com> On Behalf Of Peter Cushing
Sent: 08 November 2018 14:55
To: ***@leafe.com
Subject: Re: GetFile() issue
Post by Dave Crozier
Peter,
Mainly to place them into a folder where you preferably want them to put/get the file from rather than them being able to navigate around the PC & Network.
Hi Dave,

You are far too nice to your users!  We make them navigate the network for stuff like that.
If you chose a standard name for the report name you could use GETDIR('c:\somefolder','select input/output folder'), which does allow you to specify where it starts.

Peter



This communication is intended for the person or organisation to whom it is addressed. The contents are confidential and may be protected in law. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.

www.whisperingsmith.com

Whispering Smith Ltd Head Office:61 Great Ducie Street, Manchester M3 1RR.
Tel:0161 831 3700
Fax:0161 831 3715

London Office: 101 St. Martin's Lane,London, WC2N 4AZ Tel:0207 299 7960




[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@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/***@CWLP265MB0852.GBRP265.PROD.OUTLOOK.COM
** 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
Loading...