11-18-2022, 02:40 PM
Character swap could be done easily in C. Enough said. Otherwise we would have to go into the realm of object-oriented programming. I'm not sure now but Delphi/Free Pascal had a class that allowed an ordinary string to be handled according to its constituent characters, allowed square-bracket operator like "word[1]" instead of like in BASIC "MID$(word$, 2, 1)". This was to access the second character of "word" string variable. Saying "word(1)" instead of "word[1]" probably called the class constructor. What was confusing is that array elements always started at zero, and the bad design decision was taken not to allow low and high array bound definition like a normal Pascal array.