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

Igor Stasenko siguctua at gmail.com
Tue Nov 9 10:03:33 CET 2010


On 9 November 2010 09:58, Stéphane Ducasse <stephane.ducasse at inria.fr> wrote:
>>>
>> 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 ]
>>
>
> but my code is executed when a menu is selected. So the interaction with startUp: is not really good.
>

snapshot: save andQuit: quit embedded: embeddedFlag

answers the resuming flag.

So, you can use it like:

| resumedInFirstSnapshot |
resumedInFirstSnapshot := false.

"first save"
(Smalltalk snapshot: save andQuit: false) ifTrue: [ ... "resuming here
" resumedInFirstSnapshot  := true ]
"second save"
(Smalltalk snapshot: save andQuit: false) ifTrue: [ ... "resuming here
" resumedInFirstSnapshot ifFalse: [ ... ] ]



> Stef
>
>
>



-- 
Best regards,
Igor Stasenko AKA sig.




More information about the Pharo-project mailing list