Non-COBOL Notes

If you were really doing this, you would use functions. However this is an exercise in manipulating data and understanding how it works so I have said no functions for the exercise. COBOL makes this reasonably painless - in other languages it will take more effort!

To do the name flip in VB character by character without using functions, you have to put the data into the array. To the best of my knowledge, there is not a way to take an existing field and describe it as an array the way there is in COBOL. I believe that the same holds true in C++ and Oracle. If someone comes up with a way to handle it differently, I would love to see the solution.

Anyway, what I did in VB was set up an array where I put the text, character by character, that came in and then another array where I put the text, character by character, as I flipped it. Each of these arrays is going to hold 25 elements and for me the element is one character. An example of the array is:

Dim arrayCN(25) As String

Then when the user entered the name and clicked on the button to flip the name, I did a subroutine I called Make Array. In this subroutine I did use functions to get the data in the array - I am only holding you to the one character at a time without functions to do the actual flip. The steps I took were:

Now I had the data in the array and I was ready to flip it.