This simplified code snippet
[code] Dim a As Auto
Dim t As Text = "Hello"
a = t
If xojo.istext(a) Then
End If[/code]
Gives me the error This item does not exist - xojo.istext(a.
The docs say xojo is available on all platforms, but I suspect istext is not?
Doesn’t look like it. I suspect you’ll have to use Introspection.
if Xojo.Introspection.GetType( a ).Name = "Text" then
// It's text
end if
You can turn that into a helper function, of course.
Tim_Jones
(Tim Jones)
3
I suspect that it’s for iOS. It doesn’t autocomplete for Desktop or Console.
Thanks guys. I guess it’ll be addressed in due course.
[quote=305950:@Kem Tekinay]Doesn’t look like it. I suspect you’ll have to use Introspection.
if Xojo.Introspection.GetType( a ).Name = "Text" then
// It's text
end if
You can turn that into a helper function, of course.[/quote]
I would use this instead:
If Xojo.Introspection.GetType(a) = GetTypeInfo(Text) Then
// It's text
End If
I’ve updated the doc page with this info: http://developer.xojo.com/xojo$IsText
After further digging, apparently IsText was never implemented. So it would appear it was “prematurely documented”.
I’ve removed the method from the Xojo page and added Joe’s sample code from above to the samples on the Auto page.