I was thinking of ways Peter could possibly automate setting values for his SQL query that returned NULLs for some of the fields - which don't get included in his call to rs.toPropertyArray. So, the thought was maybe you could parse the data to json format and then back again.
Admittedly, I did all my testing in 12, so my "helpful help" for Peter over in the 11 forums is probably total garbage.
But I noticed something unsettling. While the NULL fields (represented with <No Data Returned>) would be converted to empty C-type variables in this process, my long strings of data would go missing entirely and none of the Dates would show up. I don't think that's desired behavior. I think you'd expect to get your longer strings in your property array. And the dates. They're in the json object:
I sent a bug report. But I was wondering if there were other json parsing operations out there that do the same thing? How would I format the dates in the json string so a5_json_populatearray would handle them?
--
Sarah
Admittedly, I did all my testing in 12, so my "helpful help" for Peter over in the 11 forums is probably total garbage.
But I noticed something unsettling. While the NULL fields (represented with <No Data Returned>) would be converted to empty C-type variables in this process, my long strings of data would go missing entirely and none of the Dates would show up. I don't think that's desired behavior. I think you'd expect to get your longer strings in your property array. And the dates. They're in the json object:
Code:
dim arr[0] as p arr[].date = Date() arr[..].string = "This is a very long string. It has a \0 and a ' in it." arr[..].number = 12 arr[..].logical = .t. ?arr[1] = date = {10/28/2014} logical = .T. number = 12 string = "This is a very long string. It has a \0 and a ' in it." dim arrStr as c arrStr = varToJson(arr) ? arrStr = [ { date: Date('10/28/2014'), string: 'This is a very long string. It has a \\0 and a \' in it.', number: 12, logical: true } ] dim arr2[0] as p a5_json_populatearray(arr2,arrStr) ?arr2[1] = date = 0
--
Sarah