|
제가 만든 프로그램에 들어있던 내용인데 참고하시라구요.. ^^;;
while문을 사용해도 괜찮을 듯한데... 왜 for문을 사용하시려는건지..??
pIniFile = new TIniFile( g_szIniPath ); // Make the INI file object.
sprintf( szSection, "Basic Battery %03d", i + 1 );
while( pIniFile->SectionExists( szSection ) ) {
sTestName = pIniFile->ReadString( szSection, "Name", "" );
m_pTrvBasicBattery->Items->Add( NULL, sTestName );
j = 0; sprintf( szKey, "Test %03d", j + 1 );
while( (iTest = pIniFile->ReadInteger( szSection, szKey, 0 )) != 0 ) {
sprintf( szKey, "Test %03d", (++j) + 1 ); // Next key
}
sprintf( szSection, "Basic Battery %03d", (++i) + 1 ); // Next section
}
delete pIniFile;
|