Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Pulling strings from files

Author
Message
Catalyst
21
Years of Service
User Offline
Joined: 6th Sep 2003
Location:
Posted: 11th Aug 2005 08:34
I'm trying to pull strings from plain text files and then display them properly. The only way I know of to do that would be to open the file to read, then read byte by byte each character and store it in a string. What I'd like to do is be able to pull the text out one line at a time and have that whole line be stored in a single string that will be put into an array. Basically, it's going to be an ASCII video player. Don't ask. But what I see happening is each frame represented in ASCII is seperated by a bunch of dashes. Those are likely the only lines that will be nothing but dashes on the right side (the left side has a number to represent the frame rate), so I feel pretty comfortable just checking to see if the right side of a string is full of dashes and using that to figure out how many lines per frame there are. That's all well and good.

So here's what I need to find out. Pulling the text from a file one line per string so I know that each string in the array equals one full line of text. The other issue I have is what happens when that line of text has quotes in it? I know if I were to manually copy and paste them into there it's not going to like the quotes and consider that an end of the string. Should it be read in differently? As long as I can store them in an array and print them out line by line, I'm fine.
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 11th Aug 2005 09:01
Have you looked at the "read string" command????

Check my code here
http://www.thegamecreators.com/?m=codebase_view&i=2ae01d00402a26690d22c3fff366477d

PETA - People for the Eating of Tasty Animals
Catalyst
21
Years of Service
User Offline
Joined: 6th Sep 2003
Location:
Posted: 11th Aug 2005 10:18
I didn't know how that one was working, guess if it's just pulling a full line out then it's all that I need. Thanks!
Baggers
21
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 11th Aug 2005 10:35
Not sure if this will help, its a basic tutorial for saving and loading to files, I made for MetalArts a while ago.
http://forum.thegamecreators.com/xt/xt_apollo_download.php?i=573062

Login to post a reply

Server time is: 2025-06-09 03:55:52
Your offset time is: 2025-06-09 03:55:52