× 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.



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


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.