Interactive Debugging

Top  Previous  Next

 

Interactive Debugging

Robo-FTP provides several commands to specifically facilitate interactive debugging of command script files. These commands are:

 

BREAK - Set a script file breakpoint
GO - (Re)run the currently selected script file from beginning
RESUME - Resume execution of a script file stopped at a breakpoint
STOP - Exit from the break state

 

The menu option named Enable Breakpoints under the Scripts menu controls whether or not BREAK command(s) are ignored when a script is running in the main console window.

 

When debugging, place the BREAK command at strategic places in the flow of execution of a script file to be debugged. When the Robo-FTP script processor encounters a BREAK, script execution will be suspended.

 

Robo-FTP is now in the break state and control is returned to the console window. Here you can view variable values, for example, by typing DISPLAY commands into the console command line, activate the FTP client applet to view the current state of the FTP site, reassign variable values by typing SET or SETNUM, or perform other tasks that may assist you in finding problems in your script logic.

 

Script execution may be resumed by typing the RESUME command into the console command line or by clicking the Skip To Next Command (Ctrl + N) toolbar button. The script may be stopped by typing the STOP command or by clicking the Stop toolbar button. To restart the script (perhaps after editing it to make corrections), type the GO command or click the Rerun Script File (Ctrl + R) toolbar button.

 

When your script has been thoroughly debugged, either edit your script and remove all the BREAK commands or clear the Enable Breakpoints control in the Scripts menu and BREAK commands will be ignored on subsequent runs of the script.

 

The MESSAGEBOX and PRESSANYKEY commands may also be used to temporarily halt execution without putting Robo-FTP into the break state.

 

Some "bugs" may be due to conditions beyond your control, for example a network outage or permissions issue on the remote server.  The IFERROR command is useful for detecting and changing the behavior of your command script in response to an error condition as shown in this error handling example. You may also find the Robo-FTP Client Applet and the FTPLIST command useful to confirm the current state of the remote server's file system and the Trace Window helpful to view the TRACELOG as it is created in in real time.

 

Note: The Robo-EDIT text editor installed with Robo-FTP provides color keyword highlighting and automatic capitalization of valid script commands to help you avoid syntax errors and reduce the amount of time you spend debugging script files.

 

 

Related command(s): BREAK, RESUME, GO, STOP, DISPLAY

See also: Basic Logging, Advanced Logging, Troubleshooting.