up previous next
swap

swap two values

Syntax
swap(ref A: OBJECT, ref B: OBJECT)

Description
This procedure swaps two values; it returns nothing!

Example
/**/  A := 1;
/**/  B := 2;
/**/  swap(ref A, ref B);
/**/  PrintLn [A,B];
[2, 1]

See Also