[quote=157841:@Dave S]If you define it as STRING it works as expected… as TEXT it returns 2345
BUT… Mid(myText,1,4) returns “1234” regardless if STRING or TEXT[/quote]
What you’re seeing when calling the global function Mid is that the Text is implicitly being converted to a String and you’re ending up with the String behavior.
No thats fine now I know and yes Travis it is more consistent. I never understood why it was position 1 when everything was made zero based a few versions ago.
The alternative is for the conversion from Text to String be explicit and any place you need a String and have a Text you’d have to do something like String.FromText(myText). Maybe that would have been a better direction to go, maybe not.
For model classes and non-UI classes in general, it’s not a bad idea. It will probably lead to some ugly edges where you have to interoperate with code using String. There’ll be more APIs using Text in the future, but right now there’s not many.