printer

Usually you would do this by sending large enough jobs that the first ones are still printing while you start the 2nd, 3rd, 4th etc...
 
I print a receipt which is linked by a USB cable the other linked by a network cable which is in another location example kitchen
This doesn't make sense to me. I don't understand how you can have a receipt "linked by a USB cable". Maybe use more than one sentence.
 
There is nothing built-in to the language that will simultaneously send the same output to two destinations. Frankly I would be surprised if any language has such a feature built in. The closest thing that springs to mind is the UNIX "tee" command.

Working within the 4gl I would simply encapsulate the functionality and then call it twice. Once for each printer.

Something like:
Code:
procedure printReceipt:

  define input parameter printerName as character no-undo.
  define input parameter receiptBody as character no-undo.

  output through value(  "lp -d" + printerName ).  /* yes, I have used UNIX style syntax here. replace it with something more windows like */
  put unformatted receiptBody skip.
  output close.

end.

define variable rcpt as character no-undo.

rcpt = "my reciept".

run printReceipt( "printer1", rcpt ).
run printReceipt( "printer2", rcpt ).
 
There is nothing built-in to the language that will simultaneously send the same output to two destinations. Frankly I would be surprised if any language has such a feature built in. The closest thing that springs to mind is the UNIX "tee" command.

Working within the 4gl I would simply encapsulate the functionality and then call it twice. Once for each printer.

Something like:
Code:
procedure printReceipt:

  define input parameter printerName as character no-undo.
  define input parameter receiptBody as character no-undo.

  output through value(  "lp -d" + printerName ).  /* yes, I have used UNIX style syntax here. replace it with something more windows like */
  put unformatted receiptBody skip.
  output close.

end.

define variable rcpt as character no-undo.

rcpt = "my reciept".

run printReceipt( "printer1", rcpt ).
run printReceipt( "printer2", rcpt ).
I couldn't find the command under Windows
 
Of course not. That is just how one would print on Linux. Replace “output through…” with whatever it is that you are already doing to print on windows.

Make sure to parameterize it so that you can easily support multiple destinations.
 
Back
Top