area codes

Bill Campbell bill at celestial.com
Mon Jul 14 17:43:32 PDT 2008


On Mon, Jul 14, 2008, Jay R. Ashworth wrote:
>On Mon, Jul 14, 2008 at 05:06:17PM -0400, GCC Consulting wrote:
>> > > Lop off the second part of the fP-supplied global PHONE edit, so as to
>> > > not allow the "old" classic format, the one which didn't require an area
>> > > code.
>> > 
>> > Or, better, create a new edit that works that way, and set your columns
>> > to that.  (Yes, I know some people will say that's not better, it's
>> > worse.  I disagree with those people.)
>> 
>> This only is easier if one is comfortable with writing or working with
>> edits.  The other disadvantage of doing this in an edit is you can't put up
>> a error message specific to this error,  With an edit, the only message will
>> be "EDIT FAILED".
>> 
>> With catching this in processing either msgbox or errorbox can be used with
>> information specific to the area code error.  One can even put up the
>> errorbox and then popup a list box with the 2 area codes and allow the
>> operator to pick the correct one and then combine the two.
>> 
>> This solution will be faster and easier on the user as the don't have to
>> return to the field and retype all or part of the phone #.
>
>Sure.  The question is *always* "does the ease of use for the user
>justify the labor investment by the programmers?"
>
>Programmers are easily estimateable.
>
>Users aren't.
>
>The easier way usually wins.  :-)

Only with lazy/incompetent programmers.  The programmer has to do
the job once while users will deal with the edit repeatedly.

I always try to do things to make life easier for the users, and
minimize the probability of errors.

In the case of phone numbers, my edit routines (non filepro)
first strip remove special characters (perlish s/[-()\s+//g) from
the input.  Then if the resulting string is 7 characters I
prepend the default local area code.  Finally I make it look
pretty using (AAA) XXX-YYYY.

Where things get much more interesting is dealing with dialing
where we have nearby area codes where some exchanges are local
calls, and others toll calls where one must prepend ``1''.  My
dialcodes file for Hylafax is pretty ugly to handle these
speciale case exchanges.

It's left as an excercise for the reader to have the edit convert
alpha characters to numbers (Sam Leffler put my code for this in
the HylaFAX etc/dialcodes file, probably when it was still called
flexfax :-).

Bill
-- 
INTERNET:   bill at celestial.com  Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
Voice:          (206) 236-1676  Mercer Island, WA 98040-0820
Fax:            (206) 232-9186

The day-to-day travails of the IBM programmer are so amusing to most of
us who are fortunate enough never to have been one -- like watching
Charlie Chaplin trying to cook a shoe.


More information about the Filepro-list mailing list