BrightScript Debugger> lintstr = "8589934592&"
BrightScript Debugger> Eval("x& = " + lintstr)
BrightScript Debugger> ?type(x&), x&
LongInteger 8589934592
BrightScript Debugger> n&=5123456789
BrightScript Debugger> s=n&.ToStr()
BrightScript Debugger> var
n& LongInteger refcnt=1 val:5123456789 (&h13161BF15)
s roString (2.1 was String) refcnt=1 val:"5123456789"
BrightScript Debugger> ss=FormatJson(n&)
BrightScript Debugger> var
n& LongInteger refcnt=1 val:5123456789 (&h13161BF15)
s roString (2.1 was String) refcnt=1 val:"5123456789"
ss roString (2.1 was String) refcnt=1 val:"5123456789"
BrightScript Debugger> nn&=ParseJson(s)
BrightScript Debugger> var
n& LongInteger refcnt=1 val:5123456789 (&h13161BF15)
s roString (2.1 was String) refcnt=1 val:"5123456789"
ss roString (2.1 was String) refcnt=1 val:"5123456789"
nn& LongInteger refcnt=1 val:5123456789 (&h13161BF15)
"renojim" wrote:
I've always thought it's an oversight not to have ifStringOps akin to toInt() and toFloat() for Doubles and now LongIntegers, so I hope they're somewhere on a ToDo list.
-JT
BrightScript Debugger> x& = &h80000001&
BrightScript Debugger> y& = ParseJson(x&.toStr())
BrightScript Debugger> var
x& LongInteger refcnt=1 val:2147483649 (&h80000001)
y& LongInteger refcnt=1 val:2147483648 (&h80000000)
"renojim" wrote:
This is mildly concerning:BrightScript Debugger> x& = &h80000001&
BrightScript Debugger> y& = ParseJson(x&.toStr())
BrightScript Debugger> var
x& LongInteger refcnt=1 val:2147483649 (&h80000001)
y& LongInteger refcnt=1 val:2147483648 (&h80000000)
The specifics of the bug aren't important. Suffice it to say that some values > &h80000000 work and some don't.
Now why it's mildly concerning:
That was taken from a Roku Stick running FW v7.1.0 build 4096-24. The same test on a Roku 3 with FW v7.2.0 build 4091-04 works just fine.
Does it make sense to report a bug in a FW version that's less than the latest? Keep in mind that there's still a good number of devices unable to update to v7.2.
For my purposes, I can either set the minimum firmware version to 7.2 or just leave it at 7.0 (when LongInteger appeared) since my counters aren't likely to need more than 32 bits for quite some time and, even if one does overflow, it's completely harmless. I'll probably go with the latter.
-JT
"RokuKC" wrote:
There were definitely fixes in 7.2 with respect to numeric parsing etc.
Just to confirm, your use case(s) works correctly on 7.2, right?
"RokuKC" wrote:
I can't speak to details, but my impression is that the Roku-branded 7.2 rollout should be nearing completion.
"renojim" wrote:
I'm still seeing users on 7.0, so I'm wondering if they're going to jump to 7.2?