The following warnings occurred:
Warning [2] Undefined array key 0 - Line: 1677 - File: showthread.php PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/showthread.php 1677 errorHandler->error_callback
/showthread.php 916 buildtree




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
debug information
#7
LCD Wrote:
boriel Wrote:
LCD Wrote:Yes, there are commands for compiler to check memory and arrays, and you can add PRINT commands an remove them later.
I would like to have a DEBUG command which works like similar like PRINT, but on a protected window area, ignored in normal mode, but activated in Debugging mode.
Code:
DEBUG "Reached part 7" DEBUG n debug "Test nr "+str(testnr)
Hmm nice. However, you can implement some sort of debugging using C-like macros. In C they do this way:
Code:
' Just an example of DEBUG implementation #ifdef __DEBUG__ ' This is our DEBUG command, it could be an asm routine, etc. # define DEBUG PRINT AT 20,0; #else 'If __DEBUG__ is not defined, just replace DEBUG with REM so nothing is compiled # define DEBUG REM #endif 'If __DEBUG__ is defined, DEBUG macro will be active. #define __DEBUG__ DIM x = 20 DEBUG "x="; x

Thats a solution... I currently use PRINT, but the area is not protected against overwritting by other screen output.
Yes I do it also, and is useful but is not a debuger.
The advantage of a debuger is the possibility to freezze the program in a point and trace step by step.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)