 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Dirk Schnitzler Guest
|
Posted: Wed Mar 30, 2005 1:06 pm Post subject: FindFirst/Next |
|
|
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
|
Posted: Wed Mar 30, 2005 1:50 pm Post subject: Re: FindFirst/Next |
|
|
| Quote: | What am I doing wrong?
|
Sorry, forget it...
My fault was not appending "*.*" or something like that...
Shame on me :)
|
|
| Back to top |
|
 |
|
|
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
|
|