Variable through a module?
dmurray14
Posts: 80
I am trying to pass a variable into a function. In the mainline I have:
Then I have my module included:
My module signature:
However, if in the code I do something like:
The mainline variable doesn't get updated. Shouldn't it?
And the module variable doesn't seem to reflect what the mainline variable is, either. What am I doing wrong?
Thanks,
Dan
CHAR myNewVariable[] = '5000';
Then I have my module included:
DEFINE_MODULE 'MyModule' MyMod(myNewVariable[])
My module signature:
MODULE_NAME ='MyModule' (theVariable[])
However, if in the code I do something like:
theVariable = '10000';
The mainline variable doesn't get updated. Shouldn't it?
And the module variable doesn't seem to reflect what the mainline variable is, either. What am I doing wrong?
Thanks,
Dan
0
Comments
For instance:
And then have a LEVEL_EVENT in the module or create a COMMAND event.
Good luck!
Try that and it should work. I have passed variables and them seem to update with no problems. If this still doesn't work, let me know and I will research it a little further as this could affect some of my modules.
Jeff
It's not Vegas so what happens in the module doesn't stay in the module and changes should be reflected in your main code.
Edit..
You also don't need the braces after the var array in your module declaration. I don't know if it hurts but it isn't required. I would think it wouldn't compile w/ them but I guess it does. They are required in your module header though because there your declaring the variable type!