That's good. All the best.

-----Original Message-----
From: Steve Abaffy [mailto:sabaffy@;cditelecom.com] 
Sent: Monday, November 11, 2002 2:38 PM
To: ActiveServerPages
Subject: RE: Something Stupid I'm overlooking here.

Yes, I should have sent a retraction. I found the problem there were 3
trailing spaces in the phone number as it was being passed back from the
database once I did a trim on them the function worked just fine.

Thanks


-----Original Message-----
From: Oladapo Oguntoyinbo [mailto:doguntoy@;ItechTraining.com]
Sent: Monday, November 11, 2002 12:48 PM
To: ActiveServerPages
Subject: RE: Something Stupid I'm overlooking here.


Steve it works alright for me looking like this;

<%

PHONE = 4037815200
Function FormatPhone(PHONE)

        IF PHONE <> "" THEN
                Response.write "Phone = " & Phone & "<BR>"
                Response.write "Right = " & Right(Phone,4) & "<BR>"
                FormatPhone = "(" & LEFT(PHONE,3) & ") " & MID(Phone,4,3) &
"-" & Right(Phone,4)
                Response.write FormatPhone
                Response.end
        ELSE
                FormatPhone = ""
        END IF
END FUNCTION

call formatPhone(PHONE)

%>

Hope it helps
-----Original Message-----
From: Steve Abaffy [mailto:sabaffy@;cditelecom.com]
Sent: Monday, November 11, 2002 1:13 PM
To: ActiveServerPages
Subject: Something Stupid I'm overlooking here.

Hello
I have the following function

Function FormatPhone(PHONE)

        IF PHONE <> "" THEN
                Response.write "Phone = " & Phone & "<BR>"
                Response.write "Right = " & Right(Phone,4) & "<BR>"
                FormatPhone = "(" & LEFT(PHONE,3) & ") " & MID(Phone,4,3) &
"-" &
Right(Phone,4)
                Response.write FormatPhone
                Response.end
        ELSE
                FormatPhone = ""
        END IF
END FUNCTION

which has the following outoput

Phone = 4037815200
Right = 0
(403) 781-0

As you can see it should be (403) 781-5200 so what obvious thing am I over
looking here???




---
You are currently subscribed to activeserverpages as:
[EMAIL PROTECTED]
To unsubscribe send a blank email to
%%email.unsub%%

---
You are currently subscribed to activeserverpages as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
%%email.unsub%%




---
You are currently subscribed to activeserverpages as:
[EMAIL PROTECTED]
To unsubscribe send a blank email to
%%email.unsub%%

---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to