Must be another way Json

I Have started to get a preference file using json and I am looking for so reciprocity for integer arrays. It seem so easy to write to the file but the only other way to get them back out is the following (sorry I am such a rookie)

’ UserIDField.Text =Preferences.UserID
'ComboBox1.ListIndex=Preferences.combo
'RadioButton1(0).Value =Preferences.rb
'U()= Preferences.ar ’ this I thought would work but comes back as a mismatch type

var arr() as integer

var tt as new JSONItem
tt.Load(goofy)

var p as Variant = tt.Value(“combo”)
var c as variant = tt.Value(“UserID”)
var v as Jsonitem= tt.Value(“ar”) ’ this seems to only return a JSONitem

’ Is this the only way to fill an array of numbers

redim arr(v.Count-1)
For pp As Integer = 0 To v.Count - 1
arr(pp) = v.valueAt(pp)
next

Goofy->
{
“UserID”: “Hello”,
“combo”: 2,
“rb”: true,
“ar”: [
5,
0,
2
]
}

Use Child instead of Value if you know that it’s an object.

The tricky part is that JSON arrays are not limited to a single type of data. You could certainly have

[ 1, "hello", True ]

And that’s valid, so it needs to be left as a JSONItem to get the values back out.

Thank You - this makes sense !