Reading from different lines in one text file
#1

Hello.

I want to read the messages for my 'autobot' (= some sort of chatbot that displays random lines of text)
I know howto make it read from different files with one line of text in every file.
But I was wondering if I could make one file with all the lines of text in it somehow?

Please every suggestion/help is welcome!
Reply
#2

I don`t understand what you wan`t to say.
If i am not wrong,you can do something like
Save it to the file like this
Код:
message1 = " Message1 here"
message2 = " Message2 here"
message3 = " Message3 here"
message4 = " Message4 here"
And then you can read it with
message1...
Reply
#3

If you want to read the lines of a whole file you have to do something like

pawn Код:
while(fread(file, buffer))
{
    //Reads line by line
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)