Forum Discussion
EnTerr
11 years agoRoku Guru
"TheEndless" wrote:
Generally speaking, yes, but I've apparently run into at least one occasion where the interface check didn't work as expected, resulting in me having these utility functions:
The way you check in isFloat() and isDouble() might be a case of wearing both belt and suspenders (which you have been observed to, occasionally 😛 ).
Your isInteger() logic is more interesting and i wonder why. Was it that you suspected some other type may be coerced into integer by GetInterface?
Note that roDateTime, in particular, doesn't appear to actually implement the ifDateTime interface... not sure what that's all about.
The newly hatched FindMemberFunction (thanks... RokuKC?) to the rescue:
BrightScript Debugger> ? FindMemberFunction(CreateObject("roDateTime"), "asSeconds")
<Interface: ifRoDateTime>
Aha! Seems the interface currently is named ifRoDateTime and not ifDateTime. I wouldn't put both my eggs in ifRoDateTime's basket though - naming seems to be a bug that RokuCo may fix and bring in line with teh documentation.