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



Thanks again Barbra;

What do you want for Christmas?

Duane Christen


> -----Original Message-----
> From: Barbara Morris [mailto:bmorris@xxxxxxxxxx]
> Sent: Friday, November 05, 2004 9:07 AM
> To: rpg400-l@xxxxxxxxxxxx
> Subject: Re: RPG Calling Java, Array parameter passing
> 
> 
> "Christen, Duane J." wrote:
> > 
> > I have a java method that I am calling from RPG, which 
> seems not to be
> > receiving the tns parameter. When I debug the method the 
> variable tns is not
> > available (CPF7E12), and errors out deep inside the soap 
> process. When the
> > method is called from a java program, the method works.
> > 
> > I think that the problem is that the string array is not 
> being passed
> > correctly but I can't determine why.
> > 
> 
> The call to the Java method will pass an array with a dimension of
> 32767.  If aniList.Elements is less than 32767, some of the elements
> will be null.  It looks like the method doesn't support null 
> objects in
> the array.
> 
> If you are on V5R3, you can use %SUBARR to specify the number of
> elements to pass.  You'll have to add CONST to the prototype for the
> array parameter.
> 
>      jTnList = getSpecificTnList(jLTAConnection(spidIndex) :
> %subarr(jANIs : 1 : aniList.Elements)); 
> 
> If you are not on V5R3, I think you'll have to write a Java wrapper
> method that your RPG program can call, passing an extra 
> parameter of the
> number of elements to use from the array.  Or you could directly write
> your own JNI to call the method.  (The ILE RPG Programmer's Guide has
> some examples of calling JNI directly; you could use those 
> examples for
> the basics of RPG JNI, along with the array-handling examples
> http://java.sun.com/developer/onlineTraining/Programming/JDCBo
ok/jnistring.html#array
from Sun's JNI tutorial (Sun uses C/C++, but the coding for JNI is quite
similar between C and RPG).)

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



NOTICE: This electronic mail transmission may contain confidential
information and is intended only for the person(s) named.  Any use, copying
or disclosure by any other person is strictly prohibited. If you have
received this transmission in error, please notify the sender via e-mail.




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.