json.evaluate()

Doc requests, organization, and submissions

Moderators: dorpond, trevor, Azhrei

Post Reply
User avatar
Sir Flak
Dragon
Posts: 344
Joined: Thu Sep 28, 2006 4:20 pm
Location: Oklahoma, US

json.evaluate()

Post by Sir Flak »

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: Select all

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 »
Last edited by Sir Flak on Fri Apr 06, 2012 11:03 am, edited 4 times in total.

User avatar
Sir Flak
Dragon
Posts: 344
Joined: Thu Sep 28, 2006 4:20 pm
Location: Oklahoma, US

Re: json.evaluate()

Post by Sir Flak »

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.

Post Reply

Return to “Documentation Requests/Discussion”