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 is variant in vbscript?

552


How regexp.execute method works?

588


What are the rules to name variable in vbscript?

587


How to declare an array in vbscript?

666


Explain the extension .hta?

540






What is vbscript procedures?

600


How to write functions and sub in vb script?

621


There are 5 web pages.write a script to click the button on 4th web page.

2938


what is the difference between modular and data and keyword driven framework

1738


Why is it recommended to close the database connection every time after the work is completed?

496


In what way program "hello world" you can write in vbscript?

645


How will you get the largest subscript of an array in vbscript?

603


Give me sm ideas to write Vbscripts abt protocol testing abilash700@gmail.com.

1587


Why is error handling required?

569


What are class properties?

650