T must be an object type or traced reference type, and x must be assignable to T . If the check fails, a runtime error occurs. T must be an object type or traced reference type, and x must be assignable to T .
Different types have different codes.
The code for a type is constant for any single execution of a program, but may differ for different executions. T ORD converts an element of an enumeration to the integer that represents its position in the enumeration order. The first value in any enumeration is represented by zero. If the type of element is a subrange of an enumeration T , the result is the position of the element within T , not within the subrange. It is a checked runtime error for the value of i to be out of range for T .