Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Level 7

Syntax Error Unexpected Token "[" and "if"

I am getting some Syntax error: unexpected token "[" and "if" and wondering if these are actual errors because they seem to work but wondering if this is correct. 

Sub loadMyAccountDetail(jsonData As Object)

echo(jsonData,"","==================1")

jsonDataParse=parseJSON(jsonData)

if jsonDataParse.data.resultCode="1"

    m.name.text = "Name: "+jsonDataParse.data.user_detail.name

    m.email.text = "Email Address: "+jsonDataParse.data.user_detail.email

    m.phone.text = "Phone No: "+jsonDataParse.data.user_info.[0].telephone

    m.address.text = "Address: "+jsonDataParse.data.user_info.[0].street

    m.address2.text = "Address 2: "+jsonDataParse.data.user_info.[0].street

    m.city.text = "City: "+jsonDataParse.data.user_info.[0].city

    m.state.text = "State: "+jsonDataParse.data.user_info.[0].region

    m.zipcode.text = "Zip Code: "+jsonDataParse.data.user_info.[0].postcode

end if

End Sub

I am also not finding a way to get Address 2 the second line from the Database +jsonDataParse.data.user_info.[0].street field  using ./ or /n breaks the build. any thoughts.. 

0 Kudos
2 Replies
Highlighted
Level 16

Re: Syntax Error Unexpected Token "[" and "if"

needs to be moved to Developers board.

This is General Community

Roku Ultra ---Ethernet rules---

From now on if people dont upvote me and do as I say I will consider holding my breath and selling my Roku's.
0 Kudos
Highlighted
Level 10

Re: Syntax Error Unexpected Token "[" and "if"

new line is 

 +chr(10)

   

0 Kudos