one more parsing JSON..

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

one more parsing JSON..

sergio_101-2
i am using the json library, and everything seems to be going great..
but i am missing one more piece..

my code looks like this:

results := Json readFrom: geocode readStream.

and it works fine..

the only problem is that there are a few keys that have underscores in
them.. like:

'formatted_address'

when i try to do:

results 'formatted_address'

it bombs..

but any other key that does not have an underscore works fine..

any ideas?

thanks!

--

----
peace,
sergio
photographer, journalist, visionary

http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: one more parsing JSON..

cedreek
yes this is a problem related to _ that was used for affectation before. I think this is fixed now in Pharo.

Anyway, a workaround is to change all $_ in another character in the stream you get (maybe changing it to $-).

'test_test' replaceAll: $_ with: $-

hth,

2010/4/5 sergio_101 <[hidden email]>
i am using the json library, and everything seems to be going great..
but i am missing one more piece..

my code looks like this:

results := Json readFrom: geocode readStream.

and it works fine..

the only problem is that there are a few keys that have underscores in
them.. like:

'formatted_address'

when i try to do:

results 'formatted_address'

it bombs..

but any other key that does not have an underscore works fine..

any ideas?

thanks!

--

----
peace,
sergio
photographer, journalist, visionary

http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners



--
Cédrick

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners