PROPERTY_RECURSE_ASSIGN()

Syntax

PROPERTY_RECURSE_ASSIGN( Variable1 as P, Variable2 as P )

Argument

Description

Variable1

The name of the destination dot variable.

Variable2

The name of the source dot variable.

Description

PROPERTY_RECURSE_ASSIGN() assigns the sub-elements of one "Dot" variable to another.

If you set one dot variable to another (e.g. dot_var1 = dot_var2), the sub-elements of the assigned dot variable simply point to the original dot variable’s sub-element. However, if you use the PROPERTY_RECURSE_assign() function, the assigned dot variable has its own copy of the sub-elements.

Supported By

Alpha Five Version 5 and Above

Examples

Type the following in the Interactive window:

Family.lastname = "Smith"

Family.father = "John"

Family.mother = "Irene"

Family.children.child1 = "Tim"

Family.children.child2 = "Lara"

b.lastname = ""

property_recurse_assign(b, family)

c = family

? b.lastname -> "Smith"

? c.lastname -> "Smith"

Family.lastname = "Jones"

? Family.lastname -> "Jones"

? b.lastname -> "Smith" (because "B" is its own variable. It does not point to the "Family" dot variable.)

? c.lastname -> "Jones" (because "C" simply points to the "Family" dot variable.)

See Also

Variable Functions and Methods