Vanguard Software
Forecasting & Planning Solutions
Home Products Solutions Services Customers Partners Company
 
Applying science to business management

contents.gifindex.gifprev1.gifnext1.gif

Conditional

Format: x ? y : z

Arguments: (bool) x Any Boolean expression

[any] y Consequent if x is true

[any] z Consequent if x is false

Returns: [any] The value of y if x is true, else the value of z

Description: This operator implements an if...then...else construct. First, x is evaluated and if it is true (returns a non-zero numeric value), the expression y is evaluated and its result is returned. Otherwise, the expression z is evaluated and its value is returned. Under no circumstances will both y and z be evaluated.

Examples: true?1:0 = 1

false?2+3:4+6 = 10

3>8||6<=7?"true value":"false value" = true value

See Also: if, switch, true, false

  Demand Planning  |  Financial Forecasting
Forecasting Software  |  Strategic Planning Software  |  Decision Tree Software
Decision Support Software  |  Expert System Software  |  Online Surveys

Contact Us  |  Terms of Use  |  Privacy Policy  |  Site Map
Vanguard Software
© 2011 Vanguard Software Corporation
Print this page   Email this page to a friend