Array question?? -
Riwerry - 03.02.2014
Hello guys, how is that possible? I have one dialog string used in
two parts of
strcat
First part length is (calculated by letter count web):
256
Second part length is (calculated by letter count web):
162
Together it is
406 big array.
But why, when I have now this array only
400 and it shows the
FULL dialog? (With all two parts)
Re: Array question?? -
Misiur - 03.02.2014
First of all - 256 + 162 is 418. Possible reasons - destination array is too small, or something.
Show me your code because the description is a little chaotic.
Re: Array question?? -
Riwerry - 03.02.2014
Yeah, sorry it is 418
but it doesnt matter it is same when it showing full dialog code at 400 big array
Code:
pawn Код:
new dialog[400];
strcat(dialog, "Zadaj meno tvojej postavy v tvare: {FF9900}Meno_Priezvisko\n{A9C4E4}Uisti sa, ћe si zadal {FFCC00}veľkй {A9C4E4}začiatočnй pнsmeno mena a priezviska.\n\n{FF9900}Varovanie: {A9C4E4}Nepouћнvaj {FFCC00}čнslice, medzery, {A9C4E4}alebo nejakй {FFCC00}znaky!\n\n");
strcat(dialog, "{FF9900}Varovanie č.2: {A9C4E4}Pokiaľ sa v mene vyskytnъ {FFCC00}nadбvky, {A9C4E4}alebo {FFCC00}urбћky,\n{A9C4E4}tvoja postava bude do niekoľkэch{FF6633}vymazanб!");
ShowPlayerDialog(playerid, 7, DIALOG_STYLE_INPUT, "{FF9900}M{FFCC00}eno postavy {FF9900}(slot č.1)", dialog, "Vytvoriť", "Spдť");
Re: Array question?? -
Misiur - 03.02.2014
Exactly what I told about - the destination is too small
You are trying to fit 418 ( + 1) Cells into 400 cells - that's impossible.
Now you can fit 419 characters. Yay!
Re: Array question?? -
Riwerry - 03.02.2014
Nah! You dont understand me!
When I use this:
new dialog[400]; IT SHOWS FULL CODE!! nothing missing
I know that I have it small but it is still working!
Re: Array question?? -
Misiur - 03.02.2014
Welp, no idea. All \n count as 1 character, but even then it's >400 chars long (and printing it shows that it's cut off)
Re: Array question?? -
Riwerry - 03.02.2014
Actually tried to debug strlen of this full string and it is
413 and its true. (Becouse when I put 412 one character was missing..)
But why when this message
Код:
Zadaj meno tvojej postavy v tvare: {FF9900}Meno_Priezvisko\n{A9C4E4}Uisti sa, ћe si zadal {FFCC00}veľkй {A9C4E4}začiatočnй pнsmeno mena a priezviska.\n\n{FF9900}Varovanie: {A9C4E4}Nepouћнvaj {FFCC00}čнslice, medzery, {A9C4E4}alebo nejakй {FFCC00}znaky!\n\n{FF9900}Varovanie č.2: {A9C4E4}Pokiaľ sa v mene vyskytnъ {FFCC00}nadбvky, {A9C4E4}alebo {FFCC00}urбћky,\n{A9C4E4}tvoja postava bude do niekoľkэch{FF6633}vymazanб!
is still 418 long, don't understand
//EDIT: probably got it, I have five \n symbols to start new line (and I guess this symbol count as one) thats it