Re: Is the 4gl 4.12/13/whatever compiler a bit smarter
Posted in 1994
Topics: Performance & Tuning, Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL
Kerry Sainsbury (kerry@kcbbs.gen.nz) wrote: : 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! As a previous (and sympathetic Informix) poster noted, it isn't even on the first page of desireable Informix features. That's the way *this* compiler works, we have all learned to live with it. Asking Informix to change much of anything about 4gl is like pi...er spitting in the wind. : > > 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! Then what are you doing programming in 4GL? If you want *perfection*, you are a long way off, try modula-2 or c++ or something else. After about 10 languages and a 100 or so compilers, you might learn to be a little more accepting ( or innovative ) about compilers. I know I have. :-) : > > 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? Design decisions were made in the development of this language and compiler. Many weren't the best, but they are workable. What I would have given for a NEXT ROW xxx in the INPUT ARRAY statement or a INPUT ARRAY p_arr.a, p_arr.b, ... FROM scr_arr.a, scr_arr.b, ... so I don't have to maintain parallel (or shadow) arrays for columns that I need but are not on the screen! DCT -- @ David Tomlinson @ @ dtomlnsn@netcom.com @ @ "By day fantastic birds flew through the petrified forest, and @ @ jeweled crocodiles glittered like heraldic salamanders on the @ @ banks of the crystalline river. By night the illuminated man @ @ raced among the trees, his arms like golden cartwheels, his @ @ head like a spectral crown...." @