PDA

View Full Version : TCL Globals


conzar
19th June 2006, 08:43 PM
I'm having trouble using global variables in tcl.

Here is an example of my problem


proc test {}{
global PI
set PI 3.14
test2
}

proc test2 {}{
puts $PI
}


Whats wrong with this? Or does AC3D use an interpreter that doesn't allow globals?

conzar
19th June 2006, 09:33 PM
ok, figured out what I'm doing wrong.

Change the code to the following and it works.

proc test {}{
global PI
set PI 3.14
test2
}

proc test2 {}{
global PI
puts $PI
}