IsAlpha (and related IsXXX functions) throws a TypeError if the input isn't a string, but I feel like that's one of the primary uses of those functions. I understand I can use Try to get around it, but it feels like that's what those functions should be doing.
I'm very excited about the distinction between variable types, but they can still switch back and forth relatively easily. If I'm taking the time to check the current state of the variable, just returning 0 rather than throwing an error seems more appropriate.
V2 IsAlpha throwing TypeError Topic is solved
Re: V2 IsAlpha throwing TypeError
String
Check that a string matches a specific pattern. Value must be a string, otherwise a TypeError is thrown.
Code: Select all
If Var is String && IsAlpha(Var)
Code: Select all
If Type(Var) = "String" && ...
Re: V2 IsAlpha throwing TypeError
I get that there are workarounds - I mentioned using Try in my original post, which is probably what I would use rather than converting it to check it - but I feel like the function intended to check if a variable matches some criteria should return 0 if it does not rather than an TypeError.
Re: V2 IsAlpha throwing TypeError Topic is solved
The function is clearly intended to check whether a string matches specific criteria, not to check a "variable" or value of undetermined type. Other functions of this category could give surprising results if permitted to accept a number, therefore all functions of this category are designed to explicitly require a string, for code/documentation size and consistency.