Sharp MZ-700 Series Owner's Manual page 43

Personal computer
Hide thumbs Also See for MZ-700 Series:
Table of Contents

Advertisement

(2) Format specification for string values
(a) !
When the values being displayed are character strings, specifying an excla-
mation mark in " f o r m a t string" causes just the first character of the string
specified to be displayed.
(Example:)
10 A$ = CDE"
20 PRINT USING "!" ; A$
RUN J
C
(b)
&
Specifying
— — —
in the format string causes the first 2 + n charac-
ters of specified string expressions to be displayed (where n is the number
of spaces between the two ampersands). If fewer than 2 + n characters
are specified in a string expression, characters displayed are left-justified
in the field defined by " & - - - - &".
(Examples:)
10 A$ = "ABCDEFGH "
20 PRINT USING
; A$
RUN J
ABCDEF
10 A$ = "XY"
20 PRINT USING
1 1
& ^
- - &" ; A$
RUN J
XY
(3) String constant output function
When any character other than those described above is included in the format
string of a PRINT USING statement, that character is displayed together with
the value specified following the semicolon.
(Example:)
10 A = 123
20 PRINT USING " D A T A # # # # " ; A
RUN J
D A T A ^ 1 2 3
(4) Separation of USING
Usually, PRINT and USING are specified adjacent to each other; however,
it is possible to use them separately within the same statement.
(Example:)
10 A = - 1 2 : B = 14 : C = 12
20 PRINT A; B; USING " # # # # " ; C
Normal PRINT function
USING function
RUN J
- 1 2 - 1 4 ^ 1 2
41

Advertisement

Table of Contents
loading

Table of Contents