Starting around mid July I've been seeing that Roku 1, 2, 3 some times don't persist registry writes even after flushing. Reading the value of a key that was written will some times return invalid and always return invalid after the first time. Here are the helper methods I'm using to write and read to and from the registry:
Function RegRead(key as String, section=invalid) as Dynamic if section = invalid then section = "Default" sec = CreateObject("roRegistrySection", section) if sec.Exists(key) then return sec.Read(key) return invalid End Function
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
Has anyone else been experiencing the same problem more recently?
I think most people use those same routines. When writing a key you can specify a registry section. What I usually do is for standard data that must persist (user ID, etc) I use one section that matches the channel name, and for bookmarks or stuff that's not as important or consistently changing I add a "2" to the name - that way it's easier to debug and keys don't get inadvertently deleted. When using the same section for all registry writes in a channel I ran across some rokus that would lose data, but that's mainly due to a mistake I had in the registry sort routines I was using.