Is there a way that I could pass the current command to a variable? I am trying to come up with a way to generate log files for each command that runs within a script and the sucess/fail of each command.

MD "c:\docs"
$err=@ERROR
$serr=@SERROR
Gosub errchk

:errchk
WriteLine (2,"$err,$serr"+@CRLF)
Return

I would like to also pass to the log file the line
MD "c:\docs"

I hope that I am making myself clear on this.
_________________________
I haven't failed. I just found another way that did not work.