Switching the numeric field to alpha as proposed earlier would be best,
but what about duplicating the entire display record ?

In one display file record you put EDTCDE(4) on the field you want and CHANGE(80) {or any other indicator} keyword
In the duplicated display record you put EDTCDE(3) on the same field and optionally put CHANGE(80) if you want the field to return to blanks on Enter key

In you program you test if Record Not Changed (*IN80=off) display Rec1 Else display Rec2


HTH



Sorry guys for my bad solution for %Str. I misread the RPG manual



On 4/24/2020 9:47 AM, Filip Drzewiecki via RPG400-L wrote:
Hi,

I'm trying to figure out if it is possible to have decimal field on dds screen which shows nothing(blanks) on it but if user type 0(zero), it will stay there after pressing enter. With EDTCDE(4), field is empty because of zero supression but if I will type 0 there, it will disappear after pressing enter and I would like it to stay if user typed it there.
It is not possible to achieve that result with any of Edit Codes or Edit Words. Unfortunately, option indicator can't be used on both EDTCDE and EDTWRD.

I wanted to avoid making this field character and later validation char to valid decimal format.

Thing is I have few fields (different length and decimal places) and I want them to be blank and if user type 0, this field will be set to 0 but if user leave it blank, it will be ignored.

Filip Drzewiecki
RPG Developer
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com

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.