1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| ifstream ImageTxtFile( DlgSelYearCalendar->OpenDialogImages->FileName.c_str(), ios::in);
if ( !ImageTxtFile) {
AnsiString ss="File open error "+DlgSelYearCalendar->OpenDialogImages->FileName;
Application->MessageBox( ss.c_str(),"Error", MB_OK+MB_ICONSTOP);
return;
}
i=0;
while ( !ImageTxtFile.eof())
{
if (::GetAsyncKeyState(VK_ESCAPE) & 0x8000 ) break;
// ie sort de la boucle
ImageTxtFile.getline( Comment, 200, '\n');
p=strtok(Comment,";");
ImgIndex[i]=StrToInt(p);
p=strtok(NULL,";");
ImageComments[i]=AnsiString(p);
p=strtok(NULL,";");
dummy=AnsiString(p);
if (i++==12) break;
}
ImageTxtFile.close(); |