How to Format Telephone Numbers with PICTURE MaskLast reviewed: April 30, 1996Article ID: Q119691 |
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)
(213)123-1234the PICTURE clause should appear as follows:
PICTURE "@R (999)999-9999"The string to enter in the Format box in the Field dialog box is:
@R (999)999-9999Likewise, if the telephone number is to appear as follows
213/123-1234the mask should appear as follows:
@R 999/999-9999 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)
(213)123-1234Set the Format property to "R" (without quotation marks) and the InputMask property to the following:
(999)999-9999Likewise, if the telephone number is to appear as follows
213/123-1234the Format property should be "R" (without quotation marks) and the InputMask should appear as follows:
999/999-9999 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
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |