Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

OpCodes.Ldlen Field

Pushes the number of elements of a zero-based, one-dimensional array onto the evaluation stack.

Namespace: System.Reflection.Emit
Assembly: mscorlib (in mscorlib.dll)

public static readonly OpCode Ldlen
public static final OpCode Ldlen
public static final var Ldlen : OpCode
Not applicable.

The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format

Assembly Format

Description

8E

ldlen

Pushes the length (of type natural unsigned int) of an array on the stack.

The stack transitional behavior, in sequential order, is:

  1. An object reference to an array is pushed onto the stack.

  2. The array reference is popped from the stack and the length is computed.

  3. The length is pushed onto the stack.

Arrays are objects and hence represented by a value of type O. The length is returned as a natural unsigned int.

NullReferenceException is thrown if the array reference is a null reference.

The following Emit method overload can use the ldlen opcode:

  • ILGenerator.Emit(OpCode)

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft