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



Scott Klement wrote:

Except that RPG doesn't allow object subfields, so the L member can't be
defined like(jobject).  An object reference is actually an integer, so
jint (or maybe better 10i 0) has to be used for that subfield.

The problem with that is that you can't assign an object to an integer or
vice-versa.


Right; the only way to set jvalue.l defined like(jint) given the
subfield restriction, is to have a spoof procedure that "converts" an
object reference to an integer.

 * Official prototype
D refToInt        pr            10i 0 extproc(refToInt_procptr)        
D   ref                           o   class(*java:'java.lang.Object')  
D                                     value                            
D refToInt_procptr...                                                  
D                 s               *   procptr inz(%paddr('refToIntSub')

 * Internal prototype
D refToIntSub     pr            10i 0 extproc('refToIntSub')  
D    ref                        10i 0 value                   

 * Actual procedure, called through the refToInt prototype
P refToIntSub     b                   export  
D refToIntSub     pi            10i 0         
D    ref                        10i 0 value   
 /free                                        
    return ref;                               
 /end-free                                    
P refToIntSub     e


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.