Description

The STOP message will end a print job. All START messages must have a corresponding STOP message.

Parameters

This message does not accept parameters.

See also

START Direct_Print() message

PRINT Direct_Print() message

PAGE Direct_Print() message

ABORT Direct_Print() message

PRINTBIN Direct_Print() message

Direct_Print Error Codes

Direct_Print() function

Example

Subroutine Direct_Print_Example(startValue)
 
Declare Function Direct_Print, Unassigned
 
If Unassigned(startValue) Then startValue = ''
 
Equ HP_Bold$ To char(27):'(s3B'
 
Equ HP_Norm$ To char(27):'(s-5B'
 
* This case statement contains the various START options
 
Begin Case
 
  Case startValue = ''
 
    retval = Direct_Print('START','','','') ; * print to default printer
 
  Case startValue = 'ToFile'
 
    retval = Direct_Print('START','','C:\TEMP\DIRECT_PRINT_EXAMPLE.TXT',1) ; * Print To file
 
  Case startValue = 'Different_Printer'
 
    retval = Direct_Print('START','HP LaserJet 2200 Series PCL 6','','') ; * print to a specific printer
 
End case
 
If retval < 1 then Goto ErrorHandler
 
* Print 30 lines of bold text
 
For i = 1 To 30
 
  retval = Direct_Print('PRINT',HP_Bold$:'This first page contains bold text.')
 
  If retval < 1 then Goto ErrorHandler
 
Next i
 
retval = Direct_Print('PAGE') ; * Force page break
 
If retval < 1 then Goto ErrorHandler
 
For i = 1 To 30
 
  retval = Direct_Print('PRINT',HP_Norm$:'This page contains plain text.')
 
  If retval < 1 then Goto ErrorHandler
 
Next i
 
retval = Direct_Print('PAGE') ; * Force page break
 
If retval < 1 then Goto ErrorHandler
 
retval = Direct_Print('PRINT','This page contains concatenated text.',0)
 
If retval < 1 then Goto ErrorHandler
 
retval = Direct_Print('PRINT','This page contains concatenated text.',1)
 
If retval < 1 then Goto ErrorHandler
 
* End the Print Job
 
retval = Direct_Print('STOP')
 
ErrorHandler:
 
If retval < 1 Then
 
  Swap @fm With  @vm In retval
 
  call Msg(@Window,'ERROR':retval)
 
  retval = Direct_Print('ABORT')
 
End
 
Return

 

 

  • No labels