Booth, Not trying to start any holy war here. :-) I've always found it puzzling that there wasn't an easy way to do what I wanted, and what was requested by Lance. The solution I mentioned comes close, but it beats me why IBM couldn't correct the behaviour that causes the "Field -" key to display the hex "D_" character, instead of just displaying the digit followed by the '-' sign. Minor nuisance though it is, I still think it's a pain coding Edit Words when there is an Edit Code to basically do what you want, and that doesn't have to be changed if field lengths change. I'm not particularly concerned whether a zero displayed as "0.0000" or " .0000", so wouldn't switch to an Edit Word just for that. CHECK(ER) may be a valid solution, and not impact performance on a local LAN - but could be a concern for remote users with slower connections. Neil Palmer DPS Data Processing Services Canada Ltd. 50 Acadia Avenue, Ste.102 AS/400~~~~~ Markham, Ontario, Canada. ____________ ___ ~ Phone:(905) 474-4890 x303 |OOOOOOOOOO| ________ o|__||= Cell.:(416) 565-1682 x303 |__________|_|______|_|______) Fax: (905) 474-4898 oo oo oo oo OOOo=o\ mailto:NeilP@DPSlink.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ http://www.DPSlink.com iSeries 400 The Ultimate Business Server email@example.com Sent by: firstname.lastname@example.org 2001/01/27 11:21 Please respond to MIDRANGE-L To: MIDRANGE-L@midrange.com cc: Subject: Re: Not keying decimal points Neil this can become a Jihad if we aren't careful but I would like to add a few comments. I just tried a couple of sample screens and decided to respond. The EDTWRD is a valid choice in my opinion. It allows the leading zero to be placed where you wish and is used by all of us with regularity. So far as counting spaces, well... I don't know what to say, I rank right down there with the world's worst typists and only one tiny step up when it comes to counting to ten so your comment has sympathy here. However the main thrust of this reply is the idea of using the CHECK(ER) keyword. I am changing my programming style to copy the event-based processing algorithm instead of the huge all-at-once validity subroutine. As I learn more and more about the benefits of event-based programming I am finding more and more ways to use the idea. The AS/400 is giving us sub-second response times now so it is completely reasonable for EXFMT to return the name of the cursor's field and use a SELECT group and have the select routine do a field-by-field validation process as the user progresses through the screen. In a case like you mention here one could just recognize the cursor was in the field and immediately finish the cycle and be back to the EXFMT with the field correctly formatted including commas or whatever. _______________________ Booth Martin Booth@MartinVT.com http://www.MartinVT.com _______________________ "Neil Palmer" <email@example.com> Sent by: firstname.lastname@example.org 01/27/2001 12:09 AM Please respond to MIDRANGE-L To: MIDRANGE-L@midrange.com cc: Subject: Re: Not keying decimal points That doesn't make any difference to the behaviour of the Field - key changing negative 0 through nine to '}JKLMNOPQR' - besides an edit word is more trouble than it's worth, having to count out the exact number of replaceable characters, troubles when field lengths change, etc. ...Neil email@example.com Sent by: firstname.lastname@example.org 2001/01/26 21:32 Please respond to MIDRANGE-L To: MIDRANGE-L@midrange.com cc: Subject: Re: Not keying decimal points What if you used the EDTWRD(' 0.000-') instead of the L edit code? _______________________ Booth Martin Booth@MartinVT.com http://www.MartinVT.com _______________________ "Neil Palmer" <email@example.com> Sent by: firstname.lastname@example.org 01/26/2001 08:21 PM Please respond to MIDRANGE-L To: MIDRANGE-L@midrange.com cc: Subject: Re: Not keying decimal points That's been something I've trying to figure out a better solution to for years. The answer is yes, IF you are willing to accept use of the Field - key displaying a number like negative 25.55 as 25.5N when Field - is pressed. Of course it displays correctly when you redisplay the field. If the user wants, they can also key 25.55- (key the '-' key after 25.55) and press Field + or Field Exit, to avoid the 25.5N display. REFSHIFT(Y) EDTCDE(L) CHECK(RB) optionally - if you don't want negatives RANGE(0 99999.99) or whatever field size is Oh - an amount of zero would display like .00 and not 0.00 My main reason for wanting this, besides making decimal point entry optional, was to clearly display to the user how many decimal fields they are allowed to enter into the field. So a blank zero pay rate field may display like .0000 which lets them know they have 4 decimal places they can use. If anyone has a solution that eliminates the quirk with the display of negative numbers when using the 'Field -' key I'd sure like to hear it. ...Neil Gwecnal@aol.com Sent by: email@example.com 2001/01/25 12:30 Please respond to MIDRANGE-L To: MIDRANGE-L@midrange.com cc: Subject: Not keying decimal points Is there some magic combination of keyboard shift, edit code or word, and CHECK keywords that will allow me to display a numeric like this: 0.00 left justified with decimal, zero amount 12.34 left justified with decimal, positive amount 45.67- left justified with decimal, negative amount AND allow the user to key in an amount and use field plus or field minus to justify the entry AND have the use of the decimal point optional? That is, they don't have to key the decimal, but they may. The accounting people are used to not keying decimal points since they do not have to on their calculators or older programs, but they would like to start seeing the decimals on the entry screens. All the above is easy to do if you don't need editing, and I can't quite figure out how to do it with editing. TIA, Lance +--- | 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: firstname.lastname@example.org +---
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.