Itemid (ScreenField property): Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
{{Template:ScreenField:Itemid subtitle}} | |||
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]]. | 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}} | |||
===Syntax terms=== | ===Syntax terms=== | ||
<dl> | <dl> | ||
Line 9: | Line 12: | ||
</dl> | </dl> | ||
==Usage | ==Usage notes== | ||
Any screenfield can be assigned an item ID. | Any screenfield can be assigned an item ID. | ||
Line 16: | Line 19: | ||
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. | 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== | |||
{{Template:ScreenField:Itemid footer}} |
Revision as of 20:21, 18 March 2011
Set or return the item ID value for screenfield (ScreenField class)
This 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
- num
- An integral numeric variable or expression, which can range from 1 to 32767.
- %sfield
- A reference to an instance of a ScreenField object.
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 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.