On Jan 15, 11:21=A0am, sebas22 <nos...@[EMAIL PROTECTED]
> wrote:
> On Tue, 15 Jan 2008 05:33:16 -0800 (PST), chersz...@[EMAIL PROTECTED]
wrote:
> >Hi
> >I recently discovered that if I issue a SET PRINTER TO LPTx after a
> >SET DEFAULT TO a different folder, clipper tries to create a file
> >named LPTx.PRN in the default directory and of course generates a
> >CREATE ERROR.
> >Without th SET DEFATLT TO command it does work as it should.
> >This happens in W2K/XP machines, doesn't in W98.
>
> My solution is a custom function SetPrinterTo().
> You can #translate your SET PRINTER TO to call it =A0:
>
> /* =A0SetPrinterTo(), to nullify _SET_DEFAULT before a set printer to.
> * =A0 SET PRINTER TO cFile =A0 =3D> =A0 =A0 SetPrinterTo( cFile )
> * =A0 SET PRINTER TO cFile ADDITIVE =A0 =3D> =A0 SetPrinterTo( cFile,
.T. =
)
> * =A0 SET PRINTER TO =A0 =A0 =A0 =A0 =A0 =3D> =A0 =A0 =A0SetPrinterTo(
"" =
)
> * =A0 Remarque : SetPrinterTo() gives the current setting without
> changing anythg
> */
>
> #include "hcommon.ch" =A0 =A0 =A0 =A0 =A0 =A0// for isnil()
>
> function SetPrinterTo( cPrintFile, lAdd )
> =A0 local cOldDefault
> =A0 local cOldPrintFile :=3D set(_SET_PRINTFILE)
>
> =A0 if ! isnil(cPrintFile)
> =A0 =A0 =A0cOldDefault =A0 :=3D set(_SET_DEFAULT, "" )
> =A0 =A0 =A0set(_SET_PRINTFILE, cPrintFile, lAdd)
> =A0 =A0 =A0set(_SET_DEFAULT, cOldDefault)
> =A0 endif
>
> return cOldPrintFile
>
> --
> Ciao,
> Sebas
Sebas
Thanks for your answer.
I was trying to avoid this push/pop solution.
Unless any other one had found the reason for this clipper/w2k+
behaviour, this would probably become "the" solution.
Thanks again
Claudio


|