Qbasicnews.com

Full Version: input text adventure room desc. from text file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello. I would like some help with displaying room descriptions for my text adventure game taken from a text file. I am using a sequential file and inputing the string with: input #. Even if I put quotes around my description (inside my text file), I can't get the description to print out neat and in paragraph style. The only thing that I can think of at this point is using LINE INPUT # in a loop and print everything one line at a time until I get to a certain character in my text file, such as '}'. What do you think? Am I going at this the wrong way? I know there has got to be an easier way to do this and make the room descriptions look good. I'd be happy if someone who has been where I am now could show me how they did it. Thank you in advance for your reply.

Regards,

K.S.
That is what I'd do. Except I'd use a a fewwordstogether instead of just one character IE:

Code:
CLS
OPEN "test.txt" FOR INPUT AS #1
DO
LINE INPUT #1, a$
IF a$ = "lineendthingy" THEN END ELSE PRINT a$
LOOP UNTIL EOF(1)
CLOSE
Quote:a
s
asdd
]
lineendthingy
asd231
asd
That pretty much clears it up. Thank you for the information whitetiger0990! You know your stuff.

Sincerely,

K.S.