Ask Your Question
0

force increment a for/next loop? [closed]

asked 2016-06-19 19:33:04 +0100

paul1149 gravatar image

I've got some macro code like this:

For i = 1 to 200
x = Fx(something)

if isnull(x) then
    Next 
end if  

<some code>
Next

I'm testing to see if x is null. If it is, I want to go to the top of the For/Next loop and increment i and start again. But this code draws an error on the "end if", saying it's an orphan (no "if" statement).

So is this possible, or do I need a different kind of loop, or different routing?

Thanks.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2020-09-08 12:07:09.951572

1 Answer

Sort by » oldest newest most voted
0

answered 2016-06-19 20:25:36 +0100

paul1149 gravatar image

Duh!:

For i = 1 to 200
x = Fx(something)

if isnull(x) then
    goto Nexti
end if  

<some code>
Nexti
Next
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-06-19 19:33:04 +0100

Seen: 90 times

Last updated: Jun 19 '16