Skip to main content

I haven't played that much with structs - so need some help...

json
{"Manufacturer":["FORD","HONDA"]}

struct
[Manufacturer]
[] = "FORD"
[] = "HONDA"

How do I get to the leafs / children?

I've tried :

vs_temp = v_struct->"Manufacturer"->*
vs_temp = v_struct->"Manufacturer"{1}
vs_temp = v_struct->"Manufacturer"

Hints / tips and/or suggestions - anyone?

Knut

I haven't played that much with structs - so need some help...

json
{"Manufacturer":["FORD","HONDA"]}

struct
[Manufacturer]
[] = "FORD"
[] = "HONDA"

How do I get to the leafs / children?

I've tried :

vs_temp = v_struct->"Manufacturer"->*
vs_temp = v_struct->"Manufacturer"{1}
vs_temp = v_struct->"Manufacturer"

Hints / tips and/or suggestions - anyone?

Knut

I was almost there....

vs_temp = v_struct->"Manufacturer"->*{1}

gave me what I wanted...

Better late than never...


I haven't played that much with structs - so need some help...

json
{"Manufacturer":["FORD","HONDA"]}

struct
[Manufacturer]
[] = "FORD"
[] = "HONDA"

How do I get to the leafs / children?

I've tried :

vs_temp = v_struct->"Manufacturer"->*
vs_temp = v_struct->"Manufacturer"{1}
vs_temp = v_struct->"Manufacturer"

Hints / tips and/or suggestions - anyone?

Knut

I think you're close. It's 

vs_temp = v_struct->"Manufacturer"->*{1} ; and 2 etc. 

You can loop by checking v_struct->"Manufacturer"→$membercount and using a variable in the {} 

Iain


I haven't played that much with structs - so need some help...

json
{"Manufacturer":["FORD","HONDA"]}

struct
[Manufacturer]
[] = "FORD"
[] = "HONDA"

How do I get to the leafs / children?

I've tried :

vs_temp = v_struct->"Manufacturer"->*
vs_temp = v_struct->"Manufacturer"{1}
vs_temp = v_struct->"Manufacturer"

Hints / tips and/or suggestions - anyone?

Knut

Hi Knut,

The secret here is that the array elements end up in an unnamed struct element so...

vs_temp1 = v_struct->"Manufacturer"->""{1} ; Will contain "FORD"
vs_temp2 = v_struct->"Manufacturer"->""{2) ; Will contain "HONDA"

Kind Regards
Mike