Ray Yates
: ryates at, miva d0t com
01/09/2019 17:59 p.m.
01/09/2019 17:59 p.m.
The element parameter can be confusing, where element can be a simple variable or an entire structure. In the second example below we create l.record with multiple members, then insert the record into the array.
Create a simple array:
<MvASSIGN
NAME
="
l.ok
"
VALUE
="
{ miva_array_insert( l.search_engines , 'google', '-1' )
"
}"
="
}"
>"
<MvASSIGN
NAME
="
l.ok
"
VALUE
="
{ miva_array_insert( l.search_engines , 'bing', '-1' )
"
}"
="
}"
>"
l.search_engines[1] = google l.search_engines[2] = bing To insert a structure:
<MvFOREACH
ITERATOR
="
l.item
"
ARRAY
="
l.products
>"
<MvASSIGN
NAME
="
l.record:code
"
VALUE
="
{ l.item:code }
>"
<MvASSIGN
NAME
="
l.record:name
"
VALUE
="
{ l.item:name }
>"
<MvASSIGN
NAME
="
l.ok
"
VALUE
="
{ miva_array_insert( l.myproducts , l.record, '-1' )
"
}"
="
}"
>"
</MvFOREACH>
l.myproducts[1]:code = product code l.myproducts[1]:name = product name l.myproducts[2]:code = product code l.myproducts[2]:name = product name