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



On Wed, 2009-03-25 at 14:27 -0500, Kurt Anderson wrote:
Using that example, you could, if you wanted, use *zeros instead of a line of 0's:
coldta = %subst( *zeros: 1: cwdth( #col ) - %len( coldta ) ) + coldta;

Um, not at V5R2, where the attempt tells me RNF0361 "The first parameter
*ZEROS for %SUBST is not valid; built-in function is ignored."

I typed 15 zeros because I rarely see numeric fields larger than that.
(Well, my preference for *CMD definitions largely protects me from even
those, but that is a fetish for me to flog some other day <grin />.)
Still, I am not entirely comfortable stopping there. How can the
compiler, not even knowing that coldta represents a number, do any
better?

Cheers,
Terry.


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Arthur Marino
Sent: Wednesday, March 25, 2009 2:08 PM
To: RPG programming on the IBM i / System i
Subject: RE: Using an Expression to control a FOR loop
[snip]
coldta = %subst( '000000000000000' // "lots" of zeros
: 1
: cwdth( #col ) - %len( coldta )
) + coldta;



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.