Dennis Putnam wrote:How stupid is that? All it took was some new eyes. Thanks.
Often does. That's why God gave us the internet.
When I was in college (~1979), I did a lot of Fortran programming, initially all on punched
cards. We got a time-sharing minicomputer before I left, though, so I switched from
cards to a terminal (remember those?). One day, I was working on a program that opened and read a file. The "open" statement in that version of Fortran was pretty arcane, and took a potentially long list of parameters, each of which had to be named. If your Fortran statement ran too long, you could continue it on the next line, but you had to mark the line as a continuation of the one before it. I don't remember the exact Fortran, but my file-opening statement looked something like this:
My program worked fine. After a while, I had to add some fields to my record, so my open statement had to change to this:
My program compiled and still ran, but it only read the first few characters of each record. I worked on this for
hours, finally realizing that my program "broke" whenever I had a record length of 100 or more characters. I was on the verge of concluding that the file i/o system had a bug, when another student walked in, looked over my shoulder, and said, "Your first line is too long." Too long? What he meant was that, in the days when programs were punched onto cards, the statements had to be in the first 72 columns because columns 73-80 were reserved for serial numbers. That was very useful if you dropped your deck of cards and had to sort them back into the original order, but we simply never did that.
Now, don't ask me why I put that comma in front of the
word "STATUS." I just did, for some reason. The end result was that, in my first version, the compiler correctly saw my record length as "80." In my second version, the compiler saw my record length as "10," and my line containing the record length as having a serial number of "4" in the first of the eight reserved columns on the "card" the compiler still thought it was reading (even though I was using a whiz-bang, super-cool, can-I-have-one-for-Christmas-Mom? Digital Equipment Corporation VT-100, which
didn't show the column labels like the cards did .) [Yes, the example above is nowhere near long enough for the problem I actually experienced, but I can't remember enough Fortran to fill it out that far.]
Today, over 30 years later, I am
still not sure if I wanted to kiss him, or kill him, for pointing out my error.
Sometimes, this just ain't the right game for the weak, eh?