<-- Previous || Up || Next -->

Baudot Encode Function
Codes Ciphers Class

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

Encodes a string using the Baudot machine-readable code.

Summary: Baudot is a five-bit code capable of representing capital letters, numbers, and certain punctuation characters defined as International Telegraph Alphabet #2.
Example:
    BaudotEncode("AU4") = Chr$(31) + Chr$(3) + Chr$(7) + Chr$(27) + Chr$(10)
See also:
    BaudotDecode Function
    BaudotEncodeSample Subroutine
Note: Use the BaudotEncodeSample Sub to illustrate the ANSI Windows characters supported by the Baudot code.

vValue: String which is to be encoded with the Baudot coding scheme. Function returns Null if vValue is Null or cannot be fixed up to a String.
Note: Characters within string vValue which are not supported by the Baudot code will be ignored.
Note: Lower-case characters are converted to upper-case because otherwise they would be ignored since the Baudot code does not make a distinction between lower-case and upper-case characters.

One character in the Baudot represents "letters" mode in which the following characters are interpreted as letters, and there is a "figures" mode in which the following characters are interpreted as numbers or punctuation. This algorithm uses a "letters" or "figures" character to introduce each encoded string, instead of assuming that the decoding "machine" will be in a specific mode. Also, the "letters" or "figures" character is sent at least every 72 characters to ensure that the sender and receiver do not get out of sync.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.