by Michael P Larsen (1 Submission)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 4th November 2006
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Converts a string to the NATO phonetic alphabet
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
MsgBox (strMsg & vbNewLine & "---------------" & vbNewLine & Mid(strOut, 2))
End If