for arrays you always construct elements like
<element name="name" propery="something" />
for property you often use value,
because also txtsplit() creates arrays with this property
set(arr[0].value, 'value1');
set(arr[1].value, 'value2');
debug(arr.count); <!-- 2 -->
maybe this works, too:
def(arr[0].value, string, "value1");
def(arr[1].value, string, "value2");
debug(arr.count); <!-- 2? i never use this syntax -->
or
txtsplit('value1|value2', '|', arr);
debug(arr.count); <!-- 2 -->
note: any array element can have multiple props
set(arr[0].value, 'value1');
set(arr[0].note, 'this is a nice value');
set(arr[0].align, left);
debug(arr.count); <!-- 1 -->
ps result is:
<arr name="0" value="value1" note="this is a nice value" align="left" />
pps..
arr[0] is an object containing all properties!
you can explore with
debugvar(arr);
debugvar(arr[0]);
debugvar(arr[0].value);
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »indexofrefraction« (2. Januar 2018, 12:39)