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:midrangel@black-and-blue.com]
Sent: Friday, March 08, 2002 7:49 AM
To: c400-l@midrange.com
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-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.


This thread ...

Follow-Ups:

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

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