SetCursor (ScreenField subroutine): Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
{{Template:ScreenField:SetCursor subtitle}} | |||
This method positions the cursor at the beginning of the referenced ScreenField 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== | ||
{{Template:ScreenField:SetCursor syntax}} | |||
===Syntax terms=== | ===Syntax terms=== | ||
<dl>%sfield | <dl>%sfield | ||
Line 7: | Line 10: | ||
</dl> | </dl> | ||
==Usage | ==Usage notes== | ||
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. | ||
Line 13: | Line 16: | ||
==Examples== | ==Examples== | ||
The following sequence sets the cursor on an unprotected screenfield immediately to the right of a field with a protected | The following sequence sets the cursor on an unprotected screenfield immediately to the right of a field with a protected “===>” command prompt: | ||
... | ... | ||
Line 21: | Line 24: | ||
%prompt = %scr:addField(row=2, color=white, - | %prompt = %scr:addField(row=2, color=white, - | ||
value='===>') | value='===>') | ||
==See also== | |||
{{Template:ScreenField:SetCursor footer}} |
Revision as of 20:29, 18 March 2011
Set or return the value of a screenfield (ScreenField class)
This 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 object screenfield %sfield, where position 1 is the first position in the field and where the maximum width is set by the AddField method.
Usage notes
If the position exceeds the maximum width of the field, the request is canceled.
Examples
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='===>')