|
On Jul 28, 2017, at 6:54 PM, Alan Campin <alan0307d@xxxxxxxxx> wrote:
Jon, the article you reference says nothing about *N and about using Pos.
Using *N and Pos seems to be considerable improvement to me and, of course,
free format.
The neat thing I think is I have to name nothing except the array I am
trying to create. No trying to create dummy names that are nothing but
place holders.
On Fri, Jul 28, 2017 at 3:40 PM, Jon Paris <jon.paris@xxxxxxxxxxxxxx <mailto:jon.paris@xxxxxxxxxxxxxx>> wrote:
Alan, when you say "Before I would have had to do something like ..."--
When is "before" because I can't see anything in the technique that could
not have been done many moons ago. Ugly as sin but it could be done in the
original RPG IV if not RPG/400 - just not as easily.
Booth - you'll find the answers to why/how it works in this piece which
dates back to 2003. http://ibmsystemsmag.com/ibmi/ <http://ibmsystemsmag.com/ibmi/>
developer/general/d-spec-discoveries <http://ibmsystemsmag.com/ <http://ibmsystemsmag.com/>
ibmi/developer/general/d-spec-discoveries>
Jon Paris
www.partner400.com
www.SystemiDeveloper.com
On Jul 28, 2017, at 6:31 PM, Alan Campin <alan0307d@xxxxxxxxx> wrote:variable
1. ErrorReturn is a qualified data structure that has a field named
MessageId. When you call a system API it is filled.
dcl-ds ErrorReturn LikeDs(TD_StdErrorModel) Inz(*LikeDs);
dcl-ds TD_StdErrorModel Qualified Template;
Size Int(10) Inz(%Size(TD_StdErrorModel));
BytesAvailable Int(10) Inz(0);
MessageId Char(7);
*N Char(1); <<--- Reserved piece of memory but
you don't need to name.
MessageData Char(1024);
end-ds;
What I am showing is a lookup array but I am only naming the array. *N
means no name.
Before I would have had to do something like
dcl-ds dsOkList;
MsgId1 Char(7) Inz('CPF3C51');
Msgid2 Char(7) Inz('CPF3C52');
MsgId3 Char(7) Inz('CPF3C53');
MsgId4 Char(7) Inz('CPF3C54');
MsgId5 Char(7) Inz('CPF3C55');
OkList Char(7) Dim(5) Overlay(dsOkList) Ascend;
end-ds;
The same thing but a lot more work and I don't need to worry about name
conflicts. MsgId1 is global in the procedure. If you name another
MsgId1 it would conflict. With *N, no name. Just storage allocated.wrote:
On Fri, Jul 28, 2017 at 3:06 PM, Booth Martin <booth@xxxxxxxxxxxx>
bet
It takes me a while to catch on. Its not clear to me exactly what is
happening here. I do not understand ErrorReturn.MessageID and I'd also
couldn'tI do not understand *N
I say this because it looks to me like it doesn't do anything we
missingalready do with the same basic code. Therefore I am assuming I am
mailing listsomething?--
On 7/28/2017 1:18 PM, JRusling@xxxxxxxxxxx wrote:
It is...!
<snip>
dcl-ds *N;
*N Char(7) Inz('CPF3C51');
*N Char(7) Inz('CPF3C52');
*N Char(7) Inz('CPF3C53');
*N Char(7) Inz('CPF3C54');
*N Char(7) Inz('CPF3C55');
OkList Char(7) Dim(5) Pos(1) Ascend;
end-ds;
If %Lookup(ErrorReturn.MessageId:OkList) > 0;
</snip>
--
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.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
To post a message email: RPG400-L@xxxxxxxxxxxxquestions.
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.
Please contact support@xxxxxxxxxxxx for any subscription related
link: http://amzn.to/2dEadiD
Help support midrange.com by shopping at amazon.com with our affiliate
--
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 <mailto:RPG400-L@xxxxxxxxxxxx>
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l <http://lists.midrange.com/mailman/listinfo/rpg400-l>
or email: RPG400-L-request@xxxxxxxxxxxx <mailto:RPG400-L-request@xxxxxxxxxxxx>
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l <http://archive.midrange.com/rpg400-l>.
Please contact support@xxxxxxxxxxxx <mailto:support@xxxxxxxxxxxx> for any subscription related
questions.
Help support midrange.com <http://midrange.com/> by shopping at amazon.com <http://amazon.com/> with our affiliate
link: http://amzn.to/2dEadiD <http://amzn.to/2dEadiD>
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 <mailto:RPG400-L@xxxxxxxxxxxx>
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l <http://lists.midrange.com/mailman/listinfo/rpg400-l>
or email: RPG400-L-request@xxxxxxxxxxxx <mailto:RPG400-L-request@xxxxxxxxxxxx>
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l <http://archive.midrange.com/rpg400-l>.
Please contact support@xxxxxxxxxxxx <mailto:support@xxxxxxxxxxxx> for any subscription related questions.
Help support midrange.com <http://midrange.com/> by shopping at amazon.com <http://amazon.com/> with our affiliate link: http://amzn.to/2dEadiD <http://amzn.to/2dEadiD>
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.