cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community email notifications are disrupted. While we are working to resolve, please check on your favorite boards regularly to keep up with your conversations and new topics.

Exit While problem

Raiko
16-Pearl

Exit While problem

Hello all,



I don't understand what's wrong with my code. I use it in a textbox and get an error notification from the editor (see attached pic).

The code (in my eyes) is straight forward and should compute.



ni=0

While M(ni) < d88

ni=ni+1

If ni > N Then

Exit While

End If

Wend



Can anybody help?



Raiko

P.S.
The message below says that a compilation error was encountered and a "sub" was expected
2 REPLIES 2
StuartBruff
23-Emerald II
(To:Raiko)

On 11/26/2009 7:56:47 AM, raiko01 wrote:
== I don't understand what's wrong with my code. I
use it in a textbox and get an error notification
from the editor (see attached pic).
== The code (in my eyes) is straight forward and
should compute.
== ni=0
== While M(ni) < d88
== ni=ni+1
== If ni > N Then
== Exit While
== End If
== Wend

I don't think there is an 'Exit While' in
VBScript.

The following might do what you want:

Do While M(ni) < d88
ni=ni+1
If ni > N Then
Exit Do
End If
Loop

Stuart

Thank you Stuart, you made my day!
And you're right. There doesn't seem to be an Exit While in VB script.
Raiko
Top Tags