Please enable JavaScript to view this site.

ESL Documentation

The copy action statement assigns a new value to a variable. Any existing value of the variable to which you are copying is replaced by the new value.

For example:

 

# The floating point value 1473.69 is copied into the

# floating point variable TotalSales:

 

response to start

    copy 1473.69 to TotalSales

 

In the following example, the string literal "OK" and the value of the string variable FirstStatus are copied into the variable StatusMessage. When more than one value is copied to a string variable, the values are concatenated. If FirstStatus contains the string "ChecksOut", the value of StatusMessage after the copy statement executed is "OKChecksOut".

 

response to Acknowledge

    copy "OK" FirstStatus to StatusMessage

 

You can also copy selected text from a textual region to a variable using the copy statement. See Textual Regions for more information.

 

When you copy a value to a variable, the type of variable determines the type of value that ESL expects. If the new value is of a different type, ESL will try to convert the value to the expected type. Type conversions are discussed in the Reference Guide.