|
On Fri, 24 Oct 2003, Booth Martin wrote: > > Why does my new procedure that will run QCMDEXC need two parms in? Why can > t I just send the command and let the new procedure determine the command's > length? > I haven't completely followed this thread -- but unless I missed it, you haven't created any procedures yet. You just used a prototype to call QCMDEXC instead of a PLIST. If you wanted to write a wrapper procedure for QCMDEXC, you wouldn't need to pass a length, you could just let the procedure figure it out. Here's an example: H DFTACTGRP(*NO) D do_cmd PR 1N D cmdstring 3000A const varying D Error s 1N /free Error = do_cmd('SNDMSG MSG(''EEEK'') TOUSR(KLEMSCOT)'); if Error; dsply 'Error!'; endif; *inlr = *on; /end-free P do_cmd B D do_cmd PI 1N D cmdstring 3000A const varying D qcmdexc PR ExtPgm('QCMDEXC') D command 3000A const options(*varsize) D length 15P 5 const c callp(e) qcmdexc(cmdstring: %len(cmdstring)) c if %error c return *OFF c else c return *ON c endif P E Just keep in mind that if you're doing something call-stack related (such as sending a program message, or doing an OVRDBF, etc) that a subprocedure adds another level to the call stack.
As an Amazon Associate we earn from qualifying purchases.
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.