I’m new in Xojo and I’m trying to parse one JSON to ListBox following examples found in this forum. I think I don’t understand very well how Xojo works with these kind of files.
I’ve one Window with two objects, one TextArea to view the output and one ListBox. In the listbox I’ve 4 columns and my goal es parse some key values from JSON to columns.
I need a little help parsing the JSON to columns so I appreciate some help pointing me in the right directorio to parse. This is the code I’ve:
Var socket1 As New HTTPSocket
Var jsonData As String = socket1.Get("myurl", 30)
Var apiResponse as new JSONItem(jsonData)
Var results as JSONItem = apiResponse.child("data")
Var n as JSONItem
Var author() as string
Var title() as string
Var description() as string
Var i as integer
for i = 0 to results.count-1
n= results.child(i)
author.append n.value("author")
title.append n.value("title")
description.append n.value("description")
ListBox1.AddRow(title)
next
outputApi.Text = apiResponse.ToString
Window1.Open, line 21
There is more than one method with this name but this does not match any of the available signatures.
ListBox1.AddRow(title, author, description)