I need extra set of eyes , please....
-
The attached code misbehaves...
1, It passes and runs OK the FIRST set of// verify list for (auto verify_list : verify) { text = "verify list "; text += verify_list; qDebug() << text; }On SECOND set it complains about "missing expression"
-
It gives no error on THIRD set of SAME code block
It won't identify the while ( ); block correctly - after clicking AFTER first "(" it goes all the way to the beginning of the function...not to the last ")" .
and won't "auto indent "
I just do not see the error (s) .
text = "Process command...";
text += Q_FUNC_INFO;
qDebug() << text;
//#ifdef BYPASS
// verify list
for (auto verify_list : verify) {
text = "verify list ";
text += verify_list;
qDebug() << text;
}
//#endif
time = new QTime();
QString result;
// run QProcess first time
time->start();
QP = new QProcess();
qDebug() << "DEBUG TRACE start new QProcess();";
text = "DEBUG TRACE start new QProcess();";
//TRACE_TextEdit->addItem(text);
qDebug() << text;
//text = " command ";
text = command;
// add file
text += " | tee /tmp/temp";
// qDebug() << text" | tee /tmp/temp";;
//command += " | tee /tmp/temp";
QP->start("/bin/sh", QStringList() << "-c" << command);
if(QP->Running)
{
text = "QProcess running..";
qDebug() << text;
}do { text = "Process loop "; qDebug() <<text; result = QP->readAllStandardOutput(); qDebug() << result; if( QP->waitForFinished(100)) { if(QP->waitForReadyRead()) // QP->waitForFinished(5000) | QP->waitForReadyRead()) { text = "QProcess waitForReadyRead()"; qDebug() << text; result = QP->readAllStandardOutput(); } } } while ( start here // iterate list // verify list for (auto verify_list : verify) { text = "verify list "; text += verify_list; qDebug() << text; } for (auto verify_list : verify) { if(!result.contains(verify_list)) { text = "verify list "; text += verify_list; qDebug() << text; //continue; // break; } else { text = "verify list "; text += verify_list; qDebug() << text; } } ); should stop here !!!! text = "DONE Process loop "; qDebug() <<text;// changing verify to list QString BT_Utility_Library::ProcessCommand ( char* command, QStringList verify ) { text = "Process command..."; text += Q_FUNC_INFO; qDebug() << text; //#ifdef BYPASS // verify list for (auto verify_list : verify) { text = "verify list "; text += verify_list; qDebug() << text; } //#endif time = new QTime(); QString result; // run QProcess first time time->start(); QP = new QProcess(); qDebug() << "DEBUG TRACE start new QProcess();"; text = "DEBUG TRACE start new QProcess();"; //TRACE_TextEdit->addItem(text); qDebug() << text; //text = " command "; text = command; // add file text += " | tee /tmp/temp"; // qDebug() << text" | tee /tmp/temp";; //command += " | tee /tmp/temp"; QP->start("/bin/sh", QStringList() << "-c" << command); if(QP->Running) { text = "QProcess running.."; qDebug() << text; } do { text = "Process loop "; qDebug() <<text; result = QP->readAllStandardOutput(); qDebug() << result; if( QP->waitForFinished(100)) { if(QP->waitForReadyRead()) // QP->waitForFinished(5000) | QP->waitForReadyRead()) { text = "QProcess waitForReadyRead()"; qDebug() << text; result = QP->readAllStandardOutput(); } } } while ( // iterate list // verify list for (auto verify_list : verify) { text = "verify list "; text += verify_list; qDebug() << text; } for (auto verify_list : verify) { if(!result.contains(verify_list)) { text = "verify list "; text += verify_list; qDebug() << text; //continue; // break; } else { text = "verify list "; text += verify_list; qDebug() << text; } } ); text = "DONE Process loop "; qDebug() <<text; // temp end } -
-
The attached code misbehaves...
1, It passes and runs OK the FIRST set of// verify list for (auto verify_list : verify) { text = "verify list "; text += verify_list; qDebug() << text; }On SECOND set it complains about "missing expression"
-
It gives no error on THIRD set of SAME code block
It won't identify the while ( ); block correctly - after clicking AFTER first "(" it goes all the way to the beginning of the function...not to the last ")" .
and won't "auto indent "
I just do not see the error (s) .
text = "Process command...";
text += Q_FUNC_INFO;
qDebug() << text;
//#ifdef BYPASS
// verify list
for (auto verify_list : verify) {
text = "verify list ";
text += verify_list;
qDebug() << text;
}
//#endif
time = new QTime();
QString result;
// run QProcess first time
time->start();
QP = new QProcess();
qDebug() << "DEBUG TRACE start new QProcess();";
text = "DEBUG TRACE start new QProcess();";
//TRACE_TextEdit->addItem(text);
qDebug() << text;
//text = " command ";
text = command;
// add file
text += " | tee /tmp/temp";
// qDebug() << text" | tee /tmp/temp";;
//command += " | tee /tmp/temp";
QP->start("/bin/sh", QStringList() << "-c" << command);
if(QP->Running)
{
text = "QProcess running..";
qDebug() << text;
}do { text = "Process loop "; qDebug() <<text; result = QP->readAllStandardOutput(); qDebug() << result; if( QP->waitForFinished(100)) { if(QP->waitForReadyRead()) // QP->waitForFinished(5000) | QP->waitForReadyRead()) { text = "QProcess waitForReadyRead()"; qDebug() << text; result = QP->readAllStandardOutput(); } } } while ( start here // iterate list // verify list for (auto verify_list : verify) { text = "verify list "; text += verify_list; qDebug() << text; } for (auto verify_list : verify) { if(!result.contains(verify_list)) { text = "verify list "; text += verify_list; qDebug() << text; //continue; // break; } else { text = "verify list "; text += verify_list; qDebug() << text; } } ); should stop here !!!! text = "DONE Process loop "; qDebug() <<text;// changing verify to list QString BT_Utility_Library::ProcessCommand ( char* command, QStringList verify ) { text = "Process command..."; text += Q_FUNC_INFO; qDebug() << text; //#ifdef BYPASS // verify list for (auto verify_list : verify) { text = "verify list "; text += verify_list; qDebug() << text; } //#endif time = new QTime(); QString result; // run QProcess first time time->start(); QP = new QProcess(); qDebug() << "DEBUG TRACE start new QProcess();"; text = "DEBUG TRACE start new QProcess();"; //TRACE_TextEdit->addItem(text); qDebug() << text; //text = " command "; text = command; // add file text += " | tee /tmp/temp"; // qDebug() << text" | tee /tmp/temp";; //command += " | tee /tmp/temp"; QP->start("/bin/sh", QStringList() << "-c" << command); if(QP->Running) { text = "QProcess running.."; qDebug() << text; } do { text = "Process loop "; qDebug() <<text; result = QP->readAllStandardOutput(); qDebug() << result; if( QP->waitForFinished(100)) { if(QP->waitForReadyRead()) // QP->waitForFinished(5000) | QP->waitForReadyRead()) { text = "QProcess waitForReadyRead()"; qDebug() << text; result = QP->readAllStandardOutput(); } } } while ( // iterate list // verify list for (auto verify_list : verify) { text = "verify list "; text += verify_list; qDebug() << text; } for (auto verify_list : verify) { if(!result.contains(verify_list)) { text = "verify list "; text += verify_list; qDebug() << text; //continue; // break; } else { text = "verify list "; text += verify_list; qDebug() << text; } } ); text = "DONE Process loop "; qDebug() <<text; // temp end }@AnneRanch
Your firstfor (auto verify_list : verify)is a statement, which is fine. Your subsequent ones are placed inside thewhile (condition of ado ... while (loop. You cannot use aforstatement for a condition, any more than you could writeif ( for ( .... I don't know what you are trying achieve putting a loop into a while condition. -