Karlos Zero Posted April 6, 2014 Share Posted April 6, 2014 Hi,I am working on a script that does the math when it's given a value from another object/avi, but I want to filter numbers from letters so that I'd have letters or words denied and numbers only accepted, and inputs with numbers and words also rejected.Is there any way I can check a text that my script listened to and verify if it's a number or a letter or a mixture of both?Any clues what commands or methods I should look for to be able to apply this?Your help is much appreciated. Link to comment Share on other sites More sharing options...
irihapeti Posted April 6, 2014 Share Posted April 6, 2014 integer ok = (llParseString2List(yourstring, ["0","1","2","3","4","5","6","7","8","9"], []) == []); do it like Innula says. that way will catch overflows as well. and is faster and is simpler 1 Link to comment Share on other sites More sharing options...
Innula Zenovka Posted April 6, 2014 Share Posted April 6, 2014 listen(integer channel, string name, key id, string message) { message = llStringTrim(message,STRING_TRIM); if ((string)((integer)message) == message){ llOwnerSay("All Integers"); } else{ llOwnerSay("Not all integers"); } } --||- 1 Link to comment Share on other sites More sharing options...
Karlos Zero Posted April 7, 2014 Author Share Posted April 7, 2014 Hey guys, thanks a lot for the ideas! testing them now to see how to make the best of them. Many thanks again! Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now