NATOSpelling Procedure:
Convert to the NATO international phonetic alphabet
Description:
NATOSpelling Procedure converts a string to the NATO international phonetic alphabet.
Syntax:
Call NATOSpelling(string)
Example:
<%
Call NATOSpelling("IK1HSL") '--- returns: IK1HSL ------ India-Kilo-1-Hotel-Sierra-Lima
%>
ASP Source Code:
<%
Private Sub NATOSpelling(strMsg) Dim strWords, i, strOut strWords = Array("Alpha", "Bravo", "Charlie", "Delta", _ "Echo", "Foxtrot", "Golf", "Hotel", _ "India", "Juliet", "Kilo", "Lima", _ "Mike", "November", "Oscar", "Papa", _ "Quebec", "Romeo", "Sierra", "Tango", _ "Uniform", "Victor", "Whiskey", "Xray", _ "Yankee", "Zulu") If strMsg <> "" Then For i = 1 To Len(strMsg) If (Asc(LCase(Mid(strMsg, i, 1))) >= 97) And (Asc(LCase(Mid(strMsg, i, 1))) <= 122) Then strOut = strOut & "-" & strWords(Asc(LCase(Mid(strMsg, i, 1))) - 97) Else If IsNumeric(Mid(strMsg, i, 1)) Then strOut = strOut & "-" & Mid(strMsg, i, 1) Else strOut = strOut & "-" End If End If Next response.write strMsg & vbNewLine & "------" & vbNewLine & Mid(strOut, 2) End If End Sub
%>
|