![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am writing an ActiveX Script using VB Script Language in my DTS. One place I have to use a FOR EACH .. NEXT statement. Now there is a condition i am checking inside this statement and if it pass i want to go to the next element without executing the rest of the statements in the loop. Now this is very basic question but i could not find a statement which allows me to do that. I tried LOOP but it is giving me this error message : |
#3
| |||
| |||
|
|
In message <OUwHAzGNEHA.1312 (AT) TK2MSFTNGP12 (DOT) phx.gbl>, J Y jy1970us (AT) hotmail (DOT) com> writes I am writing an ActiveX Script using VB Script Language in my DTS. One place I have to use a FOR EACH .. NEXT statement. Now there is a condition i am checking inside this statement and if it pass i want to go to the next element without executing the rest of the statements in the loop. Now this is very basic question but i could not find a statement which allows me to do that. I tried LOOP but it is giving me this error message : You can use Exit For, like this Dim bFlag For Each object In collection If object.Property = True Then 'Set something to say we exited because of test, not just fall out bottom bFlag = True Exit For End If Next If bFlag Then ' We found what we wanted Else ' Just ended loop when we ran out of work End If -- Darren Green (SQL Server MVP) DTS - http://www.sqldts.com PASS - the definitive, global community for SQL Server professionals http://www.sqlpass.org |
#4
| |||
| |||
|
#5
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |