Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
optional parameters
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,

Hi all, i want to know can we define optional parameters in vbscript
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,

Could u please eloborate???

Regards,
Sankalp
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
if i have function say

login(UN,PWD,a)

when i call login function i make use of parameters UN and PWD,
but i dont use 'a' , i may use or not use. its just optional
so i pass all the values but i dont use it the value a inside the function, does the login function work?

Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
Having Optional parameters in a function is not possible in VBscript.
You can use dictionary objects / arrays and pass the values to a function if
you want to have flexible no of arguments.
Reply
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi Ishul,

This feature is not part of vb scripting so we have to pass all the parameters while calling any action. However, you can make it option by incorporating the code if the input is empty ("") then igone that value and pass the value as empty ("") while calling the function for the one which you don't want to pass the value.

Let me know if you need any info.
Thanks,
SUpputuri
Reply
#6
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi Ishul,

This feature is not part of vb scripting so we have to pass all the parameters while calling any action. However, you can make it option by incorporating the code if the input is empty ("") then igone that value and pass the value as empty ("") while calling the function for the one which you don't want to pass the value.

Let me know if you need any info.
Thanks,
SUpputuri
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Optional parameter in function amit25007 6 5,410 01-06-2016, 03:29 PM
Last Post: venkatesh9032
  Exception handler parameters Ashok Kumar 1 2,721 12-09-2011, 10:23 PM
Last Post: supputuri
  Optional Steps : ketan.barbade@gmail.com 0 2,954 09-10-2011, 12:18 PM
Last Post: ketan.barbade@gmail.com
Exclamation how to Pass Optional Parameters in VBS? ShrikantBiradar3449 1 8,300 06-13-2011, 03:12 AM
Last Post: Skepsis
  Get parameters of action idolast 0 2,736 07-02-2008, 08:52 PM
Last Post: idolast

Forum Jump:


Users browsing this thread: 3 Guest(s)