|
Hello Michael, I checked JNI copybook Your code snippet comes from. I dare say that I would have to provide char data in UCS-2 or some code page that is native for Java, whenever calling this JNI method; it is a significant drawback for me. I think RPG compiler handles conversion from EBCDIC for me if I use a prototype. Otto Steffan -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Rooney, Michael P Sent: Tuesday, June 01, 2004 3:31 PM To: RPG programming on the AS400 / iSeries Subject: RE: Prototyping a constructor of java String class I'm not sure exactly what Java function the compiler "encapsulates" when constructing strings but it is posisble in utilzies the JNI "NewString" function. This would enable the compiler to construct the string based on the RPG prototype. The prototype for NewString looks like the following: D*--------------------------------------------------------------------- D* jstring (*NewString) D* (JNIEnv *env, const jchar *unicode, jsize len); D*--------------------------------------------------------------------- D NewString PR LIKE(jstring) D EXTPROC(*CWIDEN D : JNINativeInterface. D NewString_P) D env LIKE(JNIEnv_P) VALUE D unicode LIKE(jchar) CONST D len LIKE(jsize) VALUE While it is entirely conceivable that the compiler generates the required code to "trim" your string dynamically, you could also use BIF's to determine your exact requirements THEN use JNI to construct your string. It is the "long way" around but probably addresses your storage concerns. Michael Rooney Citigroup International
As an Amazon Associate we earn from qualifying purchases.
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.