Announcement

Collapse
No announcement yet.

Split a string function in VBScript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • vasrc
    replied
    Like I said, try VB.net.. I think it's more structured (ie consistent)

    Is Vbscript supported on Mono (ie Linux)??

    Z

    Leave a comment:


  • neutron
    replied
    Originally posted by vasrc View Post
    Try not DIMming the array.

    I like VB.net better than vbscript, it seems better behaved.

    Z
    Thanks for your help, for some reason I need to DIM the array as a normal variable, then everything works. so instead of DIM ARRAY(x) it has to be just DIM ARRAY

    seems strange but whatever works

    Thanks for your help!

    Leave a comment:


  • tenholde
    replied
    Make sure the extension of your script file is not ".vb"

    tenholde

    Leave a comment:


  • vasrc
    replied
    Try not DIMming the array.

    I like VB.net better than vbscript, it seems better behaved.

    Z

    Leave a comment:


  • neutron
    replied
    Hi Rupp,

    from what I can see (and I'm fully prepared to admit that I'm missing something obvious here) the script should work as I posted it. I'm writing this in VB Script.

    The problem seems to be the split command, that is where HS is putting up the error, but all my reading of VBScript docs seems to say the command is correct.

    Leave a comment:


  • Rupp
    replied
    Check out the example at the bottom for a vb.net example
    http://msdn.microsoft.com/en-us/libr...(v=vs.90).aspx

    For a vb script example see this example:
    http://www.w3schools.com/vbscript/func_split.asp

    Leave a comment:


  • neutron
    started a topic Split a string function in VBScript

    Split a string function in VBScript

    I'm trying to split a string into an array variable (or separate variables), from what I can see in VBScript documentation it should be this:

    Dim String
    Dim Array (4)

    Array=Split("this,is,a,test,split",",")

    or

    Array=Split("this,is,a,test,split",",",-1,1)

    When I run the script in HS3 I get the error:

    Type mismatch in line 348 More info: Type mismatch (the line is the line that command is)

    Can anybody help with what I'm doing wrong?

    Thanks
Working...
X