Assigns a value to a variable.
<assignname="string" expr="js_expression" />
| Attribute | Description |
name |
Name of variable. This variable must have already been declared. |
expr |
JavaScript expression that evaluates to the value assigned to this variable. |
|
||||||
<assign name="x" expr="Number(a) + Number(b)"/>
|
| Parents | Children |
|
| Exception | Description |
| | VoiceXML 2.0 Specification: <assign> |
| | JavaScript Quick Reference |
| | Related tag: <var> |
<?xml version="1.0" ?>
<!DOCTYPE vxml PUBLIC "-//BeVocal Inc//VoiceXML 2.0//EN"
"http://cafe.bevocal.com/libraries/dtd/vxml2-0-bevocal.dtd">
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
<form id="foo">
<var name="a"/>
<var name="b"/>
<var name="result"/>
<block>
<assign name="a" expr="'Pine'"/>
<assign name="b" expr="'Apple'"/>
<assign name="result" expr="a + b"/>
</block>
<block>
<prompt>
This is the test for the assign tag.
If you put <value expr="a"/> and <value expr="b"/> together,
it would make <value expr="result"/>
</prompt>
</block>
</form>
</vxml>
| Café Home |
Developer Agreement |
Privacy Policy |
Site Map |
Terms & Conditions Part No. 520-0001-02 | © 1999-2007, BeVocal, Inc. All rights reserved | 1.877.33.VOCAL |