|
Charlie, In a message dated 97-07-14 12:04:42 EDT, you write: > Please tell me how I properly structure a screen edit routine where the user > has requested serial editing, i.e. stop and redisplay the screen as soon as > the first error is encountered. I would code it as follows: > > C @@edit betsr > * > C item chain itemmast 20.... > c if *in20 > c goto edit@@ > c endif <<SNIP>> > c edit@@ endsr > > How would you code this without using a GOTO, without testing an error flag > repeatedly, and without using a DO *FOREVER/LEAVE construct? I would probably do the following: > C @@edit betsr > * > C item chain itemmast 20.... > c if *in20 > c (Assuming error handling routine here) > c else > * > c cust chain custmast 21.... > c if *in21 > c (Assuming error handling routine here) > c else > * > c cmhold ifeq 'Y' > c eval *in22 = *on > c (Assuming error handling routine here) > c else > ... > c endif > c endif > c endif > ... > c edit@@ endsr Gets pretty "nesty" (pun intended), but nary a GOTO in sight! Personally, I prefer to leave out the ELSE's and edit all fields at once, so that the user knows everything that needs to be corrected with only 1 screen I/O -- works much better for applications run over dial-up. And I STILL have yet to find a place in my heart for a GOTO :-)... JMHO, Dean Asmussen Enterprise Systems Consulting, Inc. Fuquay-Varina, NC USA E-Mail: DAsmussen@AOL.COM "One of the greatest labor-saving inventions of today is tomorrow." -- Vincent T. Foss * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This is the Midrange System Mailing List! To submit a new message, * * send your mail to "MIDRANGE-L@midrange.com". To unsubscribe from * * this list send email to MAJORDOMO@midrange.com and specify * * 'unsubscribe MIDRANGE-L' in the body of your message. 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-2025 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.