2009-05-27 13:23 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* contrib/hbwin/win_prn2.c
* Cleaned hb_parcx() vs. hb_parc() usage in one function.
(hb_parcx() is only needed if there is no preceding HB_ISCHAR()
check. If there is hb_parc() will also always return a valid
pointer).
+ contrib/hbwin/tests/testprn2.prg
+ Added raw printing test.
This commit is contained in:
@@ -17,6 +17,16 @@
|
||||
past entries belonging to these authors: Viktor Szakats.
|
||||
*/
|
||||
|
||||
2009-05-27 13:23 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
|
||||
* contrib/hbwin/win_prn2.c
|
||||
* Cleaned hb_parcx() vs. hb_parc() usage in one function.
|
||||
(hb_parcx() is only needed if there is no preceding HB_ISCHAR()
|
||||
check. If there is hb_parc() will also always return a valid
|
||||
pointer).
|
||||
|
||||
+ contrib/hbwin/tests/testprn2.prg
|
||||
+ Added raw printing test.
|
||||
|
||||
2009-05-27 12:59 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
|
||||
* utils/hbmk2/hbmk2.prg
|
||||
% -undef/-D Harbour options will be reduced in cross-compilation
|
||||
|
||||
40
harbour/contrib/hbwin/tests/testprn2.prg
Normal file
40
harbour/contrib/hbwin/tests/testprn2.prg
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
LOCAL nPrn := 1
|
||||
LOCAL cFileName := Space( 40 )
|
||||
LOCAL aPrn := GetPrinters()
|
||||
LOCAL GetList := {}
|
||||
|
||||
CLS
|
||||
|
||||
IF Empty( aPrn )
|
||||
Alert("No printers installed - Cannot continue")
|
||||
QUIT
|
||||
ENDIF
|
||||
|
||||
DO WHILE nPrn != 0
|
||||
CLS
|
||||
@ 0, 0 SAY "PrintFileRaw() test program. Choose a printer to test"
|
||||
@ 1, 0 SAY "File name" GET cFileName PICT "@!K"
|
||||
READ
|
||||
@ 2, 0 TO MaxRow(), MaxCol()
|
||||
nPrn := AChoice( 3, 1, MaxRow() - 1, MaxCol() - 1, aPrn, .T.,, nPrn )
|
||||
IF nPrn != 0
|
||||
PrnTest( aPrn[ nPrn ], cFileName )
|
||||
ENDIF
|
||||
ENDDO
|
||||
|
||||
RETURN
|
||||
|
||||
STATIC PROCEDURE PrnTest( cPrinter, cFileName )
|
||||
|
||||
IF Empty( cFileName )
|
||||
hb_MemoWrit( cFileName := "_hbtest.prn", "Hello World!" + Chr( 12 ) )
|
||||
ENDIF
|
||||
|
||||
Alert( PrintFileRaw( cPrinter, cFileName, "testing raw printing" ) )
|
||||
|
||||
RETURN
|
||||
@@ -481,9 +481,9 @@ HB_FUNC( PRINTFILERAW )
|
||||
LONG Result = -1;
|
||||
|
||||
if( ISCHAR( 1 ) && ISCHAR( 2 ) )
|
||||
Result = hb_PrintFileRaw( ( UCHAR * ) hb_parcx( 1 ) /* cPrinterName */,
|
||||
( UCHAR * ) hb_parcx( 2 ) /* cFileName */,
|
||||
ISCHAR( 3 ) ? ( UCHAR * ) hb_parcx( 3 ) : ( UCHAR * ) hb_parcx( 2 ) /* cDocName */ );
|
||||
Result = hb_PrintFileRaw( ( UCHAR * ) hb_parc( 1 ) /* cPrinterName */,
|
||||
( UCHAR * ) hb_parc( 2 ) /* cFileName */,
|
||||
ISCHAR( 3 ) ? ( UCHAR * ) hb_parc( 3 ) : ( UCHAR * ) hb_parc( 2 ) /* cDocName */ );
|
||||
|
||||
hb_retnl( Result );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user