need help in ternary operator
#9

Quote:
Originally Posted by newbienoob
View Post
pawn Code:
if(db_num_rows(result))
{
    ShowPlayerDialog(.....);
}
else
{
    ShowPlayerDialog(.....);
}
//Looks ugly

(db_num_rows(result)) ? ShowPlayerDialog(....) : ShowPlayerDialog(....);
//Looks simple and clean!
Ternary operators are useful in many, many cases, but they _don't_ make your code easier to read.
Reply


Messages In This Thread
need help in ternary operator - by newbienoob - 24.08.2013, 02:42
Re : need help in ternary operator - by Naruto_Emilio - 24.08.2013, 02:58
Re: need help in ternary operator - by newbienoob - 24.08.2013, 02:59
Re : need help in ternary operator - by Naruto_Emilio - 24.08.2013, 03:05
Re: need help in ternary operator - by newbienoob - 24.08.2013, 03:18
Re: need help in ternary operator - by Pottus - 24.08.2013, 06:20
Re: need help in ternary operator - by newbienoob - 24.08.2013, 06:27
Re: need help in ternary operator - by RajatPawar - 24.08.2013, 07:04
Re: need help in ternary operator - by Misiur - 24.08.2013, 07:38

Forum Jump:


Users browsing this thread: 3 Guest(s)