Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo Basic - <b>lprint using formatted output to lpt1:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
LPRINT USING             Formatted Output to LPT1:

 LPRINT USING formatstr; exprlist [;]

    Prints one or more string or numeric expressions, in a specified
    format, to LPT1:.

   formatstr    A string variable or constant specifying the format in
                which the data is to be printed (see below).

    exprlist    Numeric and/or string expressions to print. Each
                expression must be separated from the one after it by
                either a comma or a semicolon.

           ;    If included at the end of the statement, suppresses the
                usual carriage return and line feed.

    Formatting options:

    The following symbols may be used in formatstr:

      Symbol    Meaning

           !    Print only the first character of a string expression.

        \  \    Print only the first n + 2 characters of a string
                expression, where n is the number of spaces between the
                two backslashes. If n is larger than the number of
                characters in the string expression, BASIC pads the string
                expression on the right with space characters.

           &    Print a string expression without reformatting it.

           .    Specifies the position of the decimal point in a numeric
                expression.

           #    A place-holder. If the numeric expression has more digits
                to the right of the decimal point than the format string
                has #s, BASIC rounds. If the numeric expression has more
                digits to the left of the decimal point than the format
                string has #s, BASIC prints all the digits to the left of
                the decimal point and also prints a percent sign (%) to
                the left of the number. If the numeric expression has
                fewer digits to the left of the decimal point than the
                format string has #s, BASIC right-justifies the number;
                that is, it pads the number on the left with spaces. (But
                if there are any #s to the left of the decimal point in
                the format string, Turbo Basic always prints at least one
                digit--a 0 if necessary--to the left of the decimal
                point.)

           +    Print a plus or minus sign, as appropriate, to the left or
                right of the number. The sign is always printed
                immediately to the left or right of the number, depending
                on the position of plus sign.

           -    Print a minus sign immediately to the right of a negative
                number (the minus sign should appear after the place
                holders in the format string).

          $$    Print a dollar sign immediately to the left of the number.
                The double dollar sign also acts as a place holder for two
                additional digits to the left of the decimal point, one of
                which is the dollar sign itself. The dollar sign cannot be
                prefixed to a number printed in exponential format.

          **    Fill any leading spaces with asterisks. The double
                asterisk also acts as a place holder for two additional
                digits to the left of the decimal point.

         **$    Print a dollar sign immediately to the left of the number,
                and fill any remaining leading spaces with asterisks. The
                combination of two asterisks and a dollar sign also acts
                as a place holder for three additional digits, one of
                which is the dollar sign.

        ^^^^    Print a number in exponential format. The four carets
                should appear after all place holders in the format
                string. The four carets are place holders for E.nn or
                D.nn.

           _    Print next character as a literal. The combination _#, for
                example, allows you to include a number sign as a literal
                in your numeric format.

     [other]    Characters other than the foregoing may be included as
                literals in the format string. Thus, for example, a single
                dollar sign may be positioned to the left of a series of
                place holders (#s) to achieve vertically aligned dollar
                signs, and space characters may be placed at the right
                side of the format string to achieve horizontal separation
                between a series of numbers.

   -------------------------------------------------------------------------

      Notes:    Turbo Basic sends a carriage return-line feed pair after
                the last expression to be printed, unless that expression
                is followed by a semicolon.

                Turbo Basic assumes a maximum line length of 80
                characters, unless a different value has been specified by
                means of a WIDTH "LPT1:" statement. Turbo Basic sends a
                carriage return-line feed pair when the maximum line
                length has been reached.

See Also: LPRINT PRINT USING WIDTH

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