<< back to sysax.com Product page

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.

Exhibit 1.9. Syntax of list manipulation loop statement

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

end

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

Exhibit 1.10. Example for using the list manipulation loop statement

foreach $list_item in @my_list begin

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

end