|
Ok, I got it to work. It just took me awhile to figure out that I needed to make the edit work 1 character bigger than the variable. For example: D Alpha s 5a D edtwrd c '0 ' D number s 5p 0 /free number=1; alpha=%subst(%editw(number:edtwrd):2:%len(alpha)); dsply alpha; // '00001' number=12; alpha=%subst(%editw(number:edtwrd):2:%len(alpha)); dsply alpha; // '00012' number=123; alpha=%subst(%editw(number:edtwrd):2:%len(alpha)); dsply alpha; // '00123' number=1234; alpha=%subst(%editw(number:edtwrd):2:%len(alpha)); dsply alpha; // '01234' number=12345; alpha=%subst(%editw(number:edtwrd):2:%len(alpha)); dsply alpha; // '12345' *inlr=*on; return; /end-free Rob Berendt -- "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." Benjamin Franklin Scott Klement <klemscot@klement To: rpg400-l@midrange.com s.com> cc: Sent by: Fax to: rpg400-l-admin@mi Subject: RE: %CHAR drange.com 02/21/2002 11:14 AM Please respond to rpg400-l I can give you examples of using the C functions to convert numeric to character, but I'm not sure they belong in the FAQ. The RPG BIFs aren't lacking in this area, so why add the complexity? Any particular reason you wanted to use the C functions? On Thu, 21 Feb 2002 rob@dekko.com wrote: > > Buck, > > I was hoping to see the C functions to convert the numeric into character. > Or am I confused and they're just useful for the other way? > > Rob asked: > > >Who is going to whip up the FAQ? > > Done. See http://faq.midrange.com/data/cache/184.html or search (lower > left) for 'numeric'. > > --buck _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l or email: RPG400-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
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.