|
-
May 4th, 2004, 02:57 AM
#1
Thread Starter
Addicted Member
split-problem[solved]
i have the following code in one of my projects:
VB Code:
bg_dim() = Split(ReadINI("dimensions", "bg", skin), ",")
frmMain.Width = bg_dim(0)
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.
-
May 4th, 2004, 03:30 AM
#2
Frenzied Member
1. Have you tried stepping through the code in debug mode?
2. Try splitting the line out:
VB Code:
Dim tmpStr As String
tmpStr = ReadINI("dimensions", "bg", skin)
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."
-
May 4th, 2004, 03:44 AM
#3
Thread Starter
Addicted Member
tested this code:
VB Code:
Dim tmpStr As String
tmpStr = ReadINI("dimensions", "bg", skin)
MsgBox "BG-dimensions: '" & tmpStr & "'"
bg_dim() = Split(tmpStr, ",")
If bg_dim(0) = Null Then MsgBox "bg_dim(0) = NULL!"
If bg_dim(1) = Null Then MsgBox "bg_dim(1) = NULL!"
MsgBox "Split succeded!"
frmMain.Width = bg_dim(0)
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.
-
May 4th, 2004, 04:35 AM
#4
Thread Starter
Addicted Member
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:
bg_dim() = Split(tmpStr, ",")
anyone got a solution?
-
May 4th, 2004, 04:37 AM
#5
Thread Starter
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|