View Full Version : global variable not updating

02 February 2011, 04: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.

02 February 2011, 08:05 AM
Maybe a spelling problem?

The variable is called $maxKeyframe and you set $maxkeyframe.

02 February 2011, 11:07 PM
Epic facepalm.

Cheers for pickign up on that man, its greatly appreciated, though I'm sorry to waste people's time on this one.

CGTalk Moderation
02 February 2011, 11:07 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.