# SBXINP

> [HTML Version](sbxinp_sbr.htm)

**xcall SBXINP, label, opcode, row, col, xmax, entry, inftype, setdef, maxchars, clickcode, tooltip, parentid, exitcode, defpt, timer, cmdflg, maxpt, infldid, labelid, changeflag**

SBXINP.SBX is a wrapper for INFLD. Its biggest single advantage over INFLD is that allows you to associate (and align) a label with an INFLD control, rather than having to handle the label and the edit control in separate operations. This routine was originally developed by Firmaware and is now included as part of the standard subroutine collection. 

or, as an xfunc\$ function:

map1 inp'result

   map2 result'exitcode,s,4

   map2 result'values,s,5000

   map2 result'id,s,4

   map2 result'changed,s,1



inp'result = xfunc\$("sbxinp",label,opcode,…)



Source, samples and related functions can be found in [SOSLIB:\[907,37\]](https://bitbucket.org/microsabio/soslib/src/master/907037/).



**Parameters**

_label_  ([String](string.md))  \[in\]

Controls many of the extended capabilities of SBXINP (relative to INFLD). See the subtopic [Label](label_sbxinp.md) for full information.

_opcode  _([Num](num.md))  \[in\]

Determines the operation (edit, display, etc.) according to the following table:

| **Symbol** | **Value** | **Description** |
|------|------|------|
| SXI\_EDT | 1 | Preload field contents and edit the field. (Ignores _label_) |
| SXI\_DSP | 2 | Display only (create the label; create the edit control to display the data but do not put the focus on it). |
| SXI\_DSPEDT | 3 | Display and edit. Combination of SXI\_EDT and SXI\_DSP. |
| SXI\_DISABLE | 20 | Add this to disable the field. |
| SXI\_STATIC | 30 | Add this to display field as a static text control. |




_row_  ([Num](num.md))  \[in\]

Row where the field is displayed and edited. (In the case of multi-line fields, this is the top row.)

_col_  ([Num](num.md))  \[in\]

Starting column of the field (not the label).

_xmax_  ([Num](num.md))  \[in\]

Determines the width (in current grid units) of the control used to display and edit the field. (Same as INFLD _xmax_ parameter.) If _maxchars_ not specified, then _xmax_ also determines the maximum number of characters that may be entered into the field.

_entry_  (Any type)  \[in/out\]

Field contents. For _opcode_ values except 0, the initial value of _entry_ is preloaded into the field, for display and to establish the initial or default value. On exit, returns the updated field contents. Note that unlike INFLD which requires _entry_ to be a string, SBXINP allows you to pass a numeric data type for fields containing numeric data.

_inftype_  ([String](string.md))  \[in\]

Same as INFLD _type_ parameter, except that unless _inftype_ starts with a "+", whatever you specify will be added to the following default codes: A\]134569kWhsg|G|E

If _inftype_ starts with a "+", then there is no default. The "+" is discarded and _inftype_ is used for the INFLD _type_ string.

There are two special cases: "D>" specifies a Date Picker, and "t" specifies a Time Picker.

_setdef_  ([String](string.md))  \[in\]

Same as INFLD _setdef_ parameter, except with the following extensions:

To specify a minimum number of allowed characters, append ">#" to the end of _setdef_, where # is the number.

Set _setdef_ to "@" to cause the field to be validated (by VALIDA.SBX) for valid email format.

_maxchars_  ([Num](num.md))  \[in\]

Same as INFLD _maxchars_ parameter. If not specified or 0, the maximum number of allowed characters will be equal to the value of the _xmax_ parameter. Setting maxchars larger than _xmax_ allows the field to scroll horizontally (accepting more characters than can be displayed at once). Setting _maxchars_ less than _xmax_ just means that the field will "look" bigger than necessary for the number of allowed characters. Note that the units of _xmax_ are grid units, whereas the units of _maxchars_ are characters. Since characters may requires more or less space than the current grid unit, even when _maxchars_ = _xmax_, you might have either horizontal scrolling or hit the _maxchars_ limit before filling the display space of the field.

_clickcode_  (Floating point or [Signed Int](integer-signed.md))  \[in\]

Specifies the _exitcode_ value to be generated by clicking on this field when the field is not active. Note that this number should be positive even though click exitcodes are generally negative. (Setting _clickcode_ to 400 will cause the field to generate _exitcode_ -400 when clicked.)

_tooltip_  ([String](string.md))  \[in\]

Text of the tooltip to associate with the field.

_parentid_  ([String](string.md)) or Num) \[in\]

ID of the parent control (tab, groupbox, dialog). If 0, it is assumed to be the current dialog. If it is a non-empty, non-numeric string, it identifies the parent control by its ID name, rather than its number. Also see _infldid_ parameter (which gets combined with this to create the full INFLD parentid parameter).

_exitcode_  (Floating point or [Signed Int](integer-signed.md))  \[in/out\]

Same as INFLD _exitcode_ parameter, except that it has significance on input as well as output. If the incoming _exitcode_ matches _clickcode_, then the routine assumes that you must have activated the field by clicking on it (which may cause different initial or default field behavior than otherwise.)

Special exitcode values: ??

_defpt_  ([Num](num.md))  \[in\]

Number of display lines for multi-line fields, or the default decimal point position for numeric fields. (Same as INFLD _defpt_).

_timer_  ([Num](num.md))  \[in/out\]

Same as INFLD _timer_.

_cmdflg_  ([Num](num.md))  \[in\]

Same as INFLD _cmdflg_.

_maxpt_  ([Num](num.md))  \[in\]

Same as INFLD _maxpt_.

_infldid_  ([String](string.md) or Num)  \[in/out\]

Optional ID to assign to, or to retrieve from the INFLD control. (This is combined with the _parentid_ parameter above before being passed to INFLD as its parentid parameter.) If the parameter is specified but is empty, or numeric, then it will return the numeric control ID which is auto-assigned to the INFLD control.

_labelid_  ([String](string.md) or Num)  \[in/out\]

Optional ID to assign to, or retrieve from, the label control associated with the INFLD control. If a non-empty string name passed, then that is the name that will be assigned to the label control. If an empty string or a numeric parameter is passed, the auto-assigned numeric ID of the control will be returned here.

_changeflag_  ([String](string.md))  \[out\]

Set to "1" if the field contents are changed.