First of turn _SET_DEFEXTENSIONS to .F.,
after that in Harbour you'll need to convert
the Windows printer name to a port, share
name, or filename in order to print to it using
SET PRINTER TO.
Harbour core doesn't support any Windows
printers natively, so you'll need to use
hbwin.lib for some name to port conversion
and getting Windows printer name list.

IOW, in Harbour 'SET PRINTER TO' always need
to point to a filename, or any name that
can be opened using FOpen().

Brgds,
Viktor

On 2008.11.11., at 2:47, Pritpal Bedi wrote:

Hello All

Here is the code:

  cPrinter := 'Kyocera FS-1000 (KPDL-2)'

  SET PRINT ON
  SET CONSOLE OFF
  SET PRINTER TO ( cPrinter )

  ? 'Ok, I am printing'
  eject

  SET PRINTER TO
  SET PRINT OFF
  SET CONSOLE ON

The code above correctly prints on the specified printer in xHarbour
but fails in Harbour. In Harbour it creates a disk file with .prn suffix:
Kyocera FS-1000 (KPDL-2).prn

xharbour/source/rtl/set.c :

     case HB_SET_PRINTER    :
        hb_retl( hb_set.HB_SET_PRINTER );
        if( args > 1 )
        {
           hb_set.HB_SET_PRINTER = set_logical( pArg2,
hb_set.HB_SET_PRINTER );

           if( hb_set.HB_SET_PRINTER )
           {
              hb_set_SetPrinterStart();
           }
           else
           {
              hb_set_SetPrinterStop();
           }
        }
        break;

harbour/source/vm/set.c :

     case HB_SET_PRINTER:
        hb_retl( pSet->HB_SET_PRINTER );
        if( args > 1 )
pSet->HB_SET_PRINTER = set_logical( pArg2, pSet- >HB_SET_PRINTER
);
        break;

Which compiles has the correct behavior?

Regards
Pritpal Bedi

--
View this message in context: 
http://www.nabble.com/SET-PRINTER-TO-%28-cPrinter-%29---Bug-tp20431996p20431996.html
Sent from the Harbour - Dev mailing list archive at Nabble.com.

_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to