Search notes:

VBScript: for each … next

Iterating over strings

The following example uses an array to make it possible ot iterate over strings. Each string is assigned to the variable word and printed (using wscript.echo).
option explicit

dim word
for each word in array("foo", "bar", "baz")
    wscript.echo(word)
next
Github repository about-VBScript, path: /language/for-each/iterate-over-strings.vbs

See also

VBScript

Index