how can we return a value from userdefined function for eg 2
functions in func1 iam getting 2 values(a,b) and storing in
var(C). now i want to pass that var(c) to another func2 give
me the script

Answer Posted / nath t

Function returns only one value. when we assign the final
value with variable that name should be the same name of
the function name.

In the given example, som is the function it returns the
sum of two values when we assign that value to variable[i.e
same as function name(example: som = c)]

if you don't assign, function doesn't return any value
(example: z = c)

Example:

Function som(a, b)
c = a + b
som = c '(instead of these two step we can write in single
step like som = a + b)
End Function

x = 10 + som(10, 20)
msgbox x

you can pass this value in any other function.

Example:
y = som(som(10, 20), x)

msgbox y

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How will you check that your test cases covered all the requirements?

566


Explain hybrid framework with advantages and disadvantages?

543


What is fragmentation and paging?

1592


hi guys we r working in office...we write some scripts..suddenly we have a work(5min only) in out side..what will do now,,,used to system shut down or log off or lock or sleep mode,switch use or hibernate?

1584


how could i download qtp in which i get add-in support for 'oracle' is there any way to get it? i finding but not getting pls help me out :)

1433






i am trying to automate yatra.com,in that site, when i go to automate the Leaving from field showing as a WEBEDIT, but when i enter 1 or 2 char, it displaying dropdownlist, i try to use keyboard automation to select the item from that list but it is not possible, can anybody help he. Thans for posting the Answer

3492


Hi Friends, Im planning to do certifcation in mercury Automation Tool QTP.But I Didnt get any clear details regarding course syllabus, fees, where to approach, and which certification would be useful for the experienced testers? can any one send me the details?

1516


Hello everyone! I am just writing a small test for a windows application. I have a problem with a text output value. The value i am trying to catch is presented in a scrollable textbox. When the text is too long, only a portion of it gets captured. Do you have any experience with this?

2141


How to customize checkpoints with parameters?

3020


What are the technologies supported by qtp?

563


I have 5 save buttons in 5 tabs . The tabs are placed one after the other. My object repository have these added as 5 save buttons with name sav1, save 2, save 3 , save 4, save 5 .all are getting highlighted from OR but they are not getting clicked. After spying each button all the properties are same except First button Index 0 html id:=btnSaveTab1 outerhtml:=", Second button "html id:=btnSave "outerhtml:=", Third button "html id:=", outerhtml:=",

1355


For which type of project the iterative model is suitable?

1384


How can i test an application like Google Earth.In my application data will be fetched from a oracle database based upon which graphs are generated..so these all are dynamic..how can i use qtp here..alongwith that how can i test the map generated by a satellite just like google earth..

1721


Hi.. I want to do parametrization for selecting perticular flighr say XYZ by using local table: criteria: 1.If flight is available msgbox "Flight is available" and then select flight from flight table and click to ok button after that as enter username and ticket no and then stop 2. otherwise msgbox " Flight is not available" and stop Please help me out ..and let me know your responses on dipak.bachhav@gmail.com Regard, Dipak

1631


Explain quicktest professional (qtp) testing process?

539