Array command

The Array is a data structure which can store a fixed-size sequential collection of elements. Every Array has an ID which clearly identifies that array and it has an undetermined number of string items. It's really practical when you would like to collect all of your information about every message.

Parameters

Parameter name Example value Description Mandatory
ID sampleArray The ID parameter identifies the array, and can be reached by using this parameter. yes

OzML example

The following example is a simple representation, how you can use arrays in an OzML script. The array with the ID 'sampleArray' has two items. You can easily iterate through these items with a Foreach loop, and read them out with the Speak command.

<?xml version="1.0"?>
<Response>
    <array id="sampleArray">
        <item>Hello</item>
        <item>Welcome</item>
    </array>

    <ForEach source="sampleArray">
        <speak>$item</speak>
    </ForEach>
</Response>

More information