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



Hello community,
I want to have a prototype for the constructor method of String class that 
allows passing any literal or character varying variable. I think it might look 
like this:
D String...                                                      
d                 PR              O   extproc( *JAVA             
d                                            : 'java.lang.String'
d                                            : *CONSTRUCTOR)     
d  chars                     65535A   varying                    
d                                     options(*VARSIZE)          
d                                     const

I am not sure whether the ultimate size 65535 of the character parameter  has 
some side or harmful effect or not. What I am afraid of is this:
Let's have this free-form row of a code:
mystring = String( 'Hello' );
If I understand RPG Reference manual correctly RPG compilator generates a 
temporary for the literal that further passes to the method. What is the format 
of the temporary? Is the format 65535A (and varying ?) which would be rather 
unpleasant of the compiler, or 5A (and varying ?) which would be nice I suppose 
??
I am just deducing using information in RPG manuals; maybe I got lost in my 
deductions. The prototypes I found on the web vary in both the length of char 
parameter and the applied keywords.

We are on V5R2.
Thanks in advance for attention, help will be highly appreciated.

Otto Steffan


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.