#1
|
|||
|
|||
Using VBScript arrays
I want to use VBT to automate software deployments at the office. There are roughly 10 servers I deploy to and they’re split up into two batches. I’ve created arrays to access each server by name and I’d like to access the array variable in VBT. My project in its simple form looks like this:
Foundry (Group) Initialize Batch1 Variables (VBScript) Run Loop (Group Do Stuff Here Do More Stuff Here Increment Counter So the Foundry group initializes some variables and defines an array. The initialize script looks like this. Dim Batch1(5) Batch1(0) = "order1" Batch1(1) = "order2" Batch1(2) = "product5" Batch1(3) = "product6" Batch1(4) = "orderadmin9" Application.Macros(vbldTemporary).Add "SERVER_NUMBER", "0" 'Application.Macros(vbldTemporary).Add "SERVER_ARRAY", Batch1 Application.Macros(vbldTemporary).Add "TOTAL_BATCH1", UBound(Batch1) SERVER_NUMBER is a counter that simply defines how many iterations to run. I define it as 0 here because the first element in the array is always 0. SERVER_ARRAY, which is commented out is where I’d like to pass the array from the VBScript to VisualBuildTool. TOTAL_BATCH1 is just the number of the highest element in the array. What I want to happen is in the loop, certain actions will be performed on %SERVER_ARRAY%(%SERVER_NUMBER%) This should equate to Batch1(0)…(Batch1(4) But I get errors when I try to move the array over into VBT. Any help is appreciated. Last edited by gdanko; 05-27-2003 at 02:51 PM. |
|
|