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

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

Could u please eloborate???

Regards,
Sankalp
Reply
#3
Solved: 10 Years, 9 Months 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: 10 Years, 9 Months 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: 10 Years, 9 Months 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: 10 Years, 9 Months 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 4,941 01-06-2016, 03:29 PM
Last Post: venkatesh9032
  Exception handler parameters Ashok Kumar 1 2,619 12-09-2011, 10:23 PM
Last Post: supputuri
  Optional Steps : ketan.barbade@gmail.com 0 2,835 09-10-2011, 12:18 PM
Last Post: ketan.barbade@gmail.com
Exclamation how to Pass Optional Parameters in VBS? ShrikantBiradar3449 1 7,924 06-13-2011, 03:12 AM
Last Post: Skepsis
  Get parameters of action idolast 0 2,554 07-02-2008, 08:52 PM
Last Post: idolast

Forum Jump:


Users browsing this thread: 1 Guest(s)