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

How many types of operators are available in the vbscript language?

541


Is vbscript language a case-sensitive language and what does it mean?

550


Write a Program to add 2 numbers without using operators (+,-) and without using third variable. Note: Use VBScript only Hint: You can use other operators like '/' & '*'(Division & Multiplication)

3194


regular expression that will recognize a browser as long as its name property starts with mybrowser

1765


Hello friends..... Can any give the methods for Ms-Access, and Mozilla firefox in Automation Object Model in QTP. Please give me currect answers... if you do not understand my question please don't give answers. Thanking you.

1854






Develop a parameterized action that accomplishes the following a. Launch a browser of users choice ( example : IE, chrome etc) b. Open up a search engine (Google, Bing etc) c. Perform a search d. Click a particular link depending on the user’s choice ( 1st , 2nd or third link)

1416


If we take 2 strings as “good” and “bad” then what will ‘+’ and ‘&’ operators return?

538


hi i am trying for testing job for 3+ experience(fake) can u suggest me what type of projects i can keep in my resume and how much of knoeledge i should have abt that project.thnks in advance.urgt plz

2588


Which command is used for writing text on a page?

578


How to throw an error in vbscript?

610


How regexp.execute method works?

595


What is the difference between javascript and vbscript?

536


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

629


Write a code to print numbers from 5 to 0?

687


Which constant is used for print and display functions and works as same as pressing enter key?

532