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 / siri
'vbscript
'create two functions
dim a,b,d
a=20,b=30
dim c
d=add(a,b)
msgbox d
call subtract(d)
function add(a,b)
dim c
c=a+b
add=c 'add is the function name:this statetment can
return c value
end function
function subtract(c)
dim f,e
f=20
e=d-c
msgbox e
End function
Is This Answer Correct ? | 6 Yes | 5 No |
Post New Answer View All Answers
What is the event handling in vbscript?
What is loose binding? Why is it not a good practice to use it?
What is the purpose of on error resume next statement?
How to throw an error in vbscript?
i wrote vbscripit code in notepad i got error i am in learning stage if u ps tell me what wrong in my code my error is "object required descriptive at line one run time error"and my code is "set usernameobj=Descriptive.Create() usernameobj( "name").value="Username" set passwordobj=Descriptive.Create() passwordobj("name").value="password" set signinobj=Descriptive.Create() signinobj("name").value="sigin" browser("gmail").page("gmail").WebEdit("usernameobj").set ("enter username") Browser("gmail").Page("gmail").WebEdit("passwordobj").Set secure.Crypt.Encrypt("enter password") browser("gmail").page("gmail").WebButton("siginobj").click
Explain the tristate constants in vbscript?
Explain sga memory structures?
When to use function procedures and what are its characteristics?
How to Import data from a file (file is on the desktop) to the data table
how to operate webobjects in a webpage using getobject function and then using generic methods?
wht must be the interview question on corinthian information technology solutions incorporated.
Hello Guys, If any body looking for "worksoft certify tool training in bangalore", please contact me aimansaud@gmail.com
Explain few date functions in vbscript?
What is the use of the formatdatetime function in the vbscript language?
How to access array data?