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



I'm no Java expert, but I think VARYING is not applicable to the prototype.
Also if you use CONST and OPTIONS(*VARSIZE) you may pass a value of any
length and the compiler will (probably) not generate a temporary
variable--it'll pass the original value by reference. Of course if you
specify a literal for the parameter (as in your example) then the compiler
will (probably) generate a temp variable.
-Bob


-----Original Message-----
From: rpg400-l-bounces+cozzi=rpgiv.com@xxxxxxxxxxxx
[mailto:rpg400-l-bounces+cozzi=rpgiv.com@xxxxxxxxxxxx] On Behalf Of Steffan,
Otto (GE Consumer Finance)
Sent: Monday, May 31, 2004 2:27 AM
To: RPG programming on the AS400 / iSeries
Subject: Prototyping a constructor of java String class

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

--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.