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



Peter Connell wrote:
Ah, funnily enough, the minute I submitted this question, I thought of
that as something I had not tried and of course it worked (yeah, I bet
they all say that).

I had read the doco, but it did not find an example of a boolean
prototype. I interpreted what it did say as meaning that one should
pass an indicator variable at the time the call is made. In coding the
prototype I had been following a convention of always specifying a data
type as LIKE a data type defined in the JNI copy book. It had not
dawned on me to specify an 'n' in the D-spec data type column (or LIKE a
variable already defined that way) of the prototype.


Ah, that makes sense. jboolean is defined in the JNI include as 1-byte unsigned, because the real Java/JNI type is an unsigned byte. If you are calling the JNI functions directly, you have to handle it the Java way. If you are using EXTPROC(*JAVA), the RPG runtime converts between RPG indicators and Java booleans for you.

It would have been better to define jboolean as the N type in the JNI include, for your type of purpose, and to use another type like jbooleanJNI for the JNI function prototypes. jlong and jlongJNI were handled like that.

But it's too late now, rats and double rats.


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.