Microsoft KB Archive/115072

From BetaArchive Wiki

How to Limit Input Fields Based on Memvars to Field Size

ID: Q115072

The information in this article applies to:

  • Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b, 2.6
  • Microsoft FoxPro for MS-DOS, versions 2.5, 2.5a, 2.5b, 2.6
  • Microsoft FoxPro for Macintosh, versions 2.5b, 2.5c

Input fields based on memory variables on a screen do not necessarily limit the number of characters that are entered to the size of the underlying table field.

In contrast, when a screen field is based directly on the table field, you cannot enter more characters than the size of the field. By default, the width of the field on a screen that is created by the Screen Generator closely approximates the actual table field size, but if the font or the width of the field is changed, the changed field may allow more characters to be entered than can be committed to the table field.

To limit the number of characters entered to match the table field size, use the PICTURE clause in the Format dialog box of the field. For example:

  • To limit input to 5 numbers, type "99999" (without the quotation marks) in the Format dialog box of the screen field.
  • To limit input to 3 alphabetic characters, type "AAA" (without the quotation marks) in the Format dialog box of the screen field.
  • To limit input to 6 of any kind of character, type "XXXXXX" (without the quotation marks) in the Format dialog box of the screen field.

REFERENCES

For additional PICTURE code options, see pages L3-34 and L3-35 of the "Language Reference" for FoxPro for MS-DOS and Windows or see page 47 of the "Language Reference" for FoxPro for Macintosh.

Additional reference words: FoxMac FoxDos FoxWin 2.50 2.50a 2.50b 2.50c 2.60 memvars restrict exceed greater KBCategory: kbenv kbprg KBSubcategory: FxenvMemory


Last Reviewed: June 27, 1995
© 1999 Microsoft Corporation. All rights reserved. Terms of Use.