login about faq

I have created the following json :

{
  "emails": [
    {
      "someval": 0,
      "otherval": 2
    }
  ]
}

and I try to accessit like so :

priceObj.IntOf(".emails[0].otherval")
 priceObj.IntOf(".emails.otherval")

The output is 0 (invalid), tried my best to solve this but could not.

Can you please tell me how can I acces the value of "otherval" using path ? Thanks in advance.

asked Feb 17 at 19:36

spide112's gravatar image

spide112
11


How about something like this:

Dim employees As ChilkatJsonArray

Set emails = json.ArrayOf("emails")

Dim email As ChilkatJsonObject
Set email = emails.ObjectAt(0)

'  IntOf
Debug.Print "otherval: " & email.IntOf("otherval")
link

answered Feb 18 at 11:51

jpbro's gravatar image

jpbro ♦
1.1k2618

The path is this:

priceObj.IntOf("emails[0].otherval")

link

answered Feb 20 at 09:31

chilkat's gravatar image

chilkat ♦♦
12.8k317363471

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×25

Asked: Feb 17 at 19:36

Seen: 426 times

Last updated: Feb 20 at 09:31

powered by OSQA