
Itresnintg!
-
- Posts: 63
- Joined: 16 Sep 2003, 16:23
Het kan ook gewoon makkelijk:EMS2CREW wrote:Code: Select all
Option Explicit Public Function Encode(strInvoer As String) As String ' ' Tog een beetje opgemaakt :). Dim a As Long Dim b As Long Dim c As Long Dim lngRN As Long ' Rondom nummer Dim lngLI As Long ' Len Invoer ' Dim strUitvoer As String Dim strWoord As String Dim tmpInvoer As String ' strInvoer = strInvoer & Chr$(32) lngLI = Len(strInvoer) c = 1 ' For a = 1 To lngLI ' strUitvoer = vbNullString tmpInvoer = Mid$(strInvoer, a, 1) ' If InStr(tmpInvoer, Chr$(32)) > 0 Or _ InStr(tmpInvoer, vbCrLf) > 0 Then ' strWoord = Mid$(strInvoer, c, a - c) ' If Len(strWoord) > 2 Then ' strUitvoer = Left$(strWoord, 1) ' ReDim gehad(Len(strWoord)) ' ' For b = 2 To Len(strWoord) - 1 ' lngRN = Int(Rnd(1) * (Len(strWoord) - 2)) + 2 ' Do While gehad(lngRN) = 1 ' lngRN = Int(Rnd(1) * (Len(strWoord) - 2)) + 2 ' Loop ' gehad(lngRN) = 1 ' strUitvoer = strUitvoer + Mid$(strWoord, lngRN, 1) ' Next b ' strUitvoer = strUitvoer + Right$(strWoord, 1) ' Else ' strUitvoer = strWoord ' End If ' Encode = Encode & strUitvoer & Chr$(32) c = a + 1 ' End If ' Next a ' End Function
http://www.zeepost.nl/~janjaap/text.php
Heb geen moeite genomen naar leestekens te kijken...