No rows or tabulation in dialog.
#1

Hey. I am currently experiencing a problem and can't find a way to fix it.
Let's say i have in a mysql database a string (with \t, \n and such things) saved and i want to show it in a dialog. I receive the string from the database, format the dialog by inserting the string there, but there are no rows or tabulation and so. If a string in database is
"test1\ntest2\ntest3"
it will show how it is like instead of
"test1
test2
test3".
Anyone knows where is the problem? Thank you.
Reply
#2

I am bumping the topic, because i still don't find anything what could be wrong there and this topic goes further from the first page.
Reply
#3

Do you expect us to fibd the problem without showing us the code?
Ansmd dont bump
Written ob phone so sorry for spellibg mistakes
Reply
#4

Nope, but i think my post is enough to understand everything.
Reply
#5

Yeah, you actually save them as new rows, not as pieces of string. So, do like this, I guess:

pawn Код:
print("This will be\n a new row.")
print("While this one '\n' won't be.")
Reply
#6

I think you do not understand me, so let me explain more.
In the database in 1 field i have saved a string "Row1\nRow2\nRow3", it's exactly like that.
In the script i have made like this:
Код:
new text[100];
mysql_query("SELECT `sometext` FROM `blablabla` WHERE `Something` = 5415");
mysql_store_result();
if(mysql_num_rows() == 1) mysql_fetch_row(text);
mysql_free_result();
ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Dialog",text,"Accept", "Back");
I have also tried to print the text in the console to be sure if it's the right one and it prints exactly like it is saved in database (that's normal), but why in dialog it doesn't show how it should?
Reply
#7

So it shows like

Код:
row1
row2
row3
Or it shows as

Код:
 row1 row2 row3
And you want it as in the first example?
Reply
#8

It shows this in dialog: "Row1\nRow2\nRow3", with all \n's inside.
Reply
#9

Well, already many hours passed, so i am just bumping, because i can't let this topic die.
Reply
#10

Sorry, but maybe i explained my problen not enough? Just tell, i am ready to help you if you can help me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)