Home AMX User Forum NetLinx Studio

Debug break on error

Is there a way to have the debugger break on error and highlight the offending line of code?

Jeff

Comments

  • Joe HebertJoe Hebert Posts: 2,159
    I know that option is available with other IDEs for other languages but not for Netlinx AFAIK.
    I personally haven?t found break on error all that useful and I can?t think of a time that I?ve actually found the need to use it. I take it you feel otherwise?
  • DHawthorneDHawthorne Posts: 4,584
    NetLinx doesn't really have a debug environment like other IDE's do. Your debugging just kind of opens a view to the running code, if it's compiled with debug information.
  • Spire_JeffSpire_Jeff Posts: 1,917
    Normally I don't need it, I just use the information shown in the error message to track down the problem. Normally it is an Index = 0 or an index out of bounds error and the error message tells me what variable array the problem was with. Then I search all files and look for the matching line numbers.

    I am currently having an error that is as follows:
    Line    107 (13:54:08.671)::  Ref Error  ?  Index to large Line=333
    Line    108 (13:54:08.687)::  CIpCodeMan::GetDevChan 2 Error 0x0000 0x00120E
    Line    109 (13:54:08.687)::  RunCode - Address Mismatch 0x4018 0x004018 0x001216
    

    Now, I can (and will) just check near line 333 in each of the include files I have, but I thought it would be nice to just have the debugger stop right when the error occurred. Nothing I can't live without tho.

    Jeff
  • Joe HebertJoe Hebert Posts: 2,159
    Spire_Jeff wrote:
    Now, I can (and will) just check near line 333 in each of the include files I have, but I thought it would be nice to just have the debugger stop right when the error occurred.
    Makes sense to me.
    At least you are getting a line number.
    Sometimes the run-time errors don?t reference a variable or a line number which really makes things tricky.

    This can all be easily avoided though. Just write perfect code every time. :)
  • Spire_JeffSpire_Jeff Posts: 1,917
    Joe Hebert wrote: »
    This can all be easily avoided though. Just write perfect code every time. :)

    It is my contention that I write perfect code every time. It is the fault of either an imperfect compiler or an imperfect processor that errors occur. (It could also be the fault of an imperfect keyboard that responds to the buttons I push and not the buttons my mind intended to push. ;) )


    Jeff
  • Joe HebertJoe Hebert Posts: 2,159
    Spire_Jeff wrote: »
    (It could also be the fault of an imperfect keyboard that responds to the buttons I push and not the buttons my mind intended to push. ;) )
    I?ve got the same faulty keyboard. They just don?t make ?em like they used to.
  • Joe HebertJoe Hebert Posts: 2,159
    DHawthorne wrote: »
    NetLinx doesn't really have a debug environment like other IDE's do.
    I respectfully disagree with you on this one.
    The debugger may not be as robust as others but you can do all the basics like watch variables, set breakpoints, and step though code.
    That sounds like a debugger to me.
  • cbutchercbutcher Posts: 16
    DId you ever find out where the "Address Mismatch" message was coming from?
Sign In or Register to comment.