15.03.2011, 05:09
Quote:
Why is seconds not passed by reference, surely if you pass "3333" seconds you would want to know that that is 55 minutes and 33 seconds? And why do you return a string AND the values? A function should really only do one or the other - doing both is a waste of time if you only want one. Also:
pawn Код:
|
I guess you can call the seconds issue a sort of goof. It was removed when i was testing just so i could have a literal integer there instead (im lazy). The version that i actually use has it as a reference. I'll update the post i made, and actually fix that. I should've saw this when i was making an example for the thread, as i also used a literal integer there as well. Sorry for that, I'll fix it up (the entire post :P).
As for the macro, its just a reusable macro i made for things like format. I got sick of having to do:
Код:
format(String,sizeof(String), "There are %d %s left", Var, (Var == 1) ? ("second") : ("seconds"));
The references are because not everyone wants a string with the time, some people may want to format it their own way, or save it (for some...odd reason. I would just save a unix timestamp, but w/e). I wanted it to fit everyone's needs.