Script don't work : Split function

Discussion created by janggj on Jul 2, 2009
Latest reply on Apr 8, 2015 by jgardner


I make program using VBscrip in PADS.

But I encounter difficulty.


The problem is split function.


Whenever I use split function at my script,

   the script has problem.


  "Expecting an already dimensioned array"


I don't know why the syntax has problem.

For example, I wrote simple script.


Sub Main

    Dim jArray() As String

    Dim lTemp As String


    lTemp = "abc,def,jgj"


    jArray = Split(lTemp, ",")        ' Error


    For i = 0 To UBound(jArray)

        MsgBox jArray(i)


End Sub




Reference manual about "Split" function ================================


Syntax          : Split(Str, [Sep], [Max])
Description : Return a string array containing substrings from the original string.

Parameter Description ----------------
   Str             : Extract substrings from this string value.
   Sep          : Look for this string value to separate the substrings. (Default: " ")
   Max          : Create at most this many substrings. (Default -1, which means create as many as are found.)