Beyond FTP Feature Tour
Beyond FTP Script
Editor - Assign Command
Back
to Feature Tour


The Assign command acts to both declare a variable and set
its value. The type of a variable is implicitly determined by the type of
the value being assigned. The three types are string, numeric, and Boolean.
String assignments must begin and end with double-quotes. The only exception
to this rule is the use of the file parsing functions. String type is
assumed for these operations. Strings may include characters, variables, and
wildcard values. Numbers will be converted to their ASCII representation,
and Booleans will be converted to True or False.
Numeric types are edited. Any variables included in a numeric assignment
must previously be assigned numeric values. Only addition and subtraction
are supported as operators. Parentheses may not be used to establish
precedence, since it is unnecessary without additional operations such as
multiplication or division.
Boolean types are the most flexible. The constants true and false are
supported, as well as conditional expressions. There is also the special
Present check that saves the results of a check on a file specification.
Variables must be assigned before they can be used. Once assigned, the
variable value is referenced much like a wildcard value. The reference
begins with a percent sign and the name is included within single quotes.
For example, the variable count would be referenced with %’count’. This
allows variables to appear anywhere within a file name or a string.
Note: Assign commands may not follow conditions or
statements that specify a scope of Each_Server. The Each_Server scope
declaration allows the script to process subsequent commands at different
times for each server name. This makes the value of any assigned variable
ambiguous at any point in time. All variables must be declared and assigned
before reaching any condition that is modified by the Each_Server directive.
A command with All_Servers scope must then occur before assignments can once
again be executed.
Example:
:assign: FileHere = present
c:\temp\test.txt
:assign: Count = %’Count’ + 1
:assign: DoTransfer = (%’FileHere’ OR (%’Count’
< 10))
:assign: Message = “Begin processing on %DW”
:assign: FileDir = GetPath %’FileName’
Back
to Feature Tour

|