Ask Your Question
0

force increment a for/next loop?

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 close merge delete

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
Login/Signup to Answer

Question Tools

1 follower

Stats

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

Seen: 57 times

Last updated: Jun 19 '16