TOC PREV NEXT INDEX

$link

Synopsis

$link _object1 _[object2]

Description

$link adds object2 to object1's array of connections. If both object1 and object2 are either both scalars or arrays, this creates the V connection

object1 => object2;

If object1 is an array and object2 is a scalar, this creates the V connection

object1 => {object2};

If object1 already has a connection and is a scalar item, AVS/Express does not make the new connection and instead prints an error message. If object1 is an array, AVS/Express adds object2 to the array of connections.

This command implements the same operation that the Network Editor uses when it makes a connection.

Examples

For example, you have an integer array object, z, connected to two other objects, x and y:

OM(SingleWindowApp) -> int x, y;
OM(SingleWindowApp) -> int z[] => {x, y};

You then define another integer object, w:

OM(SingleWindowApp) -> int w;

You then add w to z's array of connections:


OM(SingleWindowApp) -> $link z w
OM(SingleWindowApp) -> $print z
int z[] => {x,y,.w};

(The dot before the w, inserted by AVS/Express, is superfluous in this case, and means that w is found at the current level of the object hierarchy.)

To do the same thing with a V modify statement, you would have to rename all of the other connections:

OM(SingleWindowApp) -> z => {x, y, w};

That is because a V modify statement replaces the current array with the new one; it does not add to it.

See Also

none.

TOC PREV NEXT INDEX