Printing in transcript inside a loop
Hi all, I want to print in the transcript from inside a loop, the problem I am seeing is that it does not print until the loop is finished. Is it a bug or do I have to configure something? This is a piece of code to exemplify it (1 to: 10000) do: [ :i | Transcript show: i asString. ] Thanks in advance By the way, I am using Pharo 3. -- Sebastián Tleye
Hello, You need to fork it to be able to see the updates right away. An example : [ 1 to: 100 do: [ :i | Transcript show: i asString. (Delay forMilliseconds: 20) wait. ] ] fork Cheers, Matthieu 2015-06-10 11:48 GMT+02:00 Sebastian Tleye <sebastian.tleye@gmail.com>:
Hi all,
I want to print in the transcript from inside a loop, the problem I am seeing is that it does not print until the loop is finished. Is it a bug or do I have to configure something?
This is a piece of code to exemplify it
(1 to: 10000) do: [ :i | Transcript show: i asString. ]
Thanks in advance
By the way, I am using Pharo 3.
-- Sebastián Tleye
Ah ok, thank you Mathieu! 2015-06-10 11:56 GMT+02:00 Matthieu Lacaton <matthieu.lacaton@gmail.com>:
Hello,
You need to fork it to be able to see the updates right away.
An example :
[ 1 to: 100 do: [ :i | Transcript show: i asString. (Delay forMilliseconds: 20) wait. ] ] fork
Cheers,
Matthieu
2015-06-10 11:48 GMT+02:00 Sebastian Tleye <sebastian.tleye@gmail.com>:
Hi all,
I want to print in the transcript from inside a loop, the problem I am seeing is that it does not print until the loop is finished. Is it a bug or do I have to configure something?
This is a piece of code to exemplify it
(1 to: 10000) do: [ :i | Transcript show: i asString. ]
Thanks in advance
By the way, I am using Pharo 3.
-- Sebastián Tleye
-- Sebastián Tleye
On Wed, Jun 10, 2015 at 11:56 AM, Matthieu Lacaton < matthieu.lacaton@gmail.com> wrote:
Hello,
You need to fork it to be able to see the updates right away.
Or ask for the world to happen if the code is in the UI thread. World doOneCycle http://stackoverflow.com/questions/15372103/using-morphic-step-method-outsid... Phil
An example :
[ 1 to: 100 do: [ :i | Transcript show: i asString. (Delay forMilliseconds: 20) wait. ] ] fork
Cheers,
Matthieu
2015-06-10 11:48 GMT+02:00 Sebastian Tleye <sebastian.tleye@gmail.com>:
Hi all,
I want to print in the transcript from inside a loop, the problem I am seeing is that it does not print until the loop is finished. Is it a bug or do I have to configure something?
This is a piece of code to exemplify it
(1 to: 10000) do: [ :i | Transcript show: i asString. ]
Thanks in advance
By the way, I am using Pharo 3.
-- Sebastián Tleye
participants (3)
-
Matthieu Lacaton -
phil@highoctane.be -
Sebastian Tleye