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



Scott: You're absolutely right. I was having a bad day and wasn't thinking straight and some detail got me confused and frustrated and I apologize for the confusion concerning my code. Your sample along with Adam's put me back on track and I was able to code the procedure and have it work the way I wanted ( a good night's sleep and a fresh start also helped) I do thank you and all others for the help and suggestions. They did help.

Thanks, Don.

******************************************
Don Wereschuk
ISD - Programmer/Analyst
Simcoe Parts Service Inc.
Phone: 705-435-7814 Ex: 302
Fax: 705-435-6746
mailto:dwereschuk@xxxxxxxxxxxxxxx
******************************************
"Save the Cheerleader - Save the world" - Hiro Nakamura

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Tuesday, January 22, 2008 12:36 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Passing Parameters

Hi Don,

Scott, your code was very similar but what I was trying to do was
pass the name of the field and not the actual data in the field ( not
filerec.PLCD but 'filerec.PLCD'

Sorry, your code does NOT pass the name of the field. If you think it
does, then you don't even understand what your code does.

What it does is pass the ADDRESS of the field. That's what the %addr()
is for, it passes the address of the field. How the heck did you write
your code at all if you didn't understand this?

The reason your code works is because the address of the field is within
the space in memory occupied by the filerec data structure. So when
data is read into filerec, your pointer points to the particular field
within the data structure. It has nothing to do with the name of the
field, it has to do with it's address -- that is, where it's stored in
memory.

Under the covers, in the internals of the machine, my code will look
identical to yours. The difference, at the human-level, is that I'm
passing a subfield of the data structure directly, whereas you're
passing a pointer to a subfield of the data structure, and then
dereferencing them. ultimately, we both end up with a 50A field that's
in the same area of memory as your file subfield, so they do exactly the
same thing.

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