[Help] - Combining Strcat using Format
#1

Is that possible that i can combine 2 Strcat(s) using Format because my strings length can't handle it anymore, like for example:
Код:
strcat(string1, "Message 1\n\n");
strcat(string2, "Message 2");
format(combiner, sizeof(combiner), "%s%s", string1, string2);
Thanks in Advance
Reply
#2

Yes, you can. As long as there is something stored in string1 and string2.
Reply
#3

Yes, you can.
Reply
#4

But whenever i combined the strings, it doesn't complete the Messages.

EDIT :-
and I used "new string[2048];", can i change "[2048]" to something bigger or what ?
Reply
#5

There is a limit of the amount of characters you can store in a string. Make sure you don't exceed that.
I think the limit was 1024.
If the message exceeds the max amount your string can hold, increase it.
Reply
#6

Well,
Quote:
Originally Posted by SAMProductions
Посмотреть сообщение
But whenever i combined the strings, it doesn't complete the Messages.
Reply
#7

The pawn compiler doesn't have any limit. I already compiled a string with almost 2600 chars (for a register system, which sends a mail if forgotten password).

What string isn't complete ? Message1, Message2, or combiner ?
Reply
#8

@ the code you've shown
If the string "combine" can't hold the amount of characters of string1 and string2 added, it won't display all of it. Example:
pawn Код:
new strin1[100];
new string2[100];
new combine [150];
That will only show 3/4 of the message. Why? Cause "combine" can only hold 150 characters, and not 200.
EDIT:: sorry for saying something wrong, I thought it had a limit. Pardon me.
Reply
#9

Quote:
Originally Posted by ******
Посмотреть сообщение
Youcan, or you could just use "strcat"...
Help about this,
Quote:
Originally Posted by SAMProductions
Посмотреть сообщение
But whenever i combined the strings, it doesn't complete the Messages.
EDIT :-
Anyway, Thanks for the Details
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)