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



%decpos() is only evaluated at compile time...

In fact the manual states, "The value returned is a constant..."

So I'd Agree with Kurt, there doesn't appear to be a logical reason it
doesn't work.

You could try opening a PMR, but I'd guess you'll get back a WAD and have
to open a DCR.

Charles



On Fri, Jun 6, 2014 at 2:39 PM, Robert J. Mullis <robertmullis99@xxxxxxxxxxx
wrote:

My understanding is that anything defined with keyword TEMPLATE is only
available at compile time. You can't use them in the program at execution
time. TEMPLATEs are only meant to globally define a value that is to be
used to define other values within the program/procedure.

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Kurt
Anderson
Sent: Friday, June 06, 2014 1:42 PM
To: RPG programming on the IBM i / System i (rpg400-l@xxxxxxxxxxxx)
Subject: %DecPos on a template variable

I tried using %decpos on a template variable, and it wouldn't let me:

editCode = $GetUsageAmountEditCode( %decPos( dsT_Inv_State.SBeg )
);
RNF0655: Item SBEG was defined with TEMPLATE and cannot be used in this
context.
RNF0655: Item DST_INV_STATE was defined with TEMPLATE and cannot be used in
this context.

dsT_Inv_State is indeed a template data structure, but I don't understand
why this won't work. Unlike %len, which returns the length of a field
which
can fluctuate if it's a varchar, I don't see how %decpos could be anything
but the decimal precision of the field at compile time. Am I missing
something here? We're at IBM i 7.1.

In this particular case, I have two amount fields defined like the SBeg
subfield mentioned above. I wanted to get the %decpos of the field that
the
amount fields are being defined like, instead of arbitrarily picking one
(what if one goes away with a future change, then this procedure call will
have to change as well).

And in case anyone's wondering what in the world I'd do with an edit code
in
a variable since %editC doesn't support a variable as the second parameter
(sigh), I have another procedure that translates it into an %editC with the
hardcoded edit code.

Thanks,

Kurt Anderson
Sr. Programmer/Analyst - Application Development, Service Delivery Platform
[cid:image002.jpg@01CD16F9.25D27630]
web: www.customcall.com<http://www.customcall.com/> | email:
kurt.anderson@xxxxxxxxxxxx<mailto:kurt.anderson@xxxxxxxxxxxx>

A Division of Enghouse Systems Ltd.<http://www.enghouse.com/> (TSX:ESL)

--
This is the RPG programming on the IBM i (AS/400 and 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.


--
This is the RPG programming on the IBM i (AS/400 and 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 ...

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.