Re: Is the 4gl 4.12/13/whatever compiler a bit smarter
Posted in 1994
In article <2s0ujc$ah@emory.mathcs.emory.edu>, Jack Parker wrote: > > > > The 4.10 4GL compiler is a bit stupid. Are later versions smarter? > > Specifically: > > > > MAIN > > WHENEVER ANY ERROR STOP > > CALL b() > > CALL a() > > END MAIN [code deleted] > This behaves as it should, WHENEVER is a pre-compile option, it is not compiled > as such but rather turned into a whole mess of 'c' calls which exit the program. > Therefore it is effective in the code until it runs across another one which > turns the option off. So function b() is NOT getting the WHENEVER ERROR STOP > message, it is obeying the last one put in. Check out the .ec code if you > don't trust me. I *KNOW* that it performs as per the manual, but I don't know why anybody would want it to! > > Why the hell can't I use the PRINT command in a function? It sure would > > save some code duplication at times! > > PRINT is reserved for REPORT functions. Use DISPLAY instead like: > > DISPLAY variable I wasn't clear enough, I want to: REPORT ON EVERY ROW CALL my_func() AFTER GROUP OF stuff CALL my_func() END REPORT FUNCTION my_func() # This function prints "blah" on my report PRINT blah PRINT blah_blah PRINT blah_blah_blah END FUNCTION > I think that's a bummer because during performance tuning I really want to > > DISPLAT CURRENT HOUR TO SECOND > > as opposed to > > LET ctime = CURRENT HOUR TO SECOND > DISPLAY ctime > > But c'est la vie. Nope. C'est la vie isn't good enough. If something is stupid I stand up and try to do something about it - Don't settle for second best. Strive for perfection! > > THE QUESTIONS: > > Are any of these things considered bugs? > > No. They are documented to perform in this manner. Agreed. They do work as per the documentation, but are they sensible? What damage would be done if they were "fixed", and hey - I'm not asking for the world am I? Regards, Kerry Sainsbury kerry@kcbbs.gen.nz