I have a question regarding access of global variables :

I have two tcl-scripts :

1.) init.tcl :

package require java
proc init {} {
        # create global variable
        set teststring [java::new String "abcabc"]
}

2.) access.tcl :

package require java
proc access {} {
        set resstring [$teststring concat "123"]
        puts "Result : $resstring"
}

After loading both scripts in java.lang.Shell via source-command I execute
first init, then access.
I get the error "can't read "teststring": no such variable".

Isn't the variable $teststring created in the global namespace by execution
of init.tcl ?
How can I access $teststring fom access.tcl ?


Another question :
==================
I am able to load tcl-scripts into the java.lang.Shell by the source-command.
Is it possible to unload and free the shell from the loaded script ?

Thanx
Frank

----------------------------------------------------------------------
Frank Krahmer                       Email:  [EMAIL PROTECTED]
SBS MP 5 NM IP                      Tel.:   089/61453206
                                    Fax.:   089/61209243
Telework-Adresse : Bahnhofstr. 13f, 82024 Taufkirchen
Jobadresse       : MCH-P 28-584, 81739 München, Otto-Hahn-Ring 6 
----------------------------------------------------------------------

----------------------------------------------------------------
The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe:    send mail to [EMAIL PROTECTED]  
                 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
                 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com

Reply via email to