[fpc-announce] Free Pascal Contributed units modified entry. (StrWrap1 (String Wrapper))

contribs at freepascal.org contribs at freepascal.org
Sun Jun 26 23:34:22 CEST 2005


The following entry in the Free Pascal contributed units was modified:

Name         : StrWrap1 (String Wrapper)
Author       : Lars aka L505
Email        : fpcunits1(at)z505(dot)com
Homepage     : http://z505.com
FTP site     : http://positivesale.com/freePascal/strings/StrWrap1.zip
Version      : 1.0b
Date         : 2005-06-26
Category     : File Handling
Supported OS : Linux, Windows, other
Description  :
Some string functions to make getting data out of a text files easy, without using stringlists.
<p>
Sometimes you find a StringList <b>overkill</b>,
when all you need is some simple string operations. 
<p>
This unit is essentially a wrapper for readln, assign, reset (that annoying low level you don't need, in simple string and file operations).
<pre>
 StrLoadFile <i>get entire file into a string var</i>
 GetLn1      <i>get first line contents from text file into a string var</i>
 GetLnN      <i>get Nth line from text file into a string var</i>
</pre>

Update:
Version b now offers
<pre>
 ArrayLoadFile  <i>get entire file into an array of strings</i>
 ArrayLoadLines <i>get only the first N lines into an array of strings</i>
 StrLoadLines   <i>get only the first N lines into a string var</i>
</pre>
You do not need to include the hefty 'classes' unit when using these functions alone. The file is not loaded into the memory - only the precise lines that you want. Whereas a stringlist loads the entire file into memory no matter what.







More information about the fpc-announce mailing list