Quote:
Originally Posted by PrO.GameR
Add this to your tutorial to remove all the fuss of using a ternary operator >
PHP Code:
#define TernaryOperator(%0,%1,%2) ((%0)?(%1):(%2))
and there you go, you can simply use it as TernaryOperator(check, iftrue, iffalse) without worrying about braces n stuff (Since pawn's compiler has a problem with ternary operators containing strings you could use it as %0?%1:%2 but you would encounter some problems, I suggest you to stick to that^^).
|
With all due respect, but that's rubbish. You're actually typing
more than what actually get replaced, completely defeating the purpose of a macro. The ternary operator is universal and anyone's who's familiar with will instantly recognize it.