This component is used to save variables in an array. The value of a variable can be obtained and displayed based on index.
Display months in English.
<VarArray type="">
<Vars>
<Var name="" index=""/>
</Vars>
<Items>
<Item value=""/>
<Item value=""/>
<Item value=""/>
<Item value=""/>
</Items>
</VarArray> Parameter | Type | Mandatory | Description |
|---|---|---|---|
type | String | No | Variable type, indicating whether a variable is a numeric variable or a string variable. The default value is number. |
name | String | Yes | Variable name. You can use @name to return the variable value whose sequence number is specified by index. The returned value is a string and cannot be used for calculation. |
index | Expression | No | Sequence number in an array variable. The value starts from 0 and can be an expression. Note: The item sequence determines the value of index. |
value | String | No | Variable value. The value can be a string or number. |
Display months in English. In detail, create a string array named month_str, add the English characters of 12 months to the array, and reference the global variable month as the array output. In this way, @month_str can be used to obtain the English character string of the current month.
<VarArray type="string">
<Vars>
<Var name="month_str" index="#month"/>
</Vars>
<Items>
<Item value="January"/>
<Item value="February"/>
...
<Item value="November"/>
<Item value="December"/>
</Items>
</VarArray>
<Text text="@month_str" color="#FFFFFFFF" size="20" x="100" y="100"/>