SDX
Soundex Value of String
This string function returns the 4-character Soundex value for a specified string based on the method originally developed by Margaret K. Odell and Robert C. Russell (U.S. Patents 1261167, 1918; 1435663, 1922).
Syntax
Section titled “Syntax”SDX (string-value [,ERR=line-ref|,ERC=error-code])string-value- is any valid string.
line-ref- is the program line number or label to branch to if an error is produced by this function.
error-code- is a programmer-defined error code. Valid values are positive or negative whole numbers.
Remarks
Section titled “Remarks”This function is generally available starting with release level 8.1B2.
The returned string is 4 characters long with the first character being the uppercase of the first numeric or alphabetic character in the string followed by a 3-digit number code for the string. The translation is not case sensitive (e.g. uppercase gives the same result as lowercase).
This function is often used in checking spelling in text. If a word is not found in the word processor’s dictionary, many times the word processor generates the Soundex value and lists all other words in its dictionary with the same Soundex value as possible correct spellings.
Examples
Section titled “Examples”PRINT SDX(STRING$)prints “R300” if STRING$ contained “READ”, “read”, “RED”, “red”, “RD”, “Rd”, or “rd”.
prints “B416” for “boulevard”, “bulavard”, “blvrd”, “bull-a-vard”, or “boolivard”.
From the Thoroughbred Basic Language Reference, Volume III: R–Z, version 8.9.1. Open this page in the PDF