Local Variables

You can define local variables with the .set_object and .set_value macros

For more information, see .set_object and .set_value macros. Local variables are only visible in the scope where they are defined and inside its inner scopes.

Volatile attributes may be defined through the .set_object and .set_value macros.

If the Scope Is an Object Scope:

A volatile attribute is defined. This attribute will be available on the corresponding object regardless of the scope hierarchy. Volatile attributes shadow standard attributes. Once defined, they remain available until the end of the current generation process.

The "this" keyword returns an object scope and allows you to define volatile attributes on the object which is active in the current scope.

If the Scope Is a Template Scope:

, a standard local variable is defined.

Examples:

.set_value(this.key, %Code%-%ObjectID%)

defines the key volatile attribute on the current object

eg. .set_object(this.baseClass, ChildGeneralizations.First.ParentObject)

defines the baseClass object-type volatile attribute on the current object.

Dereferencing Operator

Variables defined through the set_object macro are referred to as local objects, whereas those defined with the set_value macro are called local values. The * dereferencing operator may be applied to local values.

The * operator allows for the evaluation of the variable whose name is the value of the specified local variable.

%[.formatting-options:]*local-variable%

For example, the following code:

.set_value(i, Code)
%*i%

Is equivalent to:

%Code%