VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Converts a string to the NATO phonetic alphabet

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

Rate 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


Download this snippet    Add to My Saved Code

Converts a string to the NATO phonetic alphabet Comments

No comments have been posted about Converts a string to the NATO phonetic alphabet. Why not be the first to post a comment about Converts a string to the NATO phonetic alphabet.

Post your comment

Subject:
Message:
0/1000 characters