Go Back   AC3D Forums > Technical > AC3D Developers
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 19th June 2006, 08:43 PM   #1
conzar
Member
Advanced member
 
conzar's Avatar
 
Join Date: May 2006
Posts: 36
Question (Solved) TCL Globals

I'm having trouble using global variables in tcl.

Here is an example of my problem

Code:
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?

Last edited by conzar; 19th June 2006 at 09:34 PM.
conzar is offline   Reply With Quote
Old 19th June 2006, 09:33 PM   #2
conzar
Member
Advanced member
 
conzar's Avatar
 
Join Date: May 2006
Posts: 36
Default Re: TCL Globals

ok, figured out what I'm doing wrong.

Change the code to the following and it works.
Code:
proc test {}{
    global PI
    set PI 3.14
    test2
}

proc test2 {}{
    global PI
    puts $PI
}
conzar is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 02:17 PM.


AC3D Forum
(C) Inivis Limited 2020