Previous Topic

Next Topic

Book Contents

Book Index

String Expansion

Some of the commands and functions in the FireScript language take strings as arguments. To these you may either pass a string variable or a string literal surrounded by double quotes, e.g. “This is a string.” To put a double quote inside a string, preface it with the percent sign '%'. The percent sign '%' is used as an escape character to embed variables and quote characters in strings.

The sequence %% is replaced by a single %.
The sequence %" is replaced by ".
% followed by the name of a variable is replaced by the value of the variable.

For example, the script statement below:

send ("OPEN %HostAddress")

If HostAddress is equal to “ftp.progress.com” when this script is invoked, the command will be expanded to:

send ("OPEN ftp.progress.com")

the expression,

contains (lastreply, "%% full")

will be expanded at runtime to:

contains(lastreply "% full")

and the statement

send ("SITE SETLOG %"f:\log files\access.log%" -clear")

the expanded string sent will be:

SITE SETLOG "f:\log files\access.log" -clear

Passing a string variable is equivalent to, but faster than passing a string literal that expands the variable.

Example:

isempty(FwPassword)

is equivalent to but faster than

isempty("%FwPassword")

See Also

FireScript Editor

What is a FireScript?

FireScript Components

The Connection Sequence

The FireScript Language

FireScript Variables

Function Expressions

FireScript Statements

SSL Statements

FireScript Key Words

FireScript reserved words