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



On 2012/9/19 4:47 PM, Dean Eshleman wrote:

String tokenValue = cincom.eloquence.exits.gsm.token. UniversalToken.
getUniversalToken(Mykey, expireMinutes)
...
What I am struggling with is how do I move data between a Java string
variable and an RPG character variable?


You'd use the String constructor to create a Java string from an RPG character variable, and you'd use the getBytes method from the Java String class to get the Java string data into an RPG character variable.

The RPG/Java trouble-shooting guide http://ibm.biz/BdxjTE, in the RPG Cafe, has the code for a program JAVAPROP that has something very similar to what you would be doing.

It's calling Java method
String System.getProperty (String);
so it has to build the String parameter, and then get the value back from the returned value.

beginObjGroup (env : 100);
str = newString (prop);
str = getProperty (str);
if str = *null;
result = 'That property was not found';
else;
result = getBytes (str);
endif;
endObjGroup (env);

The RPG Cafe also has a savefile with source for the JNI utilities in the ILE RPG Programmer's Guide, to make it easy to call JNI functions like BeginObjGroup and endObjGroup which are essential for enabling Java garbage collection. Find the article called "JNI utilities from the RPG Programmer's Guide" in the left-hand navigation of the wiki that you'll get to from the trouble-shooting link.

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.