How to Format Telephone Numbers with PICTURE MaskID: Q119691 2.5x 2.6x 3.00 | 2.5x 2.60 2.60a | 2.5x 2.60a kbtool kbprg
The information in this article applies to:
SUMMARYThe format of the data entry @ ... GET edit region for a telephone number can be controlled programmatically with a mask defined using the PICTURE clause, or it can be controlled in the Screen Builder or Form Designer by specifying the picture in the Format edit region of the Field dialog box. The examples shown below illustrate both methods.
MORE INFORMATIONThe @ ... GET ... PICTURE clause provides the means of specifying a mask to control the format of data entered in a GET object in a window. The following paragraphs show examples of parameters of the clause that create a mask to control the format of a GET for entering a telephone number. These parameters provide all the customary nondata formatting characters (such as parentheses and dashes), but allow FoxPro to store only the numeric information so that the number is saved in just ten characters, either as a character field or as a numeric field. The parameters can be included either in a hard-coded "@ n.n GET <variable/field name> PICTURE ..." (without the quotation marks) command or they can be included in the Format box in the Field dialog box of FoxPro's Screen Builder.
FoxPro 2.x for Windows ExamplesFor example, if the telephone number is to appear on the screen as follows (these numbers are for example purposes only)
the PICTURE clause should appear as follows:
The string to enter in the Format box in the Field dialog box is:
Likewise, if the telephone number is to appear as follows
the mask should appear as follows:
Visual FoxPro for Windows ExamplesFor example, if the telephone number is to appear on the screen as follows (these numbers are for example purposes only)
Set the Format property to "R" (without quotation marks) and the InputMask
property to the following:
Likewise, if the telephone number is to appear as follows
the Format property should be "R" (without quotation marks) and the
InputMask should appear as follows:
Notes
REFERENCESFor additional PICTURE code options, see pages L3-33, 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. Also refer to the online Help topic for the @ ... GET command. Additional reference words: VFoxWin FoxMac FoxDos FoxWin 2.50 2.50a 2.50b 2.50c 2.60 2.60a 3.00 number format picture mask phone KBCategory: kbtool kbprg KBSubcategory: FxtoolFormdes
|
Last Reviewed: May 1, 1996 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |