Question: How Do I make code run once ?

Dear Forum, 

 

I want to make a Document where some values are initialised and left alone afterwards.
The startup-code seems to be the solution. The manual says, it is executed, when the document is reloaded.

But if i execute the document with "!!!" the startup-code is executed too. 
How can I avoid this ? 
Is there a good way to write "run once" code ?

 

Thank you very much

 

Klaus

startup code is  : 

init:=false;

After reloading, this should be false  init = trueNULL

the startup code should be executed after reloading but is executed when the code is executed with !!! . init is set to false again
If the code is executed stepwise , ! by ! , it behaves as expected.

if not init then x := 3; y := 4; init := true end if
 

2*x = 8NULL

x := 4

4

(1)

2*x = 8NULL

NULL

NULL

NULL


 

Download doesnotrunonce.mw

Please Wait...