IMHO optional parameters are a poor way of doing things.
For example, in VB
.NET I can write a method or function like this:
Public Sub foo(ByVal s as string, Optional ByVal b as Boolean = False)
So, Rupen, using your example I would do something like this:
Public Function test(ByVal x as Integer) as Integer
Public Function test(ByVal x as Integer, ByVal y as Integer) as Integer
Return (x + y)
I know that this is a Classic ASP question so you will have to forgive the .NET code but Programming Theory is Programming Theory regardless of the language.
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
^^Thats my signature