Post
by dunbarx » Tue Feb 12, 2013 12:51 am
Hi.
Not sure about all that you said. For example, will your field contain items only (like you posted, "22,11,55")? Or some other format? Will it contain alphanumeric data like "A123"? And if so, do you want to strip the "A", or just tag the whole string?
Anyway, what you ask will be simple and fun to work out. As one of many possible approaches, you should look up the operator "is a/is not a". This might be used as follows, assuming the items in your example:
repeat for each item testItem in tFieldText
if testItem is not a number then put testItem & return after collectedBadData
end repeat
You will parse your data, either by character, item, word, or line, and test each of those chunks to see if they are a number. The engine has that power built in. You can collect the bad data or the good, or just delete the bad, or send an alert, or whatever you wish.
As a sidenote, your example would only work with individual characters tested one by one as per the above, and maybe that is a part of your script that you do not show. I suppose it would also work with the string "0123456789", but I bet that is not what you meant.
Anyway, play with this, and then try to do it a completely different way. Write back with what you discover.
Craig Newman