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

Le 07/11/2018 à 11:56, Dave Crozier a écrit :
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 dcroz...@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
---

[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/84e99b46-3ba5-c76a-0c49-0b257cd95...@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.

Reply via email to