Results 1 to 7 of 7

Thread: [RESOLVED] [Solved] VBScript: Split String...

Threaded View

  1. #1

    Thread Starter
    Frenzied Member wpearsall's Avatar
    Join Date
    Feb 2002
    Location
    England / UK
    Posts
    1,065

    Resolved [RESOLVED] [Solved] VBScript: Split String...

    Hi guys,,

    I need to split incoming data into seperate items of an array... now in Visual Basic this is easy...

    in VBScript: i dunno why but its crapped up.

    I need to use it like the following:

    VB Code:
    1. Sub wskScript_DataArrival(Index, bytesTotal)
    2. 'On Error GoTo ErrHand:
    3. 'On Error Resume Next
    4.  
    5.     Dim SplitDataA(), DataArrival(), DataRecieved
    6.     Dim i
    7.    
    8.     wskScript(0).GetData DataRecieved, vbString
    9.    
    10.     SplitDataA() = Split(DataRecieved, " ## ")
    11.    
    12.     For i = 1 To UBound(SplitDataA())
    13.         DataArrival() = Split(SplitDataA(i), " :$: ")
    14.        
    15.         Select Case DataArrival(0)

    only problem is:

    when i get to the following code:

    VB Code:
    1. SplitDataA() = Split(DataRecieved, " ## ")

    i get the following error come up:

    Error> 9 - Subscript out of range: 'SplitDataA' on line 145
    has anybody got a clue of why this error is coming up?...

    i know for a fact data is coming, cuz i added a message box like:
    Code:
        wskScript(0).GetData DataRecieved, vbString
    msgbox DataRecieved
    and it come up with:
    ---------------------------
    VBScript
    ---------------------------
    ## cmdDL :$: LT ## cmdSN :$: 127.0.0.1
    ---------------------------
    OK
    ---------------------------
    anyone got a clue on dis one?.. its prolly jst the fact of the vb / vbscript differences.... but :shrugs:
    Last edited by wpearsall; Feb 1st, 2004 at 04:37 PM.
    Wayne

Posting Permissions

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



Click Here to Expand Forum to Full Width