"brocker" wrote:
But, maybe I'm thinking a bit too big, is there a way to determine what type a value is, and return that? So if I had "Foo", could I print what type of a value Foo is? At least this way I could walk a If Else tree and convert using one of the built in BrightScript methods.
Ermm.. destruk just showed you how to do that...
How about something like this?
Function ToString(variable As Dynamic) As String
If Type(variable) = "roInt" Or Type(variable) = "roInteger" Or Type(variable) = "roFloat" Or Type(variable) = "Float" Then
Return Str(variable).Trim()
Else If Type(variable) = "roBoolean" Or Type(variable) = "Boolean" Then
If variable = True Then
Return "True"
End If
Return "False"
Else If Type(variable) = "roString" Or Type(variable) = "String" Then
Return variable
Else
Return Type(variable)
End If
End Function
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)