simpson
20th July 2007, 15:45
Hi,

We have a problem for printing our payment conditions on back side of the invoice.
The payment-conditions are loaded on our canon-copier, we need to sent a command into the report, so the right payment condition is printed.
Therefore, we need to sent <esc>&f0Y<esc>&n6W<esc>mfo5 to the temp-file for defining the payment condition and sent <esc>&f2x for printing it.
In the temp-files I can find ^[ as <esc>-character coming from the print-driver, but when putting this into a field on the report or program script(with vi) and sending it to the printer, the ^[ is removed and the report prints the command instead of the payment-condition.We also use editplus for maintainting the report-scripts and program-scripts. How can we enter this in
editplus so the result is ^[ in the temp-file to the printer?

Kind regards

mark_h
20th July 2007, 16:11
Well in a report you can use chr$(27) - or in a program script. When using vi what you do is hit i for insert, ctrl-v(quote next character), then the escape key. If using in program or report script I would use chr$(27). If editing a plain text file in vi then I might use the ctrl-v method.

I guess I do not understand what you are trying to accomplish. You could put the escape sequence in a user defined font on the print driver, then use that font on the report for that field.

simpson
20th July 2007, 16:38
Hello Mark,
I know in vi I can use ctrl-v and pressing <esc>. I tried it but the result is not correct. I try to give more details.
We would like to print automaticly our payment conditions on the back side of each invoice-page coming from BaanERP. Therefore, a file with the payment condition is loaded into our canon-copier. By adding a special command into a field on the report, the payment condition is printed on the report(printing to the printer creates a temporary file on /opt/baant/bse/tmp).
The correct command we need to sent to the copier for this is:
<esc>&f0Y<esc>&n6W<esc>&mfo5
mfo5 is the name of the file loaded on the copier
When I put this command into a variable on the report(with vi in the report script I set payment.cond = "^[&f0Y etc...), when sending it to the printer
by print report, the output is not correct(the command is printed(without ^[&) instead of the payment condition loaded in the copier. When I check the
tmp-file on the unix system, I see that the escape-character is missing.
How can I make it possible to sent the correct escape code to the copier?
Thanks

csecgn
20th July 2007, 17:01
Because you are on unix you can put the ESC-seq as a user defined var in the printer driver

i.e. like

...
usr11=\E,
...

is the sequence for ESC. After this yu can use the pc$-vars inside your code for inserting this definitions in normal program vars. Just remember: usr11 is not pc$11. It a little tricky to figure out which pc$ var corresponds to which usr-var of the driver (you have to add 6 if I remember correctly. So pc$(17) is usr11). You can find all you need for this in the online-help. Look for pc$.
Longer strings like "usr4=\E&f1S\E&a-450V\E*c600v2700h2P\E&f1S," are also possible. This one puts a white filed on the printer (did work up to LJ 4000 printers. We needed it to masquerade a part of a barcode).

The colon "," at the end is important!

hth

Regards
Christof