dcsimg
June 23, 2018
Hot Topics:

The Secret of Soundex

  • November 19, 2002
  • By Karl Moore
  • Send Email »
  • More Articles »

To test out the code, let's quickly knock together a sample project.

  • Launch Visual Basic
  • Create a new Standard EXE project
  • Paste the Soundex algorithm behind Form1

This simple project will take the values from two Text Boxes, compare them and state whether or not their Soundex codes match.

  • Add two Text Boxes, a Command Button and a Label to your Form, positioning them a little like this:

Ignore regular naming conventions for now. Go on, I dare you. Hey, you've got to have a bit of fun! We're young, innocent...

  • Add this code behind your Command Button:
Private Sub Command1_Click()    Text1.Tag = Soundex(Text1.Text)    Text2.Tag = Soundex(Text2.Text)        If Text1.Tag = Text2.Tag Then        Label1.ForeColor = vbRed - 100        Label1.Caption = "The Soundex codes match!"    Else        Label1.ForeColor = vbBlue        Label1.Caption = "The Soundex codes don't match"    End IfEnd Sub

That's it! You've created your simple test application.

  • Press F5 to run

To test the project, enter two values such as 'JON' and 'JOHN' and hit the Command Button. You might also want to experiment with:

  • Visual, Vezual
  • Richard, Ricardo
  • Forrest, Forest, Forrester
  • Checker, Chequer
  • Sideroad, Syde-rowd
  • Coronation, Carnation




Page 5 of 6



Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.

Sitemap

×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date