× 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.



Barbara,

Yeah, I wasn't sure about that either.

Of course, if command is a varying string, then you're better off,
especially if you're 'building' the command, since you can just pass the
current length without the need for a %trim.

I just assumed that the underlying processing QCMDEXC was at least as good
as an RPG %trim, but perhaps not. I don't know what type of program QCMDEXC
is - it's surely not just a CL?

Rory

On Tue, Apr 20, 2010 at 3:45 PM, Barbara Morris <bmorris@xxxxxxxxxx> wrote:

Rory Hewitt wrote:

BTW, you don't need to use %trim for the second parameter to QCMDEXC -
you
can simply pass this:

execcmd(command:%len(command));

It doesn't make much difference, but it probably saves a CPU cycle or
two,
and those unnecessary %trims add up over time. Plus, it makes your code
slightly simpler to read...


I agree about simpler to read.

But I wonder about saving CPU cycles and unnecessary %trims. If you
don't use %trim to get the length, then you just move the processing of
the trailing blanks to the CL command processor. Probably makes no
difference, although it somehow feels like it's more complex for the
command processor to handle trailing blanks. I have no idea how the
command parsing works, maybe it even trims before it starts. But if it
just chugs through the entire input string, it might do a bit more work
for each character than %trim does. For instance, when it finds a
blank, it may have to also check whether it's processing a literal
before it decides whether to ignore the blank or not.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

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.