how to refresh array values inside a module
MorgoZ
Posts: 116
Hello,
i need to pass an array of integer variables to a module, so if any element of the array is modified outside of the module, the value is refreshed.
For me, the elements of the array, inside the module, maintain the initial value, and i know there is a way to pass the array to the module by reference, not by value.... but can´t remember...
Any help?
Tahnx!
i need to pass an array of integer variables to a module, so if any element of the array is modified outside of the module, the value is refreshed.
For me, the elements of the array, inside the module, maintain the initial value, and i know there is a way to pass the array to the module by reference, not by value.... but can´t remember...
Any help?
Tahnx!
0
Comments
Honestly, I don't think there is a way to pass variables to a module by reference, as I believe that modules reference their own memory space and don't have access to the memory where variables for the main code file are referenced. I could be wrong here. You may be thinking of functions, where the parameters are passed by reference, and so you can make changes to a parameter and the variable that was fed into the function changes.
I'm guessing that the only way to accomplish what you want to do is to create a set of commands in the module that will act as setters/getters for the values you want to change. Alternatively, you could use levels instead, and just have a timeline that sends a level to the module with the correct values for the variables you want to work with.
MorgoZ, can you post the code, or at least a portion of the code, that shows how your array/module is substantiated?