Tandy 1000 Basic Reference Manual page 325

Hide thumbs Also See for 1000:
Table of Contents

Advertisement

Chapter 10 I
BASIC
Keywords
STRING$
Function
STRING$( number,character)
Returns a string containing the specified number of
character.
Number
must be in the range 0 to 255.
Character
is a string or an ASCII code. If you use a string con-
stant, you must enclose it in quotation marks. All the characters
in the string have either the ASCII code, or the first letter of the
string specified.
STRING$ is useful for creating graphs or tables.
Examples:
B $
=
S T R I N G S C 2 5 ,
" X " )
puts a string of 25 "X"s into
B$.
P R I N T S T R I N G $ ( 5 0 , 10)
prints 50 blank lines on the display, because 10 is the ASCII
code for a line feed.
Sample Program
1 0 4 0 C L E A R 3 0 0
1 0 5 0 I N P U T " T Y P E
I N
3 N U M B E R S B E T W E E N 3 3 AND
1 0 6 0
C L S :
FOR
I
=
1 TO 4 : P R I N T STRING$(20, Nl):
1 0 7 0
F O R
J
=
1 TO 2: P R I N T STRINGs(40, N2): N E X T
1 0 8 0 P R I N T STRINGB(80, N3)
1 5 9 " ; N 1
,
N 2 , N3
N E X T
I
J
This program prints 3 strings. Each string has the character
corresponding to one of the ASCII codes provided.
323

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents