Page 1 of 1

[foreach():]

Posted: Fri Nov 11, 2011 11:16 pm
by Bone White
I updated the page on the documentation wiki to include that it can function on JSONS ( not only string lists ). I also added examples of both JSON types, how they function and an example of using the list separator parameter. This is my first "real" contribution to the documentation, so please check over my usage/style. I did test every example I posted in 1.3.b87

Re: [foreach():]

Posted: Sat Nov 12, 2011 10:24 pm
by Azhrei
Cool. Thanks for the additions.

I thought the loops already made mention that when a JSON Object was used, the keys of the object were the values iterated over? In any case, it's always good to have more/better examples.

Wiki link added: [foreach:].

Re: [foreach():]

Posted: Sun Nov 13, 2011 4:43 am
by Bone White
Well I'd been converting all my json arrays and objects into string lists to run through a for each loop then get each value by the index, or just using a for loop with indices. I wondered if it did work with arrays and objects, and it does, so I figured I'd add it so other newcomers to macro coding would know also. I take the documentation wiki as being pretty thorough, was surprised this was missing.

Oh well, glad to return some contribution for all the help I've received.