RPTools.net

Discussion and Support

Skip to content

It is currently Sat Dec 16, 2017 8:11 am 






Reply to topic  [ 3 posts ] 

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Great Wyrm
 
Joined: Tue Aug 23, 2011 10:41 am
Posts: 1134
Location: Cornwall, UK
 Post subject: [foreach():]
PostPosted: Fri Nov 11, 2011 11:16 pm 
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

_________________
How to get around the two code nest limit in MapTool (and MOTE)


Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 12103
Location: Tampa, FL
 Post subject: Re: [foreach():]
PostPosted: Sat Nov 12, 2011 10:24 pm 
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:].


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Tue Aug 23, 2011 10:41 am
Posts: 1134
Location: Cornwall, UK
 Post subject: Re: [foreach():]
PostPosted: Sun Nov 13, 2011 4:43 am 
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.

_________________
How to get around the two code nest limit in MapTool (and MOTE)


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 3 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 2 guests





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman