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



This compiles...

D getArray        pr             3    dim(8)              
                                                          
D myArray         S              3    Dim(8)              
                                                          
C                   Eval      myArray = getArray()          
C                   if        %lookup('   ' :myArray) > 0 
C                   endif                                 
                                                          
C                   eval      *inlr = *On                 
********************************************************  
P getArray        B                                       
D                 pi             3    dim(8)              
D prArray         s              3    dim(8)              
                                                          
C                   return    prArray                     
                                                          
P getArray        E                                       


I think the compiler is just seeing one element of the return from  the
procedure and it's not allowing a %lookup on an element (or simple
field).

> -------- Original Message --------
> Subject: RE: compile error on %lookup where array is thereturn valueof
> aprocedure
> From: "Lim Hock-Chai" <Lim.Hock-Chai@xxxxxxxxxxxxxxx>
> Date: Fri, January 13, 2006 12:41 pm
> To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
> 
> GetArray is a procedure that return an array with 8 elements.  
> 
> You should be able to cut and paste below on your SEU/wdsc editor and
> compile the program.  
> D getArray        pr             3    dim(8)              
>                                                           
> C                   if        %lookup('   ' :getArray) > 0
> C                   endif                                 
>                                                           
> C                   eval      *inlr = *On                 
>  ******************************************************** 
> P getArray        B                                       
> D                 pi             3    dim(8)              
> D prArray         s              3    dim(8)              
>                                                           
> C                   return    prArray                     
>                                                           
> P getArray        E                                       
>   
> 
> -----Original Message-----
> From: rpg400-l-bounces+lim.hock-chai=usamobility.com@xxxxxxxxxxxx
> [mailto:rpg400-l-bounces+lim.hock-chai=usamobility.com@xxxxxxxxxxxx] On
> Behalf Of Booth Martin
> Sent: Friday, January 13, 2006 11:08 AM
> To: RPG programming on the AS400 / iSeries
> Subject: Re: compile error on %lookup where array is thereturn valueof
> aprocedure
> 
> I went back and looked at the original post.  (It formatted badly on my
> e-mail.) What is the name of your array?  Is it named prArray, not
> GetArray?  I have to admit I couldn't figure out what is supposed to
> happen here  -  thats my shortcoming, not the programs shortcoming.
> 
> -- 
> 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 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.