RPTools.net

Discussion and Support

Skip to content

It is currently Sat Jun 24, 2017 8:45 pm 






Reply to topic  [ 2 posts ] 

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Dragon
 
Joined: Thu Sep 28, 2006 3:20 pm
Posts: 347
Location: Oklahoma, US
 Post subject: json.evaluate()
PostPosted: Fri Apr 06, 2012 8:56 am 
Could someone familiar with json.evaluate() put a simple example in the wiki on how it works. I've played around with it but nothing seems to happen.

Edit: Ok I figured it out. It seems to need brackets unlike normal evaluate. For some reason I thought I could do
'["var3=var1+var2","var3=var3+var2"]' but it wants internal brackets like you'd type in a macro '["[var3=var1+var2]","[var3=var3+var2]"]'

Code:
Json Evaluated: [r: string = '["[var1=1][var2=2][var3=10]","[var3=var1+var2+var3]"]']<br>
[h: string = json.evaluate(string)]

<!-- Display the results of each Eval -->
[r, foreach(result,string,"<br>"): result]


//OUTPUT//
Json Evaluated: ["[var1=1][var2=2][var3=10]","[var3=var1+var2+var3]"]
« var1=1 = var1 = 1 = 1 »« var2=2 = var2 = 2 = 2 »« var3=10 = var3 = 10 = 10 »
« var3=var1+var2+var3 = var3 = (1 + 2 + 10) = 13 »

_________________
Hoody! Hoo!

Check out the Record of our Game Sessions.


Last edited by Sir Flak on Fri Apr 06, 2012 10:03 am, edited 4 times in total.

Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Thu Sep 28, 2006 3:20 pm
Posts: 347
Location: Oklahoma, US
 Post subject: Re: json.evaluate()
PostPosted: Fri Apr 06, 2012 9:53 am 
Looks like I can't create a wiki account to modify the json.evaluate stub with an example. Could someone with rights paste in this example or something similar.

_________________
Hoody! Hoo!

Check out the Record of our Game Sessions.


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 2 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 is 1 user online :: 0 registered, 0 hidden and 1 guest (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 1 guest





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

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman