🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #6325

Re: Read Directory - File

#6325
From: Jonathan Benedicto
Date: Wed, 25 May 2005 20:24
28 lines
1667 bytes
"Pieter" <nospam@nospam.com> wrote in message 
news:4294d3f5$1@newsgroups.borland.com...
>  No, there is no reason :)
> In case of VCL, which functions should I use?

I would use FindFirstFile / FindNextFile / FindClose to read all the 
files in a dir.

To read the lines in a file, if the file has less than 130 million, 
and you are using the VCL, then I would suggest TStringList.

Eg:

// Untested

TStringList *StringList = new TStringList;
StringList->LoadFromFile( "file.txt" );

for( int i=0;i<StringList->Count;i++ )
{
    AnsiString Line = StringList->Strings[i];
}

delete StringList;

HTH

Jonathan 
Technical Details
Message-ID: <4294dedf@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news2.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <4294b813$1@newsgroups.borland.com> <4294d20e@newsgroups.borland.com> <4294d3f5$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,57ff8ac7d09a7b63
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Jonathan Benedicto" <incorrect@no.server>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4294b813$1@newsgroups.borland.com> <4294d20e@newsgroups.borland.com> <4294d3f5$1@newsgroups.borland.com>
Subject: Re: Read Directory - File
Date: Wed, 25 May 2005 16:24:00 -0400
Lines: 30
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 64.231.18.19
Message-ID: <4294dedf@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1117052639 64.231.18.19 (25 May 2005 13:23:59 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news2.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail