Hi Rob,

I did this long ago. Like Larry said, it's only the last character you need to 
worry about. As I remember it, I ended each record with a character that 
would not likely be used in the data... like a tilde ~ (In my case each record 
was terminated by CR LF combo).

Then I shelled to an external utility program that replaced all the tildes with 
spaces (char(32)).

Ben

On 5 Mar 2006 at 19:44, Rob Vincent wrote:

> Thanks for the reply Larry, but your last comment on the subject is the
> deal breaker!
> 
> I am in fact creating a fixed position export file to be used for import
> into a main-frame based accounting program.
> the (CHAR(160)) will most certainly cause them a problem.
> 
> What about using another variable TYPE that won't truncate the trailing
> spaces?
> I can't believe that something so rudimentary is causing such grief!
> 
> How'd something like this get accomplished in the past... Someone had to
> have needed the ability
> to format text in this manner...  Right?!
> 
> > -------- Original Message --------
> > Subject: [RBASE-L] - Re: Right Justified Padding
> > From: Lawrence Lustig <[EMAIL PROTECTED]>
> > Date: Sun, March 05, 2006 9:24 pm
> > To: [email protected] (RBASE-L Mailing List)
> > 
> > 
> > 
> > 
> >  <<
> > 
> > What is the correct method for creating a text variable with RJS padded
> > spaces??
> > >>
> > 
> > Whenever R:Base encounters text with trailing spaces it automatically trims 
> > the text.  That's why you don't have annoying spaces when you load data 
> > from a text field, the way you do with certain server-type databases.
> > 
> > If you want the text to appear to have blank spaces at the end, pad it with 
> > CHAR(160) which is a form of "hard" space that is not trimmed.  For 
> > instance, for to pad a variable to length 30:
> > 
> > SET VAR vMyPaddedText = (.vMyText + (SFIL(CHAR(160), 30-SLEN(.vMyText))))
> > 
> > Alternatively, only the very last character needs to be a 160:
> > 
> > SET VAR vMyPaddedText = (RJS(.vMyText, 29) + CHAR(160))
> > 
> > Be aware that if you pass this text to other programs, those CHAR(160) 
> > characters won't be treated as spaces.
> > --
> > Larry
> > 
> > 
> 

Reply via email to