Question about globals and several lock scripts
Posted: Tue Jan 04, 2011 11:53 pm
Suppose I have replicated a Lock() code on several MHS entries like this:
Entry #1:
Entry #2:
Entry #n:
For every script, will the 'timehit' address be allocated into different memory regions? In other words, are them 'globals' only in the scope of the script, or script for entry 2 will change value of 'timehit' on all other scripts?
What I need is timehit being exclusive for every entry, so entry #2 does not change entry#1's. It seems (as I am 'redeclaring' the variable, that it is global only in the scope of the script so, what if I wanted to declare a global I wish to share with all other script lock entries?
Thank you!
Entry #1:
- Code: Select all
int timehit=0;
VOID Lock(...) {
...use/change 'timehit' here...
}
Entry #2:
- Code: Select all
int timehit=0;
VOID Lock(...) {
...use/change 'timehit' here...
}
Entry #n:
- Code: Select all
int timehit=0;
VOID Lock(...) {
...use/change 'timehit' here...
}
For every script, will the 'timehit' address be allocated into different memory regions? In other words, are them 'globals' only in the scope of the script, or script for entry 2 will change value of 'timehit' on all other scripts?
What I need is timehit being exclusive for every entry, so entry #2 does not change entry#1's. It seems (as I am 'redeclaring' the variable, that it is global only in the scope of the script so, what if I wanted to declare a global I wish to share with all other script lock entries?
Thank you!