dont know what to call error/bug. part of string printed to file and konsole, without calling cout or std::ofstream m_file
-
What appears random, because it appears to be calling
emitMessageBoxRed("pass 1 can not = '' or '0' ");
is not actually leaving
void BtnDistTestEquals()
so, error is in
void BtnDistTestEquals() { emitPrint("================ BtnDistTestEquals ================"); int t46 = m_ui->textEdit_46->toPlainText().toInt(); int t47 = m_ui->textEdit_47->toPlainText().toInt(); int t48 = m_ui->textEdit_48->toPlainText().toInt(); int pass = m_threadcontroller->GetPass(); char axis = m_threadcontroller->GetAxis(); emitPrint("BtnDistTestEquals axis = " + axis); if( (t46 == 0) && (pass == 1) ) { Print("BtnDistTestEquals ( (t46 == 0) && (pass == 1) )"); emitMessageBoxRed("pass 1 can not = '' or '0' "); } else if( (t47 == 0) && (pass == 2) ) { emitMessageBoxRed("pass 2 can not = '' or '0' "); } else if( (t48 == 0) && (pass == 3) ) { emitMessageBoxRed("pass 3 can not = '' or '0' "); } else { Print("BtnDistTestEquals else"); function(); } } // ------------------------- END -------------------------
because
1 can not = '' or '0'
or
2 can not = '' or '0'
or
3 can not = '' or '0'
was printed, i assumedemitMessageBoxRed()
was called, which has thee print statements, but only second Print() appeared to be called.
add an extra Print() into first if(), keep fragment of string in other two if()'s from being printed.void Print(std::string s) { m_file << std::flush << s << '\n' << std::flush; std::cout << std::flush << s << '\n' << std::flush; }
how fragment of string printed to konsole and file, without std::cout nor std::ofstream being called?
how can anything in if() statement, get printed, when if() statement is not entered?debug shows that if() statement is not entered, and string fragment is printed at if() statement check.
i thought it was an error with std::cout and std::ofstream, not printing everything all the time, but they are not called, at least according to debugger.
-
What appears random, because it appears to be calling
emitMessageBoxRed("pass 1 can not = '' or '0' ");
is not actually leaving
void BtnDistTestEquals()
so, error is in
void BtnDistTestEquals() { emitPrint("================ BtnDistTestEquals ================"); int t46 = m_ui->textEdit_46->toPlainText().toInt(); int t47 = m_ui->textEdit_47->toPlainText().toInt(); int t48 = m_ui->textEdit_48->toPlainText().toInt(); int pass = m_threadcontroller->GetPass(); char axis = m_threadcontroller->GetAxis(); emitPrint("BtnDistTestEquals axis = " + axis); if( (t46 == 0) && (pass == 1) ) { Print("BtnDistTestEquals ( (t46 == 0) && (pass == 1) )"); emitMessageBoxRed("pass 1 can not = '' or '0' "); } else if( (t47 == 0) && (pass == 2) ) { emitMessageBoxRed("pass 2 can not = '' or '0' "); } else if( (t48 == 0) && (pass == 3) ) { emitMessageBoxRed("pass 3 can not = '' or '0' "); } else { Print("BtnDistTestEquals else"); function(); } } // ------------------------- END -------------------------
because
1 can not = '' or '0'
or
2 can not = '' or '0'
or
3 can not = '' or '0'
was printed, i assumedemitMessageBoxRed()
was called, which has thee print statements, but only second Print() appeared to be called.
add an extra Print() into first if(), keep fragment of string in other two if()'s from being printed.void Print(std::string s) { m_file << std::flush << s << '\n' << std::flush; std::cout << std::flush << s << '\n' << std::flush; }
how fragment of string printed to konsole and file, without std::cout nor std::ofstream being called?
how can anything in if() statement, get printed, when if() statement is not entered?debug shows that if() statement is not entered, and string fragment is printed at if() statement check.
i thought it was an error with std::cout and std::ofstream, not printing everything all the time, but they are not called, at least according to debugger.
@micha_eleric said in dont know what to call error/bug. part of string printed to file and konsole, without calling cout or std::ofstream m_file:
how can anything in if() statement, get printed, when if() statement is not entered?
Well, if that's the only place where it is printed then the if block was entered. Did you debug your code to see what is happening?
Also, it is hard to understand what you're writing. -
@micha_eleric said in dont know what to call error/bug. part of string printed to file and konsole, without calling cout or std::ofstream m_file:
how can anything in if() statement, get printed, when if() statement is not entered?
Well, if that's the only place where it is printed then the if block was entered. Did you debug your code to see what is happening?
Also, it is hard to understand what you're writing.@jsulm said in dont know what to call error/bug. part of string printed to file and konsole, without calling cout or std::ofstream m_file:
@micha_eleric said in dont know what to call error/bug. part of string printed to file and konsole, without calling cout or std::ofstream m_file:
how can anything in if() statement, get printed, when if() statement is not entered?
Well, if that's the only place where it is printed then the if block was entered. Did you debug your code to see what is happening?
Also, it is hard to understand what you're writing.yes, i ran debug, it never entered the if() statement.
ifPrint("BtnDistTestEquals ( (t46 == 0) && (pass == 1) )");
is in the first if() statement, then regardless of value of
pass
then
( (t46 == 0) && (pass == 1) )
is printed.
if
Print("BtnDistTestEquals ( (t46 == 0) && (pass == 1) )");
is not in first if() statement, then
1 can not = '' or '0'
is printed when pass = 1
2 can not = '' or '0'
is printed when pass = 2
3 can not = '' or '0'
is printed when pass = 3
emitMessageBoxRed
is never called, yet part of string to be sent to
emitMessageBoxRed
is printed, not all of string
put a break on line
emitMessageBoxRed
is called, then debug never stops
-
@jsulm said in dont know what to call error/bug. part of string printed to file and konsole, without calling cout or std::ofstream m_file:
@micha_eleric said in dont know what to call error/bug. part of string printed to file and konsole, without calling cout or std::ofstream m_file:
how can anything in if() statement, get printed, when if() statement is not entered?
Well, if that's the only place where it is printed then the if block was entered. Did you debug your code to see what is happening?
Also, it is hard to understand what you're writing.yes, i ran debug, it never entered the if() statement.
ifPrint("BtnDistTestEquals ( (t46 == 0) && (pass == 1) )");
is in the first if() statement, then regardless of value of
pass
then
( (t46 == 0) && (pass == 1) )
is printed.
if
Print("BtnDistTestEquals ( (t46 == 0) && (pass == 1) )");
is not in first if() statement, then
1 can not = '' or '0'
is printed when pass = 1
2 can not = '' or '0'
is printed when pass = 2
3 can not = '' or '0'
is printed when pass = 3
emitMessageBoxRed
is never called, yet part of string to be sent to
emitMessageBoxRed
is printed, not all of string
put a break on line
emitMessageBoxRed
is called, then debug never stops
@micha_eleric said in dont know what to call error/bug. part of string printed to file and konsole, without calling cout or std::ofstream m_file:
i ran debug, it never entered the if() statement.
Then please check your conditions. If your if statements are not entered then your t46 and pass don't have the values you think they have. You can easily check their values using debugger or printing them...
-
@micha_eleric said in dont know what to call error/bug. part of string printed to file and konsole, without calling cout or std::ofstream m_file:
i ran debug, it never entered the if() statement.
Then please check your conditions. If your if statements are not entered then your t46 and pass don't have the values you think they have. You can easily check their values using debugger or printing them...
@jsulm said in dont know what to call error/bug. part of string printed to file and konsole, without calling cout or std::ofstream m_file:
@micha_eleric said in dont know what to call error/bug. part of string printed to file and konsole, without calling cout or std::ofstream m_file:
i ran debug, it never entered the if() statement.
Then please check your conditions. If your if statements are not entered then your t46 and pass don't have the values you think they have. You can easily check their values using debugger or printing them...
that is the issue and question. the condition to enter the three if() statements are not meet, yet part of string, not the whole string is printed, AND
emitMessageBoxRed
does more than just print to konsole and file.