Quote:
Originally Posted by Rittik
Ternary Operators: Ternary operators deal with three operands. It is also called conditional operators because the value assigned to a variable depends upon a logical expression.
Syntax:
variable= (test expression) ? Expression 1 : Expression 2
Example:
pawn Code:
new a=5,b=3,max=0,min=0;
max=(a>b)? a:b; // Here, the value 5 is stored in max as a>b is true.
min= (b>a)? a:b; // Here, the value 3 is stored in min as b>a is false.
@BroZeus: You should write a proper definition so that scripters can understand easily, writing "Basically ternary operator are used in place of "if" and "else" statements. They consists of a "?" and a ":" sign." will not do the work. As it is your first tutorial I'll suggest you to research before posting.Nice try though. I suggest all the scripters/coders to use if-else because it can be nested easily and you can profitably make your code execute.
|
well thanks for that
but definition doesn't matter much what matter is its usage caz u gonna use it in the script not right it its definition
[its not school]
and as far as i know i have explained its usage correctly
well i will add your definition too
and also why have u put a syntax ? i think i have put it in tut isnt it?