Use the TRACE command to debug command blocks, command files, or command files requiring passed parameters. [Ctrl] + [Shift] + [F12] will trace the next entry/exit procedure.
Options
cmdfile
Specifies the name of the command file to debug.
On a workstation with multiple drives (local or mapped), especially when the files are on the different drive, it is always the best practice to define a drive letter when copying, deleting, renaming, or running files, unless the specified files are located in the working directory. You will not need to specify the drive letter if all of the files are located in the default directory when using file-based commands.
IN procfile
Specifies the name of a procedure file. A procedure file is a compiled binary file that contains stored menu, screen, and command blocks. Include a drive and path name if the procedure file is not on the current drive and directory.
SELECT VARCHAR clause
Specifies a column defined with the VARCHAR data type from a table, then you can run the contents. The SELECT clause must limit the data to only one row; otherwise, an error is returned.
USING parmlist
Lists the values the command file will use when it executes. The parameter list can contain up to nine values. The first value in the list is referenced in the executed file as %1, the second as %2, and so on through %9. They are treated just like other variables. To reference the contents of these variables, preface the variable name with a dot (.); for example, set v1 = .%1.
About the TRACE Command
The TRACE command starts the R:BASE interactive debugger. It allows you to go through the command file line-by-line to facilitate debugging the code. The TRACE command must be on a line by itself and not combined with other commands. For TRACE to work correctly with a file encoded by CodeLock, the ASCII file must be present in the current drive and directory, and have the file extension of .APP. If TRACE cannot find the ASCII file, it does not go through the procedure file line-by-line when it runs.
Immediately after you find an error in the R:BASE debugger, you can correct bad syntax using the R:BASE Editor. To correct an error:
1. | If an error point is found, the debugger displays an error message and prompts to modify the file. |
2. | If you wish to modify it at once, click the Yes button. The R:BASE Editor will then open, and focus is placed upon the error point. |
3. | Correct the syntax error, save the file, and exit the R:BASE Editor. |
4. | To repeat debugging, restart the debugger using the TRACE command. |
For more information about the interactive debugger, refer to the TRACE compiled Help in the R:BASE program directory.
Examples
The following command displays the MYCMDFIL file for debugging in the current directory.
TRACE mycmdfil
The following command displays a command block for debugging named mycmdfil in a procedure file named MYPROCFL.APX.
TRACE mycmdfil IN myprocfl.apx
The following TRACE command displays the Trace Debugger for the command syntax with the CmdData VARCHAR data field inside the table IntrnlCmd.
TRACE SELECT CmdData FROM IntrnlCmd WHERE CmdName = 'NewKey'
TRACE can also be initiated inside a command file to trace a block of code using the SET TRACE ON operating condition.