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

Explain the arrays in vb script?

0 Answers  


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

0 Answers  


a;;b;c;;;d in this string output is abcd will come how can we do that in vbscript in QTP testing?

2 Answers  


write a vbscript for traffic signal

1 Answers  


How to use QTP Object in .vbs(vbscript file) file Ex: Browser().., wait(), exist() and etc...

0 Answers  






if there is any string in a given format like as "company name employeecode date" then we have to fetch employeecode form string for ex-string is "capgemini12345june2013" then we have to fetch 12345 by using vb script so guys how can we do that please reply it.

3 Answers   Cap Gemini,


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

1 Answers   Cap Gemini,


Explain about scrrun.dll?

0 Answers  


write a vbscrpit to swap values

2 Answers   Adani,


Mention what is select case statement?

0 Answers  


write a vb script to display calculator using case statement?

1 Answers  


write a vb script to generate fibonnaci numbers

1 Answers  


Categories