Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Default values in Functions
#1
Solved: 11 Years, 3 Months, 3 Weeks 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: 11 Years, 3 Months, 3 Weeks 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: 11 Years, 3 Months, 3 Weeks 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,508 12-18-2015, 01:47 PM
Last Post: vinod123
  Passing objects to Functions vinod.nhce 0 3,291 03-13-2014, 06:09 PM
Last Post: vinod.nhce
  vb script to stop execution of functions if conditions fail visitjaga 1 7,380 12-05-2013, 12:26 AM
Last Post: ravi.gajul
  Retrieving default value from embedded webedit from webtable indranilgoswamimcb 1 3,119 01-12-2012, 02:47 PM
Last Post: sshukla12
  XML Read Functions Nish 2 4,754 11-26-2011, 11:57 PM
Last Post: Nish

Forum Jump:


Users browsing this thread: 1 Guest(s)