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



Alan,

And I don't believe (PLEASE CORRECT ME IF I'M WRONG) I can code " ColDta
= %Editc(%Dec(%Trim(ColDta):VARIABLE_WIDTH:VARIABLE_DECPOS):'X')".


What I'd suggest is you move the "editing" to a subprocedure where you can
hide the complexity. That way your inline code stays cleaner and more
readable (assuming a properly named procedure). Pass the desired length and
decimals to the subprocedure, and your inline code should be readable.

Then do whatever you have to in the procedure, and comment it as necessary
so the next guy can follow it. But at least the ugly code will be
localized.

One thing the procedure could do is call QECCVTEC to create an "edit mask"
using a passed in length, decimals, edit code, etc. Then that edit mask
(which you can re-use) can be passed to QECDT to perform the actual editing
of the field. But those APIs may make more sense if you needed fancier
editing with thousand separators, currency symbols, etc.

To just pad with zeros, it may be easier for the next guy to follow some
comments with zero padding then the edit APIs.

Just my .02,
Doug

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.