[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: phone number format -Reply
The thing that gets missed is the fact that users are incredibly creative
when given the opportunity to input data unformatted (wink wink).
The nice thing about translate, is that you can change a bunch of characters
at once. you can code out anything you can think of, and then code out more
when the users get more creative. Along with the pedestrian dashes, commas
and underscores, we've had to code out extension stuff (x, ext, extn), and
parentheses around area codes, you name it, they'll throw it in there given
the chance. . .
- - Art
-----Original Message-----
From: Buchanan, Timothy [mailto:buchanan@BIPERF.COM]
Sent: Wednesday, June 23, 1999 5:12 PM
To: Multiple recipients of list SQR-USERS
Subject: Re: phone number format -Reply
Hmm...this seems to work. Am I missing something??
unstring $phone by '-' into $ph1 $ph2 $ph3
let $phone = $ph1 || $ph2 || $ph3
unstring $phone by '/' into $ph1 $ph2 $ph3
let $phone = $ph1 || $ph2 || $ph3
unstring $phone by ' ' into $ph1 $ph2 $ph3
let $phone = $ph1 || $ph2 || $ph3
thanks
Timm
On Wednesday, June 23, 1999 3:45 PM, John Milardovic
[SMTP:milardj@SX.COM]
wrote:
> This is the first thing that came to mind. It's not as
foolproof as
Davids
> approach but it is much less code.
>
1 2
>
> let $phone2=translate(&phone,' +/\|-_','')
>
> Where '1' are the characters you want to screen out and
'2' is a null.
Like
> I said its not foolproof but its simple.
>
> HTH
> John Milardovic
> > -----Original Message-----
> > From: David Anderson [SMTP:DANDERS1@SMTPGW.IS.HFH.EDU]
> > Sent: Wednesday, June 23, 1999 5:29 PM
> > To: Multiple recipients of list SQR-USERS
> > Subject: phone number format -Reply
> >
> > This isn't an elegant approach, but you could scan
through
> > the source variable one character at a time. Test if
the
> > character is a number. If true, concat the character to
your
> > target variable.