SetCursor (ScreenField subroutine): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (match syntax table to syntax template; edits, tags and links)
Line 1: Line 1:
{{Template:ScreenField:SetCursor subtitle}}
{{Template:ScreenField:SetCursor subtitle}}
 
The <var>SetCursor</var> method positions the cursor at the beginning of the referenced <var>ScreenField</var> object. An optional numeric argument positions the cursor within the field.
This method positions the cursor at the beginning of the referenced ScreenField object. An optional numeric argument positions the cursor within the field.


==Syntax==
==Syntax==
Line 8: Line 7:
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%sfield</th>
<tr><th>%sfield</th>
<td>A reference to an instance of a ScreenField object. position A positive integral value that specifies the relative position within the object screenfield %sfield, where position 1 is the first position in the field and where the maximum width is set by the [[Screen class#AddField function|AddField method]].</td></tr>
<td>A reference to an instance of a <var>ScreenField</var> object.
<tr><th>position</th>
<td>A positive integral value that specifies the relative position within the <var class="term">%sfield</var> object, where position 1 is the first position in the field and the maximum width was set by the <var>[[Screen class#AddField function|AddField]]</var> method.</td></tr>
</table>
</table>


==Usage notes==
==Usage notes==
 
<ul><li>
If the position exceeds the maximum width of the field, the request is canceled.
If the position exceeds the maximum width of the field, the request is canceled.
</ul>


==Examples==
==Examples==
 
<oL><li>The following sequence sets the cursor on an unprotected screenfield immediately to the right of a field with a protected <code>===></code> command prompt:
The following sequence sets the cursor on an unprotected screenfield immediately to the right of a field with a protected <code>===></code> command prompt:
<p class="code">  ...
 
  %scr is object screen
...
  %prompt is object screenField
%scr is object Screen
  %cmd is object screenField
%prompt is object ScreenField
  %prompt = %scr:<var>addField</var>(row=2, color=white, -
%cmd is object ScreenField
  value='===>')
%prompt = %scr:addField(row=2, color=white, -
</p></ol>
value='===>')


==See also==
==See also==
{{Template:ScreenField:SetCursor footer}}
{{Template:ScreenField:SetCursor footer}}

Revision as of 04:47, 1 July 2011

Set or return the value of a screenfield (ScreenField class)

The SetCursor method positions the cursor at the beginning of the referenced ScreenField object. An optional numeric argument positions the cursor within the field.

Syntax

sfield:SetCursor[( [position])]

Syntax terms

%sfield A reference to an instance of a ScreenField object.
position A positive integral value that specifies the relative position within the %sfield object, where position 1 is the first position in the field and the maximum width was set by the AddField method.

Usage notes

  • If the position exceeds the maximum width of the field, the request is canceled.

Examples

  1. The following sequence sets the cursor on an unprotected screenfield immediately to the right of a field with a protected ===> command prompt:

    ... %scr is object screen %prompt is object screenField %cmd is object screenField %prompt = %scr:addField(row=2, color=white, - value='===>')

See also