Home
Main Introduction Features Constants Statements Database Objects Parser Serial-Communication Samples Misc
Misc>DEBUGGING
Caravan Business Server>Help>Misc>DEBUGGING
Syntax <CARAVAN>
output conout$
.......put your debugging statements here.........
close output
</CARAVAN>
//Directs the output to the Caravan Business Server monitor.

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

<CARAVAN>
output c:\debug\debug.txt
..........put your debugging statements here........
close output
</CARAVAN>
//Directs the output to the file specified in the path, where the Caravan Business Server is running.
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. The Caravan Business Server cannot diagnose and fix errors for you. We can, however, provide some examples to help you analyze the execution flow. There are no magic tricks to debugging, and there are no fixed steps that work every time. 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>
loop ctr (25);
"Value of the Counter is,";(ctr(counter));"<br>"
repeat ctr 100
</CARAVAN>
</BODY>
</HTML>

The value of the counter is displayed on the client browser as the loop is executed. Using the same method you can output the debugging values on the browser.
Back