What is the string/s for reading a single char as a variable,then reading the next char after that as a vairable, then reading the next char after that as a variable etc. In a text file?
Thankyou
Printable View
What is the string/s for reading a single char as a variable,then reading the next char after that as a vairable, then reading the next char after that as a variable etc. In a text file?
Thankyou
String*1 is a fixed length string with length 1 but as you want to read a file i think you should use a byte array instead:
Dim chas as byte
To read a file use:
ff=freefile
Open file for binary as ff
Get#ff,,char
close ff
Thanks for that I really appreciate it, but how would you rd the next char of that line in the txtfile(same code?). Also how do you skip a line in a txt file.
Thanks Again!
Thanks for that I really appreciate it, but how would you rd the next char after the 1st read char of that line in the txtfile(same code?). Also how do you skip a line in a txt file.
Thanks Again!
Well in binary access mode you can't read lines so i think you have to jump over to input (for text files only)
Lineinput #ff,Line
To get the next char in input it's a bit harder, you need to split the strings you get and you can't know if it is carriage or clear linefeed that you get. Use Binary in this case:
char=space(1)
Get #ff,char