home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / CODIGO_2 / SOUND_X / GENERAPP.FRM (.txt) next >
Encoding:
Visual Basic Form  |  1993-12-23  |  8.0 KB  |  270 lines

  1. VERSION 2.00
  2. Begin Form Clacker_Form 
  3.    Caption         =   "SndDex Test"
  4.    ClientHeight    =   4710
  5.    ClientLeft      =   1140
  6.    ClientTop       =   1800
  7.    ClientWidth     =   5055
  8.    Height          =   5400
  9.    Left            =   1080
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   4710
  12.    ScaleWidth      =   5055
  13.    Top             =   1170
  14.    Width           =   5175
  15.    Begin SndDex SndDex1 
  16.       Left            =   2280
  17.       Top             =   4200
  18.    End
  19.    Begin CommandButton BTN_RepeatInt 
  20.       Caption         =   "Repeat Int"
  21.       Height          =   375
  22.       Left            =   960
  23.       TabIndex        =   12
  24.       Top             =   240
  25.       Width           =   1215
  26.    End
  27.    Begin TextBox TXT_ExtSoundexCode 
  28.       Height          =   285
  29.       Left            =   2640
  30.       TabIndex        =   11
  31.       Top             =   3960
  32.       Width           =   2175
  33.    End
  34.    Begin TextBox TXT_SoundexCode 
  35.       Height          =   285
  36.       Left            =   120
  37.       TabIndex        =   10
  38.       Top             =   3960
  39.       Width           =   2175
  40.    End
  41.    Begin TextBox TXT_Result 
  42.       Height          =   375
  43.       Left            =   120
  44.       TabIndex        =   6
  45.       Top             =   3000
  46.       Width           =   4815
  47.    End
  48.    Begin TextBox TXT_KeyString 
  49.       Height          =   375
  50.       Left            =   120
  51.       TabIndex        =   3
  52.       Text            =   "Dog"
  53.       Top             =   1200
  54.       Width           =   4815
  55.    End
  56.    Begin CommandButton BTN_RepeatStd 
  57.       Caption         =   "Repeat Std"
  58.       Height          =   375
  59.       Left            =   2400
  60.       TabIndex        =   2
  61.       Top             =   240
  62.       Width           =   1215
  63.    End
  64.    Begin TextBox TXT_SearchString 
  65.       Height          =   375
  66.       Left            =   120
  67.       TabIndex        =   1
  68.       Text            =   "Dawg"
  69.       Top             =   2040
  70.       Width           =   4815
  71.    End
  72.    Begin CommandButton Btn_Compare 
  73.       Caption         =   "Compare"
  74.       Height          =   375
  75.       Left            =   3720
  76.       TabIndex        =   0
  77.       Top             =   240
  78.       Width           =   1215
  79.    End
  80.    Begin Label Label5 
  81.       Caption         =   "Key String Extended code"
  82.       Height          =   255
  83.       Left            =   2640
  84.       TabIndex        =   9
  85.       Top             =   3600
  86.       Width           =   2295
  87.    End
  88.    Begin Label Label4 
  89.       Caption         =   "Key String Soundex code"
  90.       Height          =   255
  91.       Left            =   120
  92.       TabIndex        =   8
  93.       Top             =   3600
  94.       Width           =   2295
  95.    End
  96.    Begin Label Label2 
  97.       Caption         =   "Compare result returned"
  98.       Height          =   375
  99.       Left            =   120
  100.       TabIndex        =   7
  101.       Top             =   2640
  102.       Width           =   4815
  103.    End
  104.    Begin Label Label3 
  105.       Alignment       =   2  'Center
  106.       Caption         =   "Search String"
  107.       Height          =   255
  108.       Left            =   120
  109.       TabIndex        =   5
  110.       Top             =   1680
  111.       Width           =   4815
  112.    End
  113.    Begin Label Label1 
  114.       Alignment       =   2  'Center
  115.       Caption         =   "Key String"
  116.       Height          =   255
  117.       Left            =   0
  118.       TabIndex        =   4
  119.       Top             =   840
  120.       Width           =   4815
  121.    End
  122.    Begin Menu nmu_File 
  123.       Caption         =   "&File"
  124.       Begin Menu mnu_Exit 
  125.          Caption         =   "&Exit"
  126.       End
  127.    End
  128.    Begin Menu mnu_Edit 
  129.       Caption         =   "&Edit"
  130.       Begin Menu mnu_Cut 
  131.          Caption         =   "Cu&t"
  132.       End
  133.       Begin Menu mnu_Copy 
  134.          Caption         =   "&Copy"
  135.       End
  136.       Begin Menu mnu_Paste 
  137.          Caption         =   "&Paste"
  138.       End
  139.       Begin Menu mnu_submenu 
  140.          Caption         =   "SubMenu"
  141.          Begin Menu mnu_submenu1 
  142.             Caption         =   "SubMenu 1"
  143.          End
  144.          Begin Menu mnu_submenu2 
  145.             Caption         =   "SubMenu 2"
  146.          End
  147.       End
  148.    End
  149. Option Explicit
  150. Sub Btn_Compare_Click ()
  151. Dim sStdTemp As String
  152. Dim sIntTemp As String
  153. Dim nDex As Integer
  154. Dim nR As Integer
  155. Dim ReturnedSoundexCodeStr As String
  156.     TXT_Result = ""
  157.     TXT_SoundexCode.Text = ""
  158.     TXT_ExtSoundexCode.Text = ""
  159.     ' load the words to match
  160.     SndDex1.KeyText = TXT_KeyString.Text
  161.     SndDex1.SearchText = TXT_SearchString.Text
  162.     ' do it with std soundex search
  163.     SndDex1.Action = 20   ''SNDEX_STDSEARCH
  164.     ' store results
  165.     ' NOTE: result VAR SoundsLike is an integer
  166.     '       0 => no match
  167.     '       1 => matches
  168.     sStdTemp = Str$(SndDex1.SoundsLike)
  169.     ' now do it with integer soundex search
  170.     SndDex1.Action = 21   ''SNDEX_INTSEARCH
  171.     ' store results
  172.     ' NOTE: result VAR SoundsLike is an integer
  173.     '       0 => no match
  174.     '       1 => matches
  175.     sIntTemp = Str$(SndDex1.SoundsLike)
  176.     TXT_Result.Text = "Std = " + sStdTemp + "    Int = " + sIntTemp
  177.     ''
  178.     ''
  179.     '' get the normal soundex codes
  180.     SndDex1.KeyText = TXT_KeyString.Text
  181.     SndDex1.Action = 25   ' std code
  182.     ' normal soundex code returned is a string
  183.     TXT_SoundexCode.Text = SndDex1.SoundexCode
  184.     ' loop testing of repeat code retrieve
  185.     For nDex = 1 To 5
  186.         SndDex1.KeyText = TXT_KeyString.Text
  187.         SndDex1.Action = 25   ' std code
  188.         
  189.         ' do something here with the returned code
  190.         ReturnedSoundexCodeStr = SndDex1.SoundexCode
  191.     Next
  192.     ''
  193.     ''
  194.     '' get the extended integer soundex codes
  195.     SndDex1.KeyText = TXT_KeyString.Text
  196.     SndDex1.Action = 26   ' int code
  197.     ' extended integer soundex code returned is a string
  198.     TXT_ExtSoundexCode.Text = SndDex1.SoundexCode
  199.     ' loop testing of repeat code retrieve
  200.     For nDex = 1 To 5
  201.         SndDex1.KeyText = TXT_KeyString.Text
  202.         SndDex1.Action = 26 ' int code
  203.         ' do something here with the returned code
  204.         ReturnedSoundexCodeStr = SndDex1.SoundexCode
  205.     Next
  206.     TXT_Result.Text = TXT_Result.Text + "  done"
  207. End Sub
  208. Sub BTN_Exit_Click ()
  209.     mnu_Exit_Click
  210. End Sub
  211. Sub BTN_Repeat_Click ()
  212. End Sub
  213. Sub BTN_RepeatInt_Click ()
  214. ''''''''''''''''''''''''''''''''''''''''''''''''
  215. ' PURPOSE: Illustrates a repeat integer search
  216. ''''''''''''''''''''''''''''''''''''''''''''''''
  217. Dim nDex As Integer
  218. Dim nR As Integer
  219.     MsgBox "See code for example of repeat searching."
  220.     SndDex1.KeyText = "Summertime"
  221.     SndDex1.SearchText = "Somertime"
  222.     SndDex1.Action = 21         ' int search
  223.     ''
  224.     '' a loop illustrating how to repeat search
  225.     '' words could be stored in an array
  226.     '' here we just loop on the same word
  227.     For nDex = 1 To 5
  228.         SndDex1.SearchText = "SomerTime"
  229.         SndDex1.Action = 31     ' repeat int search
  230.         nR = SndDex1.SoundsLike
  231.     Next nDex
  232.     MsgBox "Done Integer Search"
  233. End Sub
  234. Sub BTN_RepeatStd_Click ()
  235. ''''''''''''''''''''''''''''''''''''''''''''''''
  236. ' PURPOSE: Illustrates a repeat standard search
  237. ''''''''''''''''''''''''''''''''''''''''''''''''
  238. Dim nDex As Integer
  239. Dim nR As Integer
  240.     MsgBox "See code for example of repeat searching."
  241.     SndDex1.KeyText = "Summertime"
  242.     SndDex1.SearchText = "Somertime"
  243.     SndDex1.Action = 20         ' int search
  244.     ''
  245.     '' a loop illustrating how to repeat search
  246.     '' words could be stored in an array
  247.     '' here we just loop on the same word
  248.     For nDex = 1 To 5
  249.         SndDex1.SearchText = "SomerTime"
  250.         SndDex1.Action = 30     ' repeat int search
  251.         nR = SndDex1.SoundsLike
  252.     Next nDex
  253.     MsgBox "Done Standard Search"
  254. End Sub
  255. Sub Form_Load ()
  256.     If Me.WindowState = 0 Then
  257.         Top = 0
  258.         Left = 0
  259.     End If
  260. End Sub
  261. Sub Form_Resize ()
  262.     If Me.WindowState = 0 Then
  263.         Me.Height = 5550
  264.         Me.Width = 5175
  265.     End If
  266. End Sub
  267. Sub mnu_Exit_Click ()
  268.     End
  269. End Sub
  270.