×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Booth Martin wrote:
ok, I am learning. slowly of course, but at least it is sinking in instead
of bouncing off.
Here is the next question:
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?
Because that's what QCMDEXC requires?
You could easily write a wrapper procedure that takes one CONST
VARYING string parameter, that computes the length of that command
and passes it on to QCMDEXC:
--------------------------------------------------------
P doCmd b
D doCmd pi
D Command 1000a const varying
D QCmdExc pr extpgm('QCMDEXC')
D 1000a const
D 15p 5 const
/free
qcmdexc(Command:%len(Command));
/end-free
P doCmd e
--------------------------------------------------------
Thus demonstrating another advantage of procedures: Simplifying the
calling of complex API's. In other words, converting the interface
of some procedure into a different interface that's somehow better.
In this case, the caller doesn't have to work out the length. Compare:
doCmd ('CHGJOB DATFMT(' + fmt + ')');
with:
cmd = 'CHGJOB DATFMT(' + fmt + ')';
QCmdExc (cmd: %len(cmd));
Cheers! Hans
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.