So here I am, trying to simply work with arrays in TestComplete, in VB. I am getting nowhere fast.
I dream of using arrays without hassle, and with ample support methods like AddItem and such. Plain 'ol arrays in VB aren't working well for me, and of course, errors out when I try to use it.
Searching high and low for some very basic sample code in vb to incorporate has resulted in failure. What I'm looking for is an array of strings. Those strings are a list of files in a directory. I have a simple loop to enumerate files in a list. I figure drop an AddItem statement in the loop & call it a day.
Can someone throw me a bone here? I am tired of "type mismatch" and "object required" errors here. I don't even know what the syntax is to declare an arraytype object. That's my current stumbling block.
Here's a quick sample of how to use ODT Data Groups and Variables to create quick, loopable arrays. I don't have a loop built into this code but, hopefully, this should give you some of the basic syntax. Without knowing more about what you have tried I'm afraid I can't do much more.
The above code works great in DelphiScript. I'm not a VB script dude so the best I can do is
<font class="small">Code:</font><hr /><pre>
if IsSupported(ODT.Data, "TestArrays") then
set DataGroup = ODT.Data.AddGroup("TestArrays")
set ArrayVar = DataGroup.AddVarOfArrayType("FileNames")
Automated Testing Evangelists
Definition expert - noun - Unknown drip under pressure