Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- RLIB 3.0a Reference - <b>function:</b> printcode() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Function:    PRINTCODE()

Purpose:     Convert text printer codes into actual escape sequence codes.

Syntax:      PRINTCODE( textcodes )

Arguments:   textcodes   - The character text printer codes to parse and
                           convert into actual printer control codes.

Returns:     The parsed printer control codes.

Description: PRINTCODE() is a printer function that helps application
             programmers easily store and retrieve printer control codes
             as character strings that can be edited.

             The format of the <textcodes> string is industry familiar.
             ASCII codes are entered as a series of comma delimited
             numbers, each one representing one control character.  Actual
             characters may be entered instead of or in conjunction with
             ASCII codes, the only requirement being that literal codes
             are enclosed in double or single quote delimiters.

Notes:       Printer control strings that are parsed by PRINTCODE() have
             either the form: "27,'(s3B'", or "27,40,115,51,66".  The
             first format combines an ASCII character designation for the
             escape character (ASCII value = 27 decimal) followed by the
             actual literal character sequence "(s3B".  The second example
             specifies the escape sequence as a list of decimal ASCII
             values.

             The PRINTCODE() function is used by the REPORTINIT() function
             to initialize printer control codes.

Example:     *-- store some LaserJet control codes in a database
             USE printers
             REPLACE reset     WITH "27,'E'"
             REPLACE bold_on   WITH "27,'(s3B'"
             REPLACE bold_off  WITH "27,'(s0B'"

             *-- or it could be entered as
             REPLACE bold_off  WITH "27,40,115,51,66"

             *-- use PRINTCODE() to translate codes stored in a database
             *-- and place printer in Bold mode
             ? PRINTCODE(reset) + PRINTCODE(bold_on)
             ?? "RLIB users program quicker and better!"
             ?? PRINTCODE(bold_off)

             *-- or, create character enhancement functions
             ? BOLD("Hello RLIB world")

             *-- where the following function is defined
             *-------------------------------------------------------
             FUNCTION Bold
             PARAMETER string
             RETURN PRINTCODE(bold_on) + string + PRINTCODE(bold_off)

Source:      RL_PRINT.PRG

See also:    REPORTINIT(), STARTREPORT()

See Also: REPORTINIT() STARTREPORT()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson