Hi guys,
i'm upgrading some big chunks of vb6 codes into .NET and I'm getting a few
errors like this one below:
Error 40 'GoTo xxx' is not valid because 'xxx' is inside a 'For' or 'For Each' statement that does not contain this statement.
Now, I know that it's bad practice to use Goto in the first place(spaghetti all over)..but I got the code as it is. i didn't write it. i just try to upgrade it and get it to work..
I think one solution to use a Sub/function to do this.?
Problem is there are some hundreds of lines of code under 'xxx' and I think there are many variables to take care of.
I'm just wondering, whether there's a way maybe by replacing 'For' loop with 'Do while ' that'll get rid of this error?? please let me know
Thanks.


Reply With Quote

