Show pageOld revisionsBacklinksExport to PDFBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== < assign > ====== ===== Description ===== 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. ===== Syntax ===== <code> <assign name="string" expr="ECMAScript_Expression"/> </code> ===== Attributes ===== |name|The name of the variable being assigned to. This is required.| |expr|The value to assign to the variable. This is required.| In the expr content you can escape special characters (with "\") : "Bonjour, je suis l\'assistant téléphonique... '". ===== Parents ===== <code> <block>, <catch>, <error>, <filled>, <help>, <if>, <noinput>, <nomatch> </code> ===== Children ===== <code> None. </code> ===== Extensions ===== <code> None. </code> ===== Limitations/Restrictions ===== <code> None. </code> ===== Example Code ===== <code> <?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> </code> developer_guide/voicexml_references/elements/assign.txt Last modified: 2017/12/19 09:03by borja