How to Pass Multiple values in functions by using vb script?

Function value(arg1,arg2)

N1=arg1+arg2
N2=arg1-agr2
N3=arg1*agr2
N4=arg1/arg2

Value= How to pass ?

End Function

Answers were Sorted based on User's Feedback



How to Pass Multiple values in functions by using vb script? Function value(arg1,arg2) N1=arg1..

Answer / lak

Function value(arg1,arg2,N)

N1=arg1+arg2
N2=arg1-arg2
N3=arg1*arg2
N4=arg1/arg2

Value= N

End Function

call value(10,10,N1)
msgbox N1
call value(10,10,N2)
msgbox N2
call value(10,10,N3)
msgbox N3
call value(10,10,N4)
msgbox N4

Is This Answer Correct ?    1 Yes 0 No

How to Pass Multiple values in functions by using vb script? Function value(arg1,arg2) N1=arg1..

Answer / swati

above solution is a subroutine not a function

Is This Answer Correct ?    0 Yes 1 No

How to Pass Multiple values in functions by using vb script? Function value(arg1,arg2) N1=arg1..

Answer / sureshkumar

Function value(a1,a2, res)
res=a1+a2
res=a1-a2
return res
End Function

call value(10,10,res)
print res[0]
print res[1]

Is This Answer Correct ?    2 Yes 5 No

Post New Answer

More VB Script Interview Questions

How to identify column in VSFlexgrid? My VSFlexgrid window is identified as 'Active X Control'

0 Answers  


Explain about arrays in vb script?

0 Answers  


How to assign a numeric value to a variable?

0 Answers  


write a program to display configuration of a local system with the help of vb script.

0 Answers  


How can you fetch the value of a cookie?

0 Answers  






Open Yahoo Login Page in that page Suppose i have 100 mails and i want to delete 10'th mail now give procedure & Coding For that Scenario

4 Answers   AppLabs, IBM,


Input = 124 output should be 124421 Please do not use any string functions/variables

8 Answers   Cap Gemini,


I have a webtable and many objects are embedded in side.(like buttons,checkboxes etc). How to know how many such objects are there? what is the class of that objects?

1 Answers   HP, TCS,


what does create object actually do when you call it in vbscript?

1 Answers   Cap Gemini,


Explain what is loose binding? Why is it not a good practice to use it?

0 Answers  


Hi, Anybody could tell me What is the 3rd Largest Number in the series..Thanks in Advance..

3 Answers   Amazon, bcbs,


How will you generate Reports using Vb Script?it asked in testing(QTP)Interview.Plz Any Body Let me know. Thanks uday Uday_testing@yahoo.co.in

4 Answers   NIIT,


Categories