Re: Phone Number Validation Function

2017-09-11 Thread Stephen MacLean via use-livecode
Hi Bob, Last year I released a sample library for base functions like this: https://github.com/renegadesteve/rsIsValid You can use the LCS version, or build a widget library for your version of LC 9. It does use RegEx, but you can Sean said, there a

Re: Phone Number Validation Function

2017-09-11 Thread Bob Sneidar via use-livecode
Thanks Sean, but reading through that article, I think it makes the arguement for NOT using RegEx, seeing all the arguments back and forth about what is wrong with each other's regex, and one guy pooh poohing all of them in favor of a procedural approach. My goal is not to simply allow certain

Re: Phone Number Validation Function

2017-09-11 Thread Sean Cole (Pi) via use-livecode
There are currently 342 expressions on the regexlibrary: http://www.regexlib.com/Search.aspx?k=phone&AspxAutoDetectCookieSupport=1 Some eliminate erroneous numbers too like those begining with 123 or 555 and so on. Sean Cole *Pi Digital Productions Ltd* www.pidigital.co.uk +44(1634)402193 +44(770

Re: Phone Number Validation Function

2017-09-11 Thread Sean Cole (Pi) via use-livecode
Read this: https://stackoverflow.com/questions/123559/a-comprehensive-regex-for-phone-number-validation You can then filter by these Regular Expressions (RegEx) really simply. More importantly, it is one or two lines of code instead of 53. Sean Cole *Pi Digital Productions Ltd* 'Don't try to thi

Re: Phone Number Validation Function

2017-09-11 Thread JB via use-livecode
Thanks Bob. JB > On Sep 11, 2017, at 11:20 AM, Bob Sneidar via use-livecode > wrote: > > Hi all. > > Since I needed to write one, I thought I would share this phone number > validation function. NOTE: it only works for phone numbers of the following > format: > > -- pure numbers > nn

Re: Phone Number Validation Function

2017-09-11 Thread Bob Sneidar via use-livecode
WHOOPS! Change this line to if length(tPhoneNumber) <> 14 AND length(tPhoneNumber) <> 12 then > On Sep 11, 2017, at 11:20 , Bob Sneidar via use-livecode > wrote: > > if length(tPhoneNumber) <> 14 or length(tPhoneNumber) <> 12 then ___ u