developer_guide:voicexml_references:elements:assign

This is an old revision of the document!


< assign >

The <assign> element assigns a value to a variable. It is illegal to make an assignment to a variable that has not been explicitly declared using a <var> element or a <var> statement within a <script>. Attempting to assign an undeclared variable causes an error.semantic event to be thrown.

<assign
name="string"
expr="ECMAScript_Expression"/>
nameThe name of the variable being assigned to. This is required.
exprThe value to assign to the variable. This is required.
<block>, <catch>, <error>, <filled>, <help>, <if>, <noinput>, <nomatch>
None.
None.
None.
<?xml version="1.0"?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
 <var name="tree" expr="'an apple tree'"/>
 <form>
  <block>
   <prompt> The initial value is <value expr="tree"/> </prompt>
   <assign name="tree" expr="'apple orchards'"/>
   <prompt> The new value is <value expr="tree"/> </prompt>
  </block>
 </form>
</vxml>
  • developer_guide/voicexml_references/elements/assign.1444771172.txt.gz
  • Last modified: 2015/10/13 21:19
  • by borja