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
What is the use of the formatdatetime function in the vbscript language?
What are class properties?
What are the rules to name variable in vbscript?
Explain about the asc function?
how does vb script help in web page designing? explain with example.
What is the use of the date function in the vbscript language?
What is the purpose of drive object of scripting.filesystemobject class in vbscript?
Explain the functionality of vbscript?
how to write validation function for date in vb script
What is the difference between VBScript and JavaScript?
What are the uses of vb script?
Explain the .wsf files?
filter the array values without using filter function?
Explain the constants in vbscript?
write any ttest cases using check points and parameterization