Trace$ Variable

Purpose

Returns the command line to be executed next.

Syntax

Trace$

Description

Trace$ is a string variable which, inside the Tron procedurename, contains the command which will be executed next. Tron procedurename, specifies a subroutine which will be invoked before execution of every command. The combination of Tron procedurename and Trace$ is a very efficient way of looking for errors.

Example

Local mk%, mx%, my%

OpenW # 1 : Debug.Show

GraphMode R2_XORPEN

QBColor 11

Line 0, _Y - 20, _X, _Y - 20

Tron debug

Do

Exit If Len(InKey$)

Mouse mx%, my%, mk%

If mk% %& 1

If my% < _Y - 55

Box mx%, my%, mx% + 30, my% + 30

EndIf

EndIf

Loop

CloseW # 1

End

 

Procedure debug

If MouseK = 2 Then Debug.Print Trace$

EndProc

Return

Draws rectangles on the screen when the left mouse button is held down. When the right mouse button is hel down Trace$ shows the commands in debug output window.

Remarks

In a stand-alone program (EXE) the Tron command is ignored. TraceLnr, ProcLnr(p) and ProcLineCnt(p) are 0, Trace$ and SrcCode(%) are "".

See Also

Tron, Debug, Trace, TraceLnr, TraceReg, SrcCode$, ProcLnr, ProcLineCnt

{Created by Sjouke Hamstra; Last updated: 25/10/2014 by James Gaite}