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 are the rules to name variable in vbscript?
what is the standards used for writing the script in QTP
What are the different types of loops available in the vbscript language?
What is the purpose of regexp object in vbscript?
Explain the scope of the variables using dim, public, and private keywords respectively.
what is resorceallocation
What is the use of option explicit statement?
Hai this is sheik, i want to learn VB scripts for web application pls guide me what are all basic things need to know to learn VB scripts in web application.
How to access array data?
How do you declare a variable in vbscript?
By default in vbscript the arguments passed to functions and subroutines are by reference or by value?
What is dictionary object in vbscript? Explain?
can anyone send me a vb scripts code for clicking on a link and coming back on home page again does the same for many links on a web page.
Differentiate javascript and vbscript?
What are the properties of regexp object?