Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Mundelein, Illinois, USA
    Posts
    198
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Type mismatch in split? (VBS)

    I have a VB Script where I use the split function. In earlier versions of the script it worked fine but now I keep getting a Type mismatch on the line "text_array = Split("This.is.text.junk", ".", 3, 1)". I wrote a simple scipt to test it and it still errors.

    I give, can anyone help?

    Dim text_array(2)

    text_array = Split("This.is.text.junk", ".", 3, 1)

    msgbox(text_array(0) & vbcrlf & text_array(1) & vbcrlf & text_array(2))

    Thanks,
    Thanks,

    C DeWitt

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Type mismatch in split? (VBS)

    Don't specify the dimensions of text_array:

    Dim text_array

  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Mundelein, Illinois, USA
    Posts
    198
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Type mismatch in split? (VBS)

    I didn't dimension it before and it complained about out of bounds subscripts so I put it in. Who knows, but it seems to work now.

    Thanks,
    Thanks,

    C DeWitt

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •