11-10-2004, 04:22 AM
Z!re helped me with this yesterday but I'm having trouble getting an INPUT to read all the arrays in a file with out having to name the strings$ over and over again.. This is kinda hard to explain so here is some code.
here's the file I'm reading from
I want all those to be printed in QB, but i can only get the last variable (E 15) to print. Can someone alter the code to make it print out all those variables right there? Thanks
Code:
INPUT "Scale name to open: (no extensions) ", scale$
filename$ = scale$ + ".scl"
OPEN filename$ FOR INPUT AS #1
LINE INPUT #1, scalename$
p = 1
DIM a(150) AS STRING
DO
p = p + 1
INPUT #1, a$
LOOP UNTIL EOF(1)
CLOSE #1
PRINT a$, p, a
here's the file I'm reading from
Code:
E Plentonic
e 3, e 5, e 7, b 3, b 5, g 4, d 5, d 7, a 5 a 7, E 3, E 5, E 7
e 5, e 7, b 5, b 8, g 7, d 5, d 7, d 9, a 5, a 7, E 5, E 7
e 7, e 10, b 8, b 10, g 7, g 9, d 7, d 9, a 7, a 10, E 7, E 10
e 10, e 12, b 10, b 12, g 12, d 12, d 14, a 10, a 12, a 14, E 10, E 12
e 12, e 15, b 12, b 15, g 12, g 14, d 12, d 14, a 12, a 14, E 12, E 15
I want all those to be printed in QB, but i can only get the last variable (E 15) to print. Can someone alter the code to make it print out all those variables right there? Thanks