I am trying to create one more array from an existing array.
For that, I tried to set size of the new array from the size of existing array, but getting error.
---------------------------
Windows Script Host
---------------------------
Script: C:\Users\UReddy\Desktop\B.VBS
Line: 7
Char: 8
Error: Expected integer constant
Code: 800A0402
Source: Microsoft VBScript compilation error
---------------------------
OK
---------------------------
My VBScript code:
Public Sub DisplayArray(aArray)
MsgBox(Join(aArray, vbNewLine))
End Sub
Public Function getMSPVersions(aArray)
maxSize = UBound(aArray)+1
Dim a(maxSize)
Dim sCount = -1
For Each sValue in mspfilelist
sCount = sCount + 1
a[sCount] = ExtractVersionFromMSP(sValue)
Next
getMSPVersions=a
End Function
Public Function ExtractVersionFromMSP(txt)
txt1 = Replace(txt,"SizingSuite_","")
txt1 = Replace(txt1,"_Update","")
txt1 = Replace(txt1,".msp","")
ExtractVersionFromMSP=txt1
End Function
MsgBox(getMSPVersions(Array("SizingSuite_2.0.2.2_Update","SizingSuite_2.0.3.3_Update","SizingSuite_2.0.4.1_Update")))
Please suggest how to fix this.