Search

What the Quote?

"Imagine if the election came down to Alaska... they'd be runnin' out of their igloos."

Steven Rodgers

"No way, CondoBall lights up!?"

Tim Tripcony

"You can't polish a turd."

Michael Nurre

« Parsing formulas on the fly via @Eval and @While | Main| AJAX IM for Domino »

Probably useless - LotusScript toAcronym()

Category show-n-tell thursday
Not sure if there's a practical use for this, but if there is, enjoy:

Public Function toAcronym (Byval p_strFullName As String, Byval p_boolPunctuate As Boolean) As String
'Written on a whim by Tim Tripcony on 7/8/2006
    Dim intCharacterCode As Integer   
    Dim strAcronym As String
    Dim strFirstCharacter As String
    Dim varNameWords As Variant
   
    Let varNameWords = Split(p_strFullName)
    Forall strNameWord In varNameWords
        Let strFirstCharacter = Left$(strNameWord,1)
        Let intCharacterCode = Asc(strFirstCharacter)
        If ((intCharacterCode < 91) And (intCharacterCode > 64)) Then 'Only process words beginning with a capital letter
            Let strAcronym = strAcronym & strFirstCharacter
            If p_boolPunctuate Then
                Let strAcronym = strAcronym & "."
            End If
        End If
    End Forall
    Let toAcronym = strAcronym
End Function