Plum DEV Documentation
voicexml:tags:assign

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

voicexml:tags:assign [2014/05/29 15:19]
jennifer meta description
voicexml:tags:assign [2019/09/17 12:29]
Line 1: Line 1:
-{{description>​‹assign› VoiceXML tag details, attributes and VXML code example | The assign element assigns a value to a predefined variable.}} 
-===== <​assign>​ ===== 
  
-The <​assign>​ element assigns a value to a predefined variable. 
- 
-==== Attributes ==== 
- 
-| name | The name of the variable being assigned to. | 
-| expr | An ECMAscript expression to be evaluated, the results of which are assigned to the named variable. | 
- 
-==== Notes ==== 
- 
-The variable specified by the "​name"​ attribute in the <​assign>​ tag should be declared in a <var> tag first. 
- 
-==== Example ==== 
- 
-<​code>​ 
-<?xml version="​1.0"?>​ 
-<vxml version="​2.0">​ 
-  <​form>​ 
-    <!-- test_var is declared here --> 
-    <var name="​test_var"/>​ 
-    <​block>​ 
-      <!-- test_var must be declared before assigning it a value --> 
-      <assign name="​test_var"​ expr="​1234"/>​ 
-    </​block>​ 
-    <​block>​ 
-      <​prompt>​ 
-        The test variable is set to <value expr="​test_var"/>​. 
-      </​prompt>​ 
-    </​block>​ 
-  </​form>​ 
-</​vxml>​ 
-</​code>​ 
- 
-The output of the above script would be: 
- 
-Computer: The test variable is set to twelve hundred thirty-four. 
- 
-==== Child Tags ==== 
- 
-None 
- 
-==== Parent Tags ==== 
- 
-[[voicexml:​tags:​block|<​block>​]],​ [[voicexml:​tags:​catch|<​catch>​]],​ [[voicexml:​tags:​error|<​error>​]],​ [[voicexml:​tags:​filled|<​filled>​]],​ [[voicexml:​tags:​foreach|<​foreach>​]],​ [[voicexml:​tags:​help|<​help>​]],​ [[voicexml:​tags:​if|<​if>​]],​ [[voicexml:​tags:​noinput|<​noinput>​]],​ [[voicexml:​tags:​nomatch|<​nomatch>​]]