I thought about that, but it may be more trouble than it's worth. I do have a check in place where the total sales in this file/screen must match the sales in the first file/screen. So if the user were to do what I described, they wouldn't be allowed to move forward to save the values to the file because the of the mismatch in totals. They can press F12 to exit without saving.

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Jeff Young
Sent: Friday, September 17, 2010 9:29 AM
To: Midrange Systems Technical Discussion
Subject: Re: Display File spaces in number input fields.

Michael,
Try defining the field in the DSPF as type Character, with keyboard shift
code 'N' and specify keyword CHECK(RAZ) to right adjust and zero fill the field.
Then you can test if the field contains invalid characters by moving it to a
numeric field for processing.
and monitoring for an error.

Jeff Young
Sr. Programmer Analyst
IBM -e(logo) server Certified Systems Exper - iSeries Technical Solutions V5R2 
IBM  Certified Specialist- e(logo) server i5Series Technical Solutions
Designer V5R3
IBM  Certified Specialist- e(logo)server i5Series Technical
Solutions Implementer V5R3

  
 






________________________________
From: "Schutte, Michael D" <Michael_Schutte@xxxxxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Sent: Fri, September 17, 2010 8:51:03 AM
Subject: RE: Display File spaces in number input fields.

FYI, for some reason I didn't get either of your responses. 

Anyway, the field is numeric... The issue isn't that the user is pressing the
space bar.  What's happening is in a 7,2 field, the default value is 12.01  when
the user modifies the field, they can put a 1 in the first position of the field
and then hit tab.  So now the field looks like this...


1  12.01

No spaces were entered, just a 1 then tab.  When the rpg program returns the
screen, the field has be changed to 10012.01

It's been awhile since I've coded one too, but this isn't my first go around. 
Sorry for not specifying that the field was numeric in the first place. My
assumptions seem to get me in trouble a lot.  Ha Ha.


Thank you,


-----Original Message-----

AS Steve said, make the field numeric and the user would have to enter 1001 not
1  1.



William Moore
California Fine Wire
805-489-5144
wjmoore@xxxxxxxxxxxx

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx]
On Behalf Of Needles,Stephen J
Sent: Thursday, September 16, 2010 2:43 PM
To: midrange-l@xxxxxxxxxxxx
Subject: RE: Display File spaces in number input fields.

It has been awhile, but if you describe the field as numeric, it shouldn't allow
the blank to be entered...regardless of tab or field exit.

As I said...it has been awhile since I wrote a display file (15+ years!)!

-steve

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx]
On Behalf Of Schutte, Michael D
Sent: Thursday, September 16, 2010 4:29 PM
To: Midrange Systems Technical Discussion
Subject: Display File spaces in number input fields.

In a display file you can mark a field to require field exit.  However, it
doesn't prevent you from hitting tab and then hitting enter and submitting the
screen to the RPG program.  The issue I'm having is that a user can put a 1 in
the first space of the field and then put two spaces followed by another
number.  So it looks like this...

1  1.  After tabbing from the field (instead of field exit) and then pressing
enter, the number is changed to 1001 after the RPG program redisplays the
screen.  How can I prevent this?


Thank you,


Michael Schutte
Programmer Analyst
(w) 614-492-7419
[emailimage]
Announcing Bob Evans Bob-B-Q(r) Road Trip! For a limited time, America's best
Bob-B-Q(r) tastes are all at Bob Evans!
For more information, visit http://www.bobevans.com/menu/seasonal.aspx


==============================================================================
This communication, including attachments, is confidential, may be subject to
legal privileges, and is intended for the sole use of the addressee. Any use,
duplication, disclosure or dissemination of this communication, other than by
the addressee, is prohibited. If you have received this communication in error,
please notify the sender immediately and delete or destroy this communication
and all copies.

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To
post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment
to review the archives at http://archive.midrange.com/midrange-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.