Function Codes Ciphers Class

MorseCodeDecode

Decode a string which contains Morse Code dots and dashes represented by period and hyphen characters.

Signature (Visual Basic / VBA)

Public Function MorseCodeDecode( _
    ByVal vValue As Variant _
    ) As Variant

Code Example

    MorseCodeDecode("... --- ...") = "SOS"
    MorseCodeDecode("... --- ...   ... --- ...") = "SOS SOS"
    MorseCodeDecode("...     ...") = "S S" ' #3

Parameters

Parameter Description
vValue String containing the Morse Code dots and dashes (represented by period and hyphen characters respectively) which is to be decoded. Function returns Null if vValue is Null or cannot be fixed up to a String.

Notes & Version History

Summary Each Morse code character consists of a series of dots and dashes (represented by period and hyphen characters respectively within the result string).
Note The conversion from Morse code back to ANSI Windows characters is not perfect as each run of two or more spaces is converted into a single space, as in example #3.
Note Words (sequences of non-space characters) within string vValue that are not recognized as valid Morse Code characters are ignored.