Here's that function and related ones. They are all taken from the Roku example code.
Function validstr(obj As Dynamic) As String
if isnonemptystr(obj) return obj
return ""
End Function
Function isstr(obj as dynamic) As Boolean
if obj = invalid return false
if GetInterface(obj, "ifString") = invalid return false
return true
End Function
Function isnonemptystr(obj)
if isnullorempty(obj) return false
return true
End Function
Function isnullorempty(obj)
if obj = invalid return true
if not isstr(obj) return true
if Len(obj) = 0 return true
return false
End Function
The text in this particular example is being displayed on a "roSpringboardScreen" if you think that might make a difference.