Hello, I am a beginner at scripting and I have been listening to Chip Orange's Script writing class and trying to get an understanding for what he is talking about. I am currently trying to work my way through class 3 and before I move on to class 4 I want to make sure that I understand all of the concepts hthat he is teaching in class 3. What I am attempting to do with one of the examples that Chip provides four class 3 is to write a script that will display the way someones name would appear in the phonebook, and I would also like to display that persons phone number in that same message box. I think that I have almost got it, but I keep getting an error that I cannot seem to get figured out. Could someone please explain to me what I am doing wrong?

Scott Rumery


FirstName = InputBox("Enter your first name(Your Given Name): ")
LastName= InputBox ("Enter your last Name(Or Family Name): ")
AreaCode = InputBox("Enter your area code")
Prefix = InputBox("Enter First three numbers")
LastFourNumbers =InputBox("Enter Last Four Numbers")

MsgBox "In the phonebook your name would appear as:" &AlphabetizeForm(FirstName, LastName) &"Your phone number will appear as:" &PhoneNumber("(", AreaCode,")", Prefix, "-", LastFourNumbers)

function AlphabetizeForm(First, Last)
AlphabetizeForm = InitCap(Last) & ", " & InitCap(First)

end function

function PhoneNumber(AreaCode, Prefix, LastFourNumbers)
PhoneNumber = ("(") &(AreaCode) &(")") &(Prefix) &("-") &(LastFourNumbers)

end function


function InitCap(Word)
FirstLetter = Left(Word, 1)
Rest = Mid(Word, 2)
InitCap = UCase(FirstLetter) & LCase(Rest)

end function



Reply via email to