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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Exit While problem

Raiko
17-Peridot

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 III
(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
Raiko
17-Peridot
(To:StuartBruff)

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

Top Tags