AdamEisfeld
10-26-2010, 01:55 AM
I know in various other languages its possible to call a function such as isNum on a string that will return a 1 if the given string is a number, otherwise 0 if the string contains letters and/or symbols.
I cant seem to find a similar command in MEL. Ive searched the forums and through the documentation with no luck. Im aware its possible to program this command on my own via breaking the string apart and checking it manually, but if an internal command already exists Id prefer to go that route.
Alternatively --
Is it possible to restrict a textField's input to only numbers? Again, I cant seem to find any flags or info on this in the documentation / forums. Perhaps Im looking in the wrong place, but it seems something relatively simple so Im surprised I havent found anything on it.
Essentially Im in the final stages of cleaning up my code and attempting to block any user-made errors, and obviously having the user mistakenly enter a letter into a text box that requires it's text to be used in a mathematical calculation isn't a good idea. Therefor either restricting input to only numbers or checking at a later time if the user has mistakenly entered letters / symbols and alerting them of their error would be a cleaner end result.
Any help? Thanks in advance,
- Adam Eisfeld
I cant seem to find a similar command in MEL. Ive searched the forums and through the documentation with no luck. Im aware its possible to program this command on my own via breaking the string apart and checking it manually, but if an internal command already exists Id prefer to go that route.
Alternatively --
Is it possible to restrict a textField's input to only numbers? Again, I cant seem to find any flags or info on this in the documentation / forums. Perhaps Im looking in the wrong place, but it seems something relatively simple so Im surprised I havent found anything on it.
Essentially Im in the final stages of cleaning up my code and attempting to block any user-made errors, and obviously having the user mistakenly enter a letter into a text box that requires it's text to be used in a mathematical calculation isn't a good idea. Therefor either restricting input to only numbers or checking at a later time if the user has mistakenly entered letters / symbols and alerting them of their error would be a cleaner end result.
Any help? Thanks in advance,
- Adam Eisfeld
