# maxchrs
> [HTML Version](maxchrs.htm)
May be used to separate the display width of the field from the maximum number of characters that can be entered. Normally the objective here is to allow a longer string to be input than screen real estate would otherwise allow. This is accomplished by scrolling the field horizontally within the display width defined by _xmax_. A secondary motivation presents itself in the GUI proportional font environment, where you might want to make _xmax_ larger than _maxchrs_ in order to allow for the possibility that all the characters entered are wider than average, and thus would not fit within the display box size based on _xmax_.
For example, a two-character state field is likely to have this problem. The field display width is calculated based on the fixed pitch font size times the _xmax_ value. In most cases, this is more than wide enough for proportional fonts, which "on average" are more compact than fixed pitch fonts of the same point size. But capital letters, particularly in a combination like "WY", are likely to require more space. In this case, setting _maxchrs_ to 2 and _xmax_ to 3 might be a good idea.
If _maxchrs_ is omitted or equals zero, it is treated as being equal to _xmax_.
**Horizontal scrolling:** _maxchrs_ may also be used to specify a maximum horizontal scrolling width. If specified, and if larger than _xmax _(the field editing width) then the field will support up to _maxchrs _characters, scrolling horizontally as required within the display window defined by _row, col _and_ xmax_.
As a convenience, especially to those interested in using the horizontal scrolling feature but who do not care about color, the _infclr _parameter (normally a mapped structure) may be reduced to numeric zero. Thus, for example, you can call INFLD to input an alphanumeric scrolling field with an editing window width of 60 characters and a maximum width of 150 characters as follows:
xcall INFLD, row, col, 60, 0, "a", entry, inxctl, 1, 0, exitcode, timer, 0, -1, -1, 0, "", 0, "", 150