|
-
Jun 27th, 2004, 03:37 PM
#1
Thread Starter
Hyperactive Member
Code doesnt work when im adding some other code...[Solved]
Hi...
When im adding some code, all of the other code stops working
Here's the code:
VB Code:
If Left$(strData, 9) = "USERLOGIN" Then
strArray2 = Split(strData, vbCrLf)
If ReadINI(App.Path & "\users.ini", Right$(strArray2(1), Len(strArray2(1)) - 13), "Password", vbNullString, 100) = Right$(strArray2(2), Len(strArray2(2)) - 13) Then
'<:-) :WARNING: Empty String assignment updated to use vbNullString
'<:-) :PREVIOUS CODE : If ReadINI(App.Path & "\users.ini", Right$(strArray2(1), Len(strArray2(1)) - 13), "Password", "", 100) = Right$(strArray2(2), Len(strArray2(2)) - 13) Then
If ReadINI(App.Path & "\users.ini", Right$(strArray2(1), Len(strArray2(1)) - 13), "Banned", vbNullString, 100) = "True" Then
'<:-) :WARNING: Empty String assignment updated to use vbNullString
'<:-) :PREVIOUS CODE : If ReadINI(App.Path & "\users.ini", Right$(strArray2(1), Len(strArray2(1)) - 13), "Banned", "", 100) = "True" Then
sckIntro(Index).SendData "BANNED"
Exit Sub
End If
If lstUsers.ListCount < 20 Then
sckIntro(Index).SendData "FULL"
Exit Sub
End If
[b] Dim i As Integer
For i = 0 To lstUsers.ListCount - 1
lstUsers.ListIndex = i
If lstUsers.Text = Right$(strArray2(1), Len(strArray2(1)) - 13) Then
sckIntro(Index).SendData "ALREADYLOGGEDIN"
Exit Sub
Next i
End If[/b]
sckIntro(Index).SendData "GOODLOGIN"
lstActions.AddItem "[" & Format$(Time, "hh:mm:ss") & "] " & Right$(strArray2(1), Len(strArray2(1)) - 13) & " has connected."
AddHScroll lstActions
Else 'NOT READINI(APP.PATH...
sckIntro(Index).SendData "BADLOGIN"
lstActions.AddItem "[" & Format$(Time, "hh:mm:ss") & "] Someone tried to login with a bad username or password!"
AddHScroll lstActions
End If
End If
The code works fine without the bolded part...
When i add it, the code stops working and its giving errors!
What should i do?
Thanks! 
Last edited by mike2; Jun 27th, 2004 at 03:59 PM.
-
Jun 27th, 2004, 03:48 PM
#2
Frenzied Member
You should go into Debug mode and find out where and why its erroring
-
Jun 27th, 2004, 03:55 PM
#3
VB Code:
Dim i As Integer
For i = 0 To lstUsers.ListCount - 1
If lstUsers.List(i) = Right$(strArray2(1), Len(strArray2(1)) - 13) Then
sckIntro(Index).SendData "ALREADYLOGGEDIN"
Exit Sub
End If
Next i
-
Jun 27th, 2004, 03:58 PM
#4
Thread Starter
Hyperactive Member
Ahhh thank you that did it 
How stupid i was...
I had to put next i after end if
Thanks!
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
|