Numeric (ScreenField property): Difference between revisions
Jump to navigation
Jump to search
m (match syntax table to syntax template; edits, tags and links) |
mNo edit summary |
||
Line 1: | Line 1: | ||
{{Template:ScreenField:Numeric subtitle}} | {{Template:ScreenField:Numeric subtitle}} | ||
The <var>Numeric</var> property sets or returns the <var>Numeric</var> attribute for a <var>ScreenField</var>. If a field is <var>Numeric</var>, only numeric values may be entered in the field. The <var>Numeric</var> attribute is initially set for a field by the <var>[[ | The <var>Numeric</var> property sets or returns the <var>Numeric</var> attribute for a <var>ScreenField</var>. If a field is <var>Numeric</var>, only numeric values may be entered in the field. The <var>Numeric</var> attribute is initially set for a field by the <var>[[AddField_(Screen_function)|AddField]]</var> method. | ||
==Syntax== | ==Syntax== | ||
{{Template:ScreenField:Numeric syntax}} | {{Template:ScreenField:Numeric syntax}} | ||
===Syntax terms=== | ===Syntax terms=== | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>%currentBoolean</th> | <tr><th>%currentBoolean</th> | ||
<td>A <var>[[Boolean_enumeration|Boolean enumeration]]</var> to get the current value of the the <var>Numeric</var> attribute applicable to <var class="term">sfield</var>. Valid values are <code>True</code> and <code>False</code> (default). A value is numeric only if it is composed of the characters <code>0</code> through <code>9</code>, plus (<code>+</code>), minus (<code>-</code>), or period (<code>.</code>).</td></tr> | <td>A <var>[[Boolean_enumeration|Boolean enumeration]]</var> to get the current value of the the <var>Numeric</var> attribute applicable to <var class="term">sfield</var>. Valid values are <code>True</code> and <code>False</code> (default). A value is numeric only if it is composed of the characters <code>0</code> through <code>9</code>, plus (<code>+</code>), minus (<code>-</code>), or period (<code>.</code>).</td></tr> | ||
<tr><th>sfield</th> | <tr><th>sfield</th> | ||
<td>A reference to an instance of a <var>ScreenField</var> object.</td></tr> | <td>A reference to an instance of a <var>ScreenField</var> object.</td></tr> | ||
<tr><th>newBoolean</th> | <tr><th>newBoolean</th> | ||
<td>A <var>Boolean enumeration</var> to set the new value for the <var>Numeric</var> attribute applicable to <var class="term">sfield</var>. Valid values are <code>True</code> and <code>False</code> (default)</td></tr> | <td>A <var>Boolean enumeration</var> to set the new value for the <var>Numeric</var> attribute applicable to <var class="term">sfield</var>. Valid values are <code>True</code> and <code>False</code> (default)</td></tr> | ||
Line 15: | Line 18: | ||
==Usage notes== | ==Usage notes== | ||
<ul><li>Regardless of the value of a field's <var>Numeric</var> attribute, the programmer can assign any type of value to the field. Enforcement of the <var>Numeric</var> attribute takes place only when a user enters data in the field. | <ul> | ||
<li>Regardless of the value of a field's <var>Numeric</var> attribute, the programmer can assign any type of value to the field. Enforcement of the <var>Numeric</var> attribute takes place only when a user enters data in the field. | |||
<li>Some terminal emulators do not enforce numeric field restrictions, so the programmer should be aware that the value of a numeric field must still be checked for validity. | <li>Some terminal emulators do not enforce numeric field restrictions, so the programmer should be aware that the value of a numeric field must still be checked for validity. | ||
</ul> | </ul> |
Revision as of 19:36, 20 November 2012
Set or return the numeric attribute for screenfield (ScreenField class)
The Numeric property sets or returns the Numeric attribute for a ScreenField. If a field is Numeric, only numeric values may be entered in the field. The Numeric attribute is initially set for a field by the AddField method.
Syntax
%currentBoolean = sfield:Numeric sfield:Numeric = newBoolean
Syntax terms
%currentBoolean | A Boolean enumeration to get the current value of the the Numeric attribute applicable to sfield. Valid values are True and False (default). A value is numeric only if it is composed of the characters 0 through 9 , plus (+ ), minus (- ), or period (. ). |
---|---|
sfield | A reference to an instance of a ScreenField object. |
newBoolean | A Boolean enumeration to set the new value for the Numeric attribute applicable to sfield. Valid values are True and False (default) |
Usage notes
- Regardless of the value of a field's Numeric attribute, the programmer can assign any type of value to the field. Enforcement of the Numeric attribute takes place only when a user enters data in the field.
- Some terminal emulators do not enforce numeric field restrictions, so the programmer should be aware that the value of a numeric field must still be checked for validity.