Obtains through a informed key, the respective value.
1 map.get
<map.get name='name'>
<expr /> ?
<var /> ?
</map.get>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Aname | string | Name of the map. |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Eexpr | Integer | ||||
Evar | Integer |
Example
Create a dictionary of integers.
Copy
<xsql-script name='map_get_sample1'> <body> <map name='a'> <item>0<string>ZERO</string></item> <item>1<string>ONE</string></item> <item>2<string>TWO</string></item> <item>3<string>THREE</string></item> <item>4<string>FOUR</string></item> <item>5<string>FIVE</string></item> <item>6<string>SIX</string></item> <item>7<string>SEVEN</string></item> <item>8<string>EIGHT</string></item> <item>9<string>NINE</string></item> </map> <println>0 in english is: <map.get name='a'>0</map.get></println> </body> </xsql-script>
Thw word in english (value) associated to the integer 0 (key) is obtained, which is ZERO:
Copy
<map.get name='a'>0</map.get>