|
Richard Jackson wrote: >Why is writing a CL program messy? > >if (&fld1 *ne ' ') do >chgvar &qryslt ('fld1 = ') >chgvar &qryslt (&qryslt || &q || &fld1 || &q) >enddo > >and so forth. > >If the search arguments might contain a >generic character, detect the % or * >with a tiny RPG program and verify the >argument syntax or detect with the >program and validate syntax using >QCACHECK as you suggested. > >I just wrote 40 percent of the basic program >in 5 minutes. I don't understand why you >think this will get ugly. It'll be fun to watch the little tweaks that will get made to this bad boy before it's a working program instead of a skeleton. :-) The devil is (always) in the details. We'll need to add checking for blank parms (users field exit through instead of using newline), discriminating between character and numeric fields in the database (the old quote deal), search fields containing apostrophe's. Not to mention that next week we'll have to add "or" logic. :-) The main reason CL is ugly compared to an HLL is the lack of subroutines. A few subroutines/procedures would make coding the solution much cleaner, I think. I'm not knocking CL - you can use OPNQRYF to do a CHAIN in CL if you want, but it's ugly compared to the HLL version. Unfortunately, it seems that many AS/400 people aren't that comfortable with CL. When suggesting a solution I'm torn between recommending more familiar RPG or less familiar CL. Personally I would work this one in ReXX, but even fewer people use that than CL... Buck Calabro Aptis; Albany, NY "We are what we repeatedly do. Excellence, then, is not an act, but a habit." --Aristotle Billing Concepts Corp., a NASDAQ Listed Company, Symbol: BILL +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-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.