Home AMX User Forum NetLinx Studio

Watching Module Varaibles

Greetings,

I'm new to writing modules. If you have a module running on a system that declares some variables, how do you watch those varaibles during runtime? The debug associated with the master program seems to not always show the values.

Thanks.

Comments

  • You can Copy/Paste the variables in the "watch" window.
  • yuriyuri Posts: 861
    if you defines them as LOCAL_VAR or STACK_VAR you cant watch them.
    Also if you have a module that you use more than once, you will have to select one (or more) from a list.
  • viningvining Posts: 4,368
    yuri wrote:
    if you defines them as LOCAL_VAR or STACK_VAR you cant watch them.
    Also if you have a module that you use more than once, you will have to select one (or more) from a list.
    Locals are no problem and you can also see the Stack_Var while stepping through but you have to be in that code block of the stack_var to see it momentarily.
  • yuriyuri Posts: 861
    vining wrote:
    Locals are no problem and you can also see the Stack_Var while stepping through but you have to be in that code block of the stack_var to see it momentarily.

    while stepping through yes, but not while the system is up and running :)
  • DHawthorneDHawthorne Posts: 4,584
    You can also highlight the variable and drag it to the debug window. If it's a variable from the parameters list, you need to watch the original in the calling code. If you have multiple instance of the module, all bets are off; I find the ambiguous reference resolution window to be unreliable. If I need to debug a multi-copy module, I comment out all but the one I need to work on.
  • yuriyuri Posts: 861
    DHawthorne wrote:
    You can also highlight the variable and drag it to the debug window. If it's a variable from the parameters list, you need to watch the original in the calling code. If you have multiple instance of the module, all bets are off; I find the ambiguous reference resolution window to be unreliable. If I need to debug a multi-copy module, I comment out all but the one I need to work on.

    i think there is a way of selecting the correct variable.
    Let's say you have 5 instances of 1 module. If you want to watch a variable that is defined as third instance, you select the 3rd variable from the selection list. Can anyone confirm this is the way to go?
  • Variable watch for modules

    I have experienced the same problem. If you have lets see four of the same tv and use four instances of the same module. Their seems to be no way to actually watch those variables.
    It almost forces use the same module, just rename it slightly for all four.
    The variables do not reliably show. YOu can pass the in an out of the module to a variable.
    But not as simple as just watching an array or variable.
    I think this is a fault of amx debug.
    Any one else have this ame problem.
  • DHawthorneDHawthorne Posts: 4,584
    yuri wrote:
    i think there is a way of selecting the correct variable.
    Let's say you have 5 instances of 1 module. If you want to watch a variable that is defined as third instance, you select the 3rd variable from the selection list. Can anyone confirm this is the way to go?

    In theory yes, but it doesn't work. Try selecting all five from different modules. Change one, they all change. It's broken, and cannot be depended on.
  • And if you are unlucky it won't work at all and NS2 will simply crash whenever you try to look at a variable inside a module if that module has more than one instance.
Sign In or Register to comment.