Is it possible to return multiple values from a function..?
Then how..?

Answer Posted / rico

One way of getting mutiple values from function is by
passing values "ByRef" to the funtion and storing the
return values in the one or more arguemnts passed to the
functions.

Ex :
mysum = 0
msgbox mysum ' return 0
mysub = 0
msgbox mysub ' return 0

Function fnmul(byref mysum, mysub, x , y)

mysum = x + y
msgbox mysum 'return 9
mysub = x - y
msgbox mysub 'return 1

End Function

Call fnmul( mysum, mysub, 5, 4)

msgbox mysum 'return 9

msgbox mysub 'return 1

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Diff b/w Health care domain and Banking Domain?

4398


What is the difference between per-action and shared?

795


give me the code to save all messages of inbox of gmail into a folder and notepad

1812


why you have standardized functions? plzzz guys with real time exp. do answer

1617


What are the flaws in water fall model and how to overcome it?

771


how to use the QTP choose the data from oracle? e.g. i input the identity card NO. this will be add new record in the database ,and now i want get this record's prime key.

1521


How to release all resources file from the QTP?

1247


What are the different attribute used with regular expression?

709


What is method name to compare two XML files.

1725


What is the limitation to XML Checkpoints?

1827


what are the limitations of smart identification in qtp 9.0

2109


What is file database?

1864


what is meant by Implicit and explicit requirements?

3853


What should we say if interviewer asks "What is ur project architecture?".......Can any one help me with clear information.?????????

1913


Explain data driven framework?

741