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



Hi Elbert,

When I code subfiles with multiple line formats.
I'll code the sfl record with a single 79 character field

Hmmm... now THAT is something I do all the time. (I mean *all* the time... though... not usually to a subfile, but more commonly to an IFS text file.)

However, I've not needed to right justify text when I do it. I just do something like this:

eval output = %editc(Custno:'X') + ' '
+ CustName + ' '
+ %char(InvDate:*MDY) + ' '
+ %editc(InvAmt: 'L')
... etc...

The numbers are right-justified within their allotted space because the output of %EDITC does exactly that. It's very simple.

If I did have a character field that I needed to right-justify, I would have an allotted space within the output field (i.e. the positions that represent that particular column) where that field would go, so it'd be easy to do (in this example, occupying positions 41-50 of the 'subfile'):

evalr %subst(output: 41: 10) = %trim(ccode);

Or, if there's a lot of it, I might use a data structure.

But, in any event, no need to have an evalr(O) option, because the columns 41-50 are allocated to that field, I don't have to worry about blanking them out and filling them in...

In Pete's case he wanted to occupy the last X spaces of a field (where X is the string length) without erasing anything else. Sure, it can be done with %SUBST or %REPLACE but it's a bit more involved because you have to calculate the starting position and length first. THAT is the situation that comes up only rarely.

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