The Percent Sign in AutoMate

Applies To: AutoMate 6, AutoMate 5
Published: 10/12/04 , modified May 16, 2006

Introduction

A percent sign is used as a special character in AutoMate to indicate the beginning and end of an expression. For example: %1+1% inside a task will resolve to 2 at runtime. To send a literal percent sign simply escape the percent character.

Example:

  • To send the text "5%" specify "5%%"
  • At runtime the double percentage signs will be recognized and converted into one.
  • Doubling the percent sign is known as "escaping the percent sign."

Concatenating Two Values in an Expression

In some cases, it is necessary to concatenate two variables, functions, or some combination thereof. In this case it is critical to remember that two percent signs always mean a literal percent. So the following will not work:

  • %variable1%%variable2% (NOT ALLOWED)

At runtime AutoMate would actually see the following "expression":

  • variable1%variable2

Which would result in a Syntax Error. The proper way to combine two values in an expression is to use the ampersand (&) character as follows:

  •  %variable1 & variable2%

This will properly concatenate the two values.