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

Re: Use of uninitialized variable

That's a bug, allright - while "{}"-constructor, "."-member and "[]"-index-access throw error, AddReplace() silently does the wrong thing. I tried it both fw3 and fw5. Here is "clean room" reproduction ("val" is undefined):

BSD> d = {k: val}
Use of uninitialized variable. (runtime error &he9) in $LIVECOMPILE(102)

BSD> d = {}
BSD> d.k = val
Use of uninitialized variable. (runtime error &he9) in $LIVECOMPILE(93)

BSD> d["k"] = val
Use of uninitialized variable. (runtime error &he9) in $LIVECOMPILE(95)

BSD> d.AddReplace("k", val)
BSD> ? d
k: <bsTypedValue: >

BSD> ? "val=" d.k ", type=" type(d.k)
val=<bsTypedValue: >, type=
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.