|
Post by jarychk on Jul 16, 2024 8:03:29 GMT
This is not the neatest way, and I hope to learn ways to improve this.
The goal is create a starter list of things, for the main program to use; and that the user can add more things to the file, and all of these things in the list would become available for use in the program.
This example uses READ & DATA to put items into an array and then to put those array items into sequential text file. Making this work was difficult with many mistakes been corrected; and here is that very simple program:
'put names into array
dim bname$(100) B$=""
'read the FIRST item in DATA list. read B$
c=0 while B$<>"end" c=c+1 'read B$ let bnamee$(c)=B$ read B$ wend
data "g 7 o","f h s","ws sal","a s p","end"
'put all those into file bsamples.txt c0=0 open "bsamples.txt" for output as #1 for c0=1 to c print #1,bnamee$(c0) next c0 close #1
END
|
|
|
Post by zzz000abc on Jul 16, 2024 19:33:57 GMT
here is one more example to play with arrays
dim a$(1),b(4),dat$(4) b(1)=4 :b(2)=5:b(3)=4:b(4)=2
dat$(1)="hello;world;how;are" dat$(2)="it;may;rain;noon;day" dat$(3)="we;are;fine;always" dat$(4)="good;night"
for i=1 to 4 redim a$(b(i)) for j=1 to b(i) a$(j)=upper$(word$(dat$(i),j,";")) print a$(j);" "; next print "" next
|
|
|
Post by jarychk on Jul 17, 2024 1:23:24 GMT
zzz000abc I lost touch with WORD$(). If I want it back I need to make some study examples on my own.
My example uses READ, DATA because I believe simpler for what I plan. Still needs some improvement.
|
|