Re: Saving a file to a users desktop.
From: Sietse Wijnker (sietse.wijnker_at_ATsw-software.nl)
Date: 11/24/04
- Next message: Janusz Czudek: "Re: VFP9 and docking forms"
- Previous message: Anders Altberg: "Re: Purchase 8.0 or want for 9.0?"
- In reply to: Steve Fisher: "Re: Saving a file to a users desktop."
- Next in thread: borisb: "Re: Saving a file to a users desktop."
- Reply: borisb: "Re: Saving a file to a users desktop."
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 24 Nov 2004 15:55:49 +0100
Hi Steve,
> Fname=Fname+"\"+"aodbals.xls"
Take a look at the ADDBS() function. If the folder already contains a
backslash at the end you'll get something like
c:...\foldername\\aodbals.xls
with the ADDBS() that wouldn't occur. it only adds a backslash when it's not
there.
Furthermore, i would use a header file or DEFINE's for readablity of your
code. When you look at your code six months from now you might know that it
returs a file-path onto the desktop, but then again you might not:
#DEFINE CSIDL_DESKTOPDIRECTORY 0x0010
o=NEWOBJECT("_commonfolder", HOME() + "ffc\_system.vcx")
Fname = ADDBS(o.getfolder(CSIDL_DESKTOPDIRECTORY)) + "aodbals.xls"
For more values you can pass to the GetFolder method:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/enums/csidl.asp
> I can do this on Win98 easily:
> EXPORT TO c:\windows\desktop\aodbal.xls TYPE xls
You might want to use the GETENV() function to retrieve the path to the
windows folder. What if windows is installed on the D drive?
EXPORT TO (ADDBS(GETENV('windir')) + 'desktop\aodbal.xls' TYPE xls
BTW, the requirements to use the GetFolder method in the _system.vcx (using
the SHGetFolderPath() API call):
Minimum operating systems Windows 95 with Internet Explorer 5.0,
Windows 98 with Internet Explorer 5.0, Windows 98 Second Edition (SE),
Windows NT 4.0 with Internet Explorer 5.0, Windows NT 4.0 with Service Pack
4 (SP4)
Regards,
Sietse Wijnker
- Next message: Janusz Czudek: "Re: VFP9 and docking forms"
- Previous message: Anders Altberg: "Re: Purchase 8.0 or want for 9.0?"
- In reply to: Steve Fisher: "Re: Saving a file to a users desktop."
- Next in thread: borisb: "Re: Saving a file to a users desktop."
- Reply: borisb: "Re: Saving a file to a users desktop."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|