COUNTELEMENTS

Returns the number of elements of the specified list.

Syntax: COUNTELEMENTS(list)

  • list: A list which number of elements will be counted.

See also:

GETLIST
Lesson 5: Handling file lists


Command history:

This command was added in ScriptFTP version 3.2 as a hidden command but was finally documented for the v3.3.

Examples:

# Get the remote file listing, store it in $list
GETLIST($list,REMOTE_FILES,"*.txt")

# Calculate the number of elements in the list
$number_of_elements=COUNTELEMENTS($list)

IF($number_of_elements>0)
  PRINT("Found ".$number_of_elements." text files")
ELSE
  PRINT("No text files found")
END IF