Administration>Debugging
Introduction Installation Beginning Admin Quick Ref FTP Server SMTP Server Database Security
Statements Objects String Parsing Events Queues Samples Special names Error Handling Accessories   Back
Caravan Business Server>Help>Administration>Debugging
Syntax
<CARAVAN>
//Direct the output to the Caravan Business Server monitor.
             output conout$
            .......put your debugging statements here.........
             close output
</CARAVAN>      


<CARAVAN>
//Direct the output to the Caravan Business Server's printer.
             output lpt1
              ..........put your debugging statements here........
             close output
</CARAVAN>      


<CARAVAN>
//Direct the output to the file specified in the path, where the Caravan Business Server is running.
             output c:\debug\debug.txt
               ..........put your debugging statements here........
             close output
</CARAVAN>      
Text
An application can have syntactically valid code, run without performing any invalid operations, and yet produce incorrect results. Only by testing the application and analyzing the results, you can verify that the application is performing correctly or incorrectly.

Basically, in debugging you need to understand what is going on while your application is running.

The methods employed are:
* Syntactic error debugging
* Server side debugging
* Client Side debugging

Syntactic Errors Debugging
The Caravan Business Server can detect syntax errors in the Caravan script. When a web page is copied in the /template directory, the Caravan Business Server parses the code and identifies incorrect keywords, omitted punctuation, and missing Caravan tags.  The program lines with syntax errors are displayed on the Caravan Business Server console.

Server Side Debugging
By adding the following statement in a web page, the output of the full page can be directed to the desired output device instead of the client browser.  You can direct the output to the Caravan Business Server monitor, printer, or to a text file.This feature is also useful to get a system generated web page with all the values dynamically filled up.

Client Side Debugging
When a web page is executed from a client application, then you can put debugging messages in the code to know exactly what is happening when a particular statement is executed.
Sample
Example
<HTML>
<BODY>
<CARAVAN>
// Client side debugging
//The value of the counter is displayed on the browser as the loop is executed.

loop ctr (25)
"Value of the Counter is,";(ctr(counter));"<br>"
repeat ctr
</CARAVAN>
</BODY>
</HTML>
Quick Reference
Home       Back