Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert an array string to VFP cursor/array
Message
 
 
À
06/01/2017 20:11:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01646369
Message ID:
01646382
Vues:
53
>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform