data entry - phone format

What would you like to see in CSPro?
Forum rules
New release: CSPro 8.0
Post Reply
AriSilva
Posts: 591
Joined: July 22nd, 2016, 3:55 pm

data entry - phone format

Post by AriSilva »

I know this is a little bit out of line, but in the future would you consider having a phone number format that includes (or not) the area code?
Something like
(xxx) - (yyyyyyyyyyy)
I know also this is complicated for several reasons, one of them being the variable number of digits in different countries. Another might be having two fields in the same screen.
Best
Ari
aaronw
Posts: 561
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: data entry - phone format

Post by aaronw »

In the next release we plan to add a function that will return whether a given string is a match for a regular expression. A regular expression is a special text string for describing a search pattern. For example, you'll be able to write something similar to this in the future:
postproc

    string regex = "(^\([0-9]{3}\) - )?^?\([0-9]{11}\)";

    if not regexmatch(TELEPHONE, regex) then
        warning("The telephone number is not formatted correctly.");
        reenter;
    endif;
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: data entry - phone format

Post by htuser »

Hi Aaron,
Thanks for this future function. It will help validate lot of thinks such as email etc.
Best regards,
G.VOLNY, a CSProuser from Haiti, since 2004
Post Reply