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 [mailto:email@example.com] Sent: Friday, March 08, 2002 7:49 AM To: firstname.lastname@example.org Subject: [C400-L] CMD parms Hi, 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 can overcome this with SBMJOB CMD(CMD PARM('this is text')) but how can I call it interactively? 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... Thanks, _______________________________________________ This is the C programming iSeries / AS400 (C400-L) mailing list To post a message email: C400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/c400-l or email: C400-Lemail@example.com Before posting, please take a moment to review the archives at http://archive.midrange.com/c400-l.