# Questions tagged [message-coding]

Questions about coding the generation of Messages and about the Message subsystem itself.

110 questions
Filter by
Sorted by
Tagged with
32 views

### Can one force Print[] statements within a Dynamic[] to appear in the Notebook? If so, should one ever do that?

For a simple demostration of the behavior, note that the print statements in this expression appear in the Messages window: ...
1 vote
31 views

### Redirect Messages

The command nb = CreateDocument[{}] opens an empty notebook. What I want to do is to redirect messages as generated by Mathematica so that they appear in this empty ...
• 10.2k
77 views

### Can I get the error message to be printed only once?

When an error occurs, most of the messages are output once. However, sometimes a message is output multiple times. Plot3D[x + y, {x, -1, 1}, {y, 1, 1}] In this ...
• 1,718
32 views

### How to preserve the state of messages across a block?

Is there a way to inquire whether a given message is switched On or Off without modifying the ...
1 vote
59 views

### A cryptic message when converting a Graph to Graphics

In Mathematica 13.3 (Windows 11) I do Graph[{1, 2}, 1 \[UndirectedEdge] 2] then right-click on the result and choose "Convert To Graphics" from the menu ...
• 2,066
156 views

### How to express Error Message as 'Output Cell'?

I got a random error message. expr = N[Pi, a] expr = Sin[x, The error message does not appear in the 'Output Cell'. ...
• 1,718
85 views

### How to make a button to delete a message output cell?

I got an error message about the following inputs. Sin[x,y] N[Pi, a] There are two things I want. (1) Creating a button to delete all message output cells (2) ...
• 1,718
116 views

### How to find codewords from constraint equations? [closed]

I have edited this question to include more information about what algorithm I wish to use etc. Say if I have a linear binary code with parity check matrix H = \begin{bmatrix} 0 & 1 & 1 &...
• 501
1 vote
38 views

### Message converts argument to string before formatting it

How to pass automatically, context-dependently formatted arguments to Message? Interestingly, StringForm correctly interprets ...
• 47.1k
1 vote
207 views

### Problem with NonlinearModelFit in the case of ODE

I am asking for your help for fitting a nonlinear ODE to data which are unknown up to a multiplicative constant k. So the constant k appears both in the data, and in the model, where it ...
• 313
1 vote
56 views

### Mask failure message in GeoPosition?

I am trying to construct a variable in a dataset that calculates the distance from a point to a city/country listed in another variable. I hoped to use GeoPosition to get the approximate location of ...
134 views

### Runge-Kutta of order 4 to solve m first order IVPs using Mathematica [duplicate]

I have the following m first-order IVPs d(y1)/dx=f1(x,y1,…,ym), y1(x0)=y10, d(y2)/dx=f2(x,y1,…,ym), y2(x0)=y20, ⋮ ...
• 13
88 views

### Is there a comprehensive list of most common or most important native Message-s (w/tags) for errors and Failed?

Yes I understand how to use Messages[symbol] but that doesn't help much. I have no idea which important ones I may have missed in my search or even how many exist. ...
• 2,467
207 views

### What do “Analyze Notebook" and "Analyze Cells" Do?

What does "Analyze Notebook" and "Analyze Cells" do? They seem to, at least, point out some coding errors that are already highlighted in a notebook. Do they do anything else? Is ...
• 1,607
52 views

### Why is Style ignored in my custom Echo error function?

To highlight the type of error that occurred the function echoError (via err) should display type of error in color: ...
• 2,467
1 vote
48 views

### Is it possible to trigger some Mathematica code when an error of the type StringTake::take happens?

I process data from various sources (databases) that are formatted very inconsistently. I would like to be able to process them finally summarized in one piece. My code consists of many cases of ...
• 2,818
184 views

### Print a Message

Is there a way to Print a message suitable for Message? I want to recycle some messages (but ...
• 20.3k
57 views

### Avoid MachinePrecision numbers in Message

Can I change the output of Message to not show MachinePrecision numbers? E.g. ...
• 20.3k
110 views

### Information/InformationInformationValueForm using Full- or InputForm

I have a problem with the build-in Information function for user-defined symbols with custom StandardForm in Mathematica 12.1.1.0: For example with the function ...
• 3,410
221 views

### how to obtain all Messages for Mathematica build-in functions?

Help says Messages[symbol] gives all the messages assigned to a particular symbol. These are called message identifiers per help: Message names always consist of ...
• 145k
2k views

### How to implement try/catch/end try in Mathematica in the most simple way?

There are lots of question/answers about exception handling in Mathematica. I still find exception handling in Mathematica too complicated to work with. I find Maple much simpler and easier to ...
• 145k
141 views

### Clearing ::usage message

After having assigned the usage message to f using ClearAll@f; f::usage=ToString@RandomInteger@{10^10,10^11}; the ...
• 1,154
1 vote
114 views

...
• 3,632
67 views

### Is it possible to turn off all messages for a specific mathematica file?

I have a general question. I have a big Mathematica file, which sometimes comes with some messages. Is it possible to turn off all messages forever in this notebook/file? BR Mads
• 23
124 views

### Restore output to notebook

While playing around in settings, I believe I did something to cause all output to be printed to a pop up window. How do I restore the output to the notebook where the evaluation occurs? In options ...
• 589
1 vote
271 views

### Q: How to manage notebook crashes, "In a previous session", and memory consumption?

I worked in a notebook. Something went wrong. I do not know what or why. The notebook did not react anymore and closed. After it, I try to open the same notebook. Then the next text appears: "The ...
• 2,855
64 views

### Find errors in collapsed notebook

I usually keep my notebooks collapsed to make understanding what's going on easier. The problem is that if there's an execution error, I have to expand everything in order to even know that there was ...
• 3,716
89 views

### Quiet Messages with arguments

I have some global options that determine which messages are shown and which are not, e.g. $MessagesShown = {Power::infy};$MessagesNotShown = All; Now the first ...
• 1,223
73 views

### customisable error checking, message handling code

I have an iterated computation running in a while loop, which is bound to fail at some point, at which point I want it to stop, e.g. ...
• 1,223
173 views

### Building a function that uses \$Assumptions and works like Simplify, FunctionExpand, etc

I want to write a function MySimplify (like built-in Simplify) that takes a second argument to specify additional ...
• 19.7k
542 views

### How to produce an error message for function with a wrong parameter and default values for other parameter

Consider this function w[x_Integer: 2, y__List : {1, 2}, z_String: "X"] := {x y, z} w[4] {{4, 8}, "X"} Now I want to define an error message to be displayed ...
• 15.9k
143 views

### How to catch error messages from parallel kernels

Doing something that throws out an error (warning): ParallelTable[NIntegrate[1/Sin[10 t], {t, 0, W}], {W, 0, 10, 1}] In parallel somehow limits a possiblity to ...
• 959
1 vote
117 views

### How do I implement this feature in Manipulate?

I am trying to create a dialog box that informs the user when the input is wrong (or even when any type of error occurs) in the manipulate function. I have the following code: ...
• 83
377 views

### Print messages of parallel kernels to console

This question shows how to print output to the console, but how about messages? For the main kernel, I know this way: ...
• 235
3k views

### How to stop the suppression of the warnings output? [duplicate]

I have some table of numerical integrals, and during the evaluation there are outputs like NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in x ...
• 5,827
104 views

### Correct 2D representation in a message string

Message knows how to convert an expression (taken as an argument) into a string before it is spliced into an actual message: If I run the following in my terminal ...
• 19.7k
49 views

### Strange behavior of symbol::messageName in debugger [duplicate]

According to the documentation, there are two ways to define a message, which I implement as: ...
• 845
406 views

### Turn off a message forever?

I am using Mathematica on an offline PC. I constantly get the message PacletInstall::Offline at startup. Is there a way to turn off this message forever? I know ...
• 11.4k
130 views

### Understanding EvaluationData in messages context

Can I Quiet my procedure and still get messages info from inner EvaluationData? This works fine: ...
• 137k
576 views

### Avoiding the suppression of messages by NIntegrate

Consider the following code: test[x_] := If[1 < x < 2, Message[Test::message]; x^2, x]; NIntegrate[test[x], {x, 0, 3}] 5.33333333333334 I.e. it gives me ...
• 7,172
259 views

### Find prefix of list in Association

I am trying to write some kind of demonstration for coding algorithm (for prefix codes). I have an Association that contains lists of bits (0s and 1s): ...
• 215
145 views

### How to get all messages defined for a built-in symbol?

AFAICT, when given a built-in symbol as argument, Messages returns an empty list, at least initially. For example: ...
• 11.7k
103 views

### Plot & StreamPlot eat my Messages

I have a complicated function for StreamPlot to call that includes some error checking and the use of Message. Somehow the ...
• 20.3k
266 views

### How to include a backquote in a message?

NB: I know one suboptimal solution to this problem, which I give at the end. I'm looking for a better one. Also, I was not able to solve this problem with the solutions give in Backquote in string ...
• 11.7k
318 views

### How to get the error information after run a wrong expression

If we run this code: FindCycle[1, 2, 3, 4, 5] It will give a error information like: How to get the error info promption of ...
• 26.8k
346 views

### Write Unit Test with expected Message

Using Workbench, I would like to check if my function does emit a message under certain circumstances. How can I test this using an .mt file? I only know about the ...
• 1,383
154 views

### Numerous Extraneous Error Messages from EvaluationData

In the course of solving question 134644, I encountered the message Reduce::ztest1: Unable to decide whether numeric quantity -Log[5381171456512]+Log[(-Sqrt[101] Log2-10 Sqrt[101] Log[5]+101 (...
• 61.7k
241 views

### How to make NIntegrate automatically resort to arbitrary precision if machine precision fails?

Sometimes NIntegrate gives me messages like NIntegrate::slwcon or NIntegrate::ncvb when I ...
• 7,172
210 views

### Is there any difference between Quiet and InternalDeactivateMessages?

Both Quiet and Internal`DeactivateMessages seem to suppress error messages. Does anyone have any experience with them and found ...
• 19.7k