In Operator

Specifies the unit of measure that a raw numeric expression represents.

Syntax

expression In unit

Parts

expression
Required numeric expression
unit
Required name of a unit of measure

Remarks

The In operator is used when an expression needs a unit of measure, such as when passing an argument to a procedure that requires a unit.

The operator is not needed when the expression already is of a compatible unit, then the conversion is done automatically. Nor is it needed after a simple numeric literal, where just the unit will suffice.

Attempting to convert a value in one unit to an incompatible unit results in a compile-time error.

Examples

See also