The hard way: (This might be a solution if you have non-English
characters in there)
Filter 0:
Run-if: 'SerialNumber' != $NULL$
If-Action: Set fields: tmpInt = 0, tmpIsInt = 0, and tmpChar = $NULL$
If-Action: Call filter guide
Set a guide label named 'Start' at the beginning of the guide.
Filter 1:
Run-if: 'SerialNumber' != $NULL$ AND 'tmpIsInt' = 0
If-Action: Set Fields: tmpChar = SUBSTR($SerialNumber$, $tmpInt$,
$tmpInt$ + 1)
Filter 2:
Run-if: NOT('tmpChar' LIKE "%[0-9]%")
If-Action: Set Fields: tmpIsInt = 1
If-Action: EXIT GUIDE or do a REPLACE($SerialNumber$, $tmpChar$, "")
to get rid of the non-digit.
Else-Action: tmpInt = tmpInt + 1
Filter 3:
Run-if: tmpIsInt = 0 AND tmpInt < LENGTH($SerialNumber$) + 1
If-Action: GO TO GUIDE LABEL => Start
Else-Action: Set Fields tmpInt = 0 and tmpChar = $NULL$
Else-Action: EXIT GUIDE
Filter 4: This is outside of the guide
Run-if: tmpIsInt = 1
If-Action: Set Fields: tmpIsInt = 0
If-Action: ERROR PLEASE ENTER ONLY INTEGERS or take whatever action
you want
I didn't test this out, so it might have a few adjustments that needs to
be made, but basically it will iterate through each character in the
SerialNumber field, checking to see if it is an integer. If it is not an
integer, it sets a flag (sets tmpIsInt = 1) and then exits the guide.
Then you can see if tmpIsInt = 1 and perform action on it. It also exits
the guide once it reaches the last character of the SerialNumber field.
This is determined by the "tmpInt < LENGTH($SerialNumber$) + 1" in the
Run-if for Filter 3. You might have to change it to "tmpInt <=
LENGTH($SerialNumber$) + 1" to accomidate the difference between
zero-indexed and non-zero indexed functions, I would have to test this.
Also, Filter 3, the LENGTH($SerialNumber$) will be modified if you
replace a non-digit character with "". In this event, You would likely
need to perform setting tmpInt = tmpInt - 1 on filter 2 if you choose to
REPLACE($SerialNumber$, $tmpChar$, "").
Thanks,
Gary Opela, Jr.
Sr. Remedy Engineer
Avaya Phone Admin
RSP Cert, Sec+
COMM: 405 582 4272
-----Original Message-----
From: Action Request System discussion list(ARSList)
[mailto:[email protected]] On Behalf Of
[email protected]
Sent: Thursday, September 16, 2010 2:11 PM
To: [email protected]
Subject: Re: 'ISNUMBER' function?
**
I had to do something like this a long time ago. I needed to confirm
that a value was all numeric. I used the REPLACE function to replace all
numeric characters with nothing and if after doing it there was still a
value left the string must have at least one alpha or special character
in it.
This ought to work regardless of language and use of special characters.
Brian
Brian Bishop
Goldstag Consultants Ltd
+44(0)7973 746832
________________________________
From: "Mueller, Doug" <[email protected]>
Sender: "Action Request System discussion list(ARSList)"
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug10 www.wwrug.com ARSlist: "Where the Answers Are"