5

2

I'm fairly new to Mathematica. Suppose I have the following function:

```
f[x_Integer] := Module[{y, z, r},
y = 5;
z = 10;
r = x + y + z;
r
];
```

and I would like to halt the execution after each of the statements `y = 5`

, `z = 10`

and `r = x + y + z`

, and resume only after I press a key. (In other words, I'm looking for something like `Console.ReadLine()`

in `C#`

or `getline()`

in `C++`

.) Is there an easy way to do this in Mathematica?

Thanks in advance for your help.

I think

`Input[]`

does the trick. Is the the idiomatic way of implementing the desired outcome? – Shredderroy – 2013-09-09T04:12:05.4331

Maybe by using built-in debugger? -

– Vitaliy Kaurov – 2013-09-09T04:14:31.393see hereI will certainly look into that. Thank you very much. – Shredderroy – 2013-09-09T05:58:10.103

2@Shredderroy A natural way is to keep open an extra notebook in which to run the code pieces you want to check. – Alexei Boulbitch – 2013-09-09T07:47:52.300