home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / tool / various / 5pak20 / generapp.frm < prev    next >
Text File  |  1995-02-27  |  8KB  |  315 lines

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