Here's the library method I wrote:
method "FormatPhone" ($AreaCode; $Phone; &$FormatedNumber)
// Format the phone number
$FormatedNumber:=$AreaCode+$Phone
// Remove all the puctuation
// let the letters and numbers come through
regex replace("/[ -\/\:[EMAIL PROTECTED]/"; $FormatedNumber; "";
$FormatedNumber)
$PhoneLength_i:=Length($FormatedNumber)
Case of
:($PhoneLength_i=7)
// Number without area code
$FormatedNumber:=Substring($FormatedNumber;1;3)+"-"+Substring
($FormatedNumber;4)
:($PhoneLength_i=10)
// Area code and Number
$FormatedNumber:="("+Substring($FormatedNumber;1;3)+") "+Substring
($FormatedNumber;4;3)+"-"+Substring($FormatedNumber;7)
Else
// No idea!!
If ($AreaCode#"")
$FormatedNumber:="("+$AreaCode+") "+$Phone
Else
$FormatedNumber:=$Phone
End if
End case
======================
Area code can be an empty string if your phone is all in one field.
On Sep 13, 2007, at 10:35 AM, James Mccarthy wrote:
What is the code for displayng phone numbers in A4d (603)
482-8998
[Salespeople]PhoneNum:$phone
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/