On 12/28/2011 9:56 AM, Dan Kimmel wrote:
C is a pass-by-value language. However, those parameters can be pointers. The pointer can point to a value, however.

This I knew.

On i, the argument vector (argv) is an array of pointers to the argument values which are the parameters passed on the call.

This I did not, although it makes sense. In Unix, the arguments came from the command line and so were pointers to C strings.

Returning a value through the arguments is simply replacing the value at the memory location dereferenced from the pointer. One must be aware of the size of the memory space referenced and the type of value that is to be there.

Not fundamentally different than any other language where you pass pointers. At the same time, it is not what you usually learn in Unix C classes.

Jt400 class AS400Text.toBytes() is convenient for converting java string to byte array. If your c program is expecting an 80 character array, new AS400Text(80,system).toBytes("StringToPass",sytemvalue) will put the contents of "StringToPass" into systemvalue (an 80 character byte array). Pass systemvalue to the c program. Define systemvalue as byte[]systemvalue = new byte[80].

This is pretty much the standard for Java to ILE. I use it when talking to RPG as well. Actually, I usually use data structures, but that's just me.

I don't use PCML to do this. PCML-related objects may do a lot of this work for you.

And this I have no idea. Not a PCML guy myself.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 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.