what about filling the array from a textfile within a loop?
Code: Select all
Dim Bla$(8)
If ReadFile(0,"textfile.txt")
For n=0 To 8
Bla$(n) = ReadString(0,#PB_Ascii)
Next
CloseFile(0)
EndIf
For t=0 To 8
Debug Bla$(t)
Next
textfile.txt is:
Code: Select all
this is a test
does it work as expected?
-------------------------
what's the difference in an apple?
It's a telephone pole
because motorcycles don't have doors,
elephants don't eat icecream,
and an egg when broken
must stay the same crushed egg forever.
also for different structured datasets, a predefined extern file is a good possibility.
and of course there are ways to protect the data to have the user not changed it easily.
of course, you can do it the same way via DataSection, it a good solution, too.
...but direct elementwise assignment within the code is not a good solution....
your idea reminds me of C, but it's only practicable if you could use multiple lines.
to write a complete Array in one line would be a PITA.....
better use DataSection then, you could give it a table-form there, too.
oh... and have a nice day.