|
-
Jun 5th, 2000, 03:06 PM
#1
Thread Starter
Junior Member
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
-
Jun 5th, 2000, 03:59 PM
#2
transcendental analytic
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
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 6th, 2000, 02:29 PM
#3
Thread Starter
Junior Member
Rd single char
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!
-
Jun 6th, 2000, 02:30 PM
#4
Thread Starter
Junior Member
Rd single char
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!
-
Jun 6th, 2000, 08:04 PM
#5
transcendental analytic
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
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|