<assign>

Description

The <assign> element assigns a value to a variable.

In standards compliance mode, attempting to <assign> a value to a variable which has not been previously declared (with <var>) will result in an error.semantic event being thrown. If the com.voicegenie.STRICTCONFORMANCE property is set to FALSE, the variable can be assigned without being declared previously.

Syntax


<assign
    name="string"
    expr="ECMAScript_Expression"/>

Attributes

Attribute

Description

name

The name of the variable being assigned to. Required.

expr

An ECMAScript expression to be evaluated and used as the value assigned to the variable. Required.

Attribute Notes

Parents

<block>, <catch>, <error>, <filled>, <foreach>, <help>, <if>, <noinput>, <nomatch>

Children

None.

extensions

None.

Limitations/Restrictions

Example


<?xml version="1.0"?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
  <var name="var1" expr="'first'"/>
  <form>
    <block>
      The initial value is <value expr="var1"/>.
      <assign name="var1" expr="'second'"/>
      The new value is <value expr="var1"/>.
    </block>
  </form>
</vxml>