Which?
#1

Which "way" is better?

FOR EXAMPLE:

1.

pawn Код:
new bool: Test = true, TestStr[5 + 1];
    if(Test) valstr(TestStr, 45454);
    else TestStr = "false";
    printf("Test - %s", TestStr);
2.

pawn Код:
new bool: Test = true, TestStr[5 + 1];
    if(Test) format(TestStr, 5, "%d", 45454);
    else TestStr = "false";
    printf("Test - %s", TestStr);
Reply
#2

Neither way is really better, just a matter of preference. Using valstr() may be slightly quicker than formatting, but it wouldn't be enough to tell a difference unless you are running the function multiple times, right after another.
Reply
#3

Quote:
Originally Posted by Grim_
Посмотреть сообщение
Neither way is really better, just a matter of preference. Using valstr() may be slightly quicker than formatting, but it wouldn't be enough to tell a difference unless you are running the function multiple times, right after another.
So, actually, there's no difference at all? There isn't any other ways AFAIK to do something like this, if true = int, else str.
Reply
#4

^^^^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)