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:<MvASSIGNNAME="l.ok"VALUE="{ miva_array_insert( l.search_engines , 'google', '-1' )"}"="}">"<MvASSIGNNAME="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:<MvFOREACHITERATOR="l.item"ARRAY="l.products>"<MvASSIGNNAME="l.record:code"VALUE="{ l.item:code }>"<MvASSIGNNAME="l.record:name"VALUE="{ l.item:name }>"<MvASSIGNNAME="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