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
Explain How do you create a recordset object in vbscript?
What are the disadvantages of vbscript?
Explain the asc function?
Write a code to print numbers from 5 to 0?
Compare java script and vb script?
what is diff between static and dynaic arrys?
Explain about the support of asp for vb script functionality?
How can constants be declared in the vbscript language?
What is the event handling in vbscript?
When are redim statement and preserve keyword used in the vbscript language?
Which function allows you to instantiate an object given its programmatic identifier or progid?
1) How can we use VB script in testing the application? 2) What all are the things(Software application to be installed in PC) we need to learn VBscript?
Mention what is vbscript?
PLz send me the VB scripts which is having more examples my email id : hareen_11@yahoo.com
Give me sm ideas to write Vbscripts abt protocol testing abilash700@gmail.com.