|
Richard, >If the whole number >is zoned and negative, then the upper four bits of the low-order byte are >1110 - hex E. Actually, it is binary 1101 which is hex D, at least as the preferred format. I think at least one other zone is permitted as a negative number for the sake of compatibility with data from some mainframes -- if memory serves me it was hex C or binary 1100 zone. All the S/3x machines used zone D for negative numbers. >Why J through R plus one character? Because the hex value for negative 1 is >E1. When printed, hex E1 is capital J. Minus 2 is hex E2 and that is hex >for capital K. Capital R is coded hex E9. xD1 is J, xD9 is R whereas xE2 is S and xE9 is Z, so I suspect you meant zone D all along >What about this mystery "one extra character"? Hex E0 isn't printable. xE0 is a backslash character \, at least in my codepage xD0 is a rightbrace }, which is what displays if the last digit is zero and field- is used to exit a numeric display field I think } may be a variant character, so I'm not sure what shows up in other codepages -- I live a very sheltered life >I hope that leads to a solution. It doesn't really lead to a solution for the original "problem" of: >> The actual program data I'm getting from the fields is correct, >> but the hex interpretation is annoying and possibly confusing >> to the user. Adding an edit code will make the field appear correct when redisplayed, but does not directly address how input appears prior to pressing Enter, which is what Justin was seeking. The WS controller just does not handle this as gracefully as we'd like. Possible "solutions" include: - User training. (Does this count as a solution?) Teach them it really does work. Or they can key an explicit minus sign if it gives them a warm, fuzzy feeling - Define the display field as signed numeric (S) Pro: Field- gives you an onscreen trailing minus sign Con: You cannot use an edit code; user cannot type decimal I've also heard some people will redefine the Field- minus key to be a macro with an explicit minus character (hyphen) followed by Field+. Personally, I don't recommend this alternative. It makes it impossible to enter negative numbers should a display file use a signed numeric (type S) field. And it is only works for devices where you can remap the keyboard. Doug +--- | 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.