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



Hello,

I have run out of ideas how to sort out this problem:
I call a Java method getRSRows in my RPG program that returns an array of
objects; what I need is 
Number of returned objects in the array.
Here are several code snippets from my program (I used IBM manual ILE RPG
Programmer's Guide - chapter RPG and Java
to write the program). I tried to pick up the fragments that I believe are
relevant to the problem:

d GetCustomerAccountsImpl...                               
d                 S               O
class(*JAVA:'classes.GetCustomerAccountsImpl')

d RSRows...                                                    
d                 S               O
class(*JAVA:'classes.GetCustomerAccountsRSRowImpl')
d                                     dim(10)


d getRSRows...                                                     
d                 PR              O   extproc(*JAVA:               
d                                       'classes.GetCustomerAccountsImpl':

d                                       'getRSRows')               
d
class(*JAVA:'classes.GetCustomerAccountsRSRow')
d                                     dim(10)                      
   ...

  RSRows = getRSRows(GetCustomerAccountsImpl); // this row works OK - Java
returns X objects - rows

  // but the pgm fails-JVM even ends abnormally on getOuacct method in
for-loop
  // if it runs i = X+1 (let's assume X is allways less than 10):
  For  i = 1 to 10;                   
    Acct = %dec(getOuacct(RSRows(i))); 
    if  Acct = 0.;                     
      leave;  // (i-1)=X is Number of objects in the array (??)

    endif;                             
  endfor;                             


And Java documentation contains:
CLASS: classes.GetCustomerAccountsImpl
method summary:
...
classes.GetCustomerAccountsRSRow[] getRSRows()
...
CLASS: classes.GetCustomerAccountsRSRowImpl 

INTERFACE: GetCustomerAccountsRSRow
All Known Implementing Classes: classes.GetCustomerAccountsRSRowImpl
method summary:
...
long getOuacct()
....
Thanks for help and sorry about my English.

Otto Steffan

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.