Hi
I am still learning and apologize for insulting anyones intelligence...
How do you get out of a For/Next loop with
If x=y then (get out of loop)
Suffering brain fog at the moment
Thanks
Mike
Printable View
Hi
I am still learning and apologize for insulting anyones intelligence...
How do you get out of a For/Next loop with
If x=y then (get out of loop)
Suffering brain fog at the moment
Thanks
Mike
VB Code:
If x = y Then Exit For
Quote:
Originally Posted by Hack
Thanks
However I get "Next without for Error"
VB Code:
For z = 0 To 19 If (a + z + 1) > 20 Then Exit For If Abs(Text2(0 + z).Text - Text2(a + z + 1).Text) <= y Then w = w + 1 Next z
That makes sense. :D You need to add an End If after your Exit For.Quote:
Originally Posted by leachim
Yep
Works
It also works without the End If if you have "Then Exit For" on the same line.
I have the "Idiots Guide to VB 6" - although Seem to learn better from Video or DVD - Is there such a resource ?
The Idiots Guide doesn't tell me what I have just learnt - Can you recommend a book/video that is easy to learn from
Thanks Again
Mike
This is my Bible!!!!!!!!Quote:
Originally Posted by leachim
See if you can get a used copy (I believe it is out of print).
My Bible is Tricks of the 3D Game Programming Gurus. ;)
Just ordered one for $11 inc delivery to UK !!
Forgot to ask what they were new !!
1 drawback is that it was written for VB 5 ?
Mike
I've had it for years and years and still refer to it occassionally.Quote:
Originally Posted by leachim
There are features of VB6 not found in VB5, that is true, however, it will cover the vast majority of things that you will be interested in learning.
Also, take a look as some of these links. I have no idea what is good or bad, but some of the titles sound like something you would be interested in.