The Pudef Command - Commodore 128 System Manual

Table of Contents

Advertisement

PRINT USING lets you create a format for your output, using
spaces, commas, decimal points and dollar signs. Hash marks
(the # sign) are used to represent spaces or characters in the
displayed result. For example:
PRINT USING "# $ # # # # # # . # # ";A
tells the computer that when A is printed, it should be in the form
given, with up to six places to the left of the decimal point, and
two places to the right. The hash mark in front of the dollar sign
indicates that the $ should float, that is, it should always be
placed next to the left-most number in the format.
If you want a comma to appear before the last three dollar
places, as in $1,000.00 include the comma in the PRINT USING
statement. Remember you can format output with spaces,
commas, decimal points, and dollar signs. There are several
other special characters for PRINT USING, see the BASIC
Encyclopaedia for more information.

The PUDEF Command

If you want formatted output representing something other than
dollars and cents, use the PUDEF (Print Using DEFine)
command. You can replace any of four format characters with
any character on the keyboard.
The PUDEF command has four positions, but you do not have to
redefine all four. The command looks like this:
PUDEF" , . $ "
1 2 3 4
Here:
• position 1 is the filler character. A blank will appear if you
do not redefine this position.
• position 2 is the comma character. Default is the comma.
• position 3 is the decimal point.
• position 4 is the dollar sign.
If you wrote a program that converted dollar amount to English
pounds, you could format the output with these commands:
10 PUDEF " , . £ "
20 PRINT USING "# $ # # # # # # ";X
5-7

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

128d

Table of Contents