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  


How to write VB Script for selecting a particular row in a WebTable?

1 Answers   Patni,


How you can call vbscript functions?

0 Answers  


How to pass argument by reference to a function in vbscript?

0 Answers  


how to find the textfile in the folder and copy file from one folder to another folder useing parameterigation in QTP

1 Answers   Accenture,


How to Import data from a file (file is on the desktop) to the data table

0 Answers   IBM,


what is descriptive programming in QTP and what is environment variable in QTP? where we store and what is its use?

4 Answers   Perot Systems,


What aspects of vbscript make it safe so that a web page using vbscript cannot destroy or corrupt information on a user's computer?

0 Answers  


What is dictionary object in vbscript? Explain?

0 Answers  


When are redim statement and preserve keyword used in the vbscript language?

0 Answers  


i have to open a notepad having no. of words in dat file by recording in qtp and then find a particular word and display true or false

0 Answers  


what is diff between static and dynaic arrys?

0 Answers  


Categories