Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Accessing an array returned from a function
#2
Solved: 11 Years, 6 Months, 2 Weeks ago
Code:
Function MyFunction
Dim MyCtrl(1)
MyCtrl(0) = "First String"
MyCtrl(1) = "Second String"
MyFunction = MyCtrl
End Function

'Now access the array from the above function
Code:
Dim CtrlName
CtrlName = MyFunction ' get Type Mismatch at this line
for i=0 To Ubound(CtrlName)
MsgBox CtrlName(i)
next
Check the above code it is working. The variable that will receive the resulting array must be declared as dynamic
Reply


Messages In This Thread
RE: Accessing an array returned from a function - by swathi - 03-28-2012, 02:19 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Calling a function in a Test Script from a function library anupam4j 3 6,304 06-26-2015, 12:31 AM
Last Post: babu123
  How to convert a single dimension array to two dimensional array venkatesh9032 3 5,780 02-10-2014, 03:07 PM
Last Post: pranikgarg
  Accessing Environment variable value in Library file vishruth143 1 2,659 09-07-2013, 05:11 AM
Last Post: jacosta
  Adding array to another Global array in VB Script test911 1 3,271 12-02-2012, 12:40 PM
Last Post: parminderdhiman84
  ACCESSING OBJECR REPOSITORY SHARED ONE babukaturi 1 2,667 04-03-2012, 12:03 PM
Last Post: sshukla12

Forum Jump:


Users browsing this thread: 1 Guest(s)