How to return a value from function...?
you should not tell msgbox, print.. etc.,
Answer Posted / vgr
Dim StrFunVal
StrFunVal = fn_MyFunction(7)
Function fn_MyFunction(Num)
fn_MyFunction=Num+8
End Function
During the execution the "StrFunVal" variable will contain
the value 15. If you don't want to use 'Msgbox' or 'Print'
then declaring a variable is prefered.
For your other question I haven't come across returning
more than 1 value from functions. Probably we have to use a
ARRAY kind of stuff...but not sure. Need to work on it.
Cheers,
VGR
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Mention what is variant in vbscript?
How regexp.execute method works?
What are the rules to name variable in vbscript?
How to declare an array in vbscript?
Explain the extension .hta?
What is vbscript procedures?
How to write functions and sub in vb script?
There are 5 web pages.write a script to click the button on 4th web page.
what is the difference between modular and data and keyword driven framework
Why is it recommended to close the database connection every time after the work is completed?
In what way program "hello world" you can write in vbscript?
How will you get the largest subscript of an array in vbscript?
Give me sm ideas to write Vbscripts abt protocol testing abilash700@gmail.com.
Why is error handling required?
What are class properties?