# what is the command to make Mathematica beep each time there is an error even for the same command?

sorry for a basic question, but does any one know what is the trick to make the front end beep at me each time I issue the same command (which contain an error)?

It now only beeps the first time, but when I SHIFT+ENTER the same command again, it stops beeping. I want it to beep each time.

here is an example:

expr = 0.09 - (0.00043739999999999995*
Sin[x])/(Sqrt[1 - 0.36*Sin[x]^2]*(0.0225 - 0.0081*Sin[x]^2))
FullSimplify[expr]


now it beeped and gave message to the notebook

Indeterminate


and the following messages to the console:

 Mathematica beeped to let you know that a warning or error
message was generated by the kernel. You can disable this beep by resetting
MessageOptions in the Option Inspector.


But when I typed the above again:

FullSimplify[expr]


I see no more messages to the console and no more beeps but only the Indeterminate message comes out to the notebook. Only way to see the error again and hear the beeps is to do Remove["Global*"] and run everything again.

Strange thing, is that this behaviour does not happen for everything. For example, if I type

Simplify[1/0]


I will see a new error a hear a new beep EACH time I execute the command. I have a feeling that the kernel is remembering things. But I do not want to clear everything each time.

I am using 8.04, and this is a picture of my setup:

and here is the messageOptions in the advanced setup

I tried to change the MaxMessageCount to 100 but no change. same for the MessageCountRestTime.

thanks

-
Try using SetDelayed (expr := (* stuff *)) instead of Set (expr = (* stuff *)). –  Ｊ. Ｍ. Jan 20 '12 at 8:47

Heike figured out what was going on. However, if you want a command that will make your Simplify[expr] beep everytime, you need to turn of the symbolic part of the cache using

SetSystemOptions["CacheOptions" -> {"Symbolic" -> False}]

-
@Nasser: Of course, this will slow down some calculations. It will also make some of the weird behaviour go away, like trying the same integral twice in a row and getting two different results! –  Simon Jan 20 '12 at 11:41

I think you only get the warning once because Simplify somehow remembers which expressions it has simplified before. For example, in a new session this only gives me a warning for the first evaluation of FullSimplify:

FullSimplify[1/x, x == 0]
FullSimplify[1/x, x == 0]


output:

Now if I clear Simplify and run FullSimplify again the warning show up again

Unprotect[Simplify]
Clear[Simplify]
Protect[Simplify]
FullSimplify[1/x, x == 0]


output:

-
+1: Although, to clear the cached simplify results you should use ClearSystemCache[] or ClearSystemCache["Symbolic"]`. –  Simon Jan 20 '12 at 11:29
@Simon Thanks. I knew there was a different command to do this, but I couldn't find it. –  Heike Jan 20 '12 at 11:42