Roku Developer Program

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

this error RegWrite help

this error RegWrite
0 Kudos
4 Replies
Roku Employee
Roku Employee

Re: this error RegWrite help

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

Re: this error RegWrite help

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


RegWrite(aa.contentid, aa.position)
0 Kudos
ljunkie
Level 7

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
Level 7

Re: this error RegWrite help

Thanks for the help
0 Kudos