X
Xoomer
This is what I need to do, Pass the path, type in and a TStringList
pointer into the function. The caller must create and delete the
TString list, this function simply fills it with filenames and their
directory. If the Boolean is true, the TStringList of filenames will
return in random order otherwise they will return in the order they
are stored in the directory.
Problem with both lines:
TStringList* LIST = new TStringList();
Test.GetFileNames("*.jpg","c:\\pics",LIST, true);
Code
---
MAIN
==================
C_Random Test;
void __fastcall TForm1::Open1Click(TObject *Sender)
{
if (!OpenPictureDialog1->Execute()) return;
AnsiString FileExt = ExtractFileExt(OpenPictureDialog1->FileName);
//PROBLEM HERE!!!
TStringList* LIST = new TStringList(); // IS THIS RIGHT?
Test.GetFileNames("*.jpg","c:\\pics",LIST, true);
}
=================
Class File
==-=======
class C_Random
{
public:
//int GetFileNames(AnsiString Type, // e.g.
"*.jpg"
//AnsiString Dir, // e.g. "c:\\photos"
//TStringList* FileNamesList, // Return the list of
filenames
//bool Random = true); // Randomise the list
if true
int GetFileNames(AnsiString Type, AnsiString Dir, TStringList*
FileNamesList, bool Random = true);
private:
};
int C_Random::GetFileNames(AnsiString Type, AnsiString Dir,
TStringList* FileNamesList, bool Random)
{
//
}
pointer into the function. The caller must create and delete the
TString list, this function simply fills it with filenames and their
directory. If the Boolean is true, the TStringList of filenames will
return in random order otherwise they will return in the order they
are stored in the directory.
Problem with both lines:
TStringList* LIST = new TStringList();
Test.GetFileNames("*.jpg","c:\\pics",LIST, true);
Code
---
MAIN
==================
C_Random Test;
void __fastcall TForm1::Open1Click(TObject *Sender)
{
if (!OpenPictureDialog1->Execute()) return;
AnsiString FileExt = ExtractFileExt(OpenPictureDialog1->FileName);
//PROBLEM HERE!!!
TStringList* LIST = new TStringList(); // IS THIS RIGHT?
Test.GetFileNames("*.jpg","c:\\pics",LIST, true);
}
=================
Class File
==-=======
class C_Random
{
public:
//int GetFileNames(AnsiString Type, // e.g.
"*.jpg"
//AnsiString Dir, // e.g. "c:\\photos"
//TStringList* FileNamesList, // Return the list of
filenames
//bool Random = true); // Randomise the list
if true
int GetFileNames(AnsiString Type, AnsiString Dir, TStringList*
FileNamesList, bool Random = true);
private:
};
int C_Random::GetFileNames(AnsiString Type, AnsiString Dir,
TStringList* FileNamesList, bool Random)
{
//
}