Message
 
 
To
06/01/2017 20:11:34
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01646369
Message ID:
01646382
Views:
55
>>Hi,
>>
>>In one place of my app, the response of the Web API call is an "array" (I put the array in quotation marks because this is not exactly a VFP array). The "array" string looks like this:
>>
>>{"Version":"2.2222","Connected":true}
>>
>>
>>I suppose I can parse this string to get the values. But I was wondering if there is a "better" way to convert this string to an array or a cursor?
>>
>>TIA
>
>As the handle of the Web API data becomes more complex. you should use a JSON library. Check available offers at VFPX and elsewhere.
>
>For instance, with Marco Plaza's nfJson library:
>
>
>m.Result = nfjsonread('{"Version":"2.2222","Connected":true}')
>? m.Result.version
>* shows 2.2222 (string)
>? m.Result.connected
>* shows .T. (logical)
>
I have tried nfjson and it is an excellent tool. Thank you!
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View