BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

FindFirst/Next

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Dirk Schnitzler
Guest





PostPosted: Wed Mar 30, 2005 1:06 pm    Post subject: FindFirst/Next Reply with quote




I´m trying to use FindFirst() / FindNext() as follows:
(taken from help file)

void __fastcall TForm1::Button1Click(TObject *Sender)
{
TSearchRec sr;
int iAttributes = faAnyFile;
StringGrid1->RowCount = 0;
file://Tried this also:
file://Edit1->Text = IncludeTrailingBackslash(Edit1->Text);
if (FindFirst(Edit1->Text, iAttributes, sr) == 0)
{
do
{
if ((sr.Attr & iAttributes) == sr.Attr)
{
StringGrid1->RowCount = StringGrid1->RowCount + 1;
StringGrid1->Cells[1][StringGrid1->RowCount-1] = sr.Name;
StringGrid1->Cells[2][StringGrid1->RowCount-1] = IntToStr(sr.Size);
}
} while (FindNext(sr) == 0);
FindClose(sr);
}
}

Now if I search for "c:temp" containing some dirs and files,
only FindFirst() returns zero (ok) and "temp" is inserted into
the stringgrid, nothing else.
If I append a trailing backslash at the end, even FindFirst returns
with an error code.
I tried a lot more examples from different web pages, all the same ...

What am I doing wrong?
I´m using BCB6 on Win2k.

Regards, Dirk.


Back to top
Dirk Schnitzler
Guest





PostPosted: Wed Mar 30, 2005 1:50 pm    Post subject: Re: FindFirst/Next Reply with quote



Quote:
What am I doing wrong?

Sorry, forget it...
My fault was not appending "*.*" or something like that...
Shame on me :)





Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.