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


Please Help Members By Posting Answers For Below Questions

Mention what are the rules to name variable in vbscript?

772


what is the standards used for writing the script in QTP

2088


What are the different types of loops available in the vbscript language?

741


What is the purpose of regexp object in vbscript?

779


Explain the scope of the variables using dim, public, and private keywords respectively.

936


what is resorceallocation

1969


What is the use of option explicit statement?

781


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.

1650


How to access array data?

760


How do you declare a variable in vbscript?

842


By default in vbscript the arguments passed to functions and subroutines are by reference or by value?

838


What is dictionary object in vbscript? Explain?

875


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.

2064


Differentiate javascript and vbscript?

766


What are the properties of regexp object?

805