View Single Post
Old Nov 9th, 2005, 10:40 PM   #1
IceNeo
Newbie
 
Join Date: Nov 2005
Posts: 1
Rep Power: 0 IceNeo is on a distinguished road
Assigning first character of variable into an array

What I am trying to do is a very simple encrypt/decrypt program. I must point out now that I am very new at this and this is my first working program.

I load a file into a text box and have the content of the textbox in a variable. I need to then assign the first 20 characters into an array, change the characters, then read the array backwards.

This is what I came up with:

FileOpen(1, OpenFileDialog1.FileName, OpenMode.Input)
        Do While Not EOF(1)
            Dim InputArry(19) As String
            VarCount = 0
            Do While Not VarCount < 19 And Not EOF(1)
                InputArry(VarCount) = InputString(textFile, 1)
                ThisChar = Asc(InputArry(VarCount))
                Select Case ThisChar
                    Case 90
                        TempText = 65
                    Case 65 To 98
                        TempText += 1
                    Case 122
                        TempText = 97
                    Case 97 To 121
                        TempText += 1
                    Case Else
                        TempText = TempText
                End Select
                InputArry(VarCount) = Chr(TempText)
                VarCount = VarCount + 1
            Loop
            For AVar = VarCount To 0 Step -1
                StrO = StrO & InputArry(AVar)
            Next
        Loop
        FileClose(1)
        txtBox.Clear()
        txtBox.Text = StrO

Any suggestions? What am I doing wrong?
IceNeo is offline   Reply With Quote