I am working on exiting VBScript code having with..end with loop. I need break/exit the loop on a certain condition, how can I break or exit from With..End With loop in VBScript
Thanks in advance
I am working on exiting VBScript code having with..end with loop. I need break/exit the loop on a certain condition, how can I break or exit from With..End With loop in VBScript
Thanks in advance
With is not a looping construct. Something similar to this as an example will work as I credit Lankymart with stating above:
This is designed to loop 10 times but will exit on the If/Then condition of 5 and the Exit Do will execute
Do While x < 10
x = x + 1
wscript.echo x
if x = 5 then Exit Do
Loop
or...
For x = 0 to 10
x = x + 1
wscript.echo x
if x = 5 then Exit For
Next