Hello,
I am stuck in one little predicament and I was hoping someone can help me here. I have the following code below:
Open In 1,"1.txt"
While Eof(1)=0
Input#1,A$
Wend
The file 1.txt hold this information:
0,0,0,0,0,0,0,0,0,0 (Line 1)
0,1,1,1,0,0,1,1,1,0 (Line 2)
etc
I want to be able to read the file character by character and store that character in A$ and when I reach the comma file I want to be able to write some code (all inside the while loop mind you) and then resume reading the characters after that comma and so on.
For example right now I have 0,0,0,0,33,0,0 I should be able to read the first character 0 and then if the second character is comma, do code here, then move on to the second character which is 0 and then the one after it is a comma, then do code here, repeat until I reach 33. In 33, it reads the first character 3 then the second character 3 and store that in a string variable A$="33" when it reaches the third character comma then it executes code. It keeps these procedures until it finishes Line 1 and then repeat the same cycle to Line 2 until it reaches end of file.
Right now my problem are two faults.
1) When it reads the file it stores A$ immediately as "0,0,0,0,0,0,0,0,0,0" one string , but does not store the second line, third line...it just stores the first line in the string
2) I keep getting End Of File.
What advice and approach you guys could give me? Also, now they are stored as easy modifiable 1.txt file that you can easily open in a notepad, change the level design, setting and poof. There goes the security and cheating is a breeze. How do I protect people from accessing or modifying or even saving it in this format but encrypted and where it fails to open the file not encrypted?
Thanks in advance.