Mark,
I wrote a real quick and dirty program that did no more than:
D pComp S 2s 0
D pDiv S 2s 0
D pRef S 6s 0
/free
pComp = 1;
pDiv = 2;
pRef = pComp + + pDiv;
*inLR = *on;
I put it under debug. When it reach the *inLR line, I displayed the values
of the three fields.
All were as one would expect if there was only a single '+' sign.
I, then, changed the pRef line to: pRef = pComp + - pDiv;
pComp = 1;
pDiv = 2;
pRef = -1.
Then: pRef = pComp - + pDiv;
pComp = 1;
pDiv = 2;
pRef = -1;
Further testing may be appropriate, but it looks like it fits what John
said: "Most likely the first is the addition operator and the second is a
sign (positive)."
In the interest of full disclosure, we're still running V5R1 (yuck).
Jerry C. Adams
Rehab is for quitters.
IBM i Programmer/Analyst
--
NMM&D
615-832-2730
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Mark
Murphy/STAR BASE Consulting Inc.
Sent: Tuesday, March 31, 2015 6:37 AM
To: RPG programming on the IBM i (AS/400 and iSeries); Rational Developer
for IBM i / Websphere Development Studio Client for System i & iSeries
Subject: RPG Compiler (and RDi Syntax Checker) weirdness
Cross posted in RPG and WDSC lists because it applies to both. Just for
reference, IBM i 7.1 TR?, RDi 9.1.1.1.
So just by accident, due to fat fingers, I discovered that the following RPG
code does not generate an error:
handle = ls_init(LSOA_COPY + + LSOA_BLOCK + LSOA_REPEAT);
Note the two + operators separated only by a space. What does that compile
to? It is obvious to me that an operand is missing, but the compiler happily
creates something and goes on it's merry way. The LPEX source checker thinks
it is ok as well!
Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx
--
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.