Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

IF will not accept END IF

$
0
0
I have a series of FOR statements, 20 of them, and an IF statement at the end before the NEXT statements. The whole thing is inside another IF statement. My problem is that the last IF statement will not accept the END IF (the IF, END IF in red). I also note that the second NEXT appears to be outside the IF statement because the indent is wrong. It seems that I can't put the NEXT statements inside an IF statement. Please tell me the correct way to go about this.
Thanks

Code:

If flag Then
        code
            For p0 = 0 To Left(0)
                code
                For p1 = 0 To Left(1)
                    code
                    For p2 = 0 To Left(2)
                        code
                        For p3 = 0 To Left(3)
                            code
continue P4, P5 etc until P19
                                                    For p19 = 0 To Left(19)
                                                        code                                                       

                                                        If a < 0 Then
                                                        Next
                                            Next
                                        Next
continue until all NEXT           
          Next
 
        End If
        End If


Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>