next up previous index
Next: [] operator Up: Expressions Previous: Logical

# operator

CardinalExpression ::= "#" Expression

The # operator takes a single expression argument, and returns its length. If the expression denotes a list value, its length is its number of elements. If it denotes a character string value, its length is the number of characters it holds. If applied to a value of any other type, the # operator causes RainCode to abort.

aList := {};
FOR i := 1 TO 10 DO
  aList := aList & {i};
  END;
ASSERT #(aList | X MOD 2 = 0) = 5;