Difference between revisions of "Error"

(see also -- AbortCalculation, ER 19313)
 
(4 intermediate revisions by the same user not shown)
Line 4: Line 4:
  
 
[[category:Evaluation Functions]]
 
[[category:Evaluation Functions]]
 +
{{ReleaseBar}}
  
== Function Error(message) ==
+
== Function Error(message{{Release|5.2||'', caption, url, urlText''}}) ==
 
Reports an evaluation-time error, displaying the indicated «message» to the end user in a dialog box and ending the current computation.
 
Reports an evaluation-time error, displaying the indicated «message» to the end user in a dialog box and ending the current computation.
  
 
If the expression in a [[Check Attribute]] calls [[Error]](), it displays the error message as a warning dialog, instead of the default failed-check message that otherwise appears when the [[Check Attribute]] evaluates to <code>False</code> (0).
 
If the expression in a [[Check Attribute]] calls [[Error]](), it displays the error message as a warning dialog, instead of the default failed-check message that otherwise appears when the [[Check Attribute]] evaluates to <code>False</code> (0).
  
 +
{{Release|5.2||
 +
The optional «caption» parameter controls the text that appears on the title bar of the error dialog.
 +
 +
The optional «url» and «urlText» can be specified if you want to include a hyperlink on the error's message box.
 +
}}
 
== Examples ==
 
== Examples ==
 
:<code>If not IsNumber(x) Then Error("Something is wrong.  x is not numeric.");</code>
 
:<code>If not IsNumber(x) Then Error("Something is wrong.  x is not numeric.");</code>
 +
 +
{{Release|5.2||
 +
<code>
 +
:[[Error]]( "The matrix to MapKernel must be positive definite",
 +
::url: "https://mywebsite.com/Details/Using_MapKernel.html",
 +
::urlText:"Info on this error")
 +
</code>
 +
}}
  
 
== See Also ==
 
== See Also ==
Line 19: Line 33:
 
* [[Check Attribute]]
 
* [[Check Attribute]]
 
* [[MsgBox]]
 
* [[MsgBox]]
 +
* [[AbortCalculation]]

Latest revision as of 18:32, 28 September 2023



Release:

4.6  •  5.0  •  5.1  •  5.2  •  5.3  •  5.4  •  6.0  •  6.1  •  6.2  •  6.3  •  6.4  •  6.5  •  6.6


Function Error(message, caption, url, urlText)

Reports an evaluation-time error, displaying the indicated «message» to the end user in a dialog box and ending the current computation.

If the expression in a Check Attribute calls Error(), it displays the error message as a warning dialog, instead of the default failed-check message that otherwise appears when the Check Attribute evaluates to False (0).

The optional «caption» parameter controls the text that appears on the title bar of the error dialog.

The optional «url» and «urlText» can be specified if you want to include a hyperlink on the error's message box.

Examples

If not IsNumber(x) Then Error("Something is wrong. x is not numeric.");

Error( "The matrix to MapKernel must be positive definite",
url: "https://mywebsite.com/Details/Using_MapKernel.html",
urlText:"Info on this error")

See Also

Comments


You are not allowed to post comments.