JimmyTheDos wrote: ↑20 May 2018 21:34
Is there a way to "step into" (go line by line) of the code, (I can use "Pause" but this seems like not the best method.)
Often you want to debug only a particular function and often only if it is being called from a particular point, for that I programmed various debug functions. Functions could implement debug_ as follows
Code: Select all
:: --------------------------------------------------------------------------------------------------------------------------
:§myFunction_ ( null )
:: --------------------------------------------------------------------------------------------------------------------------
Rem ( %debugOn_% "!$trace!" )
::
( %debug_% "", "inside !$trace!(!%$trace%.p!)", /EQU )
::
( %forP_% '$rs,$r', '$rAs,"",""' )
::
:: (
( %debug_% "valid()", /EQU )
:: (
:: )
( %deq_% %necho$_% $debug.sub )
( %debug_% "perform()", /EQU )
:: (
:: )
( %deq_% %necho$_% $debug.sub )
:: )
( %debug_% "outside !$trace!()", /EQU, /PAUSE ) &exit /B !£e!
:: --------------------------------------------------------------------------------------------------------------------------
debugOn_ enables debugMode for the function specified as argument. debugOn_ can be used anywhere.
When debug is enabled for a function, all other debug commands become active
( %debug_% message, /PAUSE, /EQU ), ( %deq_% job ), ...
JimmyTheDos wrote: ↑20 May 2018 21:34
Is there a way to run code without the repercussions (a way to prevent accidentally deleting all your files or something) or a way that is reversible.
This happens to many at some point in time, a good way to protect your OS would be to do all the programming and testing from inside a virtual machine. VirtualPC is free but I prefer VMWare.
JimmyTheDos wrote: ↑20 May 2018 21:34
Is there a way to stop at a particular point and see the enviromental variables throughout the script (I guess this is the same as the "watches" window in excel, or "Set" in cmd?)
It's always nice to see exactly what arguments were passed to a function. My parser will print them on the console if debug is enabled for the function from where it is called. ( %forP_% 'name,value,default', 'and so on', .... ).
JimmyTheDos wrote: ↑20 May 2018 21:34
Any other good advice?
I cannot give you the code, I am too lazy, eh.. I mean it's too complex and depends on way too many factors to simply isolate this one functionality and hand it over to you. You could download and try out my library when my server is back online in a couple of weeks.