This should be simple, but I can’t seem to wrap my head around it
I have an associative array called X, and it has an associative array called Y. Y might have a string called Z.
All is fine if Z does exist, but if it doesn’t these methods all result in a crash:
If I try
if x.y.z <> invalid
I get “Syntax Error”
if x.y.lookup("z") <> invalid
I get “Member function not found in BrightScript Component or interface.”
if x.y.DoesExist("z")
I get “Member function not found in BrightScript Component or interface.”
Can anybody point me in the right direction? Thank you!
So here’s what it was! Because x.y was an empty array, it’s not seen as an associative array, therefore you can’t query for existence of keys. It all came down to it’s type coming from json when it’s empty. Thanks for pointing me in that direction!