Debugging
When you are writing complex formulas, it is likely that they will not immediately function as 
intended. Although the compiler tries to catch most of the common mistakes and reports them as 
errors
 or 
warnings
, some mistakes will go unnoticed until you try the formula.
The process of trying a formula and correcting it until it works is called debugging, because you are 
essentially removing bugs (programming mistakes). To debug a formula, you use run time 
messages. 
Run time messages can be generated by a formula while it is executed. They appear in the 
Compiler 
Messages
 tool window, where you can examine them.
To enable run time messages, define the DEBUG symbol. Run time messages are caused by an 
array index that is 
out of bounds
, an assignment of 
incompatible arrays
, or by the 
print function
. 
Here is an example:
int 
a[
4
]
int 
i = 
5
a[i] = 
4              
; out of bounds, no run time message
print
(
"Hello?"
)       
; ignored
$define DEBUG
a[i] = 
3              
; out of bounds, causes run time message
print
(
"Hello, world"
) 
; causes run time message
Use the print function to examine the values of variables while the formula is executed, so you can 
understand why it is not working properly.
By not defining the DEBUG symbol, run time messages are not generated. When you are publishing 
a formula, you should make sure the DEBUG symbol is not defined, since the users of your formula 
will probably not appreciate the run time messages.
Next: 
Optimizations
See Also
print function
Compiler directives
296






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

web hosting biz

 

Our partners: PHP: Hypertext Preprocessor Cheap Web Hosting JSP Web Hosting Ontario Web Hosting  Jsp Web Hosting

Cheapest Web Hosting Java Hosting Cheapest Hosting

Visionwebhosting.net Business web hosting division of Vision Web Hosting Inc.. All rights reserved