'The following should be placed in a module:
Public Function Rot13(ByVal j As String) As String
Dim c As Byte
Dim t As String
t = j
For i = 1 To Len(j)
t = Right(t, Len(j) - i + 1)
c = Asc(t)
If (c > 64) And (c < 78) Then
Rot13 = Rot13 + Chr(c + 13)
ElseIf (c > 77) And (c < 91) Then
Rot13 = Rot13 + Chr(c - 13)
ElseIf (c > 96) And (c < 110) Then
Rot13 = Rot13 + Chr(c + 13)
ElseIf (c > 109) And (c < 123) Then
Rot13 = Rot13 + Chr(c - 13)
Else
Rot13 = Rot13 + Chr(c)
End If
Next i
End Function
'Example, Rot13("Ruben") will return "Ehora"
'and Rot13("Ehora") will return "Ruben".
'Could be used to scramble contents of created
'text file etc. that you want to be accessed by
'your created program only.
'Created by "Ruben" <ruben@army.net>
|