I need to print text on more than 1 line using \n in the string to go to the next line and I need to read the text from a text file. I am using:
TEXT* message_txt =
{
pos_x = 0;
pos_y = 0;
layer = 2;
font = arial2_font;
string(mes_str);
flags = SHOW;
}
to display the text.
Now if I us the str_cpy function to copy a string containing \n using:
str_cpy(mes_str,message_str);
If message_str is created in the program with:
STRING* message_str = "This is a\n test";
it works OK. eg.
This is a
test
However if I load the string from a text file with:
var filehandle = file_open_read ("test.txt"); // test.txt contains the string "This is a\n test"
file_str_read(filehandle,message_str);
file_close (filehandle);
and then use the str_cpy to copy to the TEXT panel.
It will print "This is a\n test" and not
This is a
test
Any solution?
Last edited by Ercoles; 12/09/12 19:26.