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



Rory,

That's pretty neat. Offhand I can't think of a reason I'd want to do it for a CONST variable, especially since there's no guarantee to callee that the variable is not a temporary variable. But it's good to know that there's a way to accomplish it if I should need it.

-mark


At 1/28/09 05:17 PM, you wrote:
Mark,

I know the basic stuff won't work. For instance, this won't compile:

P myproc S
D PI
D parm1 10A Const
D temp1 S 10A Based(temp1ptr)

/free
temp1ptr = %addr( parm1 );
temp1 = 'NEWVALUE';
/end-free

The only sure-fire method I know of is using the NPM_PARMLIST_ADDR MI
builtin (
http://publib.boulder.ibm.com/iseries/v5r1/ic2924/tstudio/tech_ref/mi/NPMPARM.htm).
See this thread for details:
http://forums.systeminetwork.com/isnetforums/showthread.php?t=45802 - post
#14 contains my code for doing this. Once you have the array of argument
pointers, you can play with them to your hearts content.

Rory
On Wed, Jan 28, 2009 at 12:56 PM, M. Lazarus <mlazarus@xxxxxxxx> wrote:

> Doug,
>
> I recall playing a bit and trying to fool the compiler on a CONST
> variable using a DS. Has someone tried this recently? I'd like to
> see a working sample that the compiler won't catch. I think that
> Scott had posted something, but it was a lot more involved than just
> overlaying with a DS.
>
> VALUE is only really valid when calling a procedure, not a program,
> so it might be more difficult to retrofit older systems.
>
> -mark
>
--
This is the RPG programming on the IBM i / System i (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.