Commodore 128 System Manual page 301

Hide thumbs Also See for 128:
Table of Contents

Advertisement

EXAMPLES:
FIELD
EXPRESSION
##.#
-.1
##.#
1
####
-100.5
####
-1000
###.
10
#$##
1
The up arrows or caret symbols (
the number is to be printed in E format (scientific notation). A
hash sign must be used in addition to the four carets to specify
the field width. The carets must appear after the hash sign in the
format field. Four carets must be specified when a number is to
be printed in E format. If fewer than four carets are specified, a
syntax error results. If more than four carets are specified, only
the first four are used. The fifth and subsequent carets are
interpreted as text symbols. You can specify a + or - sign after
the carets if you require a trailing sign. An equal sign (=) is used
to centre a string in a field. The field width is specified by the
number of characters (hash sign and an equal sign) in the format
field. If the string contains fewer characters than the field width,
the string is centered in the field. If the string contains more
characters that can be fitted into the field, then the right-most
characters are truncated and the string fills the entire field. A
greater than sign (> ) is used to right justify a string in a field.
Other characters can be included in a format string, these are
treated as literals. This allows you to build up tables and charts.
See line 30 in the program below for a specific examples of this.
EXAMPLE:
5 X=32: Y=100.23: A$="CAT": B$="COMPUTER"
6 F$="* # = # # # # # # # # # # * # $ # # . # # * "+CHR$(13) *
10 PRINT USING "$ # # . # # ";13.25,X,Y
20 PRINT USING "# # # > # ";"CBM",A$
30 PRINT USING F$;A$,X,B$/Y
CHR$(13) IS RETURN
RESULT
COMMENT
0.1
Leading zero added
-
1.0
Trailing zero added
-101
Rounded to no
decimal places
Overflow because
four digits and
a minus sign cannot
fit in field
10
Decimal point added
.
Leading dollar sign
$1
) are used to specify that
17-59

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

128d

Table of Contents