|
Post by danuthorincas on Sept 24, 2020 8:34:02 GMT
I need an improved solution for:
for i=1 to 5
print i; space$(3);chr$(34);space$(3);chr$(34);space$(3);chr$(34)
next
|
|
|
Post by tsh73 on Sept 24, 2020 8:44:29 GMT
What kind of improvement do you want? It likely won't get any shorter or clearer. Here I added strRepeat function so you can make longer strings.
for i=1 to 5
print i; space$(3);chr$(34);space$(3);chr$(34);space$(3);chr$(34)
next
print "------------------------"
for i=1 to 5 print i; strRepeat$(space$(3);chr$(34), 3) next
function strRepeat$(a$, n) for i = 1 to n strRepeat$=strRepeat$+a$ next end function
|
|
|
Post by danuthorincas on Sept 24, 2020 11:28:58 GMT
Thanks a lot
I dont want to write in the program:space$(3);chr$(34);space$(3);chr$(34);space$(3);chr$(34) for n time .
In my initial post I put only 3 repet.
|
|
|
Post by cundo on Sept 25, 2020 21:34:25 GMT
Create variables. Like s$=space$(3) Then print the variables. print s$
|
|