Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I make a optional arguments in a subroutine.

Status
Not open for further replies.

3d1tund0

Programmer
Oct 31, 2000
9
0
0
US
I have a sub that is like this:

Sub sendmail (fromaddr, toaddr, cc, bcc, subject, body, amount)

Dim counter, Mail

Set Mail = CreateObject("CDONTS.NewMail")
For counter = 1 to amount
Mail.From = fromaddr
Mail.To = toaddr
Mail.cc = cc
Mail.bcc = bcc
Mail.Subject = subject
Mail.Body = body
Mail.Send
Next
Set Mail = Nothing
End Sub

I know it's simple but I want to be able to make the cc and bcc args optional..is this possible?

thanxs
3d1tund0
3d1tund0@globalmark-e.com

 
Well given it's VB, why not move them to be the last arguments, and add Optional before each one. Ben
+61 403 395 052
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top