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 / sangee

Call add(40,20,c)
Call subs(c,10)
Function add(a,b,c)
c=a+b
msgbox c
End Function

Function subs(c,d)
e=c*d
msgbox e
End Function

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How are values assigned to string type and numeric type variables?

535


Explain about the functionality of vb script?

565


If else for do while select in vb script?

636


What is the use of option explicit in vbscript?

542


Can u describe what kind of testing are for OTC derivates by banks.

1664






Set srchobj=Description.Create() srchobj("type").value="text" srchobj("name").value="q" srchobj("html tag").value="input" browser("micclass:=google").Page("micclass:=google").webedit (srchobj).Set "qtp" what's wrong in my code pls tell me ? the above code working fine and i got my result pass,now i am trying to run the program it shows general run time error why?pls help me i am in learning stage ?

1546


We have 1 web page with names column. I am giving the Service Providers1,2,3.... @ that time dynamically some no of names are displaying in the webpage and The Pop up windows are opening(No.of Pop Up windows=No.of Names). The names may be diffar for each and every Service Provders (Dynamically) How can we handle the Dynamic values?

1750


I have attended Anovatek Software QTP interview. They will give us computer and one web based application with QTP. We have to automate some records (already updated records or new records) using QTP Data driven testing. But we should use for loop? Can any one know how to do data driven testing using For loop?

1544


Explain the scope of the variables using dim, public, and private keywords respectively.

715


Write a code to print numbers from 5 to 0?

673


What are string functions in vbscript?

648


How will you get the last occurrence of one string within another string using vbscript?

679


how to write validation function for date in vb script

2140


Hello Guys, If any body looking for "worksoft certify tool training in bangalore", please contact me aimansaud@gmail.com

1041


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

599