Table of Contents

5.6.9.4 & Operator

Note

This section describes the implementation of MS-VBAL §5.6.9.4 & Operator.

Runtime Semantics

The & (concatenation) operator is a simple data operator: it validates its operands through OperatorRuntimeSemantics.LetCoerceNonNullOperand (RD-VBAL §5.6.9.2 Simple Data Operators).

BinaryConcatOperatorRuntimeSemantics.IsByteArray unwraps a Variant (VBVariantValue) before matching a wrapped Byte array.

👉 v1 & v2 evaluates Variants holding arrays the same as declared arrays.

See RD-VBAL §5.5.1.2.12 Let-coercion to Variant for why a Variant operand must be unwrapped before it is matched against a concrete value type.

The result is every byte of the left operand's data followed by every byte of the right operand's (VBStringValue.Concat). A trailing byte of the left operand pairs with the first byte of the right one, so two one-element Byte() operands concatenate to one character (RD-VBAL §2.4.1.2 VBStringType). + between two Strings is the same concatenation.

👉 An operand that is a number or a date is let-coerced to String in the regional settings of the session's environment (RD-VBAL §5.5.1.2.4 Let-coercion to and from String).


⏮️ RD-VBAL §5.6.9.3 Arithmetic Operators | ⏭️ RD-VBAL §5.6.9.5 Relational Operators