borisb
Fri Nov 26 02:46:33 CST 2004
Sietse,
no true abaout ADDBS (at least in VFP8)
no metter if the path end or not end with backslash the function always
retirns the path with one backslash at the end.
Boris
Sietse Wijnker wrote:
> 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
>
>