Navigation:  Reference > Commands >

Trace

Print this Topic Previous pageReturn to chapter overviewNext page

 

This command is used to create a listing of every command executed and each time the user clicks on a object that has a CLICK event.

 

TRACE

 

START f/c/eUse this to turn on the trace mode.  You must supply a file name that will be created and written to.  The program will remain in trace mode, even if you chain to other programs or exit from the program that calls this command.

 

       NOTE:  If you specify an existing file it will be overwritten automatically without any response from the user.

 

WRITE f/c/e Once you have started the trace process by executing the START option you can add your own information to the file using this option.  You would generally use this to write out field values, or other items to watch, since you will know exactly where the user is in the program at any time.

 

STOP This will stop the trace process and will close the text file.  If you wish to continue the trace process somewhere else you will have to use the START option again.

 

COMMENTS

This command can produce a lot of information about what's happening in your program.  Generally you would use this when you want to know what's happening when a user clicks on a button or a menu choice, etc.  You would also, generally, use this in connection with the Compile in Debug Mode option (Defaults Tab) in the compiler.  If you do, the process will include the actual line number of each command as it's executed.  A typical line would look like the following:

 

IF PrgLineNum: 275 \ADV60\PROGRAM2.RWN

 

The first part is the actual command, in this case an IF.  The second part is the line number within the source file, line 275.  The last part is the name and location of the program being executed.  If the user clicks on an object the following will be saved:

 

User Clicked: sortmenu4 Label Found \ADV60\PROGRAM1.RWN

 

It tells you that the user clicked on an object, the name of that object is sortmenu4.  It also tells you that a label was found in the current program and what the name of that program is.  If the label is not found the line will look like this:

 

User Clicked: sortmenu4 Label NOT Found \ADV60\PROGRAM1.RWN

 

EXAMPLE

The following is a piece of a debug file for a TAS Professional program.  Notice that in PROGRAM2 we didn't use the Compile in Debug Mode option in the compiler and the line numbers are all 0.  You may also notice that the last command in PROGRAM2 is a RET and then PROGRAM1 starts.  PROGRAM2 was called with a CHAIN and eventually returned to PROGRAM1.

 

SET_OBJECT PrgLineNum: 0 C:\ADV60\PROGRAM2.RWN

SET_FOCUS PrgLineNum: 0 C:\ADV60\PROGRAM2.RWN

RET PrgLineNum: 0 C:\ADV60\PROGRAM2.RWN

RET PrgLineNum: 0 C:\ADV60\PROGRAM2.RWN

RET PrgLineNum: 0 C:\ADV60\PROGRAM2.RWN

= PrgLineNum: 0 C:\ADV60\PROGRAM2.RWN

RET PrgLineNum: 0 C:\ADV60\PROGRAM2.RWN

FINDV PrgLineNum: 0 C:\ADV60\PROGRAM2.RWN

RET PrgLineNum: 0 C:\ADV60\PROGRAM2.RWN

IF PrgLineNum: 0 C:\ADV60\PROGRAM2.RWN

RET PrgLineNum: 0 C:\ADV60\PROGRAM2.RWN

GOSUB PrgLineNum: 141 C:\ADV60\PROGRAM1.RWN

SET_OBJECT PrgLineNum: 247 C:\ADV60\PROGRAM1.RWN

IF PrgLineNum: 248 C:\ADV60\PROGRAM1.RWN

SET_OBJECT PrgLineNum: 249 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 250 C:\ADV60\PROGRAM1.RWN

UPDTA PrgLineNum: 251 C:\ADV60\PROGRAM1.RWN

ON PrgLineNum: 252 C:\ADV60\PROGRAM1.RWN

SCAN PrgLineNum: 252 C:\ADV60\PROGRAM1.RWN

IF PrgLineNum: 253 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 255 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 256 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 257 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 258 C:\ADV60\PROGRAM1.RWN

IF PrgLineNum: 259 C:\ADV60\PROGRAM1.RWN

IF PrgLineNum: 261 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 262 C:\ADV60\PROGRAM1.RWN

ELSE PrgLineNum: 263 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 264 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 265 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 266 C:\ADV60\PROGRAM1.RWN

FINDV PrgLineNum: 267 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 268 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 269 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 270 C:\ADV60\PROGRAM1.RWN

ELSE PrgLineNum: 271 C:\ADV60\PROGRAM1.RWN

ON PrgLineNum: 272 C:\ADV60\PROGRAM1.RWN

SCAN PrgLineNum: 252 C:\ADV60\PROGRAM1.RWN

ON PrgLineNum: 273 C:\ADV60\PROGRAM1.RWN

SCAN PrgLineNum: 273 C:\ADV60\PROGRAM1.RWN

IF PrgLineNum: 275 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 278 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 279 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 280 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 281 C:\ADV60\PROGRAM1.RWN

 

 

 


Page url: http://www.cassoftware.com/tas/manual/trace.htm