|
Hah, calling my bluff eh?
The most likely reason to want to break out of a "For Each" loop is because you were looking for something, and you've found it.
As a trivial example, say you know that your script was started as "kix32.exe myscript.kix" and you wanted to know where the kix32.exe executable was?
The way to do it is to check the current directory, and then each directory in your %PATH% environment variable until you find it. Once you've found it you don't need (or want) to process the rest of the directories in your path.
Similarly you may be looking for the key in an ini file which has a specific value, or in a list returned from a LDAP query, or perhaps you are totalling values in a list and have exceeded a maximum so there is no point in further processing.
Those are just off the top of my head, I'm sure you can easily think of more appropriate examples.
|