home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware 1 2 the Maxx
/
sw_1.zip
/
sw_1
/
TEXT
/
PDX_ALL.ZIP
/
TI375.ASC
< prev
next >
Wrap
Text File
|
1991-09-11
|
968b
|
67 lines
PRODUCT : PARADOX NUMBER : 375
VERSION : 1.X, 2.X, 3.X
OS : DOS
DATE : September 11, 1991 PAGE : 1/1
TITLE : INSERTING HYPHENS INTO A PHONE NUMBER FIELD
This following script will insert -'s into a phone number field
that does not contain -'s to separate the area code, prefix and
suffix. The script illustrates the PAL commands EDIT and SCAN
and the PAL function SUBSTR(). For additional reference on these
and other PAL commands and functions, refer to the PAL User's
Guide.
EDIT "tbl" ;where tbl is the table name
SCAN
area=SUBSTR([Phone], 1, 3) ;where area is the area code
prefix=SUBSTR([Phone], 4, 3)
suffix=SUBSTR([Phone], 7, 4)
[Phone]=area+"-"+prefix+"-"+suffix
ENDSCAN