Switch group

These variables are Switch-specific. The third column indicates the scripting API function that returns the variable's dynamic value.

Variable name

Data type

Scripting API equivalent

Switch.Calculation

Rational

This allows you to use variables (that are by default treated as text) to do calculations.

It is also possible to manually enter this syntax while selecting other variables. Therefore, you can perform calculations on variables that result in a number anywhere in the Switch application, provided you have access to the variables pane from there.

Example of the Calculation variable syntax : [Switch.Calculation:Expression = "[Stats.PageHeight] *0.352777778",Precission="1"] x [Switch.Calculation:Expression = "[Stats.PageWidth] *0.352777778",Precission="1"]

Switch.Counter Text -- (see below)

Switch.Date

Date

-- (the current date/time)

Switch.ElementName

Text

Switch.getElementName()

Switch.FlowName

Text

Switch.getFlowName()

Switch.Language

Text

Environment.getLanguage()

Switch.LanguageEnvironment

Text

Environment.getLanguageEnvironment()

Switch.ServerName

Text

Environment.getServerName()

Switch.OutgoingName

Text Indexed

A list of names for the outgoing connections in alphabetical order; if a connection name is empty the target folder name is used as a fallback; if the folder name is empty as well, the connection is not listed

Script that iterates over connections, determines the (fallback) name and sorts the list

Counter operation

The Switch.Counter variable evaluates to an automatically incrementing decimal integer with a fixed number of digits. For example, if the variable has never been used before, it will evaluate to "00001". Next time, it will evaluate to "00002" and so forth. After the counter reaches "99999" it circles back to "00000".

The most recently used value of the counter is retained across multiple invocations of the Switch server.

Counter: number of digits

The Width argument specifies the number of decimal digits in the number; leading zeroes are inserted when needed. The default value for width is 5; the minimum value is 1 and the maximum value is 15. An invalid value is replaced by the nearest valid value.

The internal counter is always 15 digits wide; the Width argument specifies how many of the right-most digits are actually shown.

Identifying counters

A counter variable refers to a particular physical counter through an identifier (ID). Switch uses the same physical counter for all counter variables with the same ID, even if these variables are used in properties of a different flow element or in a different flow (in the same Switch instance). A physical counter is incremented each time a counter variable with its ID is evaluated, regardless of where the variable occurred.

A counter variable can explicitly specify an ID or it can rely on the default value.

If the "ID" argument is present and has a non-empty value, this explicitly specifies the ID. Otherwise a default ID is generated that is unique to the flow element in which the counter is used. This makes the counter variable "local".

If a property uses the same counter variable more than once, each invocation of the variable is deemed a new invocation and will cause the counter to be incremented. For example, assuming no counters have been used yet in a flow element, the property value

Demo [Switch.Counter] - [Switch.Counter]

evaluates to

Demo 00001 - 00002