Yep... That looks like what I have to do.
Add a non-space character that terminates the string.

Thanks for all the advise everyone.  It's always interesting to see the
minds at work on this list.
- Rob

> -------- Original Message --------
> Subject: [RBASE-L] - RE: Right Justified Padding
> From: "Sami Aaron" <[EMAIL PROTECTED]>
> Date: Mon, March 06, 2006 9:52 am
> To: [email protected] (RBASE-L Mailing List)
> 
> Rob -
> 
> I would create a temporary table with a field wide enough to hold an entire
> line of text.  Then write a routine to string one variable out that uses
> some character (I used the tilde (~) in the example below) as the blank
> space place-saver. Once the whole line is created and saved in one variable,
> insert it into the temp table.  Then, when the whole table is ready to go,
> output it using the SRPL on the blank space place-holder value and replace
> it with CHAR(32).  Here's a snippet of code I used for a 1099 file for the
> IRS.
> 
> Sami
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Sami Aaron
> Software Management Specialists
> 913-915-1971
> [EMAIL PROTECTED]
>  
> 
> 
> --Start a new line
> SET V vrecordinfo TEXT = NULL
> SET V vrecordinfo = ('F')
> 
> SET V vrecordinfo = (.vrecordinfo + '00000001')
> --vrecordinfo now looks like   F00000001
> 
> SET V vzero21 TEXT = '000000000000000000000'
> SET V vrecordinfo = (.vrecordinfo + .vzero21)
> --vrecordinfo now looks like   F00000001000000000000000000000
> 
> SET V vblank19 TEXT = NULL
> SET V vblank19 = (SFIL('~',19))
> SET V vrecordinfo = (.vrecordinfo + .vblank19)
> --vrecordinfo now looks like   
> --    F00000001000000000000000000000~~~~~~~~~~~~~~~~~~~
> 
> SET V vblank442 TEXT = NULL
> SET V vblank442 = (SFIL('~',442))
> SET V vrecordinfo = (.vrecordinfo + .vblank442)
> --vrecordinfo now looks like the last value 
> --  but with an additional 442 tildes
> 
> SET V vrecordinfo = (.vrecordinfo + (CHAR(13)) + (CHAR(12)))
> --Can't remember why I'm using CHAR(12) but 
> --  this is the end of line marker
> 
> INSERT INTO L1099EFile (recordtype,recordinfo) VALUES ('F',.vrecordinfo)
> 
> SET V vblank = (CHAR(32))
> 
> SET WIDTH 755
> SET LINES 0
> SET HEADINGS OFF
> OUTPUT IRSTAX.txt
> SET SELMARGIN 1
> SELECT (SRPL(recordinfo,'~',.vblank,0))=750 FROM L1099EFile
> OUTPUT SCREEN
> SET HEADINGS ON
> SET WIDTH 79
> SET LINES 20
> SET SELMARGIN 0
> 
> -----Original Message-----
> From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Rob Vincent
> Sent: Sunday, March 05, 2006 7:27 PM
> To: RBASE-L Mailing List
> Subject: [RBASE-L] - Right Justified Padding
> 
> What is the correct method for creating a text variable with RJS padded
> spaces??
> The result should look like this (without the quotes):
> 
> "Some text goes here              "
> 
> Sounds simple huh?  -- I'm stumped!
> I've tried:
> 
> RJS
> SFIL
> SRPL
> SPUT
> SMOVE
> FORMAT
> 
> No matter what, the commands execute without error, but the result
> ALWAYS truncates the trailing spaces.
> Is this an issue with defining the var as text?
> 
> - Rob

Reply via email to