Forum Discussion
EnTerr
12 years agoRoku Guru
"TheEndless" wrote:
Sorry, it seems case sensitivity is on when parsing a JSON string, so this is only true if you call the SetModeCaseSensitive() explicitly, or if your AA comes from a parsed JSON string.
Thank you for the heads-up. I see the documentation mentions explicitly (yes! i am glad) the roAAs returned by ParseJSON will be in case-sensitive mode. It occurred to me a way to circumvent that as issue would be:
BrightScript Debugger> test1 = ParseJSON("{" + Chr(34) + "Test" + Chr(34) + ": true}")It was a guess and i tested it - turns out .append() honors the case-sensitivity mode flag of the host AA, so just pouring from a case-sensitive into an insensitive AA "fixes" our issue. IMO things are in order here.
BrightScript Debugger> test2 = {}
BrightScript Debugger> test2.append( ParseJSON("{" + Chr(34) + "test" + Chr(34) + ": false}") )
BrightScript Debugger> ? test2
test: false
BrightScript Debugger> test2.append(test1)
BrightScript Debugger> ? test2
Test: true