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



Robert Upshall wrote:
> 
> I want to define a String constant in this case.  Doesn't that need to
> be some type of java object.  Right now I define 2 vars, one of type c
> and one of type o java String, I then use the String constructor to
> initialize the java var with the constant as the parm to the String
> constructor.
> 
> I am just wondering if there is a clean/more compact way of doing this.
> 

Robert, RPG doesn't have support for direct access of any Java
variables, constant or not.

The technique you're using requires you to define the string value "This
is the string" in both your Java and RPG code, right?  That seems error
prone.

You could add a getString1 method to your class that would return your
String constant.  Or, you could use direct JNI calls to get at the
constant.  The ILE RPG Programmer's Guide has an example near the end of
the "RPG and Java" section.


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.