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 will you get the last occurrence of one string within another string using vbscript?

0 Answers  


Inorder to avoid Message box while writing script which alternative method can be used?

1 Answers  


I have string like hp company.print tis like company hp.write a program in vbscripting

1 Answers   HP,


How to get 120 using 5 zeroes, you can use any operator(+, *, /...) in qtp.

2 Answers   Cognizant,


write a vb-script code to delete all the mails in my gmail in the year 2011

1 Answers  






Explain the functionality of vbscript?

0 Answers  


Mention what are the rules to name variable in vbscript?

0 Answers  


How to return only alpha bate string from an string str = "bibhu@#$%&das&*)(SUndar"

4 Answers   Cap Gemini,


What if you do not specify anything when you call a procedure?

0 Answers  


write a vb script to display factorial of a number using function

1 Answers  


How to capture a runtime error in vbscript?

0 Answers  


this q asked in applabs, q is: QTP should open google.com page and enter "qtp" in one edit(search) box and click search and should open google.com again and enter "job" in edit(search) box and click on search. I tried this but getting error "Edit(search) box matches more than one object", could anyone this question plz..

1 Answers   AppLabs,


Categories