Re: [R] read variable global in R tcltk

From: Philippe Grosjean <phgrosjean_at_sciviews.org>
Date: Tue, 22 Apr 2008 09:49:21 +0200

Read ?tclvalue.
For instance, you can do:
 > tclvalue("tcl_library") # Read the content of a Tcl variable [1] "/usr/local/lib/tcl8.4"
 > .Tcl("set myvar 1") # Create a variable inside Tcl <Tcl> 1
 > tclvalue("myvar") # Read its value
[1] "1"

To make sure you create global variables in Tcl, start their names with '::', like '::myglobalvar', if you like. Best,

Philippe Grosjean

Handayani Situmorang wrote:
> I have any problem with my code. I build a small GUI in R with tcltk package. the proolem is I don't understand how to make a variable value can be read by R from a function. the variable value can only read if it's called via tcltk widgets and pass it to another function. i think the point is the variable must be set as global variable. but i don't have any idea? is anyone can help me, please? Thank you very much.
>
>
> ---------------------------------
> Bergabunglah dengan orang-orang yang berwawasan, di bidang Anda di Yahoo! Answers
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 22 Apr 2008 - 07:51:58 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 22 Apr 2008 - 08:30:32 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive