[Pharo-project] how to know if an image is resuming or not

Igor Stasenko siguctua at gmail.com
Mon Nov 8 23:53:51 CET 2010

On 9 November 2010 00:25, Stéphane Ducasse <stephane.ducasse at inria.fr> wrote:
> hi guys
> I'm too dead to think more but I want to do the following
>        save the current image
>                (I used saveSession)
>        and only when not resuming I want to save another image.
> Is there a way to know if an image is resuming (if the pc pointer just go reactivated - that the image was closed and reopened).
> naively I was doing
> saveImageForRunningTests
>        | comment commentQuoted st |
>        SmalltalkImage current saveSession.
>                "now you can reopen prior to publishing to fix :)"
>        self saveAsImageAsTestImage.
>        self inform: 'Now you can use this image named ''Test'' to run the tests and come back to fix problems in the previous one and eventually freeze it by selecting the next step, in either one.'
> and of course when I reopened the save session I reperformed the "self saveAsImageAsTestImage."
> Now I could use startUp:....
> Or I could simply change my process but I wanted to know... I'm too dead now.
what about using some variable, like:

RunTests := true.
self saveimage.
RunTests := false.
self saveImage.

and then in startUp:

startUp: resuming

 ( resuming and: [ RunTests] ) ifTrue: [ self runTests ]

> Stef

Best regards,
Igor Stasenko AKA sig.

More information about the Pharo-project mailing list