On 10/2/2014 8:33 PM, Bruce Layne wrote: > way back in 1978. I had read the > entire textbook the summer before my freshman year. Near the end of the > class, I used a GOTO in one of my programming assignments. The teaching > assistant went nuts. My PL/C program was returned, and she had circled > the GOTO statement and scrawled, "Where did you get this?!?!?" The > language had a GOTO statement, and it was listed with all of the other > syntax in an index in the back of the book.
A programming teacher who didn't know ALL of the statements in the language she was teaching, or did but failed to teach the use of all of them? May as well have a math teacher who neglects to teach fractions because she doesn't like them. Decimals are just the *right* way to always do non-integers. For something that *always* has to run the same and is *always* called the same way, a GOTO type of statement makes perfect sense. For example a homing routine that retracts the Z axis then runs X and y until they hit their home switches, then returns to a ready state. In most languages a GOTO just jumps with no "memory" of where it jumped *from* so the programmer must know exactly where to GOTO again at the end of the gone-to routine. No problem there if the programmer doesn't want the code to jump back to where it came from. A GOSUB and RETURN does that, RETURN automatically jumps back to the next line after the GOSUB, no matter what other changes are made in the code. Useful for leaving a loop and returning to it, with conditional stuff inside the loop to determine whether or not the GOSUB gets used. An example would be a loop that does one thing if an input it's monitoring is an even number, but if the input is odd it goes to the GOSUB, does that subroutine then RETURN jumps back to the next command in the loop. Whatever is next happens then back to the beginning of the loop to test the next input for even or odd. Disclaimer: I haven't written any program code in years, but I do remember some things! I did a bunch of small things and one large project. I wrote the big one out longhand, in pencil, fully sorted out and debugged, before I started typing. There were a lot of variables to be filled in and a whole lot of subroutines. Worked perfectly the first time, loops and jumps and all. :) Programming is what made algebra make sense to me! A good old BASIC language would be an excellent teaching tool for math teachers. --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com ------------------------------------------------------------------------------ Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
