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: 
btpoole
Channel Surfer

Delete keyname From Registry

I have an option that allows the user to save favorites to the registry. I also have the option for the user to delete items from the favorite list. My problem is that when the user selects to delete an item from the favorite list, it deletes all the items. There is probably an easier way to do this but here is my code.
Function DelFav(keyname as String) 
Print"ITEM TO DELETE>>>>"keyname
rComma = CreateObject("roRegex", ",", "") ' split on comma

sec=CreateObject("roRegistrySection","favorite")
if sec.Exists("list") 
listemp=rComma.Split(ReadFav())  'READ FAVORITE LIST FROM REGISTRY
for each line in listemp    'SEARCH REGISTRY FOR CHANNEL TO REMOVE FROM FAVORITES[/font][/size]
if line=keyname
  ?"FOUND*******"  'IF FOUND SKIP
  sec.Delete(keyname)
else
list.Push(line)
   
end for
writereg("favorite","list",arraytostring(list))  'SAVE TO REGISTRY

End function
0 Kudos
1 REPLY 1
btpoole
Channel Surfer

Re: Delete keyname From Registry

Please ignore the post. Went out of channel and came back in and everything seems to be working as intended. Sorry.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.