Roku Developer Program

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

Documentation of Registry functions is where?

Hello -
I'm looking for some documentation of the functions "RegRead" & "RegWrite"
I found the functions in the example "register" channel but haven't been able to find documentation explaining the nature of the passed values. Am I missing something? Can someone explain what's what here:
RegWrite("RegToken", token, "Authentication")

I assume token is the variable value that was passed into: Sub saveRegistrationToken(token As String)
RegToken is ?
Authentication is ?

0 Kudos
1 REPLY 1\
Roku Employee
Roku Employee

Re: Documentation of Registry functions is where?

RegRead() and RegWrite() are just utility BrightScript functions in some of the example code. They use the roRegistry and roRegistrySection components to do their thing. ... trySection

The registry stores key/value pairs, so in the case of RegWrite the first two args are the key and value. The third arg is the section of the registry space to save the key/value pair to. Most channels will just have one section they use for everything, but additional sections are handy if you have multiple channels sharing the same registry space.

Function RegWrite(key as String, val as String, section=invalid) as Void
if section = invalid then section = "Default"
sec = CreateObject("roRegistrySection", section)
sec.Write(key, val)
sec.Flush() ' commit it
End Function
0 Kudos