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: 
xoceunder
Roku Guru

this error RegWrite help

this error RegWrite
0 Kudos
4 REPLIES 4
RokuNB
Roku Guru

Re: this error RegWrite help

Look at the variable values - `key` is integer, it has to be string
0 Kudos
xoceunder
Roku Guru

Re: this error RegWrite help

<Component: roAssociativeArray> =
{
    contentid: 1006
    position: "6.423"
}


RegWrite(aa.contentid, aa.position)
0 Kudos
ljunkie
Visitor

Re: this error RegWrite help

"xoceunder" wrote:
<Component: roAssociativeArray> =
{
    contentid: 1006
    position: "6.423"
}


RegWrite(aa.contentid, aa.position)

As RokuNB mentioned, your key is a integer. Your registry key/value pair must be strings. In your specific case above, you could use the following to convert the integer to a string.


RegWrite(aa.contentid.toStr(), aa.position)

You could also do some more validation/conversions in `RegWrite` since you are accepting `key as dynamic, value as dynamic`
0 Kudos
xoceunder
Roku Guru

Re: this error RegWrite help

Thanks for the help
0 Kudos