× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Joe,

Three APIs:

QECCVTEC - Convert edit code to edit mask
QECCVTEW - Convert edit word to edit mask
QECEDT   - Edit value using edit mask

These work at run time. The descriptions that I have given them may not be
the ones in the manuals. I am not sure that there isn't a bindable version
of these. It is ages (nearly 9 years) since I looked into it.

Regards,

Kevin Wright


-----Original Message-----
From: Joe Pluta [mailto:joepluta@xxxxxxxxxxxxxxxxx]
Sent: Wednesday, 13 August 2003 14:50
To: 'RPG programming on the AS400 / iSeries'
Subject: Edit codes, edit words, and constant values


Ever have one of those days?

I was trying to do some work on editing numeric data.  I did a little
mocking up of the %EDITC and %EDITW BIFs, and then went on to write the
routine.  This routine determined the appropriate editing to apply
(either an edit code or edit word) by examining the DDS for a display
file, and then applied that editing to a numeric value.

It took a few hours to work out the design of the algorithm, but I got
it.  I managed to get around a couple of issues such as having to create
a decimal object on the fly with the correct precision, but I managed
all of that.  And I was all ready to go when I got a compile error.

I had this:
              Eval   edited = %editc(
                                 %dec(value:length:decimals):
                                 EditCode)

The compiler said, no no!  EditCode is not a character constant.
Constant?  Surely I read that wrong - you don't mean a literal constant,
right?

Then I read the manual:

"The constant can be a literal, named constant or an expression whose
value can be determined at compile time."

So, if you want to be able to dynamically choose an edit code at
runtime, you'll need one heck of a big select statement to handle the
many different edit codes.

And if you want to handle edit words, well, you can't.

>>sigh<<

Back to the drawing board.  I'm going to have to write my own editing
procedure.

Joe

_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.