Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Default values in Functions
#1
Solved: 10 Years, 9 Months ago
I have tried a few ways to get a default value when you call a function, of which all have failed.

I first tried overloading, which as nothing to do with the default value, but it what I really wanted to do. That didn't work.

I tried using the following which also did not work.
Code:
Function testFunc(ByVal testvar As int = 1)
and
Function testFunc(ByVal testvar = 1)
I'm not really sure if it's possible.
Reply
#2
Solved: 10 Years, 9 Months ago
Unfortunately VBScript does not support function or operator overloading.. What you're trying to do did not work either because VBScript also does not support default parameters.
Reply
#3
Solved: 10 Years, 9 Months ago
That's disappointing that it does not support it. Oh well. Thank you for the response.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Inserting variable values into Descriptive Programming Functions eske99 2 3,147 12-18-2015, 01:47 PM
Last Post: vinod123
  Passing objects to Functions vinod.nhce 0 3,218 03-13-2014, 06:09 PM
Last Post: vinod.nhce
  vb script to stop execution of functions if conditions fail visitjaga 1 7,133 12-05-2013, 12:26 AM
Last Post: ravi.gajul
  Retrieving default value from embedded webedit from webtable indranilgoswamimcb 1 2,993 01-12-2012, 02:47 PM
Last Post: sshukla12
  XML Read Functions Nish 2 4,584 11-26-2011, 11:57 PM
Last Post: Nish

Forum Jump:


Users browsing this thread: 1 Guest(s)