[Tutorial] Ternary operation
#6

Quote:
Originally Posted by PrO.GameR
View Post
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^^).
Sorry, but I don't want to add this to my tutorial. In this macro there is no need.

Quote:
Originally Posted by Pottus
View Post
You should explain where you can use this as well.
Okay. But ... If to understand the principle of operation of ternary operations, then it is possible to apply them anywhere. For example (click).
Reply


Messages In This Thread
Ternary operation - by Untonyst - 13.07.2016, 22:14
Re: Ternary operation - by OstGot - 13.07.2016, 22:30
Re: Ternary operation - by PrO.GameR - 14.07.2016, 19:47
Re: Ternary operation - by Pottus - 14.07.2016, 20:00
Re: Ternary operation - by Vince - 14.07.2016, 20:42
Re: Ternary operation - by Untonyst - 14.07.2016, 23:00
Re: Ternary operation - by PrO.GameR - 14.07.2016, 23:25
Re: Ternary operation - by Dayrion - 15.07.2016, 01:33
Re: Ternary operation - by Diman777 - 11.08.2016, 20:53
Re: Ternary operation - by Untonyst - 11.08.2016, 21:21

Forum Jump:


Users browsing this thread: 1 Guest(s)