|
At 13:01 06.4.2000 -0400, DAN BALE wrote: >... ... you will avoid the message that's slowing you down. However, this is >considered to be a bad programming practice. (... ... ) Dan Bale: please would you express more precisely, WHY this is 'considered to be a bad programming practice'? Since a lot of years I use this error-indicator, making after the WRITE-statement the error-handling: this could be (not often used) just writing to an error-protocol file with sendmessage to the operator after LR, but most likely (=nearly always) I have the so-called Unique key, when making the databasedesign, always added with an additional (internal) numeric field as last portion of the whole key: so I add +1 to it when the error-indicator was *ON until it is *OFF, this means that the program has never to STOP with the "blue screen of death" /cpyr bill g./, and I can alarm the operator/user/human at the program end (or other logical transaction end) with a message if interactive, or a protocol file or a list if it runs batch, where he has to look for this "duplicate key" in the sense of the application, but not-duplicate for the machine! (Would this be only a theoretical discussion, I would say, yes + guilty, I am quite never using a UNIQUE key even if I write it in the DDS; as practical application maker I say, that it is unique until the moment when something goes wrong and in this moment I leave NOT the responsibility for answering to a CPF (C G I R?) to a user who is not a programmer - then something has to be wrong with MY data design and its ME who has to react with a better design).--- Of course, the question of alarming or not depends of the nature of the application, as in many cases it could be nonimportant to allow more "unique" records (as you mention, then look first for the highest key with Setll and so on), then use an internal numeric field, see above. If your comment was, to use the error indicator and then NOT doing some error handling=doing nothing, then we are meaning the same, this can be very stupid and is really not professional. Thank you for answering István (from Austria) *note: having written now so much about error handling reminds me to: SELECT - for those who read german you find an article written by Anton in our magazine where he shows how to make nice error-handling (Global Message Handling in CL), the address is: <www.common.at/info9905.pdf> and there starting at page 38. - for those who can't read german, a look at the screen shots could be informative as CL code is selfexplaining. - all others: cheers! ENDSELECT +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.