decorative banner

Previous | Next               Table Of Contents > 1 Basic syntax > 1.4 Strings, numbers, variables and lists

1.4 Strings, numbers, variables and lists


A string is any group of characters enclosed in quotes. Strings may also contain wildcards such as * and ?. A number is any value between 0 and 2^32.

A variable is represented by a ~ character followed by alphanumeric or underscore characters. A variable may contain either string or numerical values and will be treated as a string or number depending on the context in which it is used. A variable is automatically created and initialized to an empty string at the point of first use.

Some examples are

"this is a string" #string

45 #number

~my_variable #variable

@my_list #list

 

A list is represented by a @ character followed by alphanumeric or underscore characters. Lists represent the contents of a folder and can contain zero or more items. Each item represents a specific file or folder. Lists can be set using the ftpgetlist command and each item in a list can be accessed using the foreach loop. Each list item is represented by a $ character followed by alphanumeric or underscore characters and contains the following properties:

.name        file or folder name string
.isfolder    flag set to false for file and true for folder
.size        size of the file in bytes
.modtime     modification time string in YYYYMMDDhhmmss format (Y=year, M=month, D=day, h=hour, m=minute, s=second)

Some examples are

@my_list #list

$list_item #list item

$list_item.size #size property of list item


Previous | Next