String argements coming in from a command or a CL program will have a length
equal to the declared length in the command or CL program with no null
terminator.  When returning arguments from a C/C++ program to a CL program
they must be padded to the length declared in the CL program without a null
terminator.  The alternate is to also pass a length and handle the strings
accordingly in both the CL and C/C++ programs.

-----Original Message-----
From: Brendan Bispham []
Sent: Friday, March 08, 2002 7:49 AM
Subject: [C400-L] CMD parms


My C program has a string arg which works fine when i do
call pgm 'this is the string'

But I made a CMD interface, so I could:
CMD PARM('this is the string')

Of course the string that gets passed is full of junk at the tail end.. I
overcome this with SBMJOB CMD(CMD PARM('this is text')) but how can I call

BTW I have written a CL wrapper to get/examine the returned arg, and I guess
I could use this to pass the string length or append a \0 at the right
place... but am i overcomplicating this?

NB if this isn't as common as I think it is, my string lengths are 9999 in
the CMD, CL and C...


This is the C programming iSeries / AS400 (C400-L) mailing list
To post a message email:
To subscribe, unsubscribe, or change list options,
or email:
Before posting, please take a moment to review the archives

This thread ...


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

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