¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: Read NVRAM File


 

To answer your question why "trace" is better than "print"...

Print is an older way of printing debug statements, and has been depreciated (although it still works).

Trace is newer, and replaces print, and specifically used for debugging purposes.? The biggest advantage I'm aware of, is that it can be turned on/off with a simple pre-processor flag.? You can sprinkle "trace" statements all over in your program for devolopment, and use the flag "#ENABLE_TRACE" in the module header to make them active.? When you are done developing/testing the module, you can then turn off tracing, and the trace statements stop outputting (but are still in the code, so later you can turn them on if needed).

This makes it fast and easy to stop debugging statements from getting outputted to debugger/console, and you don't have to go through and remove a bunch of individual print statements to get the trace output to stop.

You could do something similar with print, but you would have to do it manually by using "If (iDebug) Then Print (...)" everywhere, where iDebug would be a constant in the program set to on/off.? This is how I've done debugging in the past and with other manufacturers, but the built-in Trace statement handles this easier and cleaner with the pre-processor flag.

-jason

Join [email protected] to automatically receive all group messages.