You are here: Development Standards > Routines > General Routines > GENPHONE

# GENPHONE

GENPHONE is a general routine that contains two multiline functions called FNPHONEMASK$ and FNGUIPHONEMASK$. These functions take a standard phone number and mask it using the specified mask. FNGUIPHONEMAKS$ also sets a mask for an INPUTE control. GENPHONE occupies lines 10100–10299 and should be merged into all programs that display or print phone numbers.

Variable | Description
XX | Any valid phone number
XX1$ | The phone number mask to be used
ID (FNGUIPHONEMASK$ only) | A GUI control ID to which the masked data belongs

To use GENPHONE, substitute FNPHONEMASK$(XX,XX1$) for printing the phone number where it would print before.

`7720 PRINT @(22,10),FNPHONEMASK$(PHONE$,MASK$),`

instead of

`7720 PRINT @(22,10),PHONE$,`

You must make sure that you have the proper mask for the phone number (from the Country Code file) in MASK$.

In GUI mode, the above code would look like this sample:

`17720 PRINT (OSGUI.CHAN)’TITLE’(4010,FNGUIPHONEMASK$(PHONE$,MASK$,4010)`

This would set the mask MASK$ as the current mask for control ID 4010, and also display the data to the control.