Hello,
i have a problem with the declaration of global variables. I use a string array in several parts of the script and so I thought it would be a good Idea, to make it global. The values are changed quite often during development.
The problematic part of the code is:
CODE
global string $lsArray[10] = {"b", "b", "b", "e", "e", "v", "g", "g", "h", "u", "g"};
[...]
global proc defineSoteUIView(){
[...]
string $ls;
for ($ls in $lsArray) {
menuItem -label $ls;
}
[...]
}
The code works faultless, if I declare $lsArray as a local variable. If I declare it as global in the beginning of the script, it is not found.
CODE
// Error: for ($ls in $lsArray) {
//
// Error: Line 143.25: "$lsArray" is an undeclared variable. //
Do you have an Idea, what is wrong or what I make wrong?
Thank you very much for your help, every luck to you and much excuses for my poor english.
Andreas
P.S. I use Maya 7.0