home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 2,123 of 2,978   
   Dr John Stockton to All   
   Re: printing variable problems   
   12 Apr 06 14:10:45   
   
   From: jrs@merlyn.demon.co.uk   
      
   JRS:  In article <4a2o2eFr6ldeU1@individual.net>, dated Tue, 11 Apr 2006   
   23:14:45 remote, seen in news:comp.lang.pascal.borland, Robert AH Prins   
    posted :   
   >   
   >Create a string[n] variabe and assing the concatenation of your   
   >'Description:' + the actual description + a load of spaces to it.   
   >Pascal's strictly enforced type-checking will discard the spaces that   
   >exceed the declared length of the string.   
      
   I'd prefer to write a function that, given a string, returns that string   
   with trailing spaces added to bring it to stated length; or that writes   
   as if given such a string.   
      
   const Plenty = '                                                    ' ;   
      
   function SL(const S : string ; const L : byte) : string ;   
     begin SL := S + copy(Plenty, 1, L-length(S)) end {SL} ;   
      
      
   function WS(const S : string ; const L : byte) : string ;   
     begin Write(S, '':L-length(S)) end {WS} ;   
      
      
   Untested : but something similar should work.   
      
   --   
    © John Stockton, Surrey, UK.  ?@merlyn.demon.co.uk   Turnpike v4.00   MIME. ©   
      TP/BP/Delphi/&c., FAQqy topics & links;   
        RAH Prins : c.l.p.b mFAQ;   
      Timo Salmi's Turbo Pascal FAQ.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca