Page 1 of 1

Problem with PRINTER class ???

Posted: Thu May 29, 2008 4:43 pm
by driessen
I noticed a slight difference in the PRINTER class in FWH 8.05 and the previous versions.

Source in PRINTER class in FWH 8.05 :

Code: Select all

function SetPrintDefault( cModel )

   local cDriver := StrToken( GetProfString( "Devices", cModel, "" ), 1, "," )
   local cPort   := StrToken( GetProfString( "Devices", cModel, "" ), 2, "," )

   WriteProfString( "Windows", "Device", cModel + "," + cDriver + "," + cPort )

return nil
Source in PRINTER class in previous versions :

Code: Select all

function SetPrintDefault( cModel )

   local cDriver := StrToken( GetProfString( "Devices", cModel, "" ), 1, "," )
   local cPort   := StrToken( GetProfString( "Devices", cModel, "" ), 2, "," )

   WriteProfString( "Windows", "Device", cModel + ",", + cDriver + "," + cPort )

return nil
There is a slight difference in the function "WriteProfString". Notice an extra comma behind <cModel + ",",>.

What is the right code ?

Thanks.

Regards.

Posted: Thu May 29, 2008 6:12 pm
by James Bott
Michel,

My version of PRINTER.PRG from ver 8.05 does not have the extra comma. Perhaps yours is corrupted.

James

Posted: Thu May 29, 2008 6:33 pm
by Antonio Linares
Michel,

That fix has been introduced intentionally as WriteProfString() only admits three parameters and we were supplying it four by mistake.

Posted: Thu May 29, 2008 7:04 pm
by James Bott
Michel,

Ops, my mistake. I thought you had shown the old version first and the new one after.

James

Posted: Thu May 29, 2008 7:25 pm
by driessen
Antonio,
James,

Thanks for your answer.

That's all I wanted to know.

Regards.