Difference between revisions of "RaiseRunTimeError"

From MultiCharts
Jump to navigation Jump to search
 
Line 3: Line 3:
 
A run-time error will cause the execution of the study to be aborted.  
 
A run-time error will cause the execution of the study to be aborted.  
  
==== Usage ====  
+
== Usage ==  
 
<syntaxhighlight>RaiseRunTimeError("Message")</syntaxhighlight>  
 
<syntaxhighlight>RaiseRunTimeError("Message")</syntaxhighlight>  
  
Where: [[Message]] - a string expression specifying the error message  
+
Where:  
 +
 
 +
:'''Message''' - a string expression specifying the error message.
 
   
 
   
==== Example ====
+
== Example ==
 
Generate a run-time error and display the message "Strategy Stopped":  
 
Generate a run-time error and display the message "Strategy Stopped":  
  
 
<syntaxhighlight>RaiseRunTimeError("Strategy Stopped");</syntaxhighlight>  
 
<syntaxhighlight>RaiseRunTimeError("Strategy Stopped");</syntaxhighlight>  
 
   
 
   
 
+
Or to generate a run-time error when the user adds an indicator to an unsuited market:
 +
<syntaxhighlight>if (Category = 12) then
 +
RaiseRunTimeError("This indicator isn't suitable for Forex!");</syntaxhighlight>
  
 
[[Category:Execution Control]]
 
[[Category:Execution Control]]

Latest revision as of 05:55, 9 February 2012

Generates a run-time error and displays the specified error message.

A run-time error will cause the execution of the study to be aborted.

Usage

RaiseRunTimeError("Message")

Where:

Message - a string expression specifying the error message.

Example

Generate a run-time error and display the message "Strategy Stopped":

RaiseRunTimeError("Strategy Stopped");

Or to generate a run-time error when the user adds an indicator to an unsuited market:

if (Category = 12) then 
	RaiseRunTimeError("This indicator isn't suitable for Forex!");