Ooooh!  I didn't think of that!   Let me try it...

Karen

 

 

 

-----Original Message-----
From: Albert Berry <[email protected]>
To: RBASE-L Mailing List <[email protected]>
Sent: Sun, Jan 4, 2015 6:18 pm
Subject: [RBASE-L] - Re: Fixed field file


          
    Would something like this work to create the line? Assumption is no    CRLF 
at the end of the variable .vDataLine.
    
    SELECT (DataLine + (SFIL(' ',675)) + .vCRLF) FROM ...
    
    Albert
    
    
    
    
On 1/4/2015 1:14 PM, Karen Tellef      wrote:
    
    
I need to create a file with fixed field lengths.           Rather than doing 
SFIL/SPUT I did a "select" statement and it          works great and is easy to 
code, except...
          
          I need to have 675 blank spaces at the end of each line and I         
 can't figure out how to do that using a "select" statement.           Has 
anyone done that, or do I need to use SFIL/SPUT.             According to my 
notes, if I use SFIL/SPUT I'll have to use a          cursor and then do 
something like this (and thanks to whoever          originally posted this code 
and I saved it):
          
        
                
   --Add CarriageReturn/LineFeed          charaters to the          line
        
Set var vDataLine =          (SPUT(.vDataLine,.vCRLF,.vPastEnd))
        
 
        
  --Make sure no trash data exists beyond          CR/LF
        
Set var vDataLine =          (SGET(.vDataLine,..vTotalLength,1))
        
 
        
  --Write the line, telling RBASE not to          add its own          CRLF
        
 WRITE .vDataLine  CONTINUE
        

        
        

        
        
Karen
        

        
                  
    
    
-- 
A democracy ..." can only exist until the majority discovers it can vote itself 
largess out of the public treasury."
Attributed to Alexander Fraser Tytler 1747-1813
  

Reply via email to