If Conditional

If Conditional

The if conditional is one of the most basic coding functions. It is used to express branching based on specific criteria. The most common use of this would be If-Then-Else. If the condition evaluates to true the application then runs another set of code. Else implies that the condition evaluated to false and runs a different set of code.

Most languages also have an elseif conditional to accommodate criteria that would have more than two branches. This would be included after the initial if condition and before the final else clause. The syntax used differs on the coding language being used. The VoiceXML syntax would be:

<if cond="number == 1">
	<!-- IVR application is here if number is equal to 1 -->
<elseif cond="number==2"/>
	<!-- IVR application is here if number is equal to 2 -->
<else/>
	<!-- IVR application is here if number is not equal to 1 or 2 -->
</if>

Related links

Related terms

for "If Conditional"

Search Glossary

Term of the Day

Conjoint analysis is a technique that is used to estimate the value subjects place on a product or service’s attributes or features.