home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Tool Box
/
SIMS_2.iso
/
vb_code2
/
sound_x
/
generapp.frm
next >
Wrap
Text File
|
1993-12-23
|
8KB
|
310 lines
VERSION 2.00
Begin Form Clacker_Form
Caption = "SndDex Test"
ClientHeight = 4710
ClientLeft = 1140
ClientTop = 1800
ClientWidth = 5055
Height = 5400
Left = 1080
LinkTopic = "Form1"
ScaleHeight = 4710
ScaleWidth = 5055
Top = 1170
Width = 5175
Begin SndDex SndDex1
Left = 2280
Top = 4200
End
Begin CommandButton BTN_RepeatInt
Caption = "Repeat Int"
Height = 375
Left = 960
TabIndex = 12
Top = 240
Width = 1215
End
Begin TextBox TXT_ExtSoundexCode
Height = 285
Left = 2640
TabIndex = 11
Top = 3960
Width = 2175
End
Begin TextBox TXT_SoundexCode
Height = 285
Left = 120
TabIndex = 10
Top = 3960
Width = 2175
End
Begin TextBox TXT_Result
Height = 375
Left = 120
TabIndex = 6
Top = 3000
Width = 4815
End
Begin TextBox TXT_KeyString
Height = 375
Left = 120
TabIndex = 3
Text = "Dog"
Top = 1200
Width = 4815
End
Begin CommandButton BTN_RepeatStd
Caption = "Repeat Std"
Height = 375
Left = 2400
TabIndex = 2
Top = 240
Width = 1215
End
Begin TextBox TXT_SearchString
Height = 375
Left = 120
TabIndex = 1
Text = "Dawg"
Top = 2040
Width = 4815
End
Begin CommandButton Btn_Compare
Caption = "Compare"
Height = 375
Left = 3720
TabIndex = 0
Top = 240
Width = 1215
End
Begin Label Label5
Caption = "Key String Extended code"
Height = 255
Left = 2640
TabIndex = 9
Top = 3600
Width = 2295
End
Begin Label Label4
Caption = "Key String Soundex code"
Height = 255
Left = 120
TabIndex = 8
Top = 3600
Width = 2295
End
Begin Label Label2
Caption = "Compare result returned"
Height = 375
Left = 120
TabIndex = 7
Top = 2640
Width = 4815
End
Begin Label Label3
Alignment = 2 'Center
Caption = "Search String"
Height = 255
Left = 120
TabIndex = 5
Top = 1680
Width = 4815
End
Begin Label Label1
Alignment = 2 'Center
Caption = "Key String"
Height = 255
Left = 0
TabIndex = 4
Top = 840
Width = 4815
End
Begin Menu nmu_File
Caption = "&File"
Begin Menu mnu_Exit
Caption = "&Exit"
End
End
Begin Menu mnu_Edit
Caption = "&Edit"
Begin Menu mnu_Cut
Caption = "Cu&t"
End
Begin Menu mnu_Copy
Caption = "&Copy"
End
Begin Menu mnu_Paste
Caption = "&Paste"
End
Begin Menu mnu_submenu
Caption = "SubMenu"
Begin Menu mnu_submenu1
Caption = "SubMenu 1"
End
Begin Menu mnu_submenu2
Caption = "SubMenu 2"
End
End
End
End
Option Explicit
Sub Btn_Compare_Click ()
Dim sStdTemp As String
Dim sIntTemp As String
Dim nDex As Integer
Dim nR As Integer
Dim ReturnedSoundexCodeStr As String
TXT_Result = ""
TXT_SoundexCode.Text = ""
TXT_ExtSoundexCode.Text = ""
' load the words to match
SndDex1.KeyText = TXT_KeyString.Text
SndDex1.SearchText = TXT_SearchString.Text
' do it with std soundex search
SndDex1.Action = 20 ''SNDEX_STDSEARCH
' store results
' NOTE: result VAR SoundsLike is an integer
' 0 => no match
' 1 => matches
sStdTemp = Str$(SndDex1.SoundsLike)
' now do it with integer soundex search
SndDex1.Action = 21 ''SNDEX_INTSEARCH
' store results
' NOTE: result VAR SoundsLike is an integer
' 0 => no match
' 1 => matches
sIntTemp = Str$(SndDex1.SoundsLike)
TXT_Result.Text = "Std = " + sStdTemp + " Int = " + sIntTemp
''
''
'' get the normal soundex codes
SndDex1.KeyText = TXT_KeyString.Text
SndDex1.Action = 25 ' std code
' normal soundex code returned is a string
TXT_SoundexCode.Text = SndDex1.SoundexCode
' loop testing of repeat code retrieve
For nDex = 1 To 5
SndDex1.KeyText = TXT_KeyString.Text
SndDex1.Action = 25 ' std code
' do something here with the returned code
ReturnedSoundexCodeStr = SndDex1.SoundexCode
Next
''
''
'' get the extended integer soundex codes
SndDex1.KeyText = TXT_KeyString.Text
SndDex1.Action = 26 ' int code
' extended integer soundex code returned is a string
TXT_ExtSoundexCode.Text = SndDex1.SoundexCode
' loop testing of repeat code retrieve
For nDex = 1 To 5
SndDex1.KeyText = TXT_KeyString.Text
SndDex1.Action = 26 ' int code
' do something here with the returned code
ReturnedSoundexCodeStr = SndDex1.SoundexCode
Next
TXT_Result.Text = TXT_Result.Text + " done"
End Sub
Sub BTN_Exit_Click ()
mnu_Exit_Click
End Sub
Sub BTN_Repeat_Click ()
End Sub
Sub BTN_RepeatInt_Click ()
''''''''''''''''''''''''''''''''''''''''''''''''
' PURPOSE: Illustrates a repeat integer search
''''''''''''''''''''''''''''''''''''''''''''''''
Dim nDex As Integer
Dim nR As Integer
MsgBox "See code for example of repeat searching."
SndDex1.KeyText = "Summertime"
SndDex1.SearchText = "Somertime"
SndDex1.Action = 21 ' int search
''
'' a loop illustrating how to repeat search
'' words could be stored in an array
'' here we just loop on the same word
For nDex = 1 To 5
SndDex1.SearchText = "SomerTime"
SndDex1.Action = 31 ' repeat int search
nR = SndDex1.SoundsLike
Next nDex
MsgBox "Done Integer Search"
End Sub
Sub BTN_RepeatStd_Click ()
''''''''''''''''''''''''''''''''''''''''''''''''
' PURPOSE: Illustrates a repeat standard search
''''''''''''''''''''''''''''''''''''''''''''''''
Dim nDex As Integer
Dim nR As Integer
MsgBox "See code for example of repeat searching."
SndDex1.KeyText = "Summertime"
SndDex1.SearchText = "Somertime"
SndDex1.Action = 20 ' int search
''
'' a loop illustrating how to repeat search
'' words could be stored in an array
'' here we just loop on the same word
For nDex = 1 To 5
SndDex1.SearchText = "SomerTime"
SndDex1.Action = 30 ' repeat int search
nR = SndDex1.SoundsLike
Next nDex
MsgBox "Done Standard Search"
End Sub
Sub Form_Load ()
If Me.WindowState = 0 Then
Top = 0
Left = 0
End If
End Sub
Sub Form_Resize ()
If Me.WindowState = 0 Then
Me.Height = 5550
Me.Width = 5175
End If
End Sub
Sub mnu_Exit_Click ()
End
End Sub