New (UserStatistics constructor): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 1: Line 1:
{{Template:UserStatistics:New subtitle}}
{{Template:UserStatistics:New subtitle}}
The <var>New</var> method creates a new instance of the <var>UserStatistics</var> class, populating it with a snapshot of the user's statistics.


This method
creates a new instance of the UserStatistics class with a snapshot
of the user's statistics.
==Syntax==
==Syntax==
{{Template:UserStatistics:New syntax}}
{{Template:UserStatistics:New syntax}}
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th><i>%ustat</i></th>
<tr><th>%userStatistics</th>
<td>A UserStatistics object variable to contain the new object instance.</td></tr>
<td>A <var>UserStatistics</var> object variable to contain the new object instance.</td></tr>
</table>
</table>
==Usage notes==
==Usage notes==
<ul>
<ul>
<li>New is a constructor and as such can be called with no object,
<li><var>New</var> is a constructor and as such can be called with no object, with an explicit class name, or with an object variable, even if that object is null:
with an explicit class
name, or with an object variable, even if that object is null:
<p class="code">%ustat = new
<p class="code">%ustat = new
%ustat = %(userStatistics):new
%ustat = %(userStatistics):new
Line 21: Line 18:
</p>
</p>
</ul>
</ul>
==See also==
==See also==
{{Template:UserStatistics:New footer}}
{{Template:UserStatistics:New footer}}

Revision as of 09:23, 31 March 2011

Create a new UserStatistics instance (UserStatistics class)

The New method creates a new instance of the UserStatistics class, populating it with a snapshot of the user's statistics.

Syntax

%userStatistics = [%(UserStatistics):]New

Syntax terms

%userStatistics A UserStatistics object variable to contain the new object instance.

Usage notes

  • New is a constructor and as such can be called with no object, with an explicit class name, or with an object variable, even if that object is null:

    %ustat = new %ustat = %(userStatistics):new %ustat = %ustat:new

See also