× 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 believe the issue is they are passed by reference, and not by value. Not
sure if you could add that to the prototype here or not.

We had this issue with CL programs too. Anything over 32 bytes got garbage
in it. We solved this by creating the field 1 bigger than it needed to be,
putting a * in the last character and passing it that way. We'd then
substr out the field length -1.

Brute force, yes... but it worked. :)

Brad
www.bvstools.com

On Wed, Feb 11, 2015 at 4:20 PM, Pete Helgren <pete@xxxxxxxxxx> wrote:

I have spent too much time in the Java/JavaScript world apparently because
I have been attempting to write what I thought was a simple RPGLE program
which I can call from a command line. The problem is that the parameter,
which is a character type, 256 in length, gets padded with "unexpected"
contents beyond what I am submitting on the command line. If I submit it
like so:

CALL PGM(MYPGM) PARM(This is a test') I see something like this when I
view the contents in either debug or the receiving program:

This is a testRPGLESRC MYLIBRAY MYPGM ??*SRCMBRTXT ‑ 1? *HEX *JOBRUN1 0
*NEW 0*LIBCRTAUT1 *CURRENT0*NONE

I understand, from reading numerous posts, that this is normal behavior
but my attempts to follow the directions to eliminate the issue seems for
naught. I couldn't find an example program in all of MY libraries that
does something similar without the side effects (I could have sworn I have
written RPG programs like this before).

The program has these Prototypes/Procedure interfaces:

D mypgm pr extpgm('MYPGM')
D text 256A varying const options(*trim)

D mypgm pi
D text 256A varying const options(*trim)

I originally defined 'text' as 256A but saw the spurious characters. So
I tried options(*varsize), same result. So I tried varying const
options(*trim). No joy ( get a variable out of range error). It is a
little early in the week to be going brain dead but apparently I have. I
can't seem to sort this out.

I want to pass a character string of up to 256 characters into this
program and only get the characters typed as the parameter value. What am I
missing?

--
Pete Helgren
www.petesworkshop.com
GIAC Secure Software Programmer-Java

--
This is the RPG programming on the IBM i (AS/400 and 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 ...

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.