STRING$ & SPACE$ functions
Posted: Thu Sep 24, 2015 2:28 pm
Simple STRING$ & SPACE$ functions like those found in many other basic languages. They are simple to make & use, and came in handy for a couple of programs I made.
- Dav
- Dav
Code: Select all
'string&space.txt
'STRING$ and SPACE$ functions for sB
'by Dav SEP/2015
a$=string$(10,"x")
b$=space$(10)
print a$&b$&string$(10,"o")
print string$(22,"C")
def string$(num, a$)
'returns string of a$ based on num
'example, print string$(0,"x") makes...
'xxxxxxxxxx
b$=""
for g=1 to num
b$=b$&a$
next g
return b$
end def
def space$(num)
'returns string of spaces based on num
'example, a$=space$(100) makes a string
'containing 100 spaces.
b$=""
for g=1 to num
b$=b$&" "
next g
return b$
end def