Encoder/decoder for String into Arrays of Integers

Category:
String Manipulation
Type:
Snippets
Difficulty:
Beginning

Author: Anonymous

Version Compatibility: Visual Basic 6

More information:
This example of code uses the random number generator to create a lookup list used to convert strings into arrays of integers. The class comes with encode and decode operations.

Can be used as a very simple encryption/decryption method.

Sample Usage:

Dim o As New clsEncoder
Dim iArr() As Integer, iCtr As Integer

Dim s As String
s = "This is a test"
o.Encode s, iArr
For iCtr = 0 To UBound(iArr)
    Debug.Print iArr(iCtr)
Next
MsgBox (o.Decode(iArr))
 

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: