Sign In Register

How can we help you today?

Start a new topic
Answered

Acessing scriptData Array

Hey, 


One of my events returns an array of bools (just true or false) to me. 


It's the only return so I'm trying to iterate over my bools that I get but I can't seem to access them nicely by index.


For example my scriptData I get back is like this:

http://puu.sh/kaimE/c9bc94e70d.png


How would I be able to get that list of values out? All my previous data has been single data retrieval so by name for int/double etc.


Thanks.


Best Answer

Yeah I ended up just doing a little class to throw it into. I'm just new to JSON and not used to not having to just parse everything and put it where I want to so having to make a class that has the same names and such is just new and a work in progress for me :P


No matter what I try I can't seem to get it out.


I've tried just converting the JSON to xml via the JSON.xnode function (doesn't work because of the array inside),

tried 

JsonConvert.DeserializeObject<bool[]>(dunResponse.ScriptData.JSON);

doesn't work either, just says it has to be a JSONArray which isn't a type I have (using the newtonsoft.Json library so...no idea)

I guess I'll just have to make some dummy classes for getting my data.


Just not used to how JSON works I guess

Hey Travis,

Apologies for the late reply. Did you manage to get the data you needed out?

Sean
Answer

Yeah I ended up just doing a little class to throw it into. I'm just new to JSON and not used to not having to just parse everything and put it where I want to so having to make a class that has the same names and such is just new and a work in progress for me :P