Hi people,
I'm wanting to copy multiple text files into the one memory bank that can then be searched. But to copy each text file into the one bank, one after another, is a little trickier than I first thought. Here are the commands I'm looking at;
- MAKE BANK FROM FILE Bank Number, Source Filename, Start Position, Number of bytes
So each text file gets loaded first into it's own memory bank.
- COPY BANK Source Bank Number, Start Position, Size, Target Bank Number, Target Position
And then I copy nBank onto Bank 1. The final size of Bank 1 I think is easy to calculate, that's just the sum of all the text file bytes. So;
Source Bank = nBank
Start Position = 1
Size = Is this in bytes? If so, the size of nBank
Target Bank Number = 1
Position = .... you got me.
I think that I need to identify the end position of each nBank, but the only way I can sudo this is super slow, and it's checking the original text file, not the bank;
Set Dir Get dir$() + "\TXT"
open datafile to read 1, "Example.txt"
repeat
inc counter
Print Datafile byte (1)
until DATAFILE END ( 1 )
Close datafile 1
print counter
nice wait key
end
do
loop
end
I had a look about on the forums but couldn't find too much info covering this. Does anyone have any ideas?