|
-
Jan 10th, 2007, 08:43 PM
#1
Thread Starter
Hyperactive Member
I need help... please help...
ok here is my code...
VB Code:
For i = 1 To 138
Set ini = New Class1
With ini
.File = App.Path & "\worlds.ini"
location = .GetValue("World" & i, "Location")
types = .GetValue("World" & i, "Type")
flag = .GetValue("World" & i, "Flag")
If types = "Members" Then
End If
Set list_item = listview1.ListItems.Add(, , location)
list_item.SubItems(1) = i
list_item.SubItems(2) = Server_Players(i, strhtml)
list_item.SubItems(3) = types
End With
Next i
and I need to make it go to the next i under this:
VB Code:
If types = "Members" Then
and I cant use a there because you cant do that... so how do I do this?
Visual Basic Rules!!!!! 
-
Jan 10th, 2007, 08:50 PM
#2
Hyperactive Member
Re: I need help... please help...
maybe something like this would work?
VB Code:
For i = 1 To 138
Whatever:
Set ini = New Class1
With ini
.File = App.Path & "\worlds.ini"
location = .GetValue("World" & i, "Location")
types = .GetValue("World" & i, "Type")
flag = .GetValue("World" & i, "Flag")
If types = "Members" Then
i = i+1
goto Whatever
End If
Set list_item = listview1.ListItems.Add(, , location)
list_item.SubItems(1) = i
list_item.SubItems(2) = Server_Players(i, strhtml)
list_item.SubItems(3) = types
End With
Next i
 Base 2
Fcnncu"Nqxgu"Lguug##
-
Jan 11th, 2007, 05:58 AM
#3
Thread Starter
Hyperactive Member
Re: I need help... please help...
yea that worked great thanks... if anyone else has another way then let me know...
Visual Basic Rules!!!!! 
-
Jan 11th, 2007, 06:54 AM
#4
Re: I need help... please help...
How about
VB Code:
For i = 1 To 138
Set ini = New Class1
With ini
.File = App.Path & "\worlds.ini"
location = .GetValue("World" & i, "Location")
types = .GetValue("World" & i, "Type")
flag = .GetValue("World" & i, "Flag")
If types <> "Members" Then
Set list_item = listview1.ListItems.Add(, , location)
list_item.SubItems(1) = i
list_item.SubItems(2) = Server_Players(i, strhtml)
list_item.SubItems(3) = types
End If
End With
Next i
-
Jan 11th, 2007, 07:36 AM
#5
Re: I need help... please help...
Just make the loop pass once if type is not "Members"
If types <> "Members" Then Exit For
-
Jan 11th, 2007, 07:47 AM
#6
Re: I need help... please help...
 Originally Posted by leinad31
Just make the loop pass once if type is not "Members"
If types <> "Members" Then Exit For
If you Exit the For/Next there is the possibility of some records not being processed depending on when it does hit "Members"
-
Jan 11th, 2007, 10:47 AM
#7
Re: I need help... please help...
@half flung pie
NEVER manipulate a loop counter from within the loop. there's no guarantee that, in some future version, or in some other language, the loop counter variable is actually checked every iteration. Some compilers generate code that keeps a local copy of the "variable" - sort of like passing a variable to a sub ByVal - so nothing you do to the counter variable will change the execution of the code. (Other compilers produce code that will crash if you make the loop counter larger than the 'To' value in order to exit the loop prematurely.)
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
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
|