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



How about :

MONITOR;
If %xfoot(%SubArr(Des:NumTag+1:15-Numtag)) > *zeros ;
ON-ERROR xxxx
etc;

ENDMON;


-----Message d'origine-----
De : rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] De la part de nb@xxxxxxxxxxxxx
Envoyé : jeudi 18 septembre 2008 17:24
À : rpg400-l@xxxxxxxxxxxx
Objet : Funny RPG error






I was manteining one of our program when i got a strange RPG behaviour, both in WDSC and with ILE compiler.

I had the following spec :

If %xfoot(%SubArr(Des:NumTag+1:15-Numtag)) > *zeros ;

which, of couse, generated an error when NumTag = 15 (index out of bound, or something similar).

I obviously change to the correct-and-usual

If NumTag < 15 and %xfoot(%SubArr(Des:NumTag+1:15-Numtag)) > *zeros ;

which is the usally way to chech the array index is inside array bound (see some hundred of example, even from IBM ...)

Now, the compiler stop with

RNF0631 - The built-in function %SUBARR is not allowed within an expression involving the relational operator AND or OR. The built-in function is ignored.

I ended up breaking the statement in two diff row, but still i can't understand why the compiler rant about. I already got bad luck with
%subarr() in the past (got a Fix from RPG lab, at time) but since we're using a lot of array in our programs, we found it to be very useful, and this behaviour seems to me an arbitrary , unreasonable lock.

I have carefully checkhed the manual, and there's nothing referring to this problem. Any hint??



--

Nicola Brion
Tech Fossil (Often called a Dinosaur) - ancient animal that make things to work.

"Ogni volta che la gente è d'accordo con me, provo la sensazione di avere torto."

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

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.