|
just as a side note on trimming, once i did a trim of the last non-blank character in some credit card software, where transmitted data has a check digit character called a LRC. Because of the way LRC is calculated, sometimes the lrc was a x'40' (blank) and the function would trim one too many. jim franz ----- Original Message ----- From: "Jon Paris" <Jon.Paris@Partner400.com> To: <rpg400-l@midrange.com> Sent: Saturday, March 30, 2002 7:56 AM Subject: Trimming off the last char > How do I go about trimming off the last character of some text when the text > inside could have variable lengths? > > Eval NewX = %Subst(X : 1 : (%Len(%TrimR(X) - 1) > > or maybe more obvious is to use a variable length field. > > Eval VarX = %TrimR(X) > Eval %Len(VarX) = %Len(VarX) - 1 > > Jon Paris > Partner400 > > > > > _______________________________________________ > 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.