Click to Rate and Give Feedback
MSDN
MSDN Library
Microsoft Dynamics
Reference
Classes
Object Class
 Object.usageCount Method
Collapse All/Expand All Collapse All
Microsoft Dynamics AX 2009
Object.usageCount Method

Returns the current number of references (the value of the reference counter) that the object has.

public int usageCount()

Called

The current number of references that the object has.

When an object is created, its reference counter equals one (1). When a new reference is created, its value increases. As a reference goes out of scope, its value decreases.

The following example prints the number of references for objA to the output window.

static void Object_UsageCount(Args _args)
{
    Object objA = new Object();
    Object objB;
    ;

    print objA.usageCount();    // Prints 1.

    objB = objA;                // objB is a reference to objA.
    print objA.usageCount();    // prints 2
    pause;
}
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker