Re: Printer escape sequences in SE table
Posted in 1999
Hi Nick.
As printer commands always start with the escape character, you could store the
remainder of the command string in a character field.
In your report just say:
PRINT ASCII 27
, table.bold_on CLIPPED
, your_string
, ASCII 27
, table.bold_off CLIPPED
This will make it easier to maintain the command strings.
Succes
Henk J. Sanders
Nick Lefel wrote:
> Here is my two penn'eth worth ...
>
> One day you may need another printer type, so today is the day to
> write a driver.
> Table printer (
> printer_type char (10), # epson, canon, HP
> effect char (10), # bold, norm, underline, font etc.
> code smallint, # decimal value for individual parts of
> esc sequences
> sort_nr smallint # to get it in the right order !
> )
>
> to get bold:
> SELECT code, sort_nr
> FROM printer
> WHERE printer_type = "CANON" AND
> effect = "bold"
> ORDER BY sort_nr>
> pack this into an array (or charwise into a string with FOREACH)
> FOR i = 1 TO <<length array>>
> PRINT ASCII (array[i])
> END FOR
>
> > Don't forget to end the mode with another ASCII 27, and use semi-colons to
> > avoid adding line-feeds you don't want:
> >
> Good thinking ...
>
> You can pack this sort of stuff into a nice subroutine and PRESTO
> Robert is your mothers uncle
>
> Have fun
>
> Nick Lefel, Hamburg