VBScript for Returning more than one value from a function
‘More than one value can returned from a function using Array Variable
‘Following function returns more than one value from a function i.e fnFunctionToReturnMoreThanOneValue
Function fnFunctionToReturnMoreThanOneValue()
x=”
www.ramupalanki.com”y=”QTP”
fnFunctionToReturnMoreThanOneValue=Array(x,y)
End Function
x=fnFunctionToReturnMoreThanOneValue()
‘Calling and assigning the array values to the variable
‘displaying both the returned original x and y values
MsgBox x(0)
MsgBox x(1)
Notepad: Copy the above code into the Notepad, save it as ScriptToReturnMoreThanOneValue.vbs and double click the file