Computer Science Canada Multiline File Reading for a 3D engine? |
Author: | Gooie [ Mon Dec 17, 2007 7:22 pm ] | ||||
Post subject: | Multiline File Reading for a 3D engine? | ||||
I was just working on a 3D engine ( Long Shot ), and ran into a roadblock. I have never been good and File I/O. I'm trying to read a line in a file one line at a time, and I can't find any good explaination of 'seek', F10 doesn't help, and the tutorial on CompSci doesn't work for me. So how could I do this? This is what I had, its not up to my usual standard, sorry about the mess, just testing stuff.
Here is the file I need to get variables from. It is exported from Houdini Master.
Any help is much appreciated, thanks. |
Author: | Saad [ Mon Dec 17, 2007 7:56 pm ] |
Post subject: | RE:Multiline File Reading for a 3D engine? |
Seek goes to a certain location within a file, eg seek : file, * goes to the eof Although I'm quite sure you only need get for loading models and to get a line its get :file , line : * |
Author: | Gooie [ Mon Dec 17, 2007 8:32 pm ] |
Post subject: | Re: Multiline File Reading for a 3D engine? |
Is there a possible way to read one line at a time? It would make things a lot easier for me. I can probably figure something out based on what you've told me though, thanks. |
Author: | Saad [ Mon Dec 17, 2007 8:35 pm ] |
Post subject: | RE:Multiline File Reading for a 3D engine? |
I said it in my previous post, get :file , line : *, where line is a string |
Author: | pyrnight [ Mon Dec 17, 2007 9:55 pm ] |
Post subject: | RE:Multiline File Reading for a 3D engine? |
: * is the key. |
Author: | Carey [ Tue Dec 18, 2007 2:03 pm ] |
Post subject: | RE:Multiline File Reading for a 3D engine? |
As Saad said you will need to have a loop with and exit when eof (file) then a get : file, line : * this will assign the line in the file to the variable line. you can then use string manipulation to extract all the usfull data from it. |