Hello, |
Re: Making "print" print...
This is not a DOORS specific issue. The output of console scripts is buffered by default. To circumvent buffering you can use cout instead of print and do a 'flush cout' which will empty the output buffer. If you have scripts with a lot of print that you don't want to change you can just override print at the beginning of your batch script:
void print (string s) { cout << s; flush cout }
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Making "print" print... Mathias Mamsch - Tue Jun 28 14:32:08 EDT 2011
This is not a DOORS specific issue. The output of console scripts is buffered by default. To circumvent buffering you can use cout instead of print and do a 'flush cout' which will empty the output buffer. If you have scripts with a lot of print that you don't want to change you can just override print at the beginning of your batch script:
void print (string s) { cout << s; flush cout }
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Making "print" print... llandale - Tue Jun 28 16:02:58 EDT 2011 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Making "print" print... Mathias Mamsch - Tue Jun 28 17:08:48 EDT 2011 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS void print (string s) { cout << s; flush cout; infoBox("print") } print "hello" Run from the DXL window I get the info box but nothing printed. I suspect an issue with the way this company sets things up, as I cannot get win32SystemWait_ to work here either.
|
Re: Making "print" print... llandale - Tue Jun 28 18:01:04 EDT 2011
You are right, I did not realize cout does not seem to work in interactive window ... Do I guess one would need to do an:
void printOld (string s) { print s }
void print (string s) {
if (isBatch()) {
cout << s; flush cout
} else {
printOld s
}
}
print "Hello"
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|