DecodeSoundexWord is a function that converts a Word type unsigned 16-bit integer AValue that represents the phonetic value of a string.

The integer AValue is the result of a string that has been passed into the function SoundexWord.

DecodeSoundexWord takes AValue and returns the corresponding Soundex string representation, which is a phonetically encoded string where each character of the Soundex representation represents a family of similar phonemes.

The resulting string will be limited to four(4) characters only.

Be aware that if you are writing to the same string variable when calling this function repeatedly, then it is necessary to clear or empty the variable after each use to avoid any corruption to the result.

Declaration: Function DecodeSoundexWord( AValue : Word) : string;

Examples are as below. You will note that the variable is being returned to blank after each call.

procedure ScriptEvent (var Value : variant);
var
wString: string;
begin
LogInfo('');
wString := DecodeSoundexWord(15416);
LogInfo('mcgillicuddy 15416 is '+wString);
wString :='';
wString := DecodeSoundexWord(19364);
LogInfo('Pumpkin 19364 is '+wString);
wString :='';
wString := DecodeSoundexWord(21940);
LogInfo('Romano-Wickham 21940 is '+wString);
wString :='';
wString := DecodeSoundexWord(21744);
LogInfo('Robinson Crusoe 21744 is '+wString);
LogInfo('');
end;