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 >
Text File  |  1991-09-11  |  968b  |  67 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  PARADOX                                NUMBER  :  375
  9.   VERSION  :  1.X, 2.X, 3.X
  10.        OS  :  DOS
  11.      DATE  :  September 11, 1991                       PAGE  :  1/1
  12.  
  13.     TITLE  :  INSERTING HYPHENS INTO A PHONE NUMBER FIELD
  14.  
  15.  
  16.  
  17.  
  18.   This following script will insert -'s into a phone number field
  19.   that does not contain -'s to separate the area code, prefix and
  20.   suffix.  The script illustrates the PAL commands EDIT and SCAN
  21.   and the PAL function SUBSTR().  For additional reference on these
  22.   and other PAL commands and functions, refer to the PAL User's
  23.   Guide.
  24.  
  25.   EDIT "tbl"                           ;where tbl is the table name
  26.   SCAN
  27.           area=SUBSTR([Phone], 1, 3)   ;where area is the area code
  28.           prefix=SUBSTR([Phone], 4, 3)
  29.           suffix=SUBSTR([Phone], 7, 4)
  30.           [Phone]=area+"-"+prefix+"-"+suffix
  31.   ENDSCAN
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.