To initialize a variable with a list of data the dlist sub tag can be used.
To initialize a variable with a map the dmap subtag can be used.
ex:-
<data data1>
text=hello,
<var script> this is head of button tag<button b1> </var>
<dlist list>one,two,three,four</dlist>
<dmap map>name=harry,age=23,sex=male,occupation=doctor</dmap>
</data>
Attributes
Messages
arg1 is variable name
clear(arg1) | Clear the contents in the variable. |
remove(arg1,arg2) | remove specified value - arg2 from list or map. |
set(arg1,arg2) | set string value to variable. |
setlist(arg1,arg2) | set list of values to variable. arg2 should be of the form val1,val2,val3 |
setmap(arg1,arg2) | set variable with key=value pairs, arg2 should be of the form key1=value1,key2=value2.... |
assign(arg1,arg2) | assign reference to arg2 to variable arg1 |
addval(arg1,arg2) | append values provided by arg2 to variable arg1 |
add(arg1,arg2,arg3) | variable arg1+variable arg2 and result in variable arg3 |
sub(arg1,arg2,arg3) | variable arg1-variable arg2 and result in variable arg3 |
mul(arg1,arg2,arg3) | variable arg1*variable arg2 and result in variable arg3 |
div(arg1,arg2,arg3) | variable arg1/variable arg2 and result in variable arg3 |
inc(arg1) | increment value of variable arg1 |
dec(arg1) | decrement value of variable arg1 |
addpos(arg1,arg2) | if arg1 variable holds position values in the form l,t,r,b then arg2 having value in the same format is added to values of arg1. |
DataValues
The data tag does not support any attributes or events.
It provides lots of options for obtaining values of data stored within
the data tag.
Ex:- #data1.get(script)#
Passing the name of any variable as the data value will return the corresponding
value.
If the variable is a list following parameters can be appended to the
variable name to get specific values.
next - Next value.
prev - Pervious value.
curr - Current value.
index - Get current index.
size - The size of the list.
Ex:- #data1.get(list1.curr)# - Get the current value.
Lists can also get the value at a specified index as follows
#data1.get(list1.index.2)# - returns
value at index 2.
For maps the following parameters can be used.
size - The size of the map.
val - Comma separated list of values.
key - Comma separated list of keys.
map.key-Returns the set of keys.
map.val-Returns the set of values.
map.size-Returns the size.
map.val.keyid- keyid should be the name of a key and this will return
the corresponding value.
Checking if a value is present in an map or list can be done as
#data1.get(list1.check.value)#
if value is present in list true is returned, else false is returned.
#data1.get(map1.check.value)# if key is present in
map true is returned, else false is returned.