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



Btw, talking about "new" biff, does somebody know why %MIN and %MAX don't
accept an array as argument?

TIA
--
Marco Facchinetti

Mr S.r.l.

Tel. 035 962885
Cel. 393 9620498

Skype: facchinettimarco


Il giorno mer 7 apr 2021 alle ore 19:14 Peter Dow <petercdow@xxxxxxxxx> ha
scritto:

Hi Alan,

I hadn't read up on %list, so I wasn't sure what this use case is
supposed to determine. I looked it up in the spiffy new IBM Documents
and found

https://www.ibm.com/docs/en/i/7.4?topic=functions-list-item-item-item

which says %list returns a temporary array. So I it appears that
%list(a:b) = %list(c:d) is asking if each element of the first array
matches each corresponding element of the 2nd array. Is that the idea?
Does that work with permanent arrays?

The next question that occurred to me is what are the field types of
Q.CLADTE and Q.CLATME? Guessing purely by the names, it looks like a
date field and a time field. Back to the documentation, which says "The
operands must all have a compatible type.".

Is a date field compatible with a time field? IBM provided a link to
answer that question right there where it's needed:

https://www.ibm.com/docs/en/ssw_ibm_i_74/rzasd/commontype.htm

The interesting thing there is that not only did it not answer the
question, but the person writing it started having problems with date vs
data, e.g.

"If all the operands have date type time, the result has data type
time with format *ISO."

* "If all the operands have date type pointer, the result has data
type pointer."

It's unclear based on that website whether a date field is compatible
with a time field. On the one hand, is 04/07/2021 compatible with
10:06:23? It's possible that the compiler would convert both to a
timestamp field internally, and therefore they would be compatible, but
I really don't know.

Btw, I used the "Contact IBM" link at the bottom of the page to let IBM
know.

--
*Peter Dow* /
Dow Software Services, Inc.
909 793-9050
petercdow@xxxxxxxxx <mailto:petercdow@xxxxxxxxx>
pdow@xxxxxxxxxxxxxx <mailto:pdow@xxxxxxxxxxxxxx> /



On 4/7/2021 5:57 AM, Alan Cassidy wrote:
A colleague where I work tried to use @list() like this:

if (Deleting)
and (%list(Q.CLADTE: Q.CLATME) = %list(CLADTE: CLATME)); //
Compiler cannot handle
iter;
endif;

And he got a compiler error:
INTERNAL COMPILER ERROR. CONTACT SERVICE REP.

He was trying to find somebody who could submit a PMR.

I thought that was a cool application of it. I've always wished we had
a way to make comparisons with this syntax. Not only for the equal
comparison, but how much simpler a *LE comparison would be for opening
an SQL cursor with a SETLL type comparison, with four key columns!

--Alan Cassidy

--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


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.