How to return a value from function...?

you should not tell msgbox, print.. etc.,

Answer Posted / bfakruddin

Function MyFunction(Num)

MyFunction=Num+1

End Function

Num=InputBox("Enter a Number")

call MyFunction(Num)
msgbox MyFunction 'It returns Num+1 value calculated in
Function

Just we have to use the Function Name to return a value...
and we can use that value out of that function...

One more question Can we return more than 1 value from
functions?


visit for qtp info http://qtptesters.wordpress.com

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which operator is used for fetching the modulus of the 2 numbers in the vbscript language?

753


Which function is used in the vbscript language to convert the specified expression into a date type value?

697


What is purpose of scripting.filesystemobject class in vbscript?

876


How can the spaces from the string be removed?

788


what is diff between static and dynaic arrys?

1824


What methods are used to create text files and open text files in the vbscript language?

741


Explain the tristate constants in vbscript?

768


What are the data types supported by vbscript?

795


Mention what is the use of option explicit in vbscript?

759


What are events in the vbscript language?

775


Which date function is used in the vbscript language to find the difference between the 2 dates?

804


How will you get the natural logarithm of the given number in vbscript?

808


Description.Create

2365


What is the difference between vbscript and vba?

817


Explain the adodb.stream class?

741