I am having major problems with using a simple one dimensional array in the Workflow scripting.
What I am trying to do is to set a set of User Defined fields based on a string. I load my array using a split command (although I have also tried loading it using a loop) and then pulling the values back out into Test Fields.
Here is my code (from the Test Plan Module):
On Error Resume Next
set Levels = "SYSTEMS\SmartMetering\AMB\AMB3\Functional\ATD AL Interface\Methods\AddOrder" 'subject.path
set myarray = Split(Levels, "\",-1,1)
set Test_Fields("TS_USER_02").Value = myarray.Item(2)
set Test_Fields("TS_USER_03").Value = myarray.Item(3)
set Test_Fields("TS_USER_04").Value = myarray.Item(5)
set Test_Fields("TS_USER_06").Value = myarray.Item(6)
If UBound(myarray) > 6 Then
set Test_Fields("TS_USER_07").Value = myarray.item(7)
set Test_Fields("TS_USER_07").Value = "N/A"
If UBound(myarray) > 7 Then
set Test_Fields("TS_USER_08").Value = myarray.item(8)
set Test_Fields("TS_USER_09").Value = "N/A"
On Error GoTo 0
Eventually I want Levels to contain the subject.path but I want to get the Array working first. If I replace the myarray.Item(2) with a string ("TEST") then it works fine putting that string into the Field. Even the second part with the If commands do not work though which is a little odd. I would have thought if there is nothing in the array then it would put the "N/A" into the field?
I have tried putting this code into an Excel Macro (obviously with a number of changes to make it work) and the array part works fine. Have I hit a bug with Arrays in the Workflow scripting? Has anyone managed to get Arrays working ok like this?