Rory Hewitt wrote:
Correct me if I'm wrong, but surely you can use:

C Eval MyCmd = 'DSPFD FILE(XYXYXYZ) ' +
C 'OUTPUT(*PRINT)'
C CallP(E) QCMDEXC(MyCmd:%Len(MyCmd))

You're absolutely right. The advantage of using VARYING is that the system won't waste CPU cycles adding a bunch of unnecessary blanks to the end, and then calling QCMDEXC which wastes CPU cycles stripping them back off.

On the other hand, if you use VARYING, then the compiler will copy the string to a temporary variable before passing it, since the API doesn't actually call for a VARYING string.

If only the system would simply pass the address of the data portion of the string... like %addr()+2.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

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