decorative banner

Previous | Next               Table Of Contents > 1 Basic syntax > 1.7 List manipulation loops

1.7 List manipulation loops

A list based loop statement consists of the keyword foreach followed by a list item name, the keyword in, the list name, and a statement block. The statement block is mandatory.

The syntax is

foreach <list item name> in <list name> begin


The list is filled using the ftpgetlist command and the foreach loop is used to access each file or folder item on the list.

Some examples are

foreach $list_item in @my_list begin

print "item name is ", $, " and size is ", $list_item.size;


Previous | Next