home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / clarion / library / soundx / test.cla < prev   
Text File  |  1989-01-31  |  1KB  |  64 lines

  1. test program
  2.  
  3. ! program to test soundex function
  4. ! go 'crun test' at the DOS prompt
  5.  
  6.  
  7.     map
  8.       module ('soundex')
  9.       func (soundex), string
  10.     . .
  11.  
  12. screen         screen      window(5,55),pre(scr),hue(7,0)
  13.  OMIT('**-END-**')
  14.    ╔═════════════════════════════════════════════════════╗
  15.    ║  First String ■■■■■  ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ ║
  16.    ║ Second String ■■■■■  ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ ║
  17.    ║        Result ■■■■■■■■■■■■■■■■■■■■             ║
  18.    ╚═════════════════════════════════════════════════════╝
  19. **-END-**
  20.  
  21.            row(2,2)      paint(3,14),hue(8,0)
  22.            row(1,1)      string('╔═{53}╗')
  23.            row(2,1)      repeat(3);string('║<0{53}>║') .
  24.            row(5,1)      string('╚═{53}╝')
  25.            row(2,4)      string('First String')
  26.            row(3,3)      string('Second String')
  27.            row(4,10)  string('Result')
  28.            row(2,24)  entry(@S30),use(f_string),esc(?-1),req
  29.            row(3,24)  entry(@S30),use(s_string),esc(?-1),req
  30. s1           row(2,17)  string(5)
  31. s2           row(3,17)  string(5)
  32.          col(1)      entry,use(?last_field)
  33. result           row(4,17)  string(20)
  34.          .
  35. f_string    string (30)
  36. s_string       string (30)
  37.  
  38.  
  39.  
  40.     code
  41.     open (screen)
  42.  
  43.     loop field# = field() to fields()
  44.       accept
  45.       if field() = ?last_field then break.
  46.     .
  47.  
  48.  
  49.     s1"=soundex (f_string);
  50.     s2"=soundex (s_string);
  51.  
  52.     scr:s1=s1"
  53.     scr:s2=s2"
  54.  
  55.     if s1" <> s2"
  56.       scr:result = 'Does NOT sound alike'
  57.     else
  58.       scr:result = 'Sounds alike'
  59.     .
  60.  
  61.     ask
  62.  
  63.  
  64.