It's been many years since I coded COBOL on a Univac 1106 but as I remember, COBOL actually had a self-modifying code statement. If memory serves me correct it was something like: Modify [Paragraph Name] to proceed to [Paragraph Name]. You probably ask yourself why. Well in those days it took a CPU much longer to perform a "If (boolean expresion) ..." than a jump (and probably still does). So what we write today as: void SomeFunc() { static bool FirstTime = true; if (FirstTime) { ... ... FirstTime = false; } ... ... } with the (boolean expression) ALWAYS being evaluated. But the COBOL code does not: ... ... Paragraph-Name1 Goto Paragraph-Name2 Paragraph-Name2 ... ... Modify Paragraph-Name1 to proceed to Paragraph-Name3 Paragraph-Name3 ... ... This COBOL code accomplishes the exact same result as using a "first time" flag but with less CPU time. That was important when processing millions of utility bills for month-end billing and processor speeds where not measured in GHZ. All you good COBOL coders out there, forgive me if I don't have the exact syntax, but regardless COBOL did offer the ability to modify its code at run-time.
skornel0
Posts
-
Die COBOL... Die!! -
Did I read that sign right?My all time favorite. When I was in the army, the latrine had a sign that read: Do not throw cigarette butts in the urinal. And someone else added: It makes them soggy and hard to light.
-
Die COBOL... Die!!One of the main things about COBOL is: when you multiply two real numbers you get the actual result, not some close approximation.
-
Exceptions in destructorsI have used similar code in my remote communications classes. My DTOR will close the comm connection, but if the reason the DTOR is being called is because the connection was already broken/disconnected, I needed to ensure that no exception interrupted the normal DTOR chain. It may not be quite what the C++ designers had in mind but it works. At least with MS VC++. Besides, if they didn't want it to work, it woud have explicitly stated so in the ARM.
-
How old did you start programming?My first personal computer was an S100 bus system running CP/M. 64K (not MB) of RAM, 5 serial ports, 2 parallel ports and a Televideo 925 terminal, 2 QUME DT8 8" floppies DSDD for 2.5MB storage. My language of choice was Pascal. That was back in 1981. I had already been writing code professionally for 6 years but wrote my very first program in college in 1967; Fortran and I don't even remember the type of computer it was. Probably IBM.
-
Code Project Articles I've used todayI've combined http://www.codeproject.com/listctrl/thumbnail.asp[^] and http://www.codeproject.com/listctrl/filedroplistctrl.asp[^] to create an image viewer that accepts files via drag and drop. Both articles saved me a lot of time and most importantly I learned some new points about the modus-operandi of Windows. I generally scan the new articles for C++ every day and keep a link to the ones that look interesting that I may be able to use in the future and it paid off today.
-
Which laptop should I choose?Well, my 2 cents is that if you intend to develop s/w with it, neither one will do the job. But in any event, beware of machines with "shared memory" video and you will not be happy with a 5400 RPM drive. I fell into that trap on my notebook and was forced to give it to my wife because it was just too slow. If you are going to upgrade something, think about upgrading them in addition to 1GB of memory.
-
BackpacksThe ALICE pack is designed to carry heavy loads with proper weight distribution. That's what I'd go with, besides, it is cheap enough.
-
using splitter windows in a non doc/view applicationCheck out the class CSSplitter found here on CodeProject. I use it in an app that has a re-sizeable dialog as the main window. Just search for CSSplitter and it's the only hit you'll get. It works very well.