X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ea58aac5808a7617dd68c94b651ad70e038a324f..69fb24ce03b4dd40e7912936d628bea1719aaaa3:/samples/console/console.cpp?ds=sidebyside diff --git a/samples/console/console.cpp b/samples/console/console.cpp index f345fc794d..27016fc935 100644 --- a/samples/console/console.cpp +++ b/samples/console/console.cpp @@ -583,12 +583,27 @@ static void TestExecute() } else { - unsigned count = output.GetCount(); - for ( unsigned n = 0; n < count; n++ ) + // don't show too much output, MAX_LINES is enough + static const unsigned MAX_LINES = 20; + + const unsigned count = output.size(); + for ( unsigned n = 0; + n < (count > MAX_LINES ? MAX_LINES/2 : count); + n++ ) { wxPrintf("%04u:\t%s\n", n + 1, output[n]); } + if ( count > MAX_LINES ) + { + wxPrintf("... skipping %u lines...\n", count - MAX_LINES); + + for ( unsigned n = count - MAX_LINES/2; n < count; n++ ) + { + wxPrintf("%04u:\t%s\n", n + 1, output[n]); + } + } + wxPuts(_T("Ok.")); } }