Xannon
02-28-2011, 03:09 AM
Hey guys, I've hit a bit of a wall of late and can't find much help through searches, so I figured I should throw something out on the boards.
I have a global variable in a proc which I want to update. The proc is small and as follows:
proc keepPresets(){
global int $maxKeyframe;
$maxkeyframe = (`intField -q -v intFieldMaxTime`);
}
The global variable has already been declared at the top of the script, and it has already been successfully changed in another proc (lets call it procX). However, if I get it to print out the value of $maxkeyframe during and after this proc, then it stubbornly keeps the value it was assigned in procX. And if I get it to print out the value of (`intField -q -v intFieldMaxTime`), then it works. Its as if it completley ignores the $maxkeyframe = (`intField -q -v intFieldMaxTime`) line.
I'm at a bit of a loss here. I don't usually use a lot of global variables, but I do use them occasionally. And I have never encountered this before. Am I doing something wrong?
Any help would be greatly appreciated.
I have a global variable in a proc which I want to update. The proc is small and as follows:
proc keepPresets(){
global int $maxKeyframe;
$maxkeyframe = (`intField -q -v intFieldMaxTime`);
}
The global variable has already been declared at the top of the script, and it has already been successfully changed in another proc (lets call it procX). However, if I get it to print out the value of $maxkeyframe during and after this proc, then it stubbornly keeps the value it was assigned in procX. And if I get it to print out the value of (`intField -q -v intFieldMaxTime`), then it works. Its as if it completley ignores the $maxkeyframe = (`intField -q -v intFieldMaxTime`) line.
I'm at a bit of a loss here. I don't usually use a lot of global variables, but I do use them occasionally. And I have never encountered this before. Am I doing something wrong?
Any help would be greatly appreciated.
