Results 1 to 5 of 5

Thread: split-problem[solved]

  1. #1

    Thread Starter
    Addicted Member vigge89's Avatar
    Join Date
    May 2002
    Location
    Sweden
    Posts
    172

    split-problem[solved]

    i have the following code in one of my projects:
    VB Code:
    1. bg_dim() = Split(ReadINI("dimensions", "bg", skin), ",")
    2.     frmMain.Width = bg_dim(0)
    3.     frmMain.Height = bg_dim(1)

    The thing is that something's making the function quit after the Split()-line, nothing below gets executed. Can anyone find something worng in the code?
    Last edited by vigge89; May 4th, 2004 at 04:37 AM.


  2. #2
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670
    1. Have you tried stepping through the code in debug mode?

    2. Try splitting the line out:

    VB Code:
    1. Dim tmpStr As String
    2. tmpStr = ReadINI("dimensions", "bg", skin)
    3. bg_dim() = Split(tmpStr, ",")

    to see which part is causing the problem. It may be because the ReadINI is returning a NULL or something like that.
    'Buzby'
    Visual Basic Developer
    "I'm moving to Theory. Everything works there."

  3. #3

    Thread Starter
    Addicted Member vigge89's Avatar
    Join Date
    May 2002
    Location
    Sweden
    Posts
    172
    tested this code:
    VB Code:
    1. Dim tmpStr As String
    2.     tmpStr = ReadINI("dimensions", "bg", skin)
    3.             MsgBox "BG-dimensions: '" & tmpStr & "'"
    4.     bg_dim() = Split(tmpStr, ",")
    5.         If bg_dim(0) = Null Then MsgBox "bg_dim(0) = NULL!"
    6.         If bg_dim(1) = Null Then MsgBox "bg_dim(1) = NULL!"
    7.     MsgBox "Split succeded!"
    8.     frmMain.Width = bg_dim(0)
    9.     frmMain.Height = bg_dim(1)

    tmpStr gets loaded succesfully, returning "220,25", however, no messagebox containing "Split succeded" popped up, the code after doesn't get executed, it jumps straight out of the function, and i don't have any Error handling, so there aren't any errors.


  4. #4

    Thread Starter
    Addicted Member vigge89's Avatar
    Join Date
    May 2002
    Location
    Sweden
    Posts
    172
    hmm, found a "On Error Resume Next" in the sub that executes that code, if i take it away, i get Type Missmatch on the line containing
    VB Code:
    1. bg_dim() = Split(tmpStr, ",")

    anyone got a solution?


  5. #5

    Thread Starter
    Addicted Member vigge89's Avatar
    Join Date
    May 2002
    Location
    Sweden
    Posts
    172
    found a solution, nevermind...


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