vbscript - QTP: How can I return multiple Values from a Function -


I am trying to write a function that can return many values ​​from the function, which contains 2 arguments.

Example:

  function sample_function (arg1, arg2) '' # # some code ................. passenger = List 1 (0) Name1 = list1 (1) age1 = list1 (2) seatNumber = list1 (3) '' # this is an incomplete function ... end function sample_function  

sample_function here In this function called 2 argument arg1, arg2. When I call this function in my driver script like value = sample_function (2, name_change), this function will return me passenger, name 1, age 1, seat number number.

How can I get it?

Edit (Lb): The QTP test uses VBScript to specify the routine, so I retagged it in VBScript, VB because the solution is probably within VBScript .

  function foo () foo = array ("hello")   

A direct solution must return an array:, "world") end function x = foo () MsgBox x (0) MsgBox x (1)

If you use only one batch of values ​​more than once, then it can pay to create a user defined class:

  class user's public name public seat end Class function bar () dim R set r = new user r.name = "JRUser" r.seat = "10" set bar = R and set function X = bar () MsgBox x.name MsgBox x.seat  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -