1. trace() enhancements (was Re: request for 2.5)
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Oct 15, 2004
- 480 views
Rob, I was toying with the idea of doing this:
prevtrace=tracef(0) <code never to be traced> trace(prevtrace)
Do you think a new builtin function tracef would be a good idea? I also tried the following code as a partial proof of concept:
without trace integer myPrevTrace myPrevTrace=0 procedure myTrace(integer t) myPrevTrace=t trace(t) end procedure function myTracef(integer t) integer p p=myPrevTrace myPrevTrace=t trace(t) return p end function with trace integer i,prevtrace myTrace(1) i=1 prevtrace=myTracef(0) i=2 myTrace(prevtrace) i=3
but the trace never triggered. If I replace the without trace on line 1 by with trace, it does actually work as expected, namely not stopping on the i=2 line, apart from five unwanted stops in myTrace & myTraceF, which is why I decided to propose a new builtin. Regards, Pete