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



Buck Calabro wrote:
 > ...
> Hans suggested using %dec, but I can't construct a more generic replacement
> for MOVE with %dec because
> c                   eval      alph15 = %editc(
> c                                        %dec(
> c                                          dec12:
> c                                          %len(alph15):
> c                                          %decpos(dec12)):
> c                                        'X')
>
> doesn't compile.  I may be missing something, but the compiler is
> complaining that the second and third arguments to %dec "must be a numeric
> literal; a built-in function that has a value known at compile-time; or a
> numeric named constant."  I would have thought the compiler would be able to
> know the length of alph15 and the decimal positions of dec12, given that
> ...

Regarding the coding of the 2nd and 3rd parameters of %DEC, we've
been struggling for years to get them to work right when coding
%LEN() and %DECPOS().  It's a problem that's defeated *all* of us
here in RPG development.  In a nutshell, the problem is that in an
expression, the parameters to %LEN() and %DECPOS() can themselves be
expressions.

The best you can do today is to define named constants defined as
%LEN() and %DECPOS() and use them as the 2nd and 3rd parameters.

Strangely enough, once you have the named constants defined, you can
do things like %DEC(NUM:LENC+3:DECPOS-2).

Cheers!  Hans





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.