Itemid (ScreenField property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (match syntax table to syntax template; edits, tags and links)
Line 1: Line 1:
{{Template:ScreenField:Itemid subtitle}}
{{Template:ScreenField:Itemid subtitle}}
The <var>Itemid</var> property sets or returns a numeric item ID value for a <var>ScreenField</var>. This ID is initially set for a field by the <var>[[Screen class#AddField function|AddField]]</var> method..


This property sets or returns a numeric item ID value for a ScreenField. This ID is initially set for a field by the [[Screen class#AddField function|AddField method]].
==Syntax==
==Syntax==
{{Template:ScreenField:Itemid syntax}}
{{Template:ScreenField:Itemid syntax}}
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>num</th>
<tr><th>%currentNum</th>
<td>An integral numeric variable or expression, which can range from 1 to 32767. </td></tr>
<td>An integral numeric variable or expression, to get the current item id value.</td></tr>
<tr><th>%sfield</th>
<tr><th>sfield</th>
<td>A reference to an instance of a ScreenField object.</td></tr>
<td>A reference to an instance of a <var>ScreenField</var> object.</td></tr>
<tr><th>newNum</th>
<td>An integral numeric variable or expression,  which can range from 1 to 32767, to set the new item id value.</td></tr>
</table>
</table>


==Usage notes==
==Usage notes==
<ul><li>Any <var>screenfield</var> can be assigned an item ID.
<li>An item ID is very practical when using <var>[[Arraylist_class|arraylists]]</var> of <var>screenfields</var>.  <var>ScreenField</var> objects within an <var>arraylist</var> can be assigned item IDs corresponding to the element numbers of the <var>arraylist</var>. For example, the <var>[[Screen class#CursorItemId|CursorItemId]]</var> method will return the item ID of the <var>screenField</var> object where the cursor is positioned. The item ID can then be used as the element number to reference a <var>ScreenField</var> object within an arraylist.
<li>Any <var>screenField</var> not assigned an item ID value will return zero.  No check is made to ensure any item Id is unique.  This is the programmer's responsibility.
</ul>


Any screenfield can be assigned an item ID.
An item ID is very practical when using arraylists of screenfields. ScreenField objects within an arraylist can be assigned item IDs corresponding to the element numbers of the arraylist. For example, the [[Screen class#CursorItemId|Screen method CursorItemId]] will return the item ID of the screenField object where the cursor is positioned. The item ID can then be used as the element number to reference a ScreenField object within an arraylist.
Any screenField not assigned an item ID value will return zero. No check is made to ensure any item Id is unique. This is the programmer's responsibility.
==See also==
==See also==
{{Template:ScreenField:Itemid footer}}
{{Template:ScreenField:Itemid footer}}

Revision as of 04:05, 1 July 2011

Set or return the item ID value for screenfield (ScreenField class)

The Itemid property sets or returns a numeric item ID value for a ScreenField. This ID is initially set for a field by the AddField method..

Syntax

%currentNumber = sfield:Itemid sfield:Itemid = newNumber

Syntax terms

%currentNum An integral numeric variable or expression, to get the current item id value.
sfield A reference to an instance of a ScreenField object.
newNum An integral numeric variable or expression, which can range from 1 to 32767, to set the new item id value.

Usage notes

  • Any screenfield can be assigned an item ID.
  • An item ID is very practical when using arraylists of screenfields. ScreenField objects within an arraylist can be assigned item IDs corresponding to the element numbers of the arraylist. For example, the CursorItemId method will return the item ID of the screenField object where the cursor is positioned. The item ID can then be used as the element number to reference a ScreenField object within an arraylist.
  • Any screenField not assigned an item ID value will return zero. No check is made to ensure any item Id is unique. This is the programmer's responsibility.

See also