Print Using; Numeric Formats - AMSTRAD cpc 6128 User Instruction

Integrated computer/disc system
Hide thumbs Also See for cpc 6128:
Table of Contents

Advertisement

PRINT USING
PR I N T[# <stream expression>][<list of: <print item> ][;]
[U SING <formattemplate>][<separator><expression>]
10 FOR x=1 TO 10
20 n=100000*(RNDtS)
30 PRINT "goods";USING "########,.##";n
40 NEXT
run
PR I N T US I N G enables you to specify the print format of the expression returned
by the PR I N T command. This is achieved by specifying a <format template> to which
the printed result must correspond. The <separator> is a comma or semicolon. The
<format template> is a string expression which is constructed using the following
'format field specifiers':
Numeric Formats
Within the number:
#
Each
#
specifies a digit position.
Example template:
# # # # # #
Specifies the position ofthe decimal point.
Example template:
# # # # # # • # #
,
(Specifies one digit position.) May appear BEFORE the decimal point only.
Specifies that digits before the decimal point are to be
divid~d
into groups of
three (for thousands), separated by commas.
Example template:
# # # # # # , • # #
Around the number:
£ £
(Specifies two digit positions.) Specifies that a
£
sign be printed immediately
before the first digit or decimal point (after any leading sign). Note that the
£
will occupy one ofthe digit positions.
Example template:
££######,. ##
* *
(Specifies two digit positions.) Specifies that any leading spaces be replaced
by
*
asterisks.
Example template:
**######,. ##
Complete List of Keywords
Chapter 3 Page 61

Advertisement

Table of Contents
loading

Table of Contents

Save PDF