How can we return a value from User Defined Function ?
For Eg. we have 2 functions. In Fun1 i am getting 2 values
(a,b) and i am addding those 2 and storing in to another var
(c). Now i want to pass that var(c) to another function
(fun2). What will be the script?
Answer Posted / chivukula.kumar
'Try this Code in Only MS-Excel
'After opened should be press Alt+F11
'select and double click the ThisWoorkbook in VBA Project
leftside of application
' paste this code in that
Private Sub Workbook_Open()
Call add(1000, 20000, c)
Call subb(c, 20000)
End Sub
'Creation of Fun1 and Fun2(add and subb)
Function add(a, b, c)
a = a + b
c = a
MsgBox c
End Function
Function subb(c, d)
sb = c - d
MsgBox sb
End Function
| Is This Answer Correct ? | 10 Yes | 3 No |
Post New Answer View All Answers
Mention characteristics of sub procedures?
Explain about scrrun.dll?
How will you get the natural logarithm of the given number in vbscript?
How to assign a date value to a variable?
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)
Mention how to access array data?
What is event handling in vbscript?
did any one attended interview in applabs if you had gone through plz tell me the procedure
how to increase the values in text box in a given text box increament by two values by clicking on button
How to scroll down a page while recording in qtp. suggest me any method apart from low level recording.
Mention what are the rules to name variable in vbscript?
What are class variables?
Explain about the asc function?
Write a test case using Test if the images,a particular test exists,check if the page links match,page response is within a certain range,parameterization of the test,the test should comprise of actions,the test should use a custom function,the test should use global repository
If else for do while select in vb script?