Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
PRiZM4ALL
Reel Rookie

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 2
boogernose
Roku Guru

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

needs to be moved to Developers board.

This is General Community

---A problem clearly stated is a problem half solved---.
0 Kudos
necrotek
Roku Guru

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

new line is 

 +chr(10)

   

0 Kudos