Dialog bug?
#1

With fread, whole file should be readed. Well, it is, but I have some problems.

Text in file:

Код:
Patrick\nPat\nPotatoman
My code:

Код:
    new string[64];
    new File:example = fopen("File.txt", io_read);
    fread(example, string);
    fclose(example);
    ShowPlayerDialog(playerid, 899, DIALOG_STYLE_MSGBOX, "Names", string, "Ok", ""); // Print what was read
But it outputs
Код:
Patrick\nPat\nPotatoman
without new lines...

Any solutions?
Reply
#2

"\n" are typed in too...
Reply
#3

Bias on how you saved "File.txt" when you read the file the ASCII character won't read as line breaks. Your best bet is to parse the file yourself to include the line breaks in the dialog output yourself as an amendment to the string.
Reply
#4

Quote:
Originally Posted by Bitrate
Посмотреть сообщение
Bias on how you saved "File.txt" when you read the file the ASCII character won't read as line breaks. Your best bet is to parse the file yourself to include the line breaks in the dialog output yourself as an amendment to the string.
You mean to put String defined by fread to another string?
Reply
#5

Still no solution...
Reply
#6

change \n for \r\n
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)